|
a/src/upmpd.cxx |
|
b/src/upmpd.cxx |
|
... |
|
... |
53 |
using namespace UPnPP;
|
53 |
using namespace UPnPP;
|
54 |
|
54 |
|
55 |
static const string dfltFriendlyName("UpMpd");
|
55 |
static const string dfltFriendlyName("UpMpd");
|
56 |
string upmpdProtocolInfo;
|
56 |
string upmpdProtocolInfo;
|
57 |
|
57 |
|
58 |
// Is scmpdcli (songcast-to-HTTP command) installed ? We only create
|
58 |
// Is sc2mpd (songcast-to-HTTP command) installed ? We only create
|
59 |
// an OpenHome Receiver service if it is. This is checked when
|
59 |
// an OpenHome Receiver service if it is. This is checked when
|
60 |
// starting up
|
60 |
// starting up
|
61 |
static bool has_scmpdcli(false);
|
61 |
static bool has_sc2mpd(false);
|
62 |
|
62 |
|
63 |
static UpnpDevice *dev;
|
63 |
static UpnpDevice *dev;
|
64 |
|
64 |
|
65 |
static void onsig(int)
|
65 |
static void onsig(int)
|
66 |
{
|
66 |
{
|
|
... |
|
... |
112 |
m_services.push_back(rdctl);
|
112 |
m_services.push_back(rdctl);
|
113 |
UpMpdAVTransport* avt = new UpMpdAVTransport(this);
|
113 |
UpMpdAVTransport* avt = new UpMpdAVTransport(this);
|
114 |
m_services.push_back(avt);
|
114 |
m_services.push_back(avt);
|
115 |
m_services.push_back(new UpMpdConMan(this));
|
115 |
m_services.push_back(new UpMpdConMan(this));
|
116 |
if (m_options & upmpdDoOH) {
|
116 |
if (m_options & upmpdDoOH) {
|
117 |
m_services.push_back(new OHProduct(this, friendlyname, has_scmpdcli));
|
117 |
m_services.push_back(new OHProduct(this, friendlyname, has_sc2mpd));
|
118 |
m_services.push_back(new OHInfo(this));
|
118 |
m_services.push_back(new OHInfo(this));
|
119 |
m_services.push_back(new OHTime(this));
|
119 |
m_services.push_back(new OHTime(this));
|
120 |
m_services.push_back(new OHVolume(this, rdctl));
|
120 |
m_services.push_back(new OHVolume(this, rdctl));
|
121 |
OHPlaylist *ohp = new OHPlaylist(this, rdctl, opts.ohmetasleep);
|
121 |
OHPlaylist *ohp = new OHPlaylist(this, rdctl, opts.ohmetasleep);
|
122 |
m_services.push_back(ohp);
|
122 |
m_services.push_back(ohp);
|
123 |
if (avt)
|
123 |
if (avt)
|
124 |
avt->setOHP(ohp);
|
124 |
avt->setOHP(ohp);
|
125 |
if (has_scmpdcli) {
|
125 |
if (has_sc2mpd) {
|
126 |
m_services.push_back(new OHReceiver(this, ohp, opts.schttpport));
|
126 |
m_services.push_back(new OHReceiver(this, ohp, opts.schttpport));
|
127 |
}
|
127 |
}
|
128 |
}
|
128 |
}
|
129 |
}
|
129 |
}
|
130 |
|
130 |
|
|
... |
|
... |
481 |
} else {
|
481 |
} else {
|
482 |
break;
|
482 |
break;
|
483 |
}
|
483 |
}
|
484 |
}
|
484 |
}
|
485 |
|
485 |
|
486 |
// Do we have an scmpdcli command installed (for songcast)?
|
486 |
// Do we have an sc2mpd command installed (for songcast)?
|
487 |
string unused;
|
487 |
string unused;
|
488 |
has_scmpdcli = ExecCmd::which("scmpdcli", unused);
|
488 |
has_sc2mpd = ExecCmd::which("sc2mpd", unused);
|
489 |
|
489 |
|
490 |
// Initialize libupnpp, and check health
|
490 |
// Initialize libupnpp, and check health
|
491 |
LibUPnP *mylib = 0;
|
491 |
LibUPnP *mylib = 0;
|
492 |
string hwaddr;
|
492 |
string hwaddr;
|
493 |
int libretrysecs = 10;
|
493 |
int libretrysecs = 10;
|
|
... |
|
... |
526 |
// Create unique ID
|
526 |
// Create unique ID
|
527 |
string UUID = LibUPnP::makeDevUUID(friendlyname, hwaddr);
|
527 |
string UUID = LibUPnP::makeDevUUID(friendlyname, hwaddr);
|
528 |
|
528 |
|
529 |
// Read our XML data to make it available from the virtual directory
|
529 |
// Read our XML data to make it available from the virtual directory
|
530 |
if (openhome) {
|
530 |
if (openhome) {
|
531 |
if (has_scmpdcli) {
|
531 |
if (has_sc2mpd) {
|
532 |
ohxmlfilenames.push_back("OHReceiver.xml");
|
532 |
ohxmlfilenames.push_back("OHReceiver.xml");
|
533 |
}
|
533 |
}
|
534 |
xmlfilenames.insert(xmlfilenames.end(), ohxmlfilenames.begin(),
|
534 |
xmlfilenames.insert(xmlfilenames.end(), ohxmlfilenames.begin(),
|
535 |
ohxmlfilenames.end());
|
535 |
ohxmlfilenames.end());
|
536 |
}
|
536 |
}
|
|
... |
|
... |
563 |
if (i == 0) {
|
563 |
if (i == 0) {
|
564 |
// Special for description: set UUID and friendlyname
|
564 |
// Special for description: set UUID and friendlyname
|
565 |
data = regsub1("@UUID@", data, UUID);
|
565 |
data = regsub1("@UUID@", data, UUID);
|
566 |
data = regsub1("@FRIENDLYNAME@", data, friendlyname);
|
566 |
data = regsub1("@FRIENDLYNAME@", data, friendlyname);
|
567 |
if (openhome) {
|
567 |
if (openhome) {
|
568 |
if (has_scmpdcli) {
|
568 |
if (has_sc2mpd) {
|
569 |
ohDesc += ohDescReceive;
|
569 |
ohDesc += ohDescReceive;
|
570 |
}
|
570 |
}
|
571 |
data = regsub1("@OPENHOME@", data, ohDesc);
|
571 |
data = regsub1("@OPENHOME@", data, ohDesc);
|
572 |
} else {
|
572 |
} else {
|
573 |
data = regsub1("@OPENHOME@", data, "");
|
573 |
data = regsub1("@OPENHOME@", data, "");
|