Also support PlayFromTop in TrackSearchLayout

This commit is contained in:
casey langen 2020-04-29 00:19:16 -07:00
parent e4141fb220
commit 8549e496c2
3 changed files with 18 additions and 9 deletions

View File

@ -439,17 +439,21 @@ bool LibraryLayout::KeyPress(const std::string& key) {
});
return true;
}
else if (Hotkeys::Is(Hotkeys::TrackListPlayFromTop, key)) {
if (this->visibleLayout == this->browseLayout) {
this->browseLayout->PlayFromTop();
}
else if (this->visibleLayout == this->directoryLayout) {
this->directoryLayout->PlayFromTop();
}
}
}
if (Hotkeys::Is(Hotkeys::NavigateLibraryPlayQueue, key)) {
if (Hotkeys::Is(Hotkeys::TrackListPlayFromTop, key)) {
/* TODO: maybe have an IPlayFromTopLayout? meh... */
if (this->visibleLayout == this->browseLayout) {
this->browseLayout->PlayFromTop();
}
else if (this->visibleLayout == this->directoryLayout) {
this->directoryLayout->PlayFromTop();
}
else if (this->visibleLayout == this->trackSearchLayout) {
this->trackSearchLayout->PlayFromTop();
}
}
else if (Hotkeys::Is(Hotkeys::NavigateLibraryPlayQueue, key)) {
this->ShowNowPlaying();
return true;
}

View File

@ -151,6 +151,10 @@ void TrackSearchLayout::Requery() {
new SearchTrackListQuery(this->library, filter, sortOrder)));
}
void TrackSearchLayout::PlayFromTop() {
playback::PlayFromTop(*this->trackList, this->playback);
}
void TrackSearchLayout::ProcessMessage(IMessage &message) {
int type = message.Type();

View File

@ -61,6 +61,7 @@ namespace musik {
virtual void OnVisibilityChanged(bool visible);
virtual bool KeyPress(const std::string& key);
void PlayFromTop();
void FocusInput();
void LoadLastSession();