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,12 +413,18 @@ void Connection::Toggle()
if (!isCommandsListEnabled) if (!isCommandsListEnabled)
{ {
GoBusy(); GoBusy();
mpd_run_toggle_pause(itsConnection);; if (isPlaying())
mpd_run_toggle_pause(itsConnection);
else
mpd_run_play(itsConnection);
} }
else else
{ {
assert(!isIdle); assert(!isIdle);
mpd_send_toggle_pause(itsConnection); if (isPlaying())
mpd_send_toggle_pause(itsConnection);
else
mpd_send_toggle_pause(itsConnection);
} }
} }