|
a/src/upmpd.cxx |
|
b/src/upmpd.cxx |
|
... |
|
... |
202 |
string mpdpassword;
|
202 |
string mpdpassword;
|
203 |
string logfilename;
|
203 |
string logfilename;
|
204 |
int loglevel(Logger::LLINF);
|
204 |
int loglevel(Logger::LLINF);
|
205 |
string friendlyname(dfltFriendlyName);
|
205 |
string friendlyname(dfltFriendlyName);
|
206 |
bool ownqueue = true;
|
206 |
bool ownqueue = true;
|
207 |
bool openhome = true;
|
207 |
bool enableAV = true;
|
|
|
208 |
bool enableOH = true;
|
208 |
bool ohmetapersist = true;
|
209 |
bool ohmetapersist = true;
|
209 |
string upmpdcliuser("upmpdcli");
|
210 |
string upmpdcliuser("upmpdcli");
|
210 |
string pidfilename("/var/run/upmpdcli.pid");
|
211 |
string pidfilename("/var/run/upmpdcli.pid");
|
211 |
string presentationhtml(DATADIR "/presentation.html");
|
212 |
string presentationhtml(DATADIR "/presentation.html");
|
212 |
string iface;
|
213 |
string iface;
|
|
... |
|
... |
252 |
op_flags |= OPT_O;
|
253 |
op_flags |= OPT_O;
|
253 |
if (argc < 2) Usage();
|
254 |
if (argc < 2) Usage();
|
254 |
const char *cp = *(++argv);
|
255 |
const char *cp = *(++argv);
|
255 |
if (*cp == '1' || *cp == 't' || *cp == 'T' || *cp == 'y' ||
|
256 |
if (*cp == '1' || *cp == 't' || *cp == 'T' || *cp == 'y' ||
|
256 |
*cp == 'Y')
|
257 |
*cp == 'Y')
|
257 |
openhome = true;
|
258 |
enableOH = true;
|
258 |
argc--; goto b1;
|
259 |
argc--; goto b1;
|
259 |
}
|
260 |
}
|
260 |
case 'P': op_flags |= OPT_P; if (argc < 2) Usage();
|
261 |
case 'P': op_flags |= OPT_P; if (argc < 2) Usage();
|
261 |
upport = atoi(*(++argv)); argc--; goto b1;
|
262 |
upport = atoi(*(++argv)); argc--; goto b1;
|
262 |
case 'p': op_flags |= OPT_p; if (argc < 2) Usage();
|
263 |
case 'p': op_flags |= OPT_p; if (argc < 2) Usage();
|
|
... |
|
... |
296 |
config.get("mpdpassword", mpdpassword);
|
297 |
config.get("mpdpassword", mpdpassword);
|
297 |
if (!(op_flags & OPT_q) && config.get("ownqueue", value)) {
|
298 |
if (!(op_flags & OPT_q) && config.get("ownqueue", value)) {
|
298 |
ownqueue = atoi(value.c_str()) != 0;
|
299 |
ownqueue = atoi(value.c_str()) != 0;
|
299 |
}
|
300 |
}
|
300 |
if (config.get("openhome", value)) {
|
301 |
if (config.get("openhome", value)) {
|
301 |
openhome = atoi(value.c_str()) != 0;
|
302 |
enableOH = atoi(value.c_str()) != 0;
|
|
|
303 |
}
|
|
|
304 |
if (config.get("upnpav", value)) {
|
|
|
305 |
enableAV = atoi(value.c_str()) != 0;
|
302 |
}
|
306 |
}
|
303 |
if (config.get("ohmetapersist", value)) {
|
307 |
if (config.get("ohmetapersist", value)) {
|
304 |
ohmetapersist = atoi(value.c_str()) != 0;
|
308 |
ohmetapersist = atoi(value.c_str()) != 0;
|
305 |
}
|
309 |
}
|
306 |
config.get("iconpath", iconpath);
|
310 |
config.get("iconpath", iconpath);
|
|
... |
|
... |
491 |
string UUID = LibUPnP::makeDevUUID(friendlyname, hwaddr);
|
495 |
string UUID = LibUPnP::makeDevUUID(friendlyname, hwaddr);
|
492 |
|
496 |
|
493 |
// Initialize the data we serve through HTTP (device and service
|
497 |
// Initialize the data we serve through HTTP (device and service
|
494 |
// descriptions, icons, presentation page, etc.)
|
498 |
// descriptions, icons, presentation page, etc.)
|
495 |
unordered_map<string, VDirContent> files;
|
499 |
unordered_map<string, VDirContent> files;
|
496 |
if (!initHttpFs(files, datadir, UUID, friendlyname, openhome, iconpath,
|
500 |
if (!initHttpFs(files, datadir, UUID, friendlyname, enableAV, enableOH,
|
497 |
presentationhtml)) {
|
501 |
iconpath, presentationhtml)) {
|
498 |
exit(1);
|
502 |
exit(1);
|
499 |
}
|
503 |
}
|
500 |
|
504 |
|
501 |
if (ownqueue)
|
505 |
if (ownqueue)
|
502 |
opts.options |= UpMpd::upmpdOwnQueue;
|
506 |
opts.options |= UpMpd::upmpdOwnQueue;
|
503 |
if (openhome)
|
507 |
if (enableOH)
|
504 |
opts.options |= UpMpd::upmpdDoOH;
|
508 |
opts.options |= UpMpd::upmpdDoOH;
|
505 |
if (ohmetapersist)
|
509 |
if (ohmetapersist)
|
506 |
opts.options |= UpMpd::upmpdOhMetaPersist;
|
510 |
opts.options |= UpMpd::upmpdOhMetaPersist;
|
507 |
if (!g_sc2mpd_path.empty())
|
511 |
if (!g_sc2mpd_path.empty())
|
508 |
opts.options |= UpMpd::upmpdOhReceiver;
|
512 |
opts.options |= UpMpd::upmpdOhReceiver;
|