|
a/src/mediaserver/mediaserver.cxx |
|
b/src/mediaserver/mediaserver.cxx |
|
... |
|
... |
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
16 |
*/
|
16 |
*/
|
17 |
|
17 |
|
18 |
#include "mediaserver.hxx"
|
18 |
#include "mediaserver.hxx"
|
19 |
|
19 |
|
|
|
20 |
#include "main.hxx"
|
20 |
#include "conman.hxx"
|
21 |
#include "conman.hxx"
|
21 |
#include "contentdirectory.hxx"
|
22 |
#include "contentdirectory.hxx"
|
22 |
|
23 |
|
23 |
using namespace std;
|
24 |
using namespace std;
|
24 |
|
25 |
|
|
|
26 |
bool MediaServer::readLibFile(const std::string& name,
|
|
|
27 |
std::string& contents)
|
|
|
28 |
{
|
|
|
29 |
if (name.empty()) {
|
|
|
30 |
if (!::readLibFile("MS-description.xml", contents)) {
|
|
|
31 |
return false;
|
|
|
32 |
}
|
|
|
33 |
contents = regsub1("@UUIDMEDIA@", contents, getDeviceId());
|
|
|
34 |
contents = regsub1("@FRIENDLYNAMEMEDIA@", contents, m_fname);
|
|
|
35 |
return true;
|
|
|
36 |
} else {
|
|
|
37 |
return ::readLibFile(name, contents);
|
|
|
38 |
}
|
|
|
39 |
}
|
|
|
40 |
|
25 |
MediaServer::MediaServer(
|
41 |
MediaServer::MediaServer(
|
26 |
const string& deviceid, const string& friendlyname, bool enabled,
|
42 |
const string& deviceid, const string& friendlyname, bool enabled)
|
27 |
const std::unordered_map<std::string, VDirContent>& files)
|
|
|
28 |
: UpnpDevice(deviceid, files), m_UDN(deviceid), m_fname(friendlyname)
|
43 |
: UpnpDevice(deviceid), m_UDN(deviceid), m_fname(friendlyname)
|
29 |
{
|
44 |
{
|
30 |
m_cd = new ContentDirectory(this, enabled);
|
45 |
m_cd = new ContentDirectory(this, enabled);
|
31 |
m_cm = new UpMpdConMan(this);
|
46 |
m_cm = new UpMpdConMan(this);
|
32 |
}
|
47 |
}
|
33 |
|
48 |
|