|
a/upmpd/upmpd.cxx |
|
b/upmpd/upmpd.cxx |
|
... |
|
... |
1157 |
|
1157 |
|
1158 |
int main(int argc, char *argv[])
|
1158 |
int main(int argc, char *argv[])
|
1159 |
{
|
1159 |
{
|
1160 |
string mpdhost("localhost");
|
1160 |
string mpdhost("localhost");
|
1161 |
int mpdport = 6600;
|
1161 |
int mpdport = 6600;
|
|
|
1162 |
string mpdpassword;
|
1162 |
string upnplogfilename("/tmp/upmpdcli_libupnp.log");
|
1163 |
string upnplogfilename("/tmp/upmpdcli_libupnp.log");
|
1163 |
string logfilename;
|
1164 |
string logfilename;
|
1164 |
int loglevel(upnppdebug::Logger::LLINF);
|
1165 |
int loglevel(upnppdebug::Logger::LLINF);
|
1165 |
string configfile;
|
1166 |
string configfile;
|
1166 |
string friendlyname(dfltFriendlyName);
|
1167 |
string friendlyname(dfltFriendlyName);
|
|
... |
|
... |
1228 |
mpdport = atoi(value.c_str());
|
1229 |
mpdport = atoi(value.c_str());
|
1229 |
}
|
1230 |
}
|
1230 |
if (!(op_flags & OPT_q) && config.get("ownqueue", value)) {
|
1231 |
if (!(op_flags & OPT_q) && config.get("ownqueue", value)) {
|
1231 |
ownqueue = atoi(value.c_str()) != 0;
|
1232 |
ownqueue = atoi(value.c_str()) != 0;
|
1232 |
}
|
1233 |
}
|
|
|
1234 |
config.get("mpdpassword", mpdpassword);
|
1233 |
}
|
1235 |
}
|
1234 |
|
1236 |
|
1235 |
if (upnppdebug::Logger::getTheLog(logfilename) == 0) {
|
1237 |
if (upnppdebug::Logger::getTheLog(logfilename) == 0) {
|
1236 |
cerr << "Can't initialize log" << endl;
|
1238 |
cerr << "Can't initialize log" << endl;
|
1237 |
return 1;
|
1239 |
return 1;
|
|
... |
|
... |
1305 |
return 1;
|
1307 |
return 1;
|
1306 |
}
|
1308 |
}
|
1307 |
//mylib->setLogFileName(upnplogfilename, LibUPnP::LogLevelDebug);
|
1309 |
//mylib->setLogFileName(upnplogfilename, LibUPnP::LogLevelDebug);
|
1308 |
|
1310 |
|
1309 |
// Initialize MPD client module
|
1311 |
// Initialize MPD client module
|
1310 |
MPDCli mpdcli(mpdhost, mpdport);
|
1312 |
MPDCli mpdcli(mpdhost, mpdport, mpdpassword);
|
1311 |
if (!mpdcli.ok()) {
|
1313 |
if (!mpdcli.ok()) {
|
1312 |
LOGFAT("MPD connection failed" << endl);
|
1314 |
LOGFAT("MPD connection failed" << endl);
|
1313 |
return 1;
|
1315 |
return 1;
|
1314 |
}
|
1316 |
}
|
1315 |
|
1317 |
|