|
a/upmpd/upmpd.cxx |
|
b/upmpd/upmpd.cxx |
|
... |
|
... |
49 |
|
49 |
|
50 |
static const string dfltFriendlyName("UpMpd");
|
50 |
static const string dfltFriendlyName("UpMpd");
|
51 |
|
51 |
|
52 |
// Note: if we ever need this to work without cxx11, there is this:
|
52 |
// Note: if we ever need this to work without cxx11, there is this:
|
53 |
// http://www.tutok.sk/fastgl/callback.html
|
53 |
// http://www.tutok.sk/fastgl/callback.html
|
54 |
UpMpd::UpMpd(const string& deviceid,
|
54 |
UpMpd::UpMpd(const string& deviceid, const string& friendlyname,
|
55 |
const unordered_map<string, string>& xmlfiles,
|
55 |
const unordered_map<string, string>& xmlfiles,
|
56 |
MPDCli *mpdcli, unsigned int opts)
|
56 |
MPDCli *mpdcli, unsigned int opts)
|
57 |
: UpnpDevice(deviceid, xmlfiles), m_mpdcli(mpdcli), m_mpds(0),
|
57 |
: UpnpDevice(deviceid, xmlfiles), m_mpdcli(mpdcli), m_mpds(0),
|
58 |
m_options(opts)
|
58 |
m_options(opts)
|
59 |
{
|
59 |
{
|
|
... |
|
... |
63 |
UpMpdRenderCtl *rdctl = new UpMpdRenderCtl(this);
|
63 |
UpMpdRenderCtl *rdctl = new UpMpdRenderCtl(this);
|
64 |
m_services.push_back(rdctl);
|
64 |
m_services.push_back(rdctl);
|
65 |
m_services.push_back(new UpMpdAVTransport(this));
|
65 |
m_services.push_back(new UpMpdAVTransport(this));
|
66 |
m_services.push_back(new UpMpdConMan(this));
|
66 |
m_services.push_back(new UpMpdConMan(this));
|
67 |
if (m_options & upmpdDoOH) {
|
67 |
if (m_options & upmpdDoOH) {
|
68 |
m_services.push_back(new OHProduct(this));
|
68 |
m_services.push_back(new OHProduct(this, friendlyname));
|
69 |
m_services.push_back(new OHInfo(this));
|
69 |
m_services.push_back(new OHInfo(this));
|
70 |
m_services.push_back(new OHTime(this));
|
70 |
m_services.push_back(new OHTime(this));
|
71 |
m_services.push_back(new OHVolume(this, rdctl));
|
71 |
m_services.push_back(new OHVolume(this, rdctl));
|
72 |
m_services.push_back(new OHPlaylist(this, rdctl));
|
72 |
m_services.push_back(new OHPlaylist(this, rdctl));
|
73 |
}
|
73 |
}
|
|
... |
|
... |
399 |
if (ownqueue)
|
399 |
if (ownqueue)
|
400 |
options |= UpMpd::upmpdOwnQueue;
|
400 |
options |= UpMpd::upmpdOwnQueue;
|
401 |
if (openhome)
|
401 |
if (openhome)
|
402 |
options |= UpMpd::upmpdDoOH;
|
402 |
options |= UpMpd::upmpdDoOH;
|
403 |
// Initialize the UPnP device object.
|
403 |
// Initialize the UPnP device object.
|
404 |
UpMpd device(string("uuid:") + UUID, xmlfiles, &mpdcli, options);
|
404 |
UpMpd device(string("uuid:") + UUID, friendlyname,
|
|
|
405 |
xmlfiles, &mpdcli, options);
|
405 |
|
406 |
|
406 |
// And forever generate state change events.
|
407 |
// And forever generate state change events.
|
407 |
LOGDEB("Entering event loop" << endl);
|
408 |
LOGDEB("Entering event loop" << endl);
|
408 |
device.eventloop();
|
409 |
device.eventloop();
|
409 |
|
410 |
|