|
a/upmpd/upmpd.cxx |
|
b/upmpd/upmpd.cxx |
|
... |
|
... |
824 |
switch (what) {
|
824 |
switch (what) {
|
825 |
case 0: ok = m_mpdcli->next();break;
|
825 |
case 0: ok = m_mpdcli->next();break;
|
826 |
case 1: ok = m_mpdcli->previous();break;
|
826 |
case 1: ok = m_mpdcli->previous();break;
|
827 |
}
|
827 |
}
|
828 |
|
828 |
|
829 |
sleepms(200);
|
|
|
830 |
const struct MpdStatus &mpds1 = m_mpdcli->getStatus();
|
|
|
831 |
|
|
|
832 |
string uri = mapget(mpds.currentsong, "uri");
|
|
|
833 |
|
|
|
834 |
loopWakeup();
|
829 |
loopWakeup();
|
835 |
return ok ? UPNP_E_SUCCESS : UPNP_E_INTERNAL_ERROR;
|
830 |
return ok ? UPNP_E_SUCCESS : UPNP_E_INTERNAL_ERROR;
|
836 |
}
|
831 |
}
|
837 |
|
832 |
|
838 |
int UpMpd::setPlayMode(const SoapArgs& sc, SoapData& data)
|
833 |
int UpMpd::setPlayMode(const SoapArgs& sc, SoapData& data)
|
|
... |
|
... |
949 |
#define OPT_l 0x40
|
944 |
#define OPT_l 0x40
|
950 |
|
945 |
|
951 |
static const char usage[] =
|
946 |
static const char usage[] =
|
952 |
"-c configfile \t configuration file to use\n"
|
947 |
"-c configfile \t configuration file to use\n"
|
953 |
"-h host \t specify host MPD is running on\n"
|
948 |
"-h host \t specify host MPD is running on\n"
|
954 |
"-i port \t specify MPD port\n"
|
949 |
"-p port \t specify MPD port\n"
|
955 |
"-d logfilename\t debug messages to\n"
|
950 |
"-d logfilename\t debug messages to\n"
|
956 |
"-l loglevel\t log level (0-6)\n"
|
951 |
"-l loglevel\t log level (0-6)\n"
|
957 |
"-D \t stay in foreground\n"
|
952 |
"-D \t run as a daemon\n"
|
958 |
" \n\n"
|
953 |
" \n\n"
|
959 |
;
|
954 |
;
|
960 |
static void
|
955 |
static void
|
961 |
Usage(void)
|
956 |
Usage(void)
|
962 |
{
|
957 |
{
|
|
... |
|
... |
971 |
|
966 |
|
972 |
int main(int argc, char *argv[])
|
967 |
int main(int argc, char *argv[])
|
973 |
{
|
968 |
{
|
974 |
string mpdhost("localhost");
|
969 |
string mpdhost("localhost");
|
975 |
int mpdport = 6600;
|
970 |
int mpdport = 6600;
|
976 |
string upnplogfilename("/tmp/upmpd_libupnp.log");
|
971 |
// string upnplogfilename("/tmp/upmpd_libupnp.log");
|
977 |
string logfilename("");
|
972 |
string logfilename;
|
978 |
int loglevel(upnppdebug::Logger::LLDEB);
|
973 |
int loglevel(upnppdebug::Logger::LLINF);
|
979 |
string configfile;
|
974 |
string configfile;
|
980 |
|
975 |
|
981 |
const char *cp;
|
976 |
const char *cp;
|
982 |
if (cp = getenv("UPMPD_HOST"))
|
977 |
if (cp = getenv("UPMPD_HOST"))
|
983 |
mpdhost = cp;
|
978 |
mpdhost = cp;
|
|
... |
|
... |
1035 |
cerr << "Can't initialize log" << endl;
|
1030 |
cerr << "Can't initialize log" << endl;
|
1036 |
return 1;
|
1031 |
return 1;
|
1037 |
}
|
1032 |
}
|
1038 |
upnppdebug::Logger::getTheLog("")->setLogLevel(upnppdebug::Logger::LogLevel(loglevel));
|
1033 |
upnppdebug::Logger::getTheLog("")->setLogLevel(upnppdebug::Logger::LogLevel(loglevel));
|
1039 |
|
1034 |
|
1040 |
if (!(op_flags & OPT_D)) {
|
1035 |
if ((op_flags & OPT_D)) {
|
1041 |
if (daemon(1, 0)) {
|
1036 |
if (daemon(1, 0)) {
|
1042 |
LOGFAT("Daemon failed: errno " << errno << endl);
|
1037 |
LOGFAT("Daemon failed: errno " << errno << endl);
|
1043 |
return 1;
|
1038 |
return 1;
|
1044 |
}
|
1039 |
}
|
1045 |
}
|
1040 |
}
|