1 /***************************************************************************
2 * Copyright (C) 2008-2016 by Andrzej Rybczak *
3 * electricityispower@gmail.com *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
21 #ifndef NCMPCPP_ACTIONS_H
22 #define NCMPCPP_ACTIONS_H
24 #include <boost/date_time/posix_time/posix_time_types.hpp>
25 #include <boost/format.hpp>
28 #include "curses/window.h"
29 #include "interfaces.h"
31 // forward declarations
53 JumpToParentDirectory
,
76 MoveSelectedItemsDown
,
82 ToggleSeparatorsBetweenAlbums
,
83 ToggleLyricsUpdateOnSongChange
,
85 ToggleFetchingLyricsInBackground
,
86 TogglePlayingSongCentering
,
108 JumpToPlaylistEditor
,
111 JumpToPositionInSong
,
132 ToggleReplayGainMode
,
135 ToggleBitrateVisibility
,
137 ToggleBrowserSortMode
,
138 ToggleLibraryTagType
,
139 ToggleMediaLibrarySortMode
,
140 FetchLyricsInBackground
,
142 SetSelectedItemsPriority
,
144 ToggleVisualizationType
,
158 ToggleMediaLibraryColumnsMode
,
165 _numberOfActions
// needed to dynamically calculate size of action array
168 void validateScreenSize();
169 void initializeScreens();
170 void setResizeFlags();
171 void resizeScreen(bool reload_main_window
);
172 void setWindowsDimensions();
174 void confirmAction(const boost::format
&description
);
175 inline void confirmAction(const std::string
&description
)
177 confirmAction(boost::format(description
));
180 bool isMPDMusicDirSet();
182 extern bool OriginalStatusbarVisibility
;
183 extern bool ExitMainLoop
;
185 extern size_t HeaderHeight
;
186 extern size_t FooterHeight
;
187 extern size_t FooterStartY
;
191 BaseAction(Type type_
, const char *name_
): m_name(name_
), m_type(type_
) { }
193 const std::string
&name() const { return m_name
; }
194 Type
type() const { return m_type
; }
196 virtual bool canBeRun() { return true; }
212 virtual void run() = 0;
217 BaseAction
&get(Type at
);
219 std::shared_ptr
<BaseAction
> get_(Type at
);
220 std::shared_ptr
<BaseAction
> get_(const std::string
&name
);
222 struct Dummy
: BaseAction
224 Dummy(): BaseAction(Type::Dummy
, "dummy") { }
227 virtual void run() override
{ }
230 struct UpdateEnvironment
: BaseAction
234 void run(bool update_status
, bool refresh_window
, bool mpd_sync
);
237 boost::posix_time::ptime m_past
;
239 virtual void run() override
;
242 struct MouseEvent
: BaseAction
244 MouseEvent(): BaseAction(Type::MouseEvent
, "mouse_event")
246 m_old_mouse_event
.bstate
= 0;
247 m_mouse_event
.bstate
= 0;
251 virtual bool canBeRun() override
;
252 virtual void run() override
;
254 MEVENT m_mouse_event
;
255 MEVENT m_old_mouse_event
;
258 struct ScrollUp
: BaseAction
260 ScrollUp(): BaseAction(Type::ScrollUp
, "scroll_up") { }
263 virtual void run() override
;
266 struct ScrollDown
: BaseAction
268 ScrollDown(): BaseAction(Type::ScrollDown
, "scroll_down") { }
271 virtual void run() override
;
274 struct ScrollUpArtist
: BaseAction
276 ScrollUpArtist(): BaseAction(Type::ScrollUpArtist
, "scroll_up_artist") { }
279 virtual bool canBeRun() override
;
280 virtual void run() override
;
283 const SongList
*m_songs
;
286 struct ScrollUpAlbum
: BaseAction
288 ScrollUpAlbum(): BaseAction(Type::ScrollUpAlbum
, "scroll_up_album") { }
291 virtual bool canBeRun() override
;
292 virtual void run() override
;
295 const SongList
*m_songs
;
298 struct ScrollDownArtist
: BaseAction
300 ScrollDownArtist(): BaseAction(Type::ScrollDownArtist
, "scroll_down_artist") { }
303 virtual bool canBeRun() override
;
304 virtual void run() override
;
307 const SongList
*m_songs
;
310 struct ScrollDownAlbum
: BaseAction
312 ScrollDownAlbum(): BaseAction(Type::ScrollDownAlbum
, "scroll_down_album") { }
315 virtual bool canBeRun() override
;
316 virtual void run() override
;
319 const SongList
*m_songs
;
322 struct PageUp
: BaseAction
324 PageUp(): BaseAction(Type::PageUp
, "page_up") { }
327 virtual void run() override
;
330 struct PageDown
: BaseAction
332 PageDown(): BaseAction(Type::PageDown
, "page_down") { }
335 virtual void run() override
;
338 struct MoveHome
: BaseAction
340 MoveHome(): BaseAction(Type::MoveHome
, "move_home") { }
343 virtual void run() override
;
346 struct MoveEnd
: BaseAction
348 MoveEnd(): BaseAction(Type::MoveEnd
, "move_end") { }
351 virtual void run() override
;
354 struct ToggleInterface
: BaseAction
356 ToggleInterface(): BaseAction(Type::ToggleInterface
, "toggle_interface") { }
359 virtual void run() override
;
362 struct JumpToParentDirectory
: BaseAction
364 JumpToParentDirectory(): BaseAction(Type::JumpToParentDirectory
, "jump_to_parent_directory") { }
367 virtual bool canBeRun() override
;
368 virtual void run() override
;
371 struct RunAction
: BaseAction
373 RunAction(): BaseAction(Type::RunAction
, "run_action") { }
376 virtual bool canBeRun() override
;
377 virtual void run() override
;
382 struct PreviousColumn
: BaseAction
384 PreviousColumn(): BaseAction(Type::PreviousColumn
, "previous_column") { }
387 virtual bool canBeRun() override
;
388 virtual void run() override
;
393 struct NextColumn
: BaseAction
395 NextColumn(): BaseAction(Type::NextColumn
, "next_column") { }
398 virtual bool canBeRun() override
;
399 virtual void run() override
;
404 struct MasterScreen
: BaseAction
406 MasterScreen(): BaseAction(Type::MasterScreen
, "master_screen") { }
409 virtual bool canBeRun() override
;
410 virtual void run() override
;
413 struct SlaveScreen
: BaseAction
415 SlaveScreen(): BaseAction(Type::SlaveScreen
, "slave_screen") { }
418 virtual bool canBeRun() override
;
419 virtual void run() override
;
422 struct VolumeUp
: BaseAction
424 VolumeUp(): BaseAction(Type::VolumeUp
, "volume_up") { }
427 virtual void run() override
;
430 struct VolumeDown
: BaseAction
432 VolumeDown(): BaseAction(Type::VolumeDown
, "volume_down") { }
435 virtual void run() override
;
438 struct AddItemToPlaylist
: BaseAction
440 AddItemToPlaylist(): BaseAction(Type::AddItemToPlaylist
, "add_item_to_playlist") { }
443 virtual bool canBeRun() override
;
444 virtual void run() override
;
449 struct PlayItem
: BaseAction
451 PlayItem(): BaseAction(Type::PlayItem
, "play_item") { }
454 virtual bool canBeRun() override
;
455 virtual void run() override
;
460 struct DeletePlaylistItems
: BaseAction
462 DeletePlaylistItems(): BaseAction(Type::DeletePlaylistItems
, "delete_playlist_items") { }
465 virtual bool canBeRun() override
;
466 virtual void run() override
;
469 struct DeleteStoredPlaylist
: BaseAction
471 DeleteStoredPlaylist(): BaseAction(Type::DeleteStoredPlaylist
, "delete_stored_playlist") { }
474 virtual bool canBeRun() override
;
475 virtual void run() override
;
478 struct DeleteBrowserItems
: BaseAction
480 DeleteBrowserItems(): BaseAction(Type::DeleteBrowserItems
, "delete_browser_items") { }
483 virtual bool canBeRun() override
;
484 virtual void run() override
;
487 struct ReplaySong
: BaseAction
489 ReplaySong(): BaseAction(Type::ReplaySong
, "replay_song") { }
492 virtual void run() override
;
495 struct PreviousSong
: BaseAction
497 PreviousSong(): BaseAction(Type::Previous
, "previous") { }
500 virtual void run() override
;
503 struct NextSong
: BaseAction
505 NextSong(): BaseAction(Type::Next
, "next") { }
508 virtual void run() override
;
511 struct Pause
: BaseAction
513 Pause(): BaseAction(Type::Pause
, "pause") { }
516 virtual void run() override
;
519 struct Stop
: BaseAction
521 Stop(): BaseAction(Type::Stop
, "stop") { }
524 virtual void run() override
;
527 struct ExecuteCommand
: BaseAction
529 ExecuteCommand(): BaseAction(Type::ExecuteCommand
, "execute_command") { }
532 virtual void run() override
;
535 struct SavePlaylist
: BaseAction
537 SavePlaylist(): BaseAction(Type::SavePlaylist
, "save_playlist") { }
540 virtual void run() override
;
543 struct MoveSortOrderUp
: BaseAction
545 MoveSortOrderUp(): BaseAction(Type::MoveSortOrderUp
, "move_sort_order_up") { }
548 virtual bool canBeRun() override
;
549 virtual void run() override
;
552 struct MoveSortOrderDown
: BaseAction
554 MoveSortOrderDown(): BaseAction(Type::MoveSortOrderDown
, "move_sort_order_down") { }
557 virtual bool canBeRun() override
;
558 virtual void run() override
;
561 struct MoveSelectedItemsUp
: BaseAction
563 MoveSelectedItemsUp(): BaseAction(Type::MoveSelectedItemsUp
, "move_selected_items_up") { }
566 virtual bool canBeRun() override
;
567 virtual void run() override
;
570 struct MoveSelectedItemsDown
: BaseAction
572 MoveSelectedItemsDown(): BaseAction(Type::MoveSelectedItemsDown
, "move_selected_items_down") { }
575 virtual bool canBeRun() override
;
576 virtual void run() override
;
579 struct MoveSelectedItemsTo
: BaseAction
581 MoveSelectedItemsTo(): BaseAction(Type::MoveSelectedItemsTo
, "move_selected_items_to") { }
584 virtual bool canBeRun() override
;
585 virtual void run() override
;
588 struct Add
: BaseAction
590 Add(): BaseAction(Type::Add
, "add") { }
593 virtual bool canBeRun() override
;
594 virtual void run() override
;
597 struct SeekForward
: BaseAction
599 SeekForward(): BaseAction(Type::SeekForward
, "seek_forward") { }
602 virtual bool canBeRun() override
;
603 virtual void run() override
;
606 struct SeekBackward
: BaseAction
608 SeekBackward(): BaseAction(Type::SeekBackward
, "seek_backward") { }
611 virtual bool canBeRun() override
;
612 virtual void run() override
;
615 struct ToggleDisplayMode
: BaseAction
617 ToggleDisplayMode(): BaseAction(Type::ToggleDisplayMode
, "toggle_display_mode") { }
620 virtual bool canBeRun() override
;
621 virtual void run() override
;
624 struct ToggleSeparatorsBetweenAlbums
: BaseAction
626 ToggleSeparatorsBetweenAlbums()
627 : BaseAction(Type::ToggleSeparatorsBetweenAlbums
, "toggle_separators_between_albums") { }
630 virtual bool canBeRun() override
;
631 virtual void run() override
;
634 struct ToggleLyricsUpdateOnSongChange
: BaseAction
636 ToggleLyricsUpdateOnSongChange()
637 : BaseAction(Type::ToggleLyricsUpdateOnSongChange
, "toggle_lyrics_update_on_song_change") { }
640 virtual bool canBeRun() override
;
641 virtual void run() override
;
644 struct ToggleLyricsFetcher
: BaseAction
646 ToggleLyricsFetcher(): BaseAction(Type::ToggleLyricsFetcher
, "toggle_lyrics_fetcher") { }
649 virtual void run() override
;
652 struct ToggleFetchingLyricsInBackground
: BaseAction
654 ToggleFetchingLyricsInBackground()
655 : BaseAction(Type::ToggleFetchingLyricsInBackground
, "toggle_fetching_lyrics_in_background") { }
658 virtual void run() override
;
661 struct TogglePlayingSongCentering
: BaseAction
663 TogglePlayingSongCentering()
664 : BaseAction(Type::TogglePlayingSongCentering
, "toggle_playing_song_centering") { }
667 virtual void run() override
;
670 struct UpdateDatabase
: BaseAction
672 UpdateDatabase(): BaseAction(Type::UpdateDatabase
, "update_database") { }
675 virtual void run() override
;
678 struct JumpToPlayingSong
: BaseAction
680 JumpToPlayingSong(): BaseAction(Type::JumpToPlayingSong
, "jump_to_playing_song") { }
683 virtual bool canBeRun() override
;
684 virtual void run() override
;
687 struct ToggleRepeat
: BaseAction
689 ToggleRepeat(): BaseAction(Type::ToggleRepeat
, "toggle_repeat") { }
692 virtual void run() override
;
695 struct Shuffle
: BaseAction
697 Shuffle(): BaseAction(Type::Shuffle
, "shuffle") { }
700 virtual bool canBeRun() override
;
701 virtual void run() override
;
703 NC::Menu
<MPD::Song
>::ConstIterator m_begin
;
704 NC::Menu
<MPD::Song
>::ConstIterator m_end
;
707 struct ToggleRandom
: BaseAction
709 ToggleRandom(): BaseAction(Type::ToggleRandom
, "toggle_random") { }
712 virtual void run() override
;
715 struct StartSearching
: BaseAction
717 StartSearching(): BaseAction(Type::StartSearching
, "start_searching") { }
720 virtual bool canBeRun() override
;
721 virtual void run() override
;
724 struct SaveTagChanges
: BaseAction
726 SaveTagChanges(): BaseAction(Type::SaveTagChanges
, "save_tag_changes") { }
729 virtual bool canBeRun() override
;
730 virtual void run() override
;
733 struct ToggleSingle
: BaseAction
735 ToggleSingle(): BaseAction(Type::ToggleSingle
, "toggle_single") { }
738 virtual void run() override
;
741 struct ToggleConsume
: BaseAction
743 ToggleConsume(): BaseAction(Type::ToggleConsume
, "toggle_consume") { }
746 virtual void run() override
;
749 struct ToggleCrossfade
: BaseAction
751 ToggleCrossfade(): BaseAction(Type::ToggleCrossfade
, "toggle_crossfade") { }
754 virtual void run() override
;
757 struct SetCrossfade
: BaseAction
759 SetCrossfade(): BaseAction(Type::SetCrossfade
, "set_crossfade") { }
762 virtual void run() override
;
765 struct SetVolume
: BaseAction
767 SetVolume(): BaseAction(Type::SetVolume
, "set_volume") { }
770 virtual void run() override
;
773 struct EnterDirectory
: BaseAction
775 EnterDirectory(): BaseAction(Type::EnterDirectory
, "enter_directory") { }
778 virtual bool canBeRun() override
;
779 virtual void run() override
;
783 struct EditSong
: BaseAction
785 EditSong(): BaseAction(Type::EditSong
, "edit_song") { }
788 virtual bool canBeRun() override
;
789 virtual void run() override
;
792 const MPD::Song
*m_song
;
793 #endif // HAVE_TAGLIB_H
796 struct EditLibraryTag
: BaseAction
798 EditLibraryTag(): BaseAction(Type::EditLibraryTag
, "edit_library_tag") { }
801 virtual bool canBeRun() override
;
802 virtual void run() override
;
805 struct EditLibraryAlbum
: BaseAction
807 EditLibraryAlbum(): BaseAction(Type::EditLibraryAlbum
, "edit_library_album") { }
810 virtual bool canBeRun() override
;
811 virtual void run() override
;
814 struct EditDirectoryName
: BaseAction
816 EditDirectoryName(): BaseAction(Type::EditDirectoryName
, "edit_directory_name") { }
819 virtual bool canBeRun() override
;
820 virtual void run() override
;
823 struct EditPlaylistName
: BaseAction
825 EditPlaylistName(): BaseAction(Type::EditPlaylistName
, "edit_playlist_name") { }
828 virtual bool canBeRun() override
;
829 virtual void run() override
;
832 struct EditLyrics
: BaseAction
834 EditLyrics(): BaseAction(Type::EditLyrics
, "edit_lyrics") { }
837 virtual bool canBeRun() override
;
838 virtual void run() override
;
841 struct JumpToBrowser
: BaseAction
843 JumpToBrowser(): BaseAction(Type::JumpToBrowser
, "jump_to_browser") { }
846 virtual bool canBeRun() override
;
847 virtual void run() override
;
849 const MPD::Song
*m_song
;
852 struct JumpToMediaLibrary
: BaseAction
854 JumpToMediaLibrary(): BaseAction(Type::JumpToMediaLibrary
, "jump_to_media_library") { }
857 virtual bool canBeRun() override
;
858 virtual void run() override
;
860 const MPD::Song
*m_song
;
863 struct JumpToPlaylistEditor
: BaseAction
865 JumpToPlaylistEditor(): BaseAction(Type::JumpToPlaylistEditor
, "jump_to_playlist_editor") { }
868 virtual bool canBeRun() override
;
869 virtual void run() override
;
872 struct ToggleScreenLock
: BaseAction
874 ToggleScreenLock(): BaseAction(Type::ToggleScreenLock
, "toggle_screen_lock") { }
877 virtual void run() override
;
880 struct JumpToTagEditor
: BaseAction
882 JumpToTagEditor(): BaseAction(Type::JumpToTagEditor
, "jump_to_tag_editor") { }
885 virtual bool canBeRun() override
;
886 virtual void run() override
;
889 const MPD::Song
*m_song
;
890 #endif // HAVE_TAGLIB_H
893 struct JumpToPositionInSong
: BaseAction
895 JumpToPositionInSong(): BaseAction(Type::JumpToPositionInSong
, "jump_to_position_in_song") { }
898 virtual bool canBeRun() override
;
899 virtual void run() override
;
902 struct SelectItem
: BaseAction
904 SelectItem(): BaseAction(Type::SelectItem
, "select_item") { }
907 virtual bool canBeRun() override
;
908 virtual void run() override
;
913 struct SelectRange
: BaseAction
915 SelectRange(): BaseAction(Type::SelectRange
, "select_range") { }
918 virtual bool canBeRun() override
;
919 virtual void run() override
;
922 NC::List::Iterator m_begin
;
923 NC::List::Iterator m_end
;
926 struct ReverseSelection
: BaseAction
928 ReverseSelection(): BaseAction(Type::ReverseSelection
, "reverse_selection") { }
931 virtual bool canBeRun() override
;
932 virtual void run() override
;
937 struct RemoveSelection
: BaseAction
939 RemoveSelection(): BaseAction(Type::RemoveSelection
, "remove_selection") { }
942 virtual bool canBeRun() override
;
943 virtual void run() override
;
948 struct SelectAlbum
: BaseAction
950 SelectAlbum(): BaseAction(Type::SelectAlbum
, "select_album") { }
953 virtual bool canBeRun() override
;
954 virtual void run() override
;
960 struct SelectFoundItems
: BaseAction
962 SelectFoundItems(): BaseAction(Type::SelectFoundItems
, "select_found_items") { }
965 virtual bool canBeRun() override
;
966 virtual void run() override
;
969 Searchable
*m_searchable
;
972 struct AddSelectedItems
: BaseAction
974 AddSelectedItems(): BaseAction(Type::AddSelectedItems
, "add_selected_items") { }
977 virtual bool canBeRun() override
;
978 virtual void run() override
;
981 struct CropMainPlaylist
: BaseAction
983 CropMainPlaylist(): BaseAction(Type::CropMainPlaylist
, "crop_main_playlist") { }
986 virtual void run() override
;
989 struct CropPlaylist
: BaseAction
991 CropPlaylist(): BaseAction(Type::CropPlaylist
, "crop_playlist") { }
994 virtual bool canBeRun() override
;
995 virtual void run() override
;
998 struct ClearMainPlaylist
: BaseAction
1000 ClearMainPlaylist(): BaseAction(Type::ClearMainPlaylist
, "clear_main_playlist") { }
1003 virtual void run() override
;
1006 struct ClearPlaylist
: BaseAction
1008 ClearPlaylist(): BaseAction(Type::ClearPlaylist
, "clear_playlist") { }
1011 virtual bool canBeRun() override
;
1012 virtual void run() override
;
1015 struct SortPlaylist
: BaseAction
1017 SortPlaylist(): BaseAction(Type::SortPlaylist
, "sort_playlist") { }
1020 virtual bool canBeRun() override
;
1021 virtual void run() override
;
1024 struct ReversePlaylist
: BaseAction
1026 ReversePlaylist(): BaseAction(Type::ReversePlaylist
, "reverse_playlist") { }
1029 virtual bool canBeRun() override
;
1030 virtual void run() override
;
1032 NC::Menu
<MPD::Song
>::ConstIterator m_begin
;
1033 NC::Menu
<MPD::Song
>::ConstIterator m_end
;
1036 struct ApplyFilter
: public BaseAction
1038 ApplyFilter(): BaseAction(Type::ApplyFilter
, "apply_filter") { }
1041 virtual bool canBeRun() override
;
1042 virtual void run() override
;
1044 Filterable
*m_filterable
;
1047 struct Find
: BaseAction
1049 Find(): BaseAction(Type::Find
, "find") { }
1052 virtual bool canBeRun() override
;
1053 virtual void run() override
;
1056 struct FindItemForward
: BaseAction
1058 FindItemForward(): BaseAction(Type::FindItemForward
, "find_item_forward") { }
1061 virtual bool canBeRun() override
;
1062 virtual void run() override
;
1065 struct FindItemBackward
: BaseAction
1067 FindItemBackward(): BaseAction(Type::FindItemBackward
, "find_item_backward") { }
1070 virtual bool canBeRun() override
;
1071 virtual void run() override
;
1074 struct NextFoundItem
: BaseAction
1076 NextFoundItem(): BaseAction(Type::NextFoundItem
, "next_found_item") { }
1079 virtual bool canBeRun() override
;
1080 virtual void run() override
;
1083 struct PreviousFoundItem
: BaseAction
1085 PreviousFoundItem(): BaseAction(Type::PreviousFoundItem
, "previous_found_item") { }
1088 virtual bool canBeRun() override
;
1089 virtual void run() override
;
1092 struct ToggleFindMode
: BaseAction
1094 ToggleFindMode(): BaseAction(Type::ToggleFindMode
, "toggle_find_mode") { }
1097 virtual void run() override
;
1100 struct ToggleReplayGainMode
: BaseAction
1102 ToggleReplayGainMode(): BaseAction(Type::ToggleReplayGainMode
, "toggle_replay_gain_mode") { }
1105 virtual void run() override
;
1108 struct ToggleAddMode
: BaseAction
1110 ToggleAddMode(): BaseAction(Type::ToggleAddMode
, "toggle_add_mode") { }
1113 virtual void run() override
;
1116 struct ToggleMouse
: BaseAction
1118 ToggleMouse(): BaseAction(Type::ToggleMouse
, "toggle_mouse") { }
1121 virtual void run() override
;
1124 struct ToggleBitrateVisibility
: BaseAction
1126 ToggleBitrateVisibility(): BaseAction(Type::ToggleBitrateVisibility
, "toggle_bitrate_visibility") { }
1129 virtual void run() override
;
1132 struct AddRandomItems
: BaseAction
1134 AddRandomItems(): BaseAction(Type::AddRandomItems
, "add_random_items") { }
1137 virtual void run() override
;
1140 struct ToggleBrowserSortMode
: BaseAction
1142 ToggleBrowserSortMode(): BaseAction(Type::ToggleBrowserSortMode
, "toggle_browser_sort_mode") { }
1145 virtual bool canBeRun() override
;
1146 virtual void run() override
;
1149 struct ToggleLibraryTagType
: BaseAction
1151 ToggleLibraryTagType(): BaseAction(Type::ToggleLibraryTagType
, "toggle_library_tag_type") { }
1154 virtual bool canBeRun() override
;
1155 virtual void run() override
;
1158 struct ToggleMediaLibrarySortMode
: BaseAction
1160 ToggleMediaLibrarySortMode()
1161 : BaseAction(Type::ToggleMediaLibrarySortMode
, "toggle_media_library_sort_mode") { }
1164 virtual bool canBeRun() override
;
1165 virtual void run() override
;
1168 struct FetchLyricsInBackground
: BaseAction
1170 FetchLyricsInBackground()
1171 : BaseAction(Type::FetchLyricsInBackground
, "fetch_lyrics_in_background") { }
1174 virtual bool canBeRun() override
;
1175 virtual void run() override
;
1180 struct RefetchLyrics
: BaseAction
1182 RefetchLyrics(): BaseAction(Type::RefetchLyrics
, "refetch_lyrics") { }
1185 virtual bool canBeRun() override
;
1186 virtual void run() override
;
1189 struct SetSelectedItemsPriority
: BaseAction
1191 SetSelectedItemsPriority()
1192 : BaseAction(Type::SetSelectedItemsPriority
, "set_selected_items_priority") { }
1195 virtual bool canBeRun() override
;
1196 virtual void run() override
;
1199 struct ToggleOutput
: BaseAction
1201 ToggleOutput(): BaseAction(Type::ToggleOutput
, "toggle_output") { }
1204 virtual bool canBeRun() override
;
1205 virtual void run() override
;
1208 struct ToggleVisualizationType
: BaseAction
1210 ToggleVisualizationType()
1211 : BaseAction(Type::ToggleVisualizationType
, "toggle_visualization_type") { }
1215 virtual bool canBeRun() override
;
1216 virtual void run() override
;
1219 struct ShowSongInfo
: BaseAction
1221 ShowSongInfo(): BaseAction(Type::ShowSongInfo
, "show_song_info") { }
1224 virtual void run() override
;
1227 struct ShowArtistInfo
: BaseAction
1229 ShowArtistInfo(): BaseAction(Type::ShowArtistInfo
, "show_artist_info") { }
1232 virtual bool canBeRun() override
;
1233 virtual void run() override
;
1236 struct ShowLyrics
: BaseAction
1238 ShowLyrics(): BaseAction(Type::ShowLyrics
, "show_lyrics") { }
1241 virtual bool canBeRun() override
;
1242 virtual void run() override
;
1244 const MPD::Song
*m_song
;
1247 struct Quit
: BaseAction
1249 Quit(): BaseAction(Type::Quit
, "quit") { }
1252 virtual void run() override
;
1255 struct NextScreen
: BaseAction
1257 NextScreen(): BaseAction(Type::NextScreen
, "next_screen") { }
1260 virtual void run() override
;
1263 struct PreviousScreen
: BaseAction
1265 PreviousScreen(): BaseAction(Type::PreviousScreen
, "previous_screen") { }
1268 virtual void run() override
;
1271 struct ShowHelp
: BaseAction
1273 ShowHelp(): BaseAction(Type::ShowHelp
, "show_help") { }
1276 virtual bool canBeRun() override
;
1277 virtual void run() override
;
1280 struct ShowPlaylist
: BaseAction
1282 ShowPlaylist(): BaseAction(Type::ShowPlaylist
, "show_playlist") { }
1285 virtual bool canBeRun() override
;
1286 virtual void run() override
;
1289 struct ShowBrowser
: BaseAction
1291 ShowBrowser(): BaseAction(Type::ShowBrowser
, "show_browser") { }
1294 virtual bool canBeRun() override
;
1295 virtual void run() override
;
1298 struct ChangeBrowseMode
: BaseAction
1300 ChangeBrowseMode(): BaseAction(Type::ChangeBrowseMode
, "change_browse_mode") { }
1303 virtual bool canBeRun() override
;
1304 virtual void run() override
;
1307 struct ShowSearchEngine
: BaseAction
1309 ShowSearchEngine(): BaseAction(Type::ShowSearchEngine
, "show_search_engine") { }
1312 virtual bool canBeRun() override
;
1313 virtual void run() override
;
1316 struct ResetSearchEngine
: BaseAction
1318 ResetSearchEngine(): BaseAction(Type::ResetSearchEngine
, "reset_search_engine") { }
1321 virtual bool canBeRun() override
;
1322 virtual void run() override
;
1325 struct ShowMediaLibrary
: BaseAction
1327 ShowMediaLibrary(): BaseAction(Type::ShowMediaLibrary
, "show_media_library") { }
1330 virtual bool canBeRun() override
;
1331 virtual void run() override
;
1334 struct ToggleMediaLibraryColumnsMode
: BaseAction
1336 ToggleMediaLibraryColumnsMode()
1337 : BaseAction(Type::ToggleMediaLibraryColumnsMode
, "toggle_media_library_columns_mode") { }
1340 virtual bool canBeRun() override
;
1341 virtual void run() override
;
1344 struct ShowPlaylistEditor
: BaseAction
1346 ShowPlaylistEditor(): BaseAction(Type::ShowPlaylistEditor
, "show_playlist_editor") { }
1349 virtual bool canBeRun() override
;
1350 virtual void run() override
;
1353 struct ShowTagEditor
: BaseAction
1355 ShowTagEditor(): BaseAction(Type::ShowTagEditor
, "show_tag_editor") { }
1358 virtual bool canBeRun() override
;
1359 virtual void run() override
;
1362 struct ShowOutputs
: BaseAction
1364 ShowOutputs(): BaseAction(Type::ShowOutputs
, "show_outputs") { }
1367 virtual bool canBeRun() override
;
1368 virtual void run() override
;
1371 struct ShowVisualizer
: BaseAction
1373 ShowVisualizer(): BaseAction(Type::ShowVisualizer
, "show_visualizer") { }
1376 virtual bool canBeRun() override
;
1377 virtual void run() override
;
1380 struct ShowClock
: BaseAction
1382 ShowClock(): BaseAction(Type::ShowClock
, "show_clock") { }
1385 virtual bool canBeRun() override
;
1386 virtual void run() override
;
1389 struct ShowServerInfo
: BaseAction
1391 ShowServerInfo(): BaseAction(Type::ShowServerInfo
, "show_server_info") { }
1394 # ifdef HAVE_TAGLIB_H
1395 virtual bool canBeRun() override
;
1396 # endif // HAVE_TAGLIB_H
1397 virtual void run() override
;
1402 #endif // NCMPCPP_ACTIONS_H