Switch to unified view

a/src/main.cxx b/src/main.cxx
...
...
171
    string friendlyname(dfltFriendlyName);
171
    string friendlyname(dfltFriendlyName);
172
    bool ownqueue = true;
172
    bool ownqueue = true;
173
    bool enableAV = true;
173
    bool enableAV = true;
174
    bool enableOH = true;
174
    bool enableOH = true;
175
    bool ohmetapersist = true;
175
    bool ohmetapersist = true;
176
    bool externalvolumecontrol =false;
176
    string upmpdcliuser("upmpdcli");
177
    string upmpdcliuser("upmpdcli");
177
    string pidfilename("/var/run/upmpdcli.pid");
178
    string pidfilename("/var/run/upmpdcli.pid");
178
    string iconpath(DATADIR "/icon.png");
179
    string iconpath(DATADIR "/icon.png");
179
    string presentationhtml(DATADIR "/presentation.html");
180
    string presentationhtml(DATADIR "/presentation.html");
180
    string iface;
181
    string iface;
...
...
245
    string cachedir;
246
    string cachedir;
246
    string onstart;
247
    string onstart;
247
    string onplay;
248
    string onplay;
248
    string onstop;
249
    string onstop;
249
    string onvolumechange;
250
    string onvolumechange;
251
    string getexternalvolume;
250
    if (!g_configfilename.empty()) {
252
    if (!g_configfilename.empty()) {
251
        g_config = new ConfSimple(g_configfilename.c_str(), 1, true);
253
        g_config = new ConfSimple(g_configfilename.c_str(), 1, true);
252
        if (!g_config || !g_config->ok()) {
254
        if (!g_config || !g_config->ok()) {
253
            cerr << "Could not open config: " << g_configfilename << endl;
255
            cerr << "Could not open config: " << g_configfilename << endl;
254
            return 1;
256
            return 1;
...
...
277
            enableAV = atoi(value.c_str()) != 0;
279
            enableAV = atoi(value.c_str()) != 0;
278
        }
280
        }
279
        if (g_config->get("ohmetapersist", value)) {
281
        if (g_config->get("ohmetapersist", value)) {
280
            ohmetapersist = atoi(value.c_str()) != 0;
282
            ohmetapersist = atoi(value.c_str()) != 0;
281
        }
283
        }
284
  if (g_config->get("externalvolumecontrol", value)) {
285
            externalvolumecontrol = atoi(value.c_str()) != 0;
286
        }
282
        g_config->get("iconpath", iconpath);
287
        g_config->get("iconpath", iconpath);
283
        g_config->get("presentationhtml", presentationhtml);
288
        g_config->get("presentationhtml", presentationhtml);
284
        g_config->get("cachedir", cachedir);
289
        g_config->get("cachedir", cachedir);
285
        g_config->get("onstart", onstart);
290
        g_config->get("onstart", onstart);
286
        g_config->get("onplay", onplay);
291
        g_config->get("onplay", onplay);
287
        g_config->get("onstop", onstop);
292
        g_config->get("onstop", onstop);
288
        g_config->get("onvolumechange", onvolumechange);
293
        g_config->get("onvolumechange", onvolumechange);
294
  g_config->get("getexternalvolume", getexternalvolume);
289
        if (!(op_flags & OPT_i)) {
295
        if (!(op_flags & OPT_i)) {
290
            g_config->get("upnpiface", iface);
296
            g_config->get("upnpiface", iface);
291
            if (iface.empty()) {
297
            if (iface.empty()) {
292
                g_config->get("upnpip", upnpip);
298
                g_config->get("upnpip", upnpip);
293
            }
299
            }
...
...
466
    // Initialize MPD client object. Retry until it works or power fail.
472
    // Initialize MPD client object. Retry until it works or power fail.
467
    MPDCli *mpdclip = 0;
473
    MPDCli *mpdclip = 0;
468
    int mpdretrysecs = 2;
474
    int mpdretrysecs = 2;
469
    for (;;) {
475
    for (;;) {
470
        mpdclip = new MPDCli(mpdhost, mpdport, mpdpassword, onstart, onplay,
476
        mpdclip = new MPDCli(mpdhost, mpdport, mpdpassword, onstart, onplay,
471
                             onstop, onvolumechange);
477
                             onstop, onvolumechange, getexternalvolume,
478
               externalvolumecontrol);
472
        if (mpdclip == 0) {
479
        if (mpdclip == 0) {
473
            LOGFAT("Can't allocate MPD client object" << endl);
480
            LOGFAT("Can't allocate MPD client object" << endl);
474
            return 1;
481
            return 1;
475
        }
482
        }
476
        if (!mpdclip->ok()) {
483
        if (!mpdclip->ok()) {