update copyright info
[ncmpcpp.git] / src / actions.h
bloba26c27dbdfdf8a52d713a0d6fe2931f9baeaa9a1
1 /***************************************************************************
2 * Copyright (C) 2008-2013 by Andrzej Rybczak *
3 * electricityispower@gmail.com *
4 * *
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. *
9 * *
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. *
14 * *
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 <map>
25 #include <string>
26 #include "window.h"
28 namespace Actions {//
30 enum class Type
32 MacroUtility,
33 Dummy, MouseEvent, ScrollUp, ScrollDown, ScrollUpArtist, ScrollUpAlbum,
34 ScrollDownArtist, ScrollDownAlbum, PageUp, PageDown, MoveHome, MoveEnd,
35 ToggleInterface, JumpToParentDirectory, PressEnter, PressSpace, PreviousColumn,
36 NextColumn, MasterScreen, SlaveScreen, VolumeUp, VolumeDown, DeletePlaylistItems,
37 DeleteStoredPlaylist, DeleteBrowserItems, ReplaySong, Previous, Next, Pause,
38 Stop, ExecuteCommand, SavePlaylist, MoveSortOrderUp, MoveSortOrderDown,
39 MoveSelectedItemsUp, MoveSelectedItemsDown, MoveSelectedItemsTo, Add,
40 SeekForward, SeekBackward, ToggleDisplayMode, ToggleSeparatorsBetweenAlbums,
41 ToggleLyricsFetcher, ToggleFetchingLyricsInBackground, TogglePlayingSongCentering,
42 UpdateDatabase, JumpToPlayingSong, ToggleRepeat, Shuffle, ToggleRandom,
43 StartSearching, SaveTagChanges, ToggleSingle, ToggleConsume, ToggleCrossfade,
44 SetCrossfade, SetVolume, EditSong, EditLibraryTag, EditLibraryAlbum, EditDirectoryName,
45 EditPlaylistName, EditLyrics, JumpToBrowser, JumpToMediaLibrary,
46 JumpToPlaylistEditor, ToggleScreenLock, JumpToTagEditor, JumpToPositionInSong,
47 ReverseSelection, RemoveSelection, SelectAlbum, AddSelectedItems,
48 CropMainPlaylist, CropPlaylist, ClearMainPlaylist, ClearPlaylist, SortPlaylist,
49 ReversePlaylist, ApplyFilter, Find, FindItemForward, FindItemBackward,
50 NextFoundItem, PreviousFoundItem, ToggleFindMode, ToggleReplayGainMode,
51 ToggleSpaceMode, ToggleAddMode, ToggleMouse, ToggleBitrateVisibility,
52 AddRandomItems, ToggleBrowserSortMode, ToggleLibraryTagType,
53 ToggleMediaLibrarySortMode, RefetchLyrics, RefetchArtistInfo,
54 SetSelectedItemsPriority, FilterPlaylistOnPriorities, ShowSongInfo,
55 ShowArtistInfo, ShowLyrics, Quit, NextScreen, PreviousScreen, ShowHelp,
56 ShowPlaylist, ShowBrowser, ChangeBrowseMode, ShowSearchEngine,
57 ResetSearchEngine, ShowMediaLibrary, ToggleMediaLibraryColumnsMode,
58 ShowPlaylistEditor, ShowTagEditor, ShowOutputs, ShowVisualizer,
59 ShowClock, ShowServerInfo
62 void validateScreenSize();
63 void initializeScreens();
64 void setResizeFlags();
65 void resizeScreen(bool reload_main_window);
66 void setWindowsDimensions();
68 bool connectToMPD();
69 bool askYesNoQuestion(const std::string &question, void (*callback)());
70 bool isMPDMusicDirSet();
72 struct BaseAction *get(Type at);
73 struct BaseAction *get(const std::string &name);
75 extern bool OriginalStatusbarVisibility;
76 extern bool ExitMainLoop;
78 extern size_t HeaderHeight;
79 extern size_t FooterHeight;
80 extern size_t FooterStartY;
82 struct BaseAction
84 BaseAction(Type type_, const char *name_) : m_type(type_), m_name(name_) { }
86 const char *name() const { return m_name; }
87 Type type() const { return m_type; }
89 virtual bool canBeRun() const { return true; }
91 bool execute()
93 if (canBeRun())
95 run();
96 return true;
98 return false;
101 protected:
102 virtual void run() = 0;
104 private:
105 Type m_type;
106 const char *m_name;
109 struct Dummy : public BaseAction
111 Dummy() : BaseAction(Type::Dummy, "dummy") { }
113 protected:
114 virtual void run() { }
117 struct MouseEvent : public BaseAction
119 MouseEvent() : BaseAction(Type::MouseEvent, "mouse_event") { }
121 protected:
122 virtual bool canBeRun() const;
123 virtual void run();
125 private:
126 MEVENT m_mouse_event;
127 MEVENT m_old_mouse_event;
130 struct ScrollUp : public BaseAction
132 ScrollUp() : BaseAction(Type::ScrollUp, "scroll_up") { }
134 protected:
135 virtual void run();
138 struct ScrollDown : public BaseAction
140 ScrollDown() : BaseAction(Type::ScrollDown, "scroll_down") { }
142 protected:
143 virtual void run();
146 struct ScrollUpArtist : public BaseAction
148 ScrollUpArtist() : BaseAction(Type::ScrollUpArtist, "scroll_up_artist") { }
150 protected:
151 virtual bool canBeRun() const;
152 virtual void run();
155 struct ScrollUpAlbum : public BaseAction
157 ScrollUpAlbum() : BaseAction(Type::ScrollUpAlbum, "scroll_up_album") { }
159 protected:
160 virtual bool canBeRun() const;
161 virtual void run();
164 struct ScrollDownArtist : public BaseAction
166 ScrollDownArtist() : BaseAction(Type::ScrollDownArtist, "scroll_down_artist") { }
168 protected:
169 virtual bool canBeRun() const;
170 virtual void run();
173 struct ScrollDownAlbum : public BaseAction
175 ScrollDownAlbum() : BaseAction(Type::ScrollDownAlbum, "scroll_down_album") { }
177 protected:
178 virtual bool canBeRun() const;
179 virtual void run();
182 struct PageUp : public BaseAction
184 PageUp() : BaseAction(Type::PageUp, "page_up") { }
186 protected:
187 virtual void run();
190 struct PageDown : public BaseAction
192 PageDown() : BaseAction(Type::PageDown, "page_down") { }
194 protected:
195 virtual void run();
198 struct MoveHome : public BaseAction
200 MoveHome() : BaseAction(Type::MoveHome, "move_home") { }
202 protected:
203 virtual void run();
206 struct MoveEnd : public BaseAction
208 MoveEnd() : BaseAction(Type::MoveEnd, "move_end") { }
210 protected:
211 virtual void run();
214 struct ToggleInterface : public BaseAction
216 ToggleInterface() : BaseAction(Type::ToggleInterface, "toggle_interface") { }
218 protected:
219 virtual void run();
222 struct JumpToParentDirectory : public BaseAction
224 JumpToParentDirectory() : BaseAction(Type::JumpToParentDirectory, "jump_to_parent_directory") { }
226 protected:
227 virtual bool canBeRun() const;
228 virtual void run();
231 struct PressEnter : public BaseAction
233 PressEnter() : BaseAction(Type::PressEnter, "press_enter") { }
235 protected:
236 virtual void run();
239 struct PressSpace : public BaseAction
241 PressSpace() : BaseAction(Type::PressSpace, "press_space") { }
243 protected:
244 virtual void run();
247 struct PreviousColumn : public BaseAction
249 PreviousColumn() : BaseAction(Type::PreviousColumn, "previous_column") { }
251 protected:
252 virtual bool canBeRun() const;
253 virtual void run();
256 struct NextColumn : public BaseAction
258 NextColumn() : BaseAction(Type::NextColumn, "next_column") { }
260 protected:
261 virtual bool canBeRun() const;
262 virtual void run();
265 struct MasterScreen : public BaseAction
267 MasterScreen() : BaseAction(Type::MasterScreen, "master_screen") { }
269 protected:
270 virtual bool canBeRun() const;
271 virtual void run();
274 struct SlaveScreen : public BaseAction
276 SlaveScreen() : BaseAction(Type::SlaveScreen, "slave_screen") { }
278 protected:
279 virtual bool canBeRun() const;
280 virtual void run();
283 struct VolumeUp : public BaseAction
285 VolumeUp() : BaseAction(Type::VolumeUp, "volume_up") { }
287 protected:
288 virtual void run();
291 struct VolumeDown : public BaseAction
293 VolumeDown() : BaseAction(Type::VolumeDown, "volume_down") { }
295 protected:
296 virtual void run();
299 struct DeletePlaylistItems : public BaseAction
301 DeletePlaylistItems() : BaseAction(Type::DeletePlaylistItems, "delete_playlist_items") { }
303 protected:
304 virtual bool canBeRun() const;
305 virtual void run();
308 struct DeleteStoredPlaylist : public BaseAction
310 DeleteStoredPlaylist() : BaseAction(Type::DeleteStoredPlaylist, "delete_stored_playlist") { }
312 protected:
313 virtual bool canBeRun() const;
314 virtual void run();
317 struct DeleteBrowserItems : public BaseAction
319 DeleteBrowserItems() : BaseAction(Type::DeleteBrowserItems, "delete_browser_items") { }
321 protected:
322 virtual bool canBeRun() const;
323 virtual void run();
326 struct ReplaySong : public BaseAction
328 ReplaySong() : BaseAction(Type::ReplaySong, "replay_song") { }
330 protected:
331 virtual void run();
334 struct PreviousSong : public BaseAction
336 PreviousSong() : BaseAction(Type::Previous, "previous") { }
338 protected:
339 virtual void run();
342 struct NextSong : public BaseAction
344 NextSong() : BaseAction(Type::Next, "next") { }
346 protected:
347 virtual void run();
350 struct Pause : public BaseAction
352 Pause() : BaseAction(Type::Pause, "pause") { }
354 protected:
355 virtual void run();
358 struct Stop : public BaseAction
360 Stop() : BaseAction(Type::Stop, "stop") { }
362 protected:
363 virtual void run();
366 struct ExecuteCommand : public BaseAction
368 ExecuteCommand() : BaseAction(Type::ExecuteCommand, "execute_command") { }
370 protected:
371 virtual void run();
374 struct SavePlaylist : public BaseAction
376 SavePlaylist() : BaseAction(Type::SavePlaylist, "save_playlist") { }
378 protected:
379 virtual void run();
382 struct MoveSortOrderUp : public BaseAction
384 MoveSortOrderUp() : BaseAction(Type::MoveSortOrderUp, "move_sort_order_up") { }
386 protected:
387 virtual bool canBeRun() const;
388 virtual void run();
391 struct MoveSortOrderDown : public BaseAction
393 MoveSortOrderDown() : BaseAction(Type::MoveSortOrderDown, "move_sort_order_down") { }
395 protected:
396 virtual bool canBeRun() const;
397 virtual void run();
400 struct MoveSelectedItemsUp : public BaseAction
402 MoveSelectedItemsUp() : BaseAction(Type::MoveSelectedItemsUp, "move_selected_items_up") { }
404 protected:
405 virtual bool canBeRun() const;
406 virtual void run();
409 struct MoveSelectedItemsDown : public BaseAction
411 MoveSelectedItemsDown() : BaseAction(Type::MoveSelectedItemsDown, "move_selected_items_down") { }
413 protected:
414 virtual bool canBeRun() const;
415 virtual void run();
418 struct MoveSelectedItemsTo : public BaseAction
420 MoveSelectedItemsTo() : BaseAction(Type::MoveSelectedItemsTo, "move_selected_items_to") { }
422 protected:
423 virtual bool canBeRun() const;
424 virtual void run();
427 struct Add : public BaseAction
429 Add() : BaseAction(Type::Add, "add") { }
431 protected:
432 virtual bool canBeRun() const;
433 virtual void run();
436 struct SeekForward : public BaseAction
438 SeekForward() : BaseAction(Type::SeekForward, "seek_forward") { }
440 protected:
441 virtual bool canBeRun() const;
442 virtual void run();
445 struct SeekBackward : public BaseAction
447 SeekBackward() : BaseAction(Type::SeekBackward, "seek_backward") { }
449 protected:
450 virtual bool canBeRun() const;
451 virtual void run();
454 struct ToggleDisplayMode : public BaseAction
456 ToggleDisplayMode() : BaseAction(Type::ToggleDisplayMode, "toggle_display_mode") { }
458 protected:
459 virtual bool canBeRun() const;
460 virtual void run();
463 struct ToggleSeparatorsBetweenAlbums : public BaseAction
465 ToggleSeparatorsBetweenAlbums()
466 : BaseAction(Type::ToggleSeparatorsBetweenAlbums, "toggle_separators_between_albums") { }
468 protected:
469 virtual bool canBeRun() const;
470 virtual void run();
473 struct ToggleLyricsFetcher : public BaseAction
475 ToggleLyricsFetcher() : BaseAction(Type::ToggleLyricsFetcher, "toggle_lyrics_fetcher") { }
477 protected:
478 # ifndef HAVE_CURL_CURL_H
479 virtual bool canBeRun() const;
480 # endif // NOT HAVE_CURL_CURL_H
481 virtual void run();
484 struct ToggleFetchingLyricsInBackground : public BaseAction
486 ToggleFetchingLyricsInBackground()
487 : BaseAction(Type::ToggleFetchingLyricsInBackground, "toggle_fetching_lyrics_in_background") { }
489 protected:
490 # ifndef HAVE_CURL_CURL_H
491 virtual bool canBeRun() const;
492 # endif // NOT HAVE_CURL_CURL_H
493 virtual void run();
496 struct TogglePlayingSongCentering : public BaseAction
498 TogglePlayingSongCentering()
499 : BaseAction(Type::TogglePlayingSongCentering, "toggle_playing_song_centering") { }
501 protected:
502 virtual void run();
505 struct UpdateDatabase : public BaseAction
507 UpdateDatabase() : BaseAction(Type::UpdateDatabase, "update_database") { }
509 protected:
510 virtual void run();
513 struct JumpToPlayingSong : public BaseAction
515 JumpToPlayingSong() : BaseAction(Type::JumpToPlayingSong, "jump_to_playing_song") { }
517 protected:
518 virtual bool canBeRun() const;
519 virtual void run();
522 struct ToggleRepeat : public BaseAction
524 ToggleRepeat() : BaseAction(Type::ToggleRepeat, "toggle_repeat") { }
526 protected:
527 virtual void run();
530 struct Shuffle : public BaseAction
532 Shuffle() : BaseAction(Type::Shuffle, "shuffle") { }
534 protected:
535 virtual void run();
538 struct ToggleRandom : public BaseAction
540 ToggleRandom() : BaseAction(Type::ToggleRandom, "toggle_random") { }
542 protected:
543 virtual void run();
546 struct StartSearching : public BaseAction
548 StartSearching() : BaseAction(Type::StartSearching, "start_searching") { }
550 protected:
551 virtual bool canBeRun() const;
552 virtual void run();
555 struct SaveTagChanges : public BaseAction
557 SaveTagChanges() : BaseAction(Type::SaveTagChanges, "save_tag_changes") { }
559 protected:
560 virtual bool canBeRun() const;
561 virtual void run();
564 struct ToggleSingle : public BaseAction
566 ToggleSingle() : BaseAction(Type::ToggleSingle, "toggle_single") { }
568 protected:
569 virtual void run();
572 struct ToggleConsume : public BaseAction
574 ToggleConsume() : BaseAction(Type::ToggleConsume, "toggle_consume") { }
576 protected:
577 virtual void run();
580 struct ToggleCrossfade : public BaseAction
582 ToggleCrossfade() : BaseAction(Type::ToggleCrossfade, "toggle_crossfade") { }
584 protected:
585 virtual void run();
588 struct SetCrossfade : public BaseAction
590 SetCrossfade() : BaseAction(Type::SetCrossfade, "set_crossfade") { }
592 protected:
593 virtual void run();
596 struct SetVolume : public BaseAction
598 SetVolume() : BaseAction(Type::SetVolume, "set_volume") { }
600 protected:
601 virtual void run();
604 struct EditSong : public BaseAction
606 EditSong() : BaseAction(Type::EditSong, "edit_song") { }
608 protected:
609 virtual bool canBeRun() const;
610 virtual void run();
613 struct EditLibraryTag : public BaseAction
615 EditLibraryTag() : BaseAction(Type::EditLibraryTag, "edit_library_tag") { }
617 protected:
618 virtual bool canBeRun() const;
619 virtual void run();
622 struct EditLibraryAlbum : public BaseAction
624 EditLibraryAlbum() : BaseAction(Type::EditLibraryAlbum, "edit_library_album") { }
626 protected:
627 virtual bool canBeRun() const;
628 virtual void run();
631 struct EditDirectoryName : public BaseAction
633 EditDirectoryName() : BaseAction(Type::EditDirectoryName, "edit_directory_name") { }
635 protected:
636 virtual bool canBeRun() const;
637 virtual void run();
640 struct EditPlaylistName : public BaseAction
642 EditPlaylistName() : BaseAction(Type::EditPlaylistName, "edit_playlist_name") { }
644 protected:
645 virtual bool canBeRun() const;
646 virtual void run();
649 struct EditLyrics : public BaseAction
651 EditLyrics() : BaseAction(Type::EditLyrics, "edit_lyrics") { }
653 protected:
654 virtual bool canBeRun() const;
655 virtual void run();
658 struct JumpToBrowser : public BaseAction
660 JumpToBrowser() : BaseAction(Type::JumpToBrowser, "jump_to_browser") { }
662 protected:
663 virtual bool canBeRun() const;
664 virtual void run();
667 struct JumpToMediaLibrary : public BaseAction
669 JumpToMediaLibrary() : BaseAction(Type::JumpToMediaLibrary, "jump_to_media_library") { }
671 protected:
672 virtual bool canBeRun() const;
673 virtual void run();
676 struct JumpToPlaylistEditor : public BaseAction
678 JumpToPlaylistEditor() : BaseAction(Type::JumpToPlaylistEditor, "jump_to_playlist_editor") { }
680 protected:
681 virtual bool canBeRun() const;
682 virtual void run();
685 struct ToggleScreenLock : public BaseAction
687 ToggleScreenLock() : BaseAction(Type::ToggleScreenLock, "toggle_screen_lock") { }
689 protected:
690 virtual void run();
693 struct JumpToTagEditor : public BaseAction
695 JumpToTagEditor() : BaseAction(Type::JumpToTagEditor, "jump_to_tag_editor") { }
697 protected:
698 virtual bool canBeRun() const;
699 virtual void run();
702 struct JumpToPositionInSong : public BaseAction
704 JumpToPositionInSong() : BaseAction(Type::JumpToPositionInSong, "jump_to_position_in_song") { }
706 protected:
707 virtual bool canBeRun() const;
708 virtual void run();
711 struct ReverseSelection : public BaseAction
713 ReverseSelection() : BaseAction(Type::ReverseSelection, "reverse_selection") { }
715 protected:
716 virtual bool canBeRun() const;
717 virtual void run();
720 struct RemoveSelection : public BaseAction
722 RemoveSelection() : BaseAction(Type::RemoveSelection, "remove_selection") { }
724 protected:
725 virtual bool canBeRun() const;
726 virtual void run();
729 struct SelectAlbum : public BaseAction
731 SelectAlbum() : BaseAction(Type::SelectAlbum, "select_album") { }
733 protected:
734 virtual bool canBeRun() const;
735 virtual void run();
738 struct AddSelectedItems : public BaseAction
740 AddSelectedItems() : BaseAction(Type::AddSelectedItems, "add_selected_items") { }
742 protected:
743 virtual bool canBeRun() const;
744 virtual void run();
747 struct CropMainPlaylist : public BaseAction
749 CropMainPlaylist() : BaseAction(Type::CropMainPlaylist, "crop_main_playlist") { }
751 protected:
752 virtual void run();
755 struct CropPlaylist : public BaseAction
757 CropPlaylist() : BaseAction(Type::CropPlaylist, "crop_playlist") { }
759 protected:
760 virtual bool canBeRun() const;
761 virtual void run();
764 struct ClearMainPlaylist : public BaseAction
766 ClearMainPlaylist() : BaseAction(Type::ClearMainPlaylist, "clear_main_playlist") { }
768 protected:
769 virtual void run();
772 struct ClearPlaylist : public BaseAction
774 ClearPlaylist() : BaseAction(Type::ClearPlaylist, "clear_playlist") { }
776 protected:
777 virtual bool canBeRun() const;
778 virtual void run();
781 struct SortPlaylist : public BaseAction
783 SortPlaylist() : BaseAction(Type::SortPlaylist, "sort_playlist") { }
785 protected:
786 virtual bool canBeRun() const;
787 virtual void run();
790 struct ReversePlaylist : public BaseAction
792 ReversePlaylist() : BaseAction(Type::ReversePlaylist, "reverse_playlist") { }
794 protected:
795 virtual bool canBeRun() const;
796 virtual void run();
799 struct ApplyFilter : public BaseAction
801 ApplyFilter() : BaseAction(Type::ApplyFilter, "apply_filter") { }
803 protected:
804 virtual bool canBeRun() const;
805 virtual void run();
808 struct Find : public BaseAction
810 Find() : BaseAction(Type::Find, "find") { }
812 protected:
813 virtual bool canBeRun() const;
814 virtual void run();
817 struct FindItemForward : public BaseAction
819 FindItemForward() : BaseAction(Type::FindItemForward, "find_item_forward") { }
821 protected:
822 virtual bool canBeRun() const;
823 virtual void run();
826 struct FindItemBackward : public BaseAction
828 FindItemBackward() : BaseAction(Type::FindItemBackward, "find_item_backward") { }
830 protected:
831 virtual bool canBeRun() const;
832 virtual void run();
835 struct NextFoundItem : public BaseAction
837 NextFoundItem() : BaseAction(Type::NextFoundItem, "next_found_item") { }
839 protected:
840 virtual bool canBeRun() const;
841 virtual void run();
844 struct PreviousFoundItem : public BaseAction
846 PreviousFoundItem() : BaseAction(Type::PreviousFoundItem, "previous_found_item") { }
848 protected:
849 virtual bool canBeRun() const;
850 virtual void run();
853 struct ToggleFindMode : public BaseAction
855 ToggleFindMode() : BaseAction(Type::ToggleFindMode, "toggle_find_mode") { }
857 protected:
858 virtual void run();
861 struct ToggleReplayGainMode : public BaseAction
863 ToggleReplayGainMode() : BaseAction(Type::ToggleReplayGainMode, "toggle_replay_gain_mode") { }
865 protected:
866 virtual void run();
869 struct ToggleSpaceMode : public BaseAction
871 ToggleSpaceMode() : BaseAction(Type::ToggleSpaceMode, "toggle_space_mode") { }
873 protected:
874 virtual void run();
877 struct ToggleAddMode : public BaseAction
879 ToggleAddMode() : BaseAction(Type::ToggleAddMode, "toggle_add_mode") { }
881 protected:
882 virtual void run();
885 struct ToggleMouse : public BaseAction
887 ToggleMouse() : BaseAction(Type::ToggleMouse, "toggle_mouse") { }
889 protected:
890 virtual void run();
893 struct ToggleBitrateVisibility : public BaseAction
895 ToggleBitrateVisibility() : BaseAction(Type::ToggleBitrateVisibility, "toggle_bitrate_visibility") { }
897 protected:
898 virtual void run();
901 struct AddRandomItems : public BaseAction
903 AddRandomItems() : BaseAction(Type::AddRandomItems, "add_random_items") { }
905 protected:
906 virtual void run();
909 struct ToggleBrowserSortMode : public BaseAction
911 ToggleBrowserSortMode() : BaseAction(Type::ToggleBrowserSortMode, "toggle_browser_sort_mode") { }
913 protected:
914 virtual bool canBeRun() const;
915 virtual void run();
918 struct ToggleLibraryTagType : public BaseAction
920 ToggleLibraryTagType() : BaseAction(Type::ToggleLibraryTagType, "toggle_library_tag_type") { }
922 protected:
923 virtual bool canBeRun() const;
924 virtual void run();
927 struct ToggleMediaLibrarySortMode : public BaseAction
929 ToggleMediaLibrarySortMode()
930 : BaseAction(Type::ToggleMediaLibrarySortMode, "toggle_media_library_sort_mode") { }
932 protected:
933 virtual bool canBeRun() const;
934 virtual void run();
937 struct RefetchLyrics : public BaseAction
939 RefetchLyrics() : BaseAction(Type::RefetchLyrics, "refetch_lyrics") { }
941 protected:
942 virtual bool canBeRun() const;
943 virtual void run();
946 struct RefetchArtistInfo : public BaseAction
948 RefetchArtistInfo() : BaseAction(Type::RefetchArtistInfo, "refetch_artist_info") { }
950 protected:
951 virtual bool canBeRun() const;
952 virtual void run();
955 struct SetSelectedItemsPriority : public BaseAction
957 SetSelectedItemsPriority()
958 : BaseAction(Type::SetSelectedItemsPriority, "set_selected_items_priority") { }
960 protected:
961 virtual bool canBeRun() const;
962 virtual void run();
965 struct FilterPlaylistOnPriorities : public BaseAction
967 FilterPlaylistOnPriorities()
968 : BaseAction(Type::FilterPlaylistOnPriorities, "filter_playlist_on_priorities") { }
970 protected:
971 virtual bool canBeRun() const;
972 virtual void run();
975 struct ShowSongInfo : public BaseAction
977 ShowSongInfo() : BaseAction(Type::ShowSongInfo, "show_song_info") { }
979 protected:
980 virtual void run();
983 struct ShowArtistInfo : public BaseAction
985 ShowArtistInfo() : BaseAction(Type::ShowArtistInfo, "show_artist_info") { }
987 protected:
988 virtual bool canBeRun() const;
989 virtual void run();
992 struct ShowLyrics : public BaseAction
994 ShowLyrics() : BaseAction(Type::ShowLyrics, "show_lyrics") { }
996 protected:
997 virtual void run();
1000 struct Quit : public BaseAction
1002 Quit() : BaseAction(Type::Quit, "quit") { }
1004 protected:
1005 virtual void run();
1008 struct NextScreen : public BaseAction
1010 NextScreen() : BaseAction(Type::NextScreen, "next_screen") { }
1012 protected:
1013 virtual void run();
1016 struct PreviousScreen : public BaseAction
1018 PreviousScreen() : BaseAction(Type::PreviousScreen, "previous_screen") { }
1020 protected:
1021 virtual void run();
1024 struct ShowHelp : public BaseAction
1026 ShowHelp() : BaseAction(Type::ShowHelp, "show_help") { }
1028 protected:
1029 virtual bool canBeRun() const;
1030 virtual void run();
1033 struct ShowPlaylist : public BaseAction
1035 ShowPlaylist() : BaseAction(Type::ShowPlaylist, "show_playlist") { }
1037 protected:
1038 virtual bool canBeRun() const;
1039 virtual void run();
1042 struct ShowBrowser : public BaseAction
1044 ShowBrowser() : BaseAction(Type::ShowBrowser, "show_browser") { }
1046 protected:
1047 virtual bool canBeRun() const;
1048 virtual void run();
1051 struct ChangeBrowseMode : public BaseAction
1053 ChangeBrowseMode() : BaseAction(Type::ChangeBrowseMode, "change_browse_mode") { }
1055 protected:
1056 virtual bool canBeRun() const;
1057 virtual void run();
1060 struct ShowSearchEngine : public BaseAction
1062 ShowSearchEngine() : BaseAction(Type::ShowSearchEngine, "show_search_engine") { }
1064 protected:
1065 virtual bool canBeRun() const;
1066 virtual void run();
1069 struct ResetSearchEngine : public BaseAction
1071 ResetSearchEngine() : BaseAction(Type::ResetSearchEngine, "reset_search_engine") { }
1073 protected:
1074 virtual bool canBeRun() const;
1075 virtual void run();
1078 struct ShowMediaLibrary : public BaseAction
1080 ShowMediaLibrary() : BaseAction(Type::ShowMediaLibrary, "show_media_library") { }
1082 protected:
1083 virtual bool canBeRun() const;
1084 virtual void run();
1087 struct ToggleMediaLibraryColumnsMode : public BaseAction
1089 ToggleMediaLibraryColumnsMode()
1090 : BaseAction(Type::ToggleMediaLibraryColumnsMode, "toggle_media_library_columns_mode") { }
1092 protected:
1093 virtual bool canBeRun() const;
1094 virtual void run();
1097 struct ShowPlaylistEditor : public BaseAction
1099 ShowPlaylistEditor() : BaseAction(Type::ShowPlaylistEditor, "show_playlist_editor") { }
1101 protected:
1102 virtual bool canBeRun() const;
1103 virtual void run();
1106 struct ShowTagEditor : public BaseAction
1108 ShowTagEditor() : BaseAction(Type::ShowTagEditor, "show_tag_editor") { }
1110 protected:
1111 virtual bool canBeRun() const;
1112 virtual void run();
1115 struct ShowOutputs : public BaseAction
1117 ShowOutputs() : BaseAction(Type::ShowOutputs, "show_outputs") { }
1119 protected:
1120 virtual bool canBeRun() const;
1121 virtual void run();
1124 struct ShowVisualizer : public BaseAction
1126 ShowVisualizer() : BaseAction(Type::ShowVisualizer, "show_visualizer") { }
1128 protected:
1129 virtual bool canBeRun() const;
1130 virtual void run();
1133 struct ShowClock : public BaseAction
1135 ShowClock() : BaseAction(Type::ShowClock, "show_clock") { }
1137 protected:
1138 virtual bool canBeRun() const;
1139 virtual void run();
1142 struct ShowServerInfo : public BaseAction
1144 ShowServerInfo() : BaseAction(Type::ShowServerInfo, "show_server_info") { }
1146 protected:
1147 # ifdef HAVE_TAGLIB_H
1148 virtual bool canBeRun() const;
1149 # endif // HAVE_TAGLIB_H
1150 virtual void run();
1155 #endif // NCMPCPP_ACTIONS_H