fix toggle command
This commit is contained in:
@@ -176,6 +176,12 @@ void ParseArgv(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
else if (!strcmp(argv[i], "toggle"))
|
else if (!strcmp(argv[i], "toggle"))
|
||||||
{
|
{
|
||||||
|
Mpd.UpdateStatus();
|
||||||
|
if (!Mpd.GetErrorMessage().empty())
|
||||||
|
{
|
||||||
|
std::cout << "Error: " << Mpd.GetErrorMessage() << std::endl;
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
Mpd.Toggle();
|
Mpd.Toggle();
|
||||||
quit = 1;
|
quit = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -424,7 +424,7 @@ void Connection::Toggle()
|
|||||||
if (isPlaying())
|
if (isPlaying())
|
||||||
mpd_send_toggle_pause(itsConnection);
|
mpd_send_toggle_pause(itsConnection);
|
||||||
else
|
else
|
||||||
mpd_send_toggle_pause(itsConnection);
|
mpd_send_play(itsConnection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user