make ncmpcpp toggle start playing if mpd is stopped

This commit is contained in:
Andrzej Rybczak
2009-01-30 00:05:47 +01:00
parent b8f73ae6a6
commit ec38d57c9b

View File

@@ -107,7 +107,19 @@ void ParseArgv(int argc, char **argv)
} }
else if (strcmp(argv[i], "toggle") == 0) else if (strcmp(argv[i], "toggle") == 0)
{ {
Mpd->Execute("pause\n"); Mpd->UpdateStatus();
switch (Mpd->GetState())
{
case psPause:
case psPlay:
Mpd->Pause();
break;
case psStop:
Mpd->Play();
break;
default:
break;
}
quit = 1; quit = 1;
} }
else if (strcmp(argv[i], "stop") == 0) else if (strcmp(argv[i], "stop") == 0)