make MPD::Connection::Toggle() run playback if player is stopped

This commit is contained in:
Andrzej Rybczak
2009-12-23 21:36:05 +01:00
parent 43dcc8bd54
commit 05fc53ba32

View File

@@ -413,11 +413,17 @@ void Connection::Toggle()
if (!isCommandsListEnabled)
{
GoBusy();
mpd_run_toggle_pause(itsConnection);;
if (isPlaying())
mpd_run_toggle_pause(itsConnection);
else
mpd_run_play(itsConnection);
}
else
{
assert(!isIdle);
if (isPlaying())
mpd_send_toggle_pause(itsConnection);
else
mpd_send_toggle_pause(itsConnection);
}
}