|
a/src/main.cxx |
|
b/src/main.cxx |
|
... |
|
... |
91 |
exit(1);
|
91 |
exit(1);
|
92 |
}
|
92 |
}
|
93 |
|
93 |
|
94 |
|
94 |
|
95 |
static const string dfltFriendlyName("UpMpd");
|
95 |
static const string dfltFriendlyName("UpMpd");
|
|
|
96 |
|
|
|
97 |
ohProductDesc_t ohProductDesc = {
|
|
|
98 |
// Manufacturer
|
|
|
99 |
{
|
|
|
100 |
"UpMPDCli heavy industries Co.", // name
|
|
|
101 |
"Such nice guys and gals", // info
|
|
|
102 |
"http://www.lesbonscomptes.com/upmpdcli", // url
|
|
|
103 |
"" // imageUri
|
|
|
104 |
},
|
|
|
105 |
// Model
|
|
|
106 |
{
|
|
|
107 |
"UpMPDCli UPnP-MPD gateway", // name
|
|
|
108 |
"", // info
|
|
|
109 |
"http://www.lesbonscomptes.com/upmpdcli", // url
|
|
|
110 |
"" // imageUri
|
|
|
111 |
},
|
|
|
112 |
// Product
|
|
|
113 |
{
|
|
|
114 |
"Upmpdcli", // name
|
|
|
115 |
PACKAGE_VERSION, // info
|
|
|
116 |
"", // url
|
|
|
117 |
"" // imageUri
|
|
|
118 |
}
|
|
|
119 |
};
|
96 |
|
120 |
|
97 |
// This is global
|
121 |
// This is global
|
98 |
string g_protocolInfo;
|
122 |
string g_protocolInfo;
|
99 |
|
123 |
|
100 |
// Static for cleanup in sig handler.
|
124 |
// Static for cleanup in sig handler.
|
|
... |
|
... |
273 |
opts.schttpport = atoi(value.c_str());
|
297 |
opts.schttpport = atoi(value.c_str());
|
274 |
g_config->get("scplaymethod", opts.scplaymethod);
|
298 |
g_config->get("scplaymethod", opts.scplaymethod);
|
275 |
g_config->get("sc2mpd", sc2mpdpath);
|
299 |
g_config->get("sc2mpd", sc2mpdpath);
|
276 |
if (g_config->get("ohmetasleep", value))
|
300 |
if (g_config->get("ohmetasleep", value))
|
277 |
opts.ohmetasleep = atoi(value.c_str());
|
301 |
opts.ohmetasleep = atoi(value.c_str());
|
|
|
302 |
g_config->get("ohmanufacturername", ohProductDesc.manufacturer.name);
|
|
|
303 |
g_config->get("ohmanufacturerinfo", ohProductDesc.manufacturer.info);
|
|
|
304 |
g_config->get("ohmanufacturerurl", ohProductDesc.manufacturer.url);
|
|
|
305 |
g_config->get("ohmanufacturerimageuri", ohProductDesc.manufacturer.imageUri);
|
|
|
306 |
g_config->get("ohmodelname", ohProductDesc.model.name);
|
|
|
307 |
g_config->get("ohmodelinfo", ohProductDesc.model.info);
|
|
|
308 |
g_config->get("ohmodelurl", ohProductDesc.model.url);
|
|
|
309 |
g_config->get("ohmodelimageUri", ohProductDesc.model.imageUri);
|
|
|
310 |
g_config->get("ohproductname", ohProductDesc.product.name);
|
|
|
311 |
g_config->get("ohproductinfo", ohProductDesc.product.info);
|
|
|
312 |
g_config->get("ohproducturl", ohProductDesc.product.url);
|
|
|
313 |
g_config->get("ohproductimageuri", ohProductDesc.product.imageUri);
|
|
|
314 |
g_config->get("ohproductroom", ohProductDesc.room);
|
|
|
315 |
// ProductName is set to ModelName by default
|
|
|
316 |
if (ohProductDesc.product.name.empty()) {
|
|
|
317 |
ohProductDesc.product.name = ohProductDesc.model.name;
|
|
|
318 |
}
|
|
|
319 |
// ProductRoom is set to "Main Room" by default
|
|
|
320 |
if (ohProductDesc.room.empty()) {
|
|
|
321 |
ohProductDesc.room = "Main Room";
|
|
|
322 |
}
|
278 |
|
323 |
|
279 |
g_config->get("scsenderpath", senderpath);
|
324 |
g_config->get("scsenderpath", senderpath);
|
280 |
if (g_config->get("scsendermpdport", value))
|
325 |
if (g_config->get("scsendermpdport", value))
|
281 |
sendermpdport = atoi(value.c_str());
|
326 |
sendermpdport = atoi(value.c_str());
|
282 |
}
|
327 |
}
|
|
... |
|
... |
502 |
}
|
547 |
}
|
503 |
|
548 |
|
504 |
if (!enableAV)
|
549 |
if (!enableAV)
|
505 |
opts.options |= UpMpd::upmpdNoAV;
|
550 |
opts.options |= UpMpd::upmpdNoAV;
|
506 |
// Initialize the UPnP device object.
|
551 |
// Initialize the UPnP device object.
|
507 |
UpMpd device(string("uuid:") + UUID, friendlyname,
|
552 |
UpMpd device(string("uuid:") + UUID, friendlyname, ohProductDesc,
|
508 |
files, mpdclip, opts);
|
553 |
files, mpdclip, opts);
|
509 |
dev = &device;
|
554 |
dev = &device;
|
510 |
|
555 |
|
511 |
// And forever generate state change events.
|
556 |
// And forever generate state change events.
|
512 |
LOGDEB("Entering event loop" << endl);
|
557 |
LOGDEB("Entering event loop" << endl);
|