|
a/src/upmpd.cxx |
|
b/src/upmpd.cxx |
|
... |
|
... |
277 |
UpMpd::Options opts;
|
277 |
UpMpd::Options opts;
|
278 |
|
278 |
|
279 |
string cachedir;
|
279 |
string cachedir;
|
280 |
string onstart;
|
280 |
string onstart;
|
281 |
string onstop;
|
281 |
string onstop;
|
|
|
282 |
string onvolumechange;
|
282 |
if (!g_configfilename.empty()) {
|
283 |
if (!g_configfilename.empty()) {
|
283 |
ConfSimple config(g_configfilename.c_str(), 1, true);
|
284 |
ConfSimple config(g_configfilename.c_str(), 1, true);
|
284 |
if (!config.ok()) {
|
285 |
if (!config.ok()) {
|
285 |
cerr << "Could not open config: " << g_configfilename << endl;
|
286 |
cerr << "Could not open config: " << g_configfilename << endl;
|
286 |
return 1;
|
287 |
return 1;
|
|
... |
|
... |
313 |
config.get("iconpath", iconpath);
|
314 |
config.get("iconpath", iconpath);
|
314 |
config.get("presentationhtml", presentationhtml);
|
315 |
config.get("presentationhtml", presentationhtml);
|
315 |
config.get("cachedir", cachedir);
|
316 |
config.get("cachedir", cachedir);
|
316 |
config.get("onstart", onstart);
|
317 |
config.get("onstart", onstart);
|
317 |
config.get("onstop", onstop);
|
318 |
config.get("onstop", onstop);
|
|
|
319 |
config.get("onvolumechange", onvolumechange);
|
318 |
if (!(op_flags & OPT_i)) {
|
320 |
if (!(op_flags & OPT_i)) {
|
319 |
config.get("upnpiface", iface);
|
321 |
config.get("upnpiface", iface);
|
320 |
if (iface.empty()) {
|
322 |
if (iface.empty()) {
|
321 |
config.get("upnpip", upnpip);
|
323 |
config.get("upnpip", upnpip);
|
322 |
}
|
324 |
}
|
|
... |
|
... |
442 |
|
444 |
|
443 |
// Initialize MPD client object. Retry until it works or power fail.
|
445 |
// Initialize MPD client object. Retry until it works or power fail.
|
444 |
MPDCli *mpdclip = 0;
|
446 |
MPDCli *mpdclip = 0;
|
445 |
int mpdretrysecs = 2;
|
447 |
int mpdretrysecs = 2;
|
446 |
for (;;) {
|
448 |
for (;;) {
|
447 |
mpdclip = new MPDCli(mpdhost, mpdport, mpdpassword, onstart, onstop);
|
449 |
mpdclip = new MPDCli(mpdhost, mpdport, mpdpassword, onstart, onstop,
|
|
|
450 |
onvolumechange);
|
448 |
if (mpdclip == 0) {
|
451 |
if (mpdclip == 0) {
|
449 |
LOGFAT("Can't allocate MPD client object" << endl);
|
452 |
LOGFAT("Can't allocate MPD client object" << endl);
|
450 |
return 1;
|
453 |
return 1;
|
451 |
}
|
454 |
}
|
452 |
if (!mpdclip->ok()) {
|
455 |
if (!mpdclip->ok()) {
|