handle single command and remove hacks used as substitute for it
mpd-git has single command, which provides functionality of both "repeat one" and "stop after current track" modes. repeat one = single && repeat stop after current track = single && !repeat
This commit is contained in:
@@ -1080,11 +1080,6 @@ int main(int argc, char *argv[])
|
||||
Mpd->SetRepeat(!Mpd->GetRepeat());
|
||||
Mpd->UpdateStatus();
|
||||
}
|
||||
else if (Keypressed(input, Key.ToggleRepeatOne))
|
||||
{
|
||||
Config.repeat_one_mode = !Config.repeat_one_mode;
|
||||
ShowMessage("'Repeat one' mode: %s", Config.repeat_one_mode ? "On" : "Off");
|
||||
}
|
||||
else if (Keypressed(input, Key.Shuffle))
|
||||
{
|
||||
Mpd->Shuffle();
|
||||
@@ -1095,6 +1090,22 @@ int main(int argc, char *argv[])
|
||||
Mpd->SetRandom(!Mpd->GetRandom());
|
||||
Mpd->UpdateStatus();
|
||||
}
|
||||
else if (Keypressed(input, Key.ToggleSingle))
|
||||
{
|
||||
if (myScreen == mySearcher && !mySearcher->Main()->isStatic(0))
|
||||
{
|
||||
mySearcher->Main()->Highlight(SearchEngine::SearchButton);
|
||||
mySearcher->Main()->Highlighting(0);
|
||||
mySearcher->Main()->Refresh();
|
||||
mySearcher->Main()->Highlighting(1);
|
||||
mySearcher->EnterPressed();
|
||||
}
|
||||
else
|
||||
{
|
||||
Mpd->SetSingle(!Mpd->GetSingle());
|
||||
Mpd->UpdateStatus();
|
||||
}
|
||||
}
|
||||
else if (Keypressed(input, Key.ToggleCrossfade))
|
||||
{
|
||||
Mpd->SetCrossfade(Mpd->GetCrossfade() ? 0 : Config.crossfade_time);
|
||||
@@ -1276,22 +1287,6 @@ int main(int argc, char *argv[])
|
||||
if (s)
|
||||
myBrowser->LocateSong(*s);
|
||||
}
|
||||
else if (Keypressed(input, Key.StartSearching))
|
||||
{
|
||||
if (myScreen == myPlaylist && myPlaylist->isPlaying())
|
||||
{
|
||||
Config.stop_after_current_song = !Config.stop_after_current_song;
|
||||
ShowMessage("Stop playing after current song: %s", Config.stop_after_current_song ? "on" : "off");
|
||||
}
|
||||
else if (myScreen == mySearcher && !mySearcher->Main()->isStatic(0))
|
||||
{
|
||||
mySearcher->Main()->Highlight(SearchEngine::SearchButton);
|
||||
mySearcher->Main()->Highlighting(0);
|
||||
mySearcher->Main()->Refresh();
|
||||
mySearcher->Main()->Highlighting(1);
|
||||
mySearcher->EnterPressed();
|
||||
}
|
||||
}
|
||||
else if (Keypressed(input, Key.GoToPosition))
|
||||
{
|
||||
const Song *s = myPlaylist->NowPlayingSong();
|
||||
|
||||
Reference in New Issue
Block a user