Bind Play to Backspace by default

This commit is contained in:
Andrzej Rybczak
2020-12-23 00:17:50 +01:00
parent e0fe49e3e3
commit 7e4f3b1917
6 changed files with 12 additions and 2 deletions

View File

@@ -797,6 +797,11 @@ void DeleteStoredPlaylist::run()
myPlaylistEditor->requestPlaylistsUpdate();
}
bool ReplaySong::canBeRun()
{
return Status::State::currentSongPosition() >= 0;
}
void ReplaySong::run()
{
Mpd.Play(Status::State::currentSongPosition());

View File

@@ -495,6 +495,7 @@ struct ReplaySong: BaseAction
ReplaySong(): BaseAction(Type::ReplaySong, "replay_song") { }
private:
virtual bool canBeRun() override;
virtual void run() override;
};

View File

@@ -610,6 +610,7 @@ void BindingsConfiguration::generateDefaults()
{
bind(k, Actions::Type::JumpToParentDirectory);
bind(k, Actions::Type::ReplaySong);
bind(k, Actions::Type::Play);
}
if (notBound(k = stringToKey("f")))
bind(k, Actions::Type::SeekForward);

View File

@@ -178,7 +178,7 @@ void write_bindings(NC::Scrollpad &w)
key(w, Type::Pause, "Pause");
key(w, Type::Next, "Next track");
key(w, Type::Previous, "Previous track");
key(w, Type::ReplaySong, "Replay the current song");
key(w, Type::ReplaySong, "Replay current song");
key(w, Type::SeekForward, "Seek forward in playing song");
key(w, Type::SeekBackward, "Seek backward in playing song");
key(w, Type::VolumeDown,