media library: fix mouse event handler
[ncmpcpp.git] / src / actions.h
blobd828c2ebea6d25e6fe4f99b75698b6f8b5ee7123
1 /***************************************************************************
2 * Copyright (C) 2008-2014 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 <boost/format.hpp>
25 #include <map>
26 #include <string>
27 #include "window.h"
29 namespace Actions {//
31 enum class Type
33 MacroUtility = 0,
34 Dummy, MouseEvent, ScrollUp, ScrollDown, ScrollUpArtist, ScrollUpAlbum,
35 ScrollDownArtist, ScrollDownAlbum, PageUp, PageDown, MoveHome, MoveEnd,
36 ToggleInterface, JumpToParentDirectory, PressEnter, PressSpace, PreviousColumn,
37 NextColumn, MasterScreen, SlaveScreen, VolumeUp, VolumeDown, DeletePlaylistItems,
38 DeleteStoredPlaylist, DeleteBrowserItems, ReplaySong, Previous, Next, Pause,
39 Stop, ExecuteCommand, SavePlaylist, MoveSortOrderUp, MoveSortOrderDown,
40 MoveSelectedItemsUp, MoveSelectedItemsDown, MoveSelectedItemsTo, Add,
41 SeekForward, SeekBackward, ToggleDisplayMode, ToggleSeparatorsBetweenAlbums,
42 ToggleLyricsFetcher, ToggleFetchingLyricsInBackground, TogglePlayingSongCentering,
43 UpdateDatabase, JumpToPlayingSong, ToggleRepeat, Shuffle, ToggleRandom,
44 StartSearching, SaveTagChanges, ToggleSingle, ToggleConsume, ToggleCrossfade,
45 SetCrossfade, SetVolume, EditSong, EditLibraryTag, EditLibraryAlbum, EditDirectoryName,
46 EditPlaylistName, EditLyrics, JumpToBrowser, JumpToMediaLibrary,
47 JumpToPlaylistEditor, ToggleScreenLock, JumpToTagEditor, JumpToPositionInSong,
48 ReverseSelection, RemoveSelection, SelectAlbum, AddSelectedItems,
49 CropMainPlaylist, CropPlaylist, ClearMainPlaylist, ClearPlaylist, SortPlaylist,
50 ReversePlaylist, ApplyFilter, Find, FindItemForward, FindItemBackward,
51 NextFoundItem, PreviousFoundItem, ToggleFindMode, ToggleReplayGainMode,
52 ToggleSpaceMode, ToggleAddMode, ToggleMouse, ToggleBitrateVisibility,
53 AddRandomItems, ToggleBrowserSortMode, ToggleLibraryTagType,
54 ToggleMediaLibrarySortMode, RefetchLyrics,
55 SetSelectedItemsPriority, SetVisualizerSampleMultiplier, FilterPlaylistOnPriorities,
56 ShowSongInfo, ShowArtistInfo, ShowLyrics, Quit, NextScreen, PreviousScreen,
57 ShowHelp, ShowPlaylist, ShowBrowser, ChangeBrowseMode, ShowSearchEngine,
58 ResetSearchEngine, ShowMediaLibrary, ToggleMediaLibraryColumnsMode,
59 ShowPlaylistEditor, ShowTagEditor, ShowOutputs, ShowVisualizer,
60 ShowClock, ShowServerInfo,
61 _numberOfActions // needed to dynamically calculate size of action array
64 void validateScreenSize();
65 void initializeScreens();
66 void setResizeFlags();
67 void resizeScreen(bool reload_main_window);
68 void setWindowsDimensions();
70 bool askYesNoQuestion(const boost::format &question, void (*callback)());
71 inline bool askYesNoQuestion(const std::string &question, void (*callback)())
73 return askYesNoQuestion(boost::format(question), callback);
76 bool isMPDMusicDirSet();
78 extern bool OriginalStatusbarVisibility;
79 extern bool ExitMainLoop;
81 extern size_t HeaderHeight;
82 extern size_t FooterHeight;
83 extern size_t FooterStartY;
85 struct BaseAction
87 BaseAction(Type type_, const char *name_) : m_type(type_), m_name(name_) { }
89 const char *name() const { return m_name; }
90 Type type() const { return m_type; }
92 virtual bool canBeRun() const { return true; }
94 bool execute()
96 if (canBeRun())
98 run();
99 return true;
101 return false;
104 protected:
105 virtual void run() = 0;
107 private:
108 Type m_type;
109 const char *m_name;
112 BaseAction &get(Type at);
113 BaseAction *get(const std::string &name);
115 struct Dummy : public BaseAction
117 Dummy() : BaseAction(Type::Dummy, "dummy") { }
119 protected:
120 virtual void run() { }
123 struct MouseEvent : public BaseAction
125 MouseEvent() : BaseAction(Type::MouseEvent, "mouse_event") { }
127 protected:
128 virtual bool canBeRun() const;
129 virtual void run();
131 private:
132 MEVENT m_mouse_event;
133 MEVENT m_old_mouse_event;
136 struct ScrollUp : public BaseAction
138 ScrollUp() : BaseAction(Type::ScrollUp, "scroll_up") { }
140 protected:
141 virtual void run();
144 struct ScrollDown : public BaseAction
146 ScrollDown() : BaseAction(Type::ScrollDown, "scroll_down") { }
148 protected:
149 virtual void run();
152 struct ScrollUpArtist : public BaseAction
154 ScrollUpArtist() : BaseAction(Type::ScrollUpArtist, "scroll_up_artist") { }
156 protected:
157 virtual bool canBeRun() const;
158 virtual void run();
161 struct ScrollUpAlbum : public BaseAction
163 ScrollUpAlbum() : BaseAction(Type::ScrollUpAlbum, "scroll_up_album") { }
165 protected:
166 virtual bool canBeRun() const;
167 virtual void run();
170 struct ScrollDownArtist : public BaseAction
172 ScrollDownArtist() : BaseAction(Type::ScrollDownArtist, "scroll_down_artist") { }
174 protected:
175 virtual bool canBeRun() const;
176 virtual void run();
179 struct ScrollDownAlbum : public BaseAction
181 ScrollDownAlbum() : BaseAction(Type::ScrollDownAlbum, "scroll_down_album") { }
183 protected:
184 virtual bool canBeRun() const;
185 virtual void run();
188 struct PageUp : public BaseAction
190 PageUp() : BaseAction(Type::PageUp, "page_up") { }
192 protected:
193 virtual void run();
196 struct PageDown : public BaseAction
198 PageDown() : BaseAction(Type::PageDown, "page_down") { }
200 protected:
201 virtual void run();
204 struct MoveHome : public BaseAction
206 MoveHome() : BaseAction(Type::MoveHome, "move_home") { }
208 protected:
209 virtual void run();
212 struct MoveEnd : public BaseAction
214 MoveEnd() : BaseAction(Type::MoveEnd, "move_end") { }
216 protected:
217 virtual void run();
220 struct ToggleInterface : public BaseAction
222 ToggleInterface() : BaseAction(Type::ToggleInterface, "toggle_interface") { }
224 protected:
225 virtual void run();
228 struct JumpToParentDirectory : public BaseAction
230 JumpToParentDirectory() : BaseAction(Type::JumpToParentDirectory, "jump_to_parent_directory") { }
232 protected:
233 virtual bool canBeRun() const;
234 virtual void run();
237 struct PressEnter : public BaseAction
239 PressEnter() : BaseAction(Type::PressEnter, "press_enter") { }
241 protected:
242 virtual void run();
245 struct PressSpace : public BaseAction
247 PressSpace() : BaseAction(Type::PressSpace, "press_space") { }
249 protected:
250 virtual void run();
253 struct PreviousColumn : public BaseAction
255 PreviousColumn() : BaseAction(Type::PreviousColumn, "previous_column") { }
257 protected:
258 virtual bool canBeRun() const;
259 virtual void run();
262 struct NextColumn : public BaseAction
264 NextColumn() : BaseAction(Type::NextColumn, "next_column") { }
266 protected:
267 virtual bool canBeRun() const;
268 virtual void run();
271 struct MasterScreen : public BaseAction
273 MasterScreen() : BaseAction(Type::MasterScreen, "master_screen") { }
275 protected:
276 virtual bool canBeRun() const;
277 virtual void run();
280 struct SlaveScreen : public BaseAction
282 SlaveScreen() : BaseAction(Type::SlaveScreen, "slave_screen") { }
284 protected:
285 virtual bool canBeRun() const;
286 virtual void run();
289 struct VolumeUp : public BaseAction
291 VolumeUp() : BaseAction(Type::VolumeUp, "volume_up") { }
293 protected:
294 virtual void run();
297 struct VolumeDown : public BaseAction
299 VolumeDown() : BaseAction(Type::VolumeDown, "volume_down") { }
301 protected:
302 virtual void run();
305 struct DeletePlaylistItems : public BaseAction
307 DeletePlaylistItems() : BaseAction(Type::DeletePlaylistItems, "delete_playlist_items") { }
309 protected:
310 virtual bool canBeRun() const;
311 virtual void run();
314 struct DeleteStoredPlaylist : public BaseAction
316 DeleteStoredPlaylist() : BaseAction(Type::DeleteStoredPlaylist, "delete_stored_playlist") { }
318 protected:
319 virtual bool canBeRun() const;
320 virtual void run();
323 struct DeleteBrowserItems : public BaseAction
325 DeleteBrowserItems() : BaseAction(Type::DeleteBrowserItems, "delete_browser_items") { }
327 protected:
328 virtual bool canBeRun() const;
329 virtual void run();
332 struct ReplaySong : public BaseAction
334 ReplaySong() : BaseAction(Type::ReplaySong, "replay_song") { }
336 protected:
337 virtual void run();
340 struct PreviousSong : public BaseAction
342 PreviousSong() : BaseAction(Type::Previous, "previous") { }
344 protected:
345 virtual void run();
348 struct NextSong : public BaseAction
350 NextSong() : BaseAction(Type::Next, "next") { }
352 protected:
353 virtual void run();
356 struct Pause : public BaseAction
358 Pause() : BaseAction(Type::Pause, "pause") { }
360 protected:
361 virtual void run();
364 struct Stop : public BaseAction
366 Stop() : BaseAction(Type::Stop, "stop") { }
368 protected:
369 virtual void run();
372 struct ExecuteCommand : public BaseAction
374 ExecuteCommand() : BaseAction(Type::ExecuteCommand, "execute_command") { }
376 protected:
377 virtual void run();
380 struct SavePlaylist : public BaseAction
382 SavePlaylist() : BaseAction(Type::SavePlaylist, "save_playlist") { }
384 protected:
385 virtual void run();
388 struct MoveSortOrderUp : public BaseAction
390 MoveSortOrderUp() : BaseAction(Type::MoveSortOrderUp, "move_sort_order_up") { }
392 protected:
393 virtual bool canBeRun() const;
394 virtual void run();
397 struct MoveSortOrderDown : public BaseAction
399 MoveSortOrderDown() : BaseAction(Type::MoveSortOrderDown, "move_sort_order_down") { }
401 protected:
402 virtual bool canBeRun() const;
403 virtual void run();
406 struct MoveSelectedItemsUp : public BaseAction
408 MoveSelectedItemsUp() : BaseAction(Type::MoveSelectedItemsUp, "move_selected_items_up") { }
410 protected:
411 virtual bool canBeRun() const;
412 virtual void run();
415 struct MoveSelectedItemsDown : public BaseAction
417 MoveSelectedItemsDown() : BaseAction(Type::MoveSelectedItemsDown, "move_selected_items_down") { }
419 protected:
420 virtual bool canBeRun() const;
421 virtual void run();
424 struct MoveSelectedItemsTo : public BaseAction
426 MoveSelectedItemsTo() : BaseAction(Type::MoveSelectedItemsTo, "move_selected_items_to") { }
428 protected:
429 virtual bool canBeRun() const;
430 virtual void run();
433 struct Add : public BaseAction
435 Add() : BaseAction(Type::Add, "add") { }
437 protected:
438 virtual bool canBeRun() const;
439 virtual void run();
442 struct SeekForward : public BaseAction
444 SeekForward() : BaseAction(Type::SeekForward, "seek_forward") { }
446 protected:
447 virtual bool canBeRun() const;
448 virtual void run();
451 struct SeekBackward : public BaseAction
453 SeekBackward() : BaseAction(Type::SeekBackward, "seek_backward") { }
455 protected:
456 virtual bool canBeRun() const;
457 virtual void run();
460 struct ToggleDisplayMode : public BaseAction
462 ToggleDisplayMode() : BaseAction(Type::ToggleDisplayMode, "toggle_display_mode") { }
464 protected:
465 virtual bool canBeRun() const;
466 virtual void run();
469 struct ToggleSeparatorsBetweenAlbums : public BaseAction
471 ToggleSeparatorsBetweenAlbums()
472 : BaseAction(Type::ToggleSeparatorsBetweenAlbums, "toggle_separators_between_albums") { }
474 protected:
475 virtual bool canBeRun() const;
476 virtual void run();
479 struct ToggleLyricsFetcher : public BaseAction
481 ToggleLyricsFetcher() : BaseAction(Type::ToggleLyricsFetcher, "toggle_lyrics_fetcher") { }
483 protected:
484 # ifndef HAVE_CURL_CURL_H
485 virtual bool canBeRun() const;
486 # endif // NOT HAVE_CURL_CURL_H
487 virtual void run();
490 struct ToggleFetchingLyricsInBackground : public BaseAction
492 ToggleFetchingLyricsInBackground()
493 : BaseAction(Type::ToggleFetchingLyricsInBackground, "toggle_fetching_lyrics_in_background") { }
495 protected:
496 # ifndef HAVE_CURL_CURL_H
497 virtual bool canBeRun() const;
498 # endif // NOT HAVE_CURL_CURL_H
499 virtual void run();
502 struct TogglePlayingSongCentering : public BaseAction
504 TogglePlayingSongCentering()
505 : BaseAction(Type::TogglePlayingSongCentering, "toggle_playing_song_centering") { }
507 protected:
508 virtual void run();
511 struct UpdateDatabase : public BaseAction
513 UpdateDatabase() : BaseAction(Type::UpdateDatabase, "update_database") { }
515 protected:
516 virtual void run();
519 struct JumpToPlayingSong : public BaseAction
521 JumpToPlayingSong() : BaseAction(Type::JumpToPlayingSong, "jump_to_playing_song") { }
523 protected:
524 virtual bool canBeRun() const;
525 virtual void run();
528 struct ToggleRepeat : public BaseAction
530 ToggleRepeat() : BaseAction(Type::ToggleRepeat, "toggle_repeat") { }
532 protected:
533 virtual void run();
536 struct Shuffle : public BaseAction
538 Shuffle() : BaseAction(Type::Shuffle, "shuffle") { }
540 protected:
541 virtual void run();
544 struct ToggleRandom : public BaseAction
546 ToggleRandom() : BaseAction(Type::ToggleRandom, "toggle_random") { }
548 protected:
549 virtual void run();
552 struct StartSearching : public BaseAction
554 StartSearching() : BaseAction(Type::StartSearching, "start_searching") { }
556 protected:
557 virtual bool canBeRun() const;
558 virtual void run();
561 struct SaveTagChanges : public BaseAction
563 SaveTagChanges() : BaseAction(Type::SaveTagChanges, "save_tag_changes") { }
565 protected:
566 virtual bool canBeRun() const;
567 virtual void run();
570 struct ToggleSingle : public BaseAction
572 ToggleSingle() : BaseAction(Type::ToggleSingle, "toggle_single") { }
574 protected:
575 virtual void run();
578 struct ToggleConsume : public BaseAction
580 ToggleConsume() : BaseAction(Type::ToggleConsume, "toggle_consume") { }
582 protected:
583 virtual void run();
586 struct ToggleCrossfade : public BaseAction
588 ToggleCrossfade() : BaseAction(Type::ToggleCrossfade, "toggle_crossfade") { }
590 protected:
591 virtual void run();
594 struct SetCrossfade : public BaseAction
596 SetCrossfade() : BaseAction(Type::SetCrossfade, "set_crossfade") { }
598 protected:
599 virtual void run();
602 struct SetVolume : public BaseAction
604 SetVolume() : BaseAction(Type::SetVolume, "set_volume") { }
606 protected:
607 virtual void run();
610 struct EditSong : public BaseAction
612 EditSong() : BaseAction(Type::EditSong, "edit_song") { }
614 protected:
615 virtual bool canBeRun() const;
616 virtual void run();
619 struct EditLibraryTag : public BaseAction
621 EditLibraryTag() : BaseAction(Type::EditLibraryTag, "edit_library_tag") { }
623 protected:
624 virtual bool canBeRun() const;
625 virtual void run();
628 struct EditLibraryAlbum : public BaseAction
630 EditLibraryAlbum() : BaseAction(Type::EditLibraryAlbum, "edit_library_album") { }
632 protected:
633 virtual bool canBeRun() const;
634 virtual void run();
637 struct EditDirectoryName : public BaseAction
639 EditDirectoryName() : BaseAction(Type::EditDirectoryName, "edit_directory_name") { }
641 protected:
642 virtual bool canBeRun() const;
643 virtual void run();
646 struct EditPlaylistName : public BaseAction
648 EditPlaylistName() : BaseAction(Type::EditPlaylistName, "edit_playlist_name") { }
650 protected:
651 virtual bool canBeRun() const;
652 virtual void run();
655 struct EditLyrics : public BaseAction
657 EditLyrics() : BaseAction(Type::EditLyrics, "edit_lyrics") { }
659 protected:
660 virtual bool canBeRun() const;
661 virtual void run();
664 struct JumpToBrowser : public BaseAction
666 JumpToBrowser() : BaseAction(Type::JumpToBrowser, "jump_to_browser") { }
668 protected:
669 virtual bool canBeRun() const;
670 virtual void run();
673 struct JumpToMediaLibrary : public BaseAction
675 JumpToMediaLibrary() : BaseAction(Type::JumpToMediaLibrary, "jump_to_media_library") { }
677 protected:
678 virtual bool canBeRun() const;
679 virtual void run();
682 struct JumpToPlaylistEditor : public BaseAction
684 JumpToPlaylistEditor() : BaseAction(Type::JumpToPlaylistEditor, "jump_to_playlist_editor") { }
686 protected:
687 virtual bool canBeRun() const;
688 virtual void run();
691 struct ToggleScreenLock : public BaseAction
693 ToggleScreenLock() : BaseAction(Type::ToggleScreenLock, "toggle_screen_lock") { }
695 protected:
696 virtual void run();
699 struct JumpToTagEditor : public BaseAction
701 JumpToTagEditor() : BaseAction(Type::JumpToTagEditor, "jump_to_tag_editor") { }
703 protected:
704 virtual bool canBeRun() const;
705 virtual void run();
708 struct JumpToPositionInSong : public BaseAction
710 JumpToPositionInSong() : BaseAction(Type::JumpToPositionInSong, "jump_to_position_in_song") { }
712 protected:
713 virtual bool canBeRun() const;
714 virtual void run();
717 struct ReverseSelection : public BaseAction
719 ReverseSelection() : BaseAction(Type::ReverseSelection, "reverse_selection") { }
721 protected:
722 virtual bool canBeRun() const;
723 virtual void run();
726 struct RemoveSelection : public BaseAction
728 RemoveSelection() : BaseAction(Type::RemoveSelection, "remove_selection") { }
730 protected:
731 virtual bool canBeRun() const;
732 virtual void run();
735 struct SelectAlbum : public BaseAction
737 SelectAlbum() : BaseAction(Type::SelectAlbum, "select_album") { }
739 protected:
740 virtual bool canBeRun() const;
741 virtual void run();
744 struct AddSelectedItems : public BaseAction
746 AddSelectedItems() : BaseAction(Type::AddSelectedItems, "add_selected_items") { }
748 protected:
749 virtual bool canBeRun() const;
750 virtual void run();
753 struct CropMainPlaylist : public BaseAction
755 CropMainPlaylist() : BaseAction(Type::CropMainPlaylist, "crop_main_playlist") { }
757 protected:
758 virtual void run();
761 struct CropPlaylist : public BaseAction
763 CropPlaylist() : BaseAction(Type::CropPlaylist, "crop_playlist") { }
765 protected:
766 virtual bool canBeRun() const;
767 virtual void run();
770 struct ClearMainPlaylist : public BaseAction
772 ClearMainPlaylist() : BaseAction(Type::ClearMainPlaylist, "clear_main_playlist") { }
774 protected:
775 virtual void run();
778 struct ClearPlaylist : public BaseAction
780 ClearPlaylist() : BaseAction(Type::ClearPlaylist, "clear_playlist") { }
782 protected:
783 virtual bool canBeRun() const;
784 virtual void run();
787 struct SortPlaylist : public BaseAction
789 SortPlaylist() : BaseAction(Type::SortPlaylist, "sort_playlist") { }
791 protected:
792 virtual bool canBeRun() const;
793 virtual void run();
796 struct ReversePlaylist : public BaseAction
798 ReversePlaylist() : BaseAction(Type::ReversePlaylist, "reverse_playlist") { }
800 protected:
801 virtual bool canBeRun() const;
802 virtual void run();
805 struct ApplyFilter : public BaseAction
807 ApplyFilter() : BaseAction(Type::ApplyFilter, "apply_filter") { }
809 protected:
810 virtual bool canBeRun() const;
811 virtual void run();
814 struct Find : public BaseAction
816 Find() : BaseAction(Type::Find, "find") { }
818 protected:
819 virtual bool canBeRun() const;
820 virtual void run();
823 struct FindItemForward : public BaseAction
825 FindItemForward() : BaseAction(Type::FindItemForward, "find_item_forward") { }
827 protected:
828 virtual bool canBeRun() const;
829 virtual void run();
832 struct FindItemBackward : public BaseAction
834 FindItemBackward() : BaseAction(Type::FindItemBackward, "find_item_backward") { }
836 protected:
837 virtual bool canBeRun() const;
838 virtual void run();
841 struct NextFoundItem : public BaseAction
843 NextFoundItem() : BaseAction(Type::NextFoundItem, "next_found_item") { }
845 protected:
846 virtual bool canBeRun() const;
847 virtual void run();
850 struct PreviousFoundItem : public BaseAction
852 PreviousFoundItem() : BaseAction(Type::PreviousFoundItem, "previous_found_item") { }
854 protected:
855 virtual bool canBeRun() const;
856 virtual void run();
859 struct ToggleFindMode : public BaseAction
861 ToggleFindMode() : BaseAction(Type::ToggleFindMode, "toggle_find_mode") { }
863 protected:
864 virtual void run();
867 struct ToggleReplayGainMode : public BaseAction
869 ToggleReplayGainMode() : BaseAction(Type::ToggleReplayGainMode, "toggle_replay_gain_mode") { }
871 protected:
872 virtual void run();
875 struct ToggleSpaceMode : public BaseAction
877 ToggleSpaceMode() : BaseAction(Type::ToggleSpaceMode, "toggle_space_mode") { }
879 protected:
880 virtual void run();
883 struct ToggleAddMode : public BaseAction
885 ToggleAddMode() : BaseAction(Type::ToggleAddMode, "toggle_add_mode") { }
887 protected:
888 virtual void run();
891 struct ToggleMouse : public BaseAction
893 ToggleMouse() : BaseAction(Type::ToggleMouse, "toggle_mouse") { }
895 protected:
896 virtual void run();
899 struct ToggleBitrateVisibility : public BaseAction
901 ToggleBitrateVisibility() : BaseAction(Type::ToggleBitrateVisibility, "toggle_bitrate_visibility") { }
903 protected:
904 virtual void run();
907 struct AddRandomItems : public BaseAction
909 AddRandomItems() : BaseAction(Type::AddRandomItems, "add_random_items") { }
911 protected:
912 virtual void run();
915 struct ToggleBrowserSortMode : public BaseAction
917 ToggleBrowserSortMode() : BaseAction(Type::ToggleBrowserSortMode, "toggle_browser_sort_mode") { }
919 protected:
920 virtual bool canBeRun() const;
921 virtual void run();
924 struct ToggleLibraryTagType : public BaseAction
926 ToggleLibraryTagType() : BaseAction(Type::ToggleLibraryTagType, "toggle_library_tag_type") { }
928 protected:
929 virtual bool canBeRun() const;
930 virtual void run();
933 struct ToggleMediaLibrarySortMode : public BaseAction
935 ToggleMediaLibrarySortMode()
936 : BaseAction(Type::ToggleMediaLibrarySortMode, "toggle_media_library_sort_mode") { }
938 protected:
939 virtual bool canBeRun() const;
940 virtual void run();
943 struct RefetchLyrics : public BaseAction
945 RefetchLyrics() : BaseAction(Type::RefetchLyrics, "refetch_lyrics") { }
947 protected:
948 virtual bool canBeRun() const;
949 virtual void run();
952 struct SetSelectedItemsPriority : public BaseAction
954 SetSelectedItemsPriority()
955 : BaseAction(Type::SetSelectedItemsPriority, "set_selected_items_priority") { }
957 protected:
958 virtual bool canBeRun() const;
959 virtual void run();
962 struct SetVisualizerSampleMultiplier : public BaseAction
964 SetVisualizerSampleMultiplier()
965 : BaseAction(Type::SetVisualizerSampleMultiplier, "set_visualizer_sample_multiplier") { }
967 protected:
968 virtual bool canBeRun() const;
969 virtual void run();
972 struct FilterPlaylistOnPriorities : public BaseAction
974 FilterPlaylistOnPriorities()
975 : BaseAction(Type::FilterPlaylistOnPriorities, "filter_playlist_on_priorities") { }
977 protected:
978 virtual bool canBeRun() const;
979 virtual void run();
982 struct ShowSongInfo : public BaseAction
984 ShowSongInfo() : BaseAction(Type::ShowSongInfo, "show_song_info") { }
986 protected:
987 virtual void run();
990 struct ShowArtistInfo : public BaseAction
992 ShowArtistInfo() : BaseAction(Type::ShowArtistInfo, "show_artist_info") { }
994 protected:
995 virtual bool canBeRun() const;
996 virtual void run();
999 struct ShowLyrics : public BaseAction
1001 ShowLyrics() : BaseAction(Type::ShowLyrics, "show_lyrics") { }
1003 protected:
1004 virtual void run();
1007 struct Quit : public BaseAction
1009 Quit() : BaseAction(Type::Quit, "quit") { }
1011 protected:
1012 virtual void run();
1015 struct NextScreen : public BaseAction
1017 NextScreen() : BaseAction(Type::NextScreen, "next_screen") { }
1019 protected:
1020 virtual void run();
1023 struct PreviousScreen : public BaseAction
1025 PreviousScreen() : BaseAction(Type::PreviousScreen, "previous_screen") { }
1027 protected:
1028 virtual void run();
1031 struct ShowHelp : public BaseAction
1033 ShowHelp() : BaseAction(Type::ShowHelp, "show_help") { }
1035 protected:
1036 virtual bool canBeRun() const;
1037 virtual void run();
1040 struct ShowPlaylist : public BaseAction
1042 ShowPlaylist() : BaseAction(Type::ShowPlaylist, "show_playlist") { }
1044 protected:
1045 virtual bool canBeRun() const;
1046 virtual void run();
1049 struct ShowBrowser : public BaseAction
1051 ShowBrowser() : BaseAction(Type::ShowBrowser, "show_browser") { }
1053 protected:
1054 virtual bool canBeRun() const;
1055 virtual void run();
1058 struct ChangeBrowseMode : public BaseAction
1060 ChangeBrowseMode() : BaseAction(Type::ChangeBrowseMode, "change_browse_mode") { }
1062 protected:
1063 virtual bool canBeRun() const;
1064 virtual void run();
1067 struct ShowSearchEngine : public BaseAction
1069 ShowSearchEngine() : BaseAction(Type::ShowSearchEngine, "show_search_engine") { }
1071 protected:
1072 virtual bool canBeRun() const;
1073 virtual void run();
1076 struct ResetSearchEngine : public BaseAction
1078 ResetSearchEngine() : BaseAction(Type::ResetSearchEngine, "reset_search_engine") { }
1080 protected:
1081 virtual bool canBeRun() const;
1082 virtual void run();
1085 struct ShowMediaLibrary : public BaseAction
1087 ShowMediaLibrary() : BaseAction(Type::ShowMediaLibrary, "show_media_library") { }
1089 protected:
1090 virtual bool canBeRun() const;
1091 virtual void run();
1094 struct ToggleMediaLibraryColumnsMode : public BaseAction
1096 ToggleMediaLibraryColumnsMode()
1097 : BaseAction(Type::ToggleMediaLibraryColumnsMode, "toggle_media_library_columns_mode") { }
1099 protected:
1100 virtual bool canBeRun() const;
1101 virtual void run();
1104 struct ShowPlaylistEditor : public BaseAction
1106 ShowPlaylistEditor() : BaseAction(Type::ShowPlaylistEditor, "show_playlist_editor") { }
1108 protected:
1109 virtual bool canBeRun() const;
1110 virtual void run();
1113 struct ShowTagEditor : public BaseAction
1115 ShowTagEditor() : BaseAction(Type::ShowTagEditor, "show_tag_editor") { }
1117 protected:
1118 virtual bool canBeRun() const;
1119 virtual void run();
1122 struct ShowOutputs : public BaseAction
1124 ShowOutputs() : BaseAction(Type::ShowOutputs, "show_outputs") { }
1126 protected:
1127 virtual bool canBeRun() const;
1128 virtual void run();
1131 struct ShowVisualizer : public BaseAction
1133 ShowVisualizer() : BaseAction(Type::ShowVisualizer, "show_visualizer") { }
1135 protected:
1136 virtual bool canBeRun() const;
1137 virtual void run();
1140 struct ShowClock : public BaseAction
1142 ShowClock() : BaseAction(Type::ShowClock, "show_clock") { }
1144 protected:
1145 virtual bool canBeRun() const;
1146 virtual void run();
1149 struct ShowServerInfo : public BaseAction
1151 ShowServerInfo() : BaseAction(Type::ShowServerInfo, "show_server_info") { }
1153 protected:
1154 # ifdef HAVE_TAGLIB_H
1155 virtual bool canBeRun() const;
1156 # endif // HAVE_TAGLIB_H
1157 virtual void run();
1162 #endif // NCMPCPP_ACTIONS_H