1 /***************************************************************************
2 * Copyright (C) 2008-2014 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 "interfaces.h"
31 // forward declarations
39 Dummy
, UpdateEnvironment
, MouseEvent
, ScrollUp
, ScrollDown
, ScrollUpArtist
, ScrollUpAlbum
,
40 ScrollDownArtist
, ScrollDownAlbum
, PageUp
, PageDown
, MoveHome
, MoveEnd
,
41 ToggleInterface
, JumpToParentDirectory
, RunAction
, PreviousColumn
,
42 NextColumn
, MasterScreen
, SlaveScreen
, VolumeUp
, VolumeDown
, AddItemToPlaylist
, PlayItem
,
43 DeletePlaylistItems
, DeleteStoredPlaylist
, DeleteBrowserItems
, ReplaySong
, Previous
,
44 Next
, Pause
, Stop
, ExecuteCommand
, SavePlaylist
, MoveSortOrderUp
, MoveSortOrderDown
,
45 MoveSelectedItemsUp
, MoveSelectedItemsDown
, MoveSelectedItemsTo
, Add
,
46 SeekForward
, SeekBackward
, ToggleDisplayMode
, ToggleSeparatorsBetweenAlbums
,
47 ToggleLyricsUpdateOnSongChange
, ToggleLyricsFetcher
, ToggleFetchingLyricsInBackground
,
48 TogglePlayingSongCentering
, UpdateDatabase
, JumpToPlayingSong
, ToggleRepeat
, Shuffle
,
49 ToggleRandom
, StartSearching
, SaveTagChanges
, ToggleSingle
, ToggleConsume
, ToggleCrossfade
,
50 SetCrossfade
, SetVolume
, EnterDirectory
, EditSong
, EditLibraryTag
, EditLibraryAlbum
, EditDirectoryName
,
51 EditPlaylistName
, EditLyrics
, JumpToBrowser
, JumpToMediaLibrary
,
52 JumpToPlaylistEditor
, ToggleScreenLock
, JumpToTagEditor
, JumpToPositionInSong
,
53 SelectItem
, SelectRange
, ReverseSelection
, RemoveSelection
, SelectAlbum
, SelectFoundItems
,
54 AddSelectedItems
, CropMainPlaylist
, CropPlaylist
, ClearMainPlaylist
, ClearPlaylist
,
55 SortPlaylist
, ReversePlaylist
, Find
, FindItemForward
, FindItemBackward
,
56 NextFoundItem
, PreviousFoundItem
, ToggleFindMode
, ToggleReplayGainMode
,
57 ToggleAddMode
, ToggleMouse
, ToggleBitrateVisibility
,
58 AddRandomItems
, ToggleBrowserSortMode
, ToggleLibraryTagType
,
59 ToggleMediaLibrarySortMode
, RefetchLyrics
,
60 SetSelectedItemsPriority
, ToggleOutput
, ToggleVisualizationType
, SetVisualizerSampleMultiplier
,
61 ShowSongInfo
, ShowArtistInfo
, ShowLyrics
, Quit
, NextScreen
, PreviousScreen
,
62 ShowHelp
, ShowPlaylist
, ShowBrowser
, ChangeBrowseMode
, ShowSearchEngine
,
63 ResetSearchEngine
, ShowMediaLibrary
, ToggleMediaLibraryColumnsMode
,
64 ShowPlaylistEditor
, ShowTagEditor
, ShowOutputs
, ShowVisualizer
,
65 ShowClock
, ShowServerInfo
,
66 _numberOfActions
// needed to dynamically calculate size of action array
69 void validateScreenSize();
70 void initializeScreens();
71 void setResizeFlags();
72 void resizeScreen(bool reload_main_window
);
73 void setWindowsDimensions();
75 void confirmAction(const boost::format
&description
);
76 inline void confirmAction(const std::string
&description
)
78 confirmAction(boost::format(description
));
81 bool isMPDMusicDirSet();
83 extern bool OriginalStatusbarVisibility
;
84 extern bool ExitMainLoop
;
86 extern size_t HeaderHeight
;
87 extern size_t FooterHeight
;
88 extern size_t FooterStartY
;
92 BaseAction(Type type_
, const char *name_
): m_name(name_
), m_type(type_
) { }
94 const std::string
&name() const { return m_name
; }
95 Type
type() const { return m_type
; }
97 virtual bool canBeRun() { return true; }
113 virtual void run() = 0;
118 BaseAction
&get(Type at
);
119 BaseAction
*get(const std::string
&name
);
121 struct Dummy
: BaseAction
123 Dummy(): BaseAction(Type::Dummy
, "dummy") { }
126 virtual void run() OVERRIDE
{ }
129 struct UpdateEnvironment
: BaseAction
133 void run(bool update_status
, bool refresh_window
);
136 boost::posix_time::ptime m_past
;
138 virtual void run() OVERRIDE
;
141 struct MouseEvent
: BaseAction
143 MouseEvent(): BaseAction(Type::MouseEvent
, "mouse_event")
145 m_old_mouse_event
.bstate
= 0;
146 m_mouse_event
.bstate
= 0;
150 virtual bool canBeRun() OVERRIDE
;
151 virtual void run() OVERRIDE
;
153 MEVENT m_mouse_event
;
154 MEVENT m_old_mouse_event
;
157 struct ScrollUp
: BaseAction
159 ScrollUp(): BaseAction(Type::ScrollUp
, "scroll_up") { }
162 virtual void run() OVERRIDE
;
165 struct ScrollDown
: BaseAction
167 ScrollDown(): BaseAction(Type::ScrollDown
, "scroll_down") { }
170 virtual void run() OVERRIDE
;
173 struct ScrollUpArtist
: BaseAction
175 ScrollUpArtist(): BaseAction(Type::ScrollUpArtist
, "scroll_up_artist") { }
178 virtual bool canBeRun() OVERRIDE
;
179 virtual void run() OVERRIDE
;
185 struct ScrollUpAlbum
: BaseAction
187 ScrollUpAlbum(): BaseAction(Type::ScrollUpAlbum
, "scroll_up_album") { }
190 virtual bool canBeRun() OVERRIDE
;
191 virtual void run() OVERRIDE
;
197 struct ScrollDownArtist
: BaseAction
199 ScrollDownArtist(): BaseAction(Type::ScrollDownArtist
, "scroll_down_artist") { }
202 virtual bool canBeRun() OVERRIDE
;
203 virtual void run() OVERRIDE
;
209 struct ScrollDownAlbum
: BaseAction
211 ScrollDownAlbum(): BaseAction(Type::ScrollDownAlbum
, "scroll_down_album") { }
214 virtual bool canBeRun() OVERRIDE
;
215 virtual void run() OVERRIDE
;
221 struct PageUp
: BaseAction
223 PageUp(): BaseAction(Type::PageUp
, "page_up") { }
226 virtual void run() OVERRIDE
;
229 struct PageDown
: BaseAction
231 PageDown(): BaseAction(Type::PageDown
, "page_down") { }
234 virtual void run() OVERRIDE
;
237 struct MoveHome
: BaseAction
239 MoveHome(): BaseAction(Type::MoveHome
, "move_home") { }
242 virtual void run() OVERRIDE
;
245 struct MoveEnd
: BaseAction
247 MoveEnd(): BaseAction(Type::MoveEnd
, "move_end") { }
250 virtual void run() OVERRIDE
;
253 struct ToggleInterface
: BaseAction
255 ToggleInterface(): BaseAction(Type::ToggleInterface
, "toggle_interface") { }
258 virtual void run() OVERRIDE
;
261 struct JumpToParentDirectory
: BaseAction
263 JumpToParentDirectory(): BaseAction(Type::JumpToParentDirectory
, "jump_to_parent_directory") { }
266 virtual bool canBeRun() OVERRIDE
;
267 virtual void run() OVERRIDE
;
270 struct RunAction
: BaseAction
272 RunAction(): BaseAction(Type::RunAction
, "run_action") { }
275 virtual bool canBeRun() OVERRIDE
;
276 virtual void run() OVERRIDE
;
281 struct PreviousColumn
: BaseAction
283 PreviousColumn(): BaseAction(Type::PreviousColumn
, "previous_column") { }
286 virtual bool canBeRun() OVERRIDE
;
287 virtual void run() OVERRIDE
;
292 struct NextColumn
: BaseAction
294 NextColumn(): BaseAction(Type::NextColumn
, "next_column") { }
297 virtual bool canBeRun() OVERRIDE
;
298 virtual void run() OVERRIDE
;
303 struct MasterScreen
: BaseAction
305 MasterScreen(): BaseAction(Type::MasterScreen
, "master_screen") { }
308 virtual bool canBeRun() OVERRIDE
;
309 virtual void run() OVERRIDE
;
312 struct SlaveScreen
: BaseAction
314 SlaveScreen(): BaseAction(Type::SlaveScreen
, "slave_screen") { }
317 virtual bool canBeRun() OVERRIDE
;
318 virtual void run() OVERRIDE
;
321 struct VolumeUp
: BaseAction
323 VolumeUp(): BaseAction(Type::VolumeUp
, "volume_up") { }
326 virtual void run() OVERRIDE
;
329 struct VolumeDown
: BaseAction
331 VolumeDown(): BaseAction(Type::VolumeDown
, "volume_down") { }
334 virtual void run() OVERRIDE
;
337 struct AddItemToPlaylist
: BaseAction
339 AddItemToPlaylist(): BaseAction(Type::AddItemToPlaylist
, "add_item_to_playlist") { }
342 virtual bool canBeRun() OVERRIDE
;
343 virtual void run() OVERRIDE
;
348 struct PlayItem
: BaseAction
350 PlayItem(): BaseAction(Type::PlayItem
, "play_item") { }
353 virtual bool canBeRun() OVERRIDE
;
354 virtual void run() OVERRIDE
;
359 struct DeletePlaylistItems
: BaseAction
361 DeletePlaylistItems(): BaseAction(Type::DeletePlaylistItems
, "delete_playlist_items") { }
364 virtual bool canBeRun() OVERRIDE
;
365 virtual void run() OVERRIDE
;
368 struct DeleteStoredPlaylist
: BaseAction
370 DeleteStoredPlaylist(): BaseAction(Type::DeleteStoredPlaylist
, "delete_stored_playlist") { }
373 virtual bool canBeRun() OVERRIDE
;
374 virtual void run() OVERRIDE
;
377 struct DeleteBrowserItems
: BaseAction
379 DeleteBrowserItems(): BaseAction(Type::DeleteBrowserItems
, "delete_browser_items") { }
382 virtual bool canBeRun() OVERRIDE
;
383 virtual void run() OVERRIDE
;
386 struct ReplaySong
: BaseAction
388 ReplaySong(): BaseAction(Type::ReplaySong
, "replay_song") { }
391 virtual void run() OVERRIDE
;
394 struct PreviousSong
: BaseAction
396 PreviousSong(): BaseAction(Type::Previous
, "previous") { }
399 virtual void run() OVERRIDE
;
402 struct NextSong
: BaseAction
404 NextSong(): BaseAction(Type::Next
, "next") { }
407 virtual void run() OVERRIDE
;
410 struct Pause
: BaseAction
412 Pause(): BaseAction(Type::Pause
, "pause") { }
415 virtual void run() OVERRIDE
;
418 struct Stop
: BaseAction
420 Stop(): BaseAction(Type::Stop
, "stop") { }
423 virtual void run() OVERRIDE
;
426 struct ExecuteCommand
: BaseAction
428 ExecuteCommand(): BaseAction(Type::ExecuteCommand
, "execute_command") { }
431 virtual void run() OVERRIDE
;
434 struct SavePlaylist
: BaseAction
436 SavePlaylist(): BaseAction(Type::SavePlaylist
, "save_playlist") { }
439 virtual void run() OVERRIDE
;
442 struct MoveSortOrderUp
: BaseAction
444 MoveSortOrderUp(): BaseAction(Type::MoveSortOrderUp
, "move_sort_order_up") { }
447 virtual bool canBeRun() OVERRIDE
;
448 virtual void run() OVERRIDE
;
451 struct MoveSortOrderDown
: BaseAction
453 MoveSortOrderDown(): BaseAction(Type::MoveSortOrderDown
, "move_sort_order_down") { }
456 virtual bool canBeRun() OVERRIDE
;
457 virtual void run() OVERRIDE
;
460 struct MoveSelectedItemsUp
: BaseAction
462 MoveSelectedItemsUp(): BaseAction(Type::MoveSelectedItemsUp
, "move_selected_items_up") { }
465 virtual bool canBeRun() OVERRIDE
;
466 virtual void run() OVERRIDE
;
469 struct MoveSelectedItemsDown
: BaseAction
471 MoveSelectedItemsDown(): BaseAction(Type::MoveSelectedItemsDown
, "move_selected_items_down") { }
474 virtual bool canBeRun() OVERRIDE
;
475 virtual void run() OVERRIDE
;
478 struct MoveSelectedItemsTo
: BaseAction
480 MoveSelectedItemsTo(): BaseAction(Type::MoveSelectedItemsTo
, "move_selected_items_to") { }
483 virtual bool canBeRun() OVERRIDE
;
484 virtual void run() OVERRIDE
;
487 struct Add
: BaseAction
489 Add(): BaseAction(Type::Add
, "add") { }
492 virtual bool canBeRun() OVERRIDE
;
493 virtual void run() OVERRIDE
;
496 struct SeekForward
: BaseAction
498 SeekForward(): BaseAction(Type::SeekForward
, "seek_forward") { }
501 virtual bool canBeRun() OVERRIDE
;
502 virtual void run() OVERRIDE
;
505 struct SeekBackward
: BaseAction
507 SeekBackward(): BaseAction(Type::SeekBackward
, "seek_backward") { }
510 virtual bool canBeRun() OVERRIDE
;
511 virtual void run() OVERRIDE
;
514 struct ToggleDisplayMode
: BaseAction
516 ToggleDisplayMode(): BaseAction(Type::ToggleDisplayMode
, "toggle_display_mode") { }
519 virtual bool canBeRun() OVERRIDE
;
520 virtual void run() OVERRIDE
;
523 struct ToggleSeparatorsBetweenAlbums
: BaseAction
525 ToggleSeparatorsBetweenAlbums()
526 : BaseAction(Type::ToggleSeparatorsBetweenAlbums
, "toggle_separators_between_albums") { }
529 virtual bool canBeRun() OVERRIDE
;
530 virtual void run() OVERRIDE
;
533 struct ToggleLyricsUpdateOnSongChange
: BaseAction
535 ToggleLyricsUpdateOnSongChange()
536 : BaseAction(Type::ToggleLyricsUpdateOnSongChange
, "toggle_lyrics_update_on_song_change") { }
539 virtual bool canBeRun() OVERRIDE
;
540 virtual void run() OVERRIDE
;
543 struct ToggleLyricsFetcher
: BaseAction
545 ToggleLyricsFetcher(): BaseAction(Type::ToggleLyricsFetcher
, "toggle_lyrics_fetcher") { }
548 # ifndef HAVE_CURL_CURL_H
549 virtual bool canBeRun() OVERRIDE
;
550 # endif // NOT HAVE_CURL_CURL_H
551 virtual void run() OVERRIDE
;
554 struct ToggleFetchingLyricsInBackground
: BaseAction
556 ToggleFetchingLyricsInBackground()
557 : BaseAction(Type::ToggleFetchingLyricsInBackground
, "toggle_fetching_lyrics_in_background") { }
560 # ifndef HAVE_CURL_CURL_H
561 virtual bool canBeRun() OVERRIDE
;
562 # endif // NOT HAVE_CURL_CURL_H
563 virtual void run() OVERRIDE
;
566 struct TogglePlayingSongCentering
: BaseAction
568 TogglePlayingSongCentering()
569 : BaseAction(Type::TogglePlayingSongCentering
, "toggle_playing_song_centering") { }
572 virtual void run() OVERRIDE
;
575 struct UpdateDatabase
: BaseAction
577 UpdateDatabase(): BaseAction(Type::UpdateDatabase
, "update_database") { }
580 virtual void run() OVERRIDE
;
583 struct JumpToPlayingSong
: BaseAction
585 JumpToPlayingSong(): BaseAction(Type::JumpToPlayingSong
, "jump_to_playing_song") { }
588 virtual bool canBeRun() OVERRIDE
;
589 virtual void run() OVERRIDE
;
592 struct ToggleRepeat
: BaseAction
594 ToggleRepeat(): BaseAction(Type::ToggleRepeat
, "toggle_repeat") { }
597 virtual void run() OVERRIDE
;
600 struct Shuffle
: BaseAction
602 Shuffle(): BaseAction(Type::Shuffle
, "shuffle") { }
605 virtual bool canBeRun() OVERRIDE
;
606 virtual void run() OVERRIDE
;
608 NC::Menu
<MPD::Song
>::ConstIterator m_begin
;
609 NC::Menu
<MPD::Song
>::ConstIterator m_end
;
612 struct ToggleRandom
: BaseAction
614 ToggleRandom(): BaseAction(Type::ToggleRandom
, "toggle_random") { }
617 virtual void run() OVERRIDE
;
620 struct StartSearching
: BaseAction
622 StartSearching(): BaseAction(Type::StartSearching
, "start_searching") { }
625 virtual bool canBeRun() OVERRIDE
;
626 virtual void run() OVERRIDE
;
629 struct SaveTagChanges
: BaseAction
631 SaveTagChanges(): BaseAction(Type::SaveTagChanges
, "save_tag_changes") { }
634 virtual bool canBeRun() OVERRIDE
;
635 virtual void run() OVERRIDE
;
638 struct ToggleSingle
: BaseAction
640 ToggleSingle(): BaseAction(Type::ToggleSingle
, "toggle_single") { }
643 virtual void run() OVERRIDE
;
646 struct ToggleConsume
: BaseAction
648 ToggleConsume(): BaseAction(Type::ToggleConsume
, "toggle_consume") { }
651 virtual void run() OVERRIDE
;
654 struct ToggleCrossfade
: BaseAction
656 ToggleCrossfade(): BaseAction(Type::ToggleCrossfade
, "toggle_crossfade") { }
659 virtual void run() OVERRIDE
;
662 struct SetCrossfade
: BaseAction
664 SetCrossfade(): BaseAction(Type::SetCrossfade
, "set_crossfade") { }
667 virtual void run() OVERRIDE
;
670 struct SetVolume
: BaseAction
672 SetVolume(): BaseAction(Type::SetVolume
, "set_volume") { }
675 virtual void run() OVERRIDE
;
678 struct EnterDirectory
: BaseAction
680 EnterDirectory(): BaseAction(Type::EnterDirectory
, "enter_directory") { }
683 virtual bool canBeRun() OVERRIDE
;
684 virtual void run() OVERRIDE
;
688 struct EditSong
: BaseAction
690 EditSong(): BaseAction(Type::EditSong
, "edit_song") { }
693 virtual bool canBeRun() OVERRIDE
;
694 virtual void run() OVERRIDE
;
697 const MPD::Song
*m_song
;
698 #endif // HAVE_TAGLIB_H
701 struct EditLibraryTag
: BaseAction
703 EditLibraryTag(): BaseAction(Type::EditLibraryTag
, "edit_library_tag") { }
706 virtual bool canBeRun() OVERRIDE
;
707 virtual void run() OVERRIDE
;
710 struct EditLibraryAlbum
: BaseAction
712 EditLibraryAlbum(): BaseAction(Type::EditLibraryAlbum
, "edit_library_album") { }
715 virtual bool canBeRun() OVERRIDE
;
716 virtual void run() OVERRIDE
;
719 struct EditDirectoryName
: BaseAction
721 EditDirectoryName(): BaseAction(Type::EditDirectoryName
, "edit_directory_name") { }
724 virtual bool canBeRun() OVERRIDE
;
725 virtual void run() OVERRIDE
;
728 struct EditPlaylistName
: BaseAction
730 EditPlaylistName(): BaseAction(Type::EditPlaylistName
, "edit_playlist_name") { }
733 virtual bool canBeRun() OVERRIDE
;
734 virtual void run() OVERRIDE
;
737 struct EditLyrics
: BaseAction
739 EditLyrics(): BaseAction(Type::EditLyrics
, "edit_lyrics") { }
742 virtual bool canBeRun() OVERRIDE
;
743 virtual void run() OVERRIDE
;
746 struct JumpToBrowser
: BaseAction
748 JumpToBrowser(): BaseAction(Type::JumpToBrowser
, "jump_to_browser") { }
751 virtual bool canBeRun() OVERRIDE
;
752 virtual void run() OVERRIDE
;
754 const MPD::Song
*m_song
;
757 struct JumpToMediaLibrary
: BaseAction
759 JumpToMediaLibrary(): BaseAction(Type::JumpToMediaLibrary
, "jump_to_media_library") { }
762 virtual bool canBeRun() OVERRIDE
;
763 virtual void run() OVERRIDE
;
765 const MPD::Song
*m_song
;
768 struct JumpToPlaylistEditor
: BaseAction
770 JumpToPlaylistEditor(): BaseAction(Type::JumpToPlaylistEditor
, "jump_to_playlist_editor") { }
773 virtual bool canBeRun() OVERRIDE
;
774 virtual void run() OVERRIDE
;
777 struct ToggleScreenLock
: BaseAction
779 ToggleScreenLock(): BaseAction(Type::ToggleScreenLock
, "toggle_screen_lock") { }
782 virtual void run() OVERRIDE
;
785 struct JumpToTagEditor
: BaseAction
787 JumpToTagEditor(): BaseAction(Type::JumpToTagEditor
, "jump_to_tag_editor") { }
790 virtual bool canBeRun() OVERRIDE
;
791 virtual void run() OVERRIDE
;
794 const MPD::Song
*m_song
;
795 #endif // HAVE_TAGLIB_H
798 struct JumpToPositionInSong
: BaseAction
800 JumpToPositionInSong(): BaseAction(Type::JumpToPositionInSong
, "jump_to_position_in_song") { }
803 virtual bool canBeRun() OVERRIDE
;
804 virtual void run() OVERRIDE
;
807 struct SelectItem
: BaseAction
809 SelectItem(): BaseAction(Type::SelectItem
, "select_item") { }
812 virtual bool canBeRun() OVERRIDE
;
813 virtual void run() OVERRIDE
;
818 struct SelectRange
: BaseAction
820 SelectRange(): BaseAction(Type::SelectRange
, "select_range") { }
823 virtual bool canBeRun() OVERRIDE
;
824 virtual void run() OVERRIDE
;
827 NC::List::Iterator m_begin
;
828 NC::List::Iterator m_end
;
831 struct ReverseSelection
: BaseAction
833 ReverseSelection(): BaseAction(Type::ReverseSelection
, "reverse_selection") { }
836 virtual bool canBeRun() OVERRIDE
;
837 virtual void run() OVERRIDE
;
842 struct RemoveSelection
: BaseAction
844 RemoveSelection(): BaseAction(Type::RemoveSelection
, "remove_selection") { }
847 virtual bool canBeRun() OVERRIDE
;
848 virtual void run() OVERRIDE
;
853 struct SelectAlbum
: BaseAction
855 SelectAlbum(): BaseAction(Type::SelectAlbum
, "select_album") { }
858 virtual bool canBeRun() OVERRIDE
;
859 virtual void run() OVERRIDE
;
865 struct SelectFoundItems
: BaseAction
867 SelectFoundItems(): BaseAction(Type::SelectFoundItems
, "select_found_items") { }
870 virtual bool canBeRun() OVERRIDE
;
871 virtual void run() OVERRIDE
;
874 Searchable
*m_searchable
;
877 struct AddSelectedItems
: BaseAction
879 AddSelectedItems(): BaseAction(Type::AddSelectedItems
, "add_selected_items") { }
882 virtual bool canBeRun() OVERRIDE
;
883 virtual void run() OVERRIDE
;
886 struct CropMainPlaylist
: BaseAction
888 CropMainPlaylist(): BaseAction(Type::CropMainPlaylist
, "crop_main_playlist") { }
891 virtual void run() OVERRIDE
;
894 struct CropPlaylist
: BaseAction
896 CropPlaylist(): BaseAction(Type::CropPlaylist
, "crop_playlist") { }
899 virtual bool canBeRun() OVERRIDE
;
900 virtual void run() OVERRIDE
;
903 struct ClearMainPlaylist
: BaseAction
905 ClearMainPlaylist(): BaseAction(Type::ClearMainPlaylist
, "clear_main_playlist") { }
908 virtual void run() OVERRIDE
;
911 struct ClearPlaylist
: BaseAction
913 ClearPlaylist(): BaseAction(Type::ClearPlaylist
, "clear_playlist") { }
916 virtual bool canBeRun() OVERRIDE
;
917 virtual void run() OVERRIDE
;
920 struct SortPlaylist
: BaseAction
922 SortPlaylist(): BaseAction(Type::SortPlaylist
, "sort_playlist") { }
925 virtual bool canBeRun() OVERRIDE
;
926 virtual void run() OVERRIDE
;
929 struct ReversePlaylist
: BaseAction
931 ReversePlaylist(): BaseAction(Type::ReversePlaylist
, "reverse_playlist") { }
934 virtual bool canBeRun() OVERRIDE
;
935 virtual void run() OVERRIDE
;
937 NC::Menu
<MPD::Song
>::ConstIterator m_begin
;
938 NC::Menu
<MPD::Song
>::ConstIterator m_end
;
941 struct Find
: BaseAction
943 Find(): BaseAction(Type::Find
, "find") { }
946 virtual bool canBeRun() OVERRIDE
;
947 virtual void run() OVERRIDE
;
950 struct FindItemForward
: BaseAction
952 FindItemForward(): BaseAction(Type::FindItemForward
, "find_item_forward") { }
955 virtual bool canBeRun() OVERRIDE
;
956 virtual void run() OVERRIDE
;
959 struct FindItemBackward
: BaseAction
961 FindItemBackward(): BaseAction(Type::FindItemBackward
, "find_item_backward") { }
964 virtual bool canBeRun() OVERRIDE
;
965 virtual void run() OVERRIDE
;
968 struct NextFoundItem
: BaseAction
970 NextFoundItem(): BaseAction(Type::NextFoundItem
, "next_found_item") { }
973 virtual bool canBeRun() OVERRIDE
;
974 virtual void run() OVERRIDE
;
977 struct PreviousFoundItem
: BaseAction
979 PreviousFoundItem(): BaseAction(Type::PreviousFoundItem
, "previous_found_item") { }
982 virtual bool canBeRun() OVERRIDE
;
983 virtual void run() OVERRIDE
;
986 struct ToggleFindMode
: BaseAction
988 ToggleFindMode(): BaseAction(Type::ToggleFindMode
, "toggle_find_mode") { }
991 virtual void run() OVERRIDE
;
994 struct ToggleReplayGainMode
: BaseAction
996 ToggleReplayGainMode(): BaseAction(Type::ToggleReplayGainMode
, "toggle_replay_gain_mode") { }
999 virtual void run() OVERRIDE
;
1002 struct ToggleAddMode
: BaseAction
1004 ToggleAddMode(): BaseAction(Type::ToggleAddMode
, "toggle_add_mode") { }
1007 virtual void run() OVERRIDE
;
1010 struct ToggleMouse
: BaseAction
1012 ToggleMouse(): BaseAction(Type::ToggleMouse
, "toggle_mouse") { }
1015 virtual void run() OVERRIDE
;
1018 struct ToggleBitrateVisibility
: BaseAction
1020 ToggleBitrateVisibility(): BaseAction(Type::ToggleBitrateVisibility
, "toggle_bitrate_visibility") { }
1023 virtual void run() OVERRIDE
;
1026 struct AddRandomItems
: BaseAction
1028 AddRandomItems(): BaseAction(Type::AddRandomItems
, "add_random_items") { }
1031 virtual void run() OVERRIDE
;
1034 struct ToggleBrowserSortMode
: BaseAction
1036 ToggleBrowserSortMode(): BaseAction(Type::ToggleBrowserSortMode
, "toggle_browser_sort_mode") { }
1039 virtual bool canBeRun() OVERRIDE
;
1040 virtual void run() OVERRIDE
;
1043 struct ToggleLibraryTagType
: BaseAction
1045 ToggleLibraryTagType(): BaseAction(Type::ToggleLibraryTagType
, "toggle_library_tag_type") { }
1048 virtual bool canBeRun() OVERRIDE
;
1049 virtual void run() OVERRIDE
;
1052 struct ToggleMediaLibrarySortMode
: BaseAction
1054 ToggleMediaLibrarySortMode()
1055 : BaseAction(Type::ToggleMediaLibrarySortMode
, "toggle_media_library_sort_mode") { }
1058 virtual bool canBeRun() OVERRIDE
;
1059 virtual void run() OVERRIDE
;
1062 struct RefetchLyrics
: BaseAction
1064 RefetchLyrics(): BaseAction(Type::RefetchLyrics
, "refetch_lyrics") { }
1067 virtual bool canBeRun() OVERRIDE
;
1068 virtual void run() OVERRIDE
;
1071 struct SetSelectedItemsPriority
: BaseAction
1073 SetSelectedItemsPriority()
1074 : BaseAction(Type::SetSelectedItemsPriority
, "set_selected_items_priority") { }
1077 virtual bool canBeRun() OVERRIDE
;
1078 virtual void run() OVERRIDE
;
1081 struct ToggleOutput
: BaseAction
1083 ToggleOutput(): BaseAction(Type::ToggleOutput
, "toggle_output") { }
1086 virtual bool canBeRun() OVERRIDE
;
1087 virtual void run() OVERRIDE
;
1090 struct ToggleVisualizationType
: BaseAction
1092 ToggleVisualizationType()
1093 : BaseAction(Type::ToggleVisualizationType
, "toggle_visualization_type") { }
1097 virtual bool canBeRun() OVERRIDE
;
1098 virtual void run() OVERRIDE
;
1101 struct SetVisualizerSampleMultiplier
: BaseAction
1103 SetVisualizerSampleMultiplier()
1104 : BaseAction(Type::SetVisualizerSampleMultiplier
, "set_visualizer_sample_multiplier") { }
1107 virtual bool canBeRun() OVERRIDE
;
1108 virtual void run() OVERRIDE
;
1111 struct ShowSongInfo
: BaseAction
1113 ShowSongInfo(): BaseAction(Type::ShowSongInfo
, "show_song_info") { }
1116 virtual void run() OVERRIDE
;
1119 struct ShowArtistInfo
: BaseAction
1121 ShowArtistInfo(): BaseAction(Type::ShowArtistInfo
, "show_artist_info") { }
1124 virtual bool canBeRun() OVERRIDE
;
1125 virtual void run() OVERRIDE
;
1128 struct ShowLyrics
: BaseAction
1130 ShowLyrics(): BaseAction(Type::ShowLyrics
, "show_lyrics") { }
1133 virtual void run() OVERRIDE
;
1136 struct Quit
: BaseAction
1138 Quit(): BaseAction(Type::Quit
, "quit") { }
1141 virtual void run() OVERRIDE
;
1144 struct NextScreen
: BaseAction
1146 NextScreen(): BaseAction(Type::NextScreen
, "next_screen") { }
1149 virtual void run() OVERRIDE
;
1152 struct PreviousScreen
: BaseAction
1154 PreviousScreen(): BaseAction(Type::PreviousScreen
, "previous_screen") { }
1157 virtual void run() OVERRIDE
;
1160 struct ShowHelp
: BaseAction
1162 ShowHelp(): BaseAction(Type::ShowHelp
, "show_help") { }
1165 virtual bool canBeRun() OVERRIDE
;
1166 virtual void run() OVERRIDE
;
1169 struct ShowPlaylist
: BaseAction
1171 ShowPlaylist(): BaseAction(Type::ShowPlaylist
, "show_playlist") { }
1174 virtual bool canBeRun() OVERRIDE
;
1175 virtual void run() OVERRIDE
;
1178 struct ShowBrowser
: BaseAction
1180 ShowBrowser(): BaseAction(Type::ShowBrowser
, "show_browser") { }
1183 virtual bool canBeRun() OVERRIDE
;
1184 virtual void run() OVERRIDE
;
1187 struct ChangeBrowseMode
: BaseAction
1189 ChangeBrowseMode(): BaseAction(Type::ChangeBrowseMode
, "change_browse_mode") { }
1192 virtual bool canBeRun() OVERRIDE
;
1193 virtual void run() OVERRIDE
;
1196 struct ShowSearchEngine
: BaseAction
1198 ShowSearchEngine(): BaseAction(Type::ShowSearchEngine
, "show_search_engine") { }
1201 virtual bool canBeRun() OVERRIDE
;
1202 virtual void run() OVERRIDE
;
1205 struct ResetSearchEngine
: BaseAction
1207 ResetSearchEngine(): BaseAction(Type::ResetSearchEngine
, "reset_search_engine") { }
1210 virtual bool canBeRun() OVERRIDE
;
1211 virtual void run() OVERRIDE
;
1214 struct ShowMediaLibrary
: BaseAction
1216 ShowMediaLibrary(): BaseAction(Type::ShowMediaLibrary
, "show_media_library") { }
1219 virtual bool canBeRun() OVERRIDE
;
1220 virtual void run() OVERRIDE
;
1223 struct ToggleMediaLibraryColumnsMode
: BaseAction
1225 ToggleMediaLibraryColumnsMode()
1226 : BaseAction(Type::ToggleMediaLibraryColumnsMode
, "toggle_media_library_columns_mode") { }
1229 virtual bool canBeRun() OVERRIDE
;
1230 virtual void run() OVERRIDE
;
1233 struct ShowPlaylistEditor
: BaseAction
1235 ShowPlaylistEditor(): BaseAction(Type::ShowPlaylistEditor
, "show_playlist_editor") { }
1238 virtual bool canBeRun() OVERRIDE
;
1239 virtual void run() OVERRIDE
;
1242 struct ShowTagEditor
: BaseAction
1244 ShowTagEditor(): BaseAction(Type::ShowTagEditor
, "show_tag_editor") { }
1247 virtual bool canBeRun() OVERRIDE
;
1248 virtual void run() OVERRIDE
;
1251 struct ShowOutputs
: BaseAction
1253 ShowOutputs(): BaseAction(Type::ShowOutputs
, "show_outputs") { }
1256 virtual bool canBeRun() OVERRIDE
;
1257 virtual void run() OVERRIDE
;
1260 struct ShowVisualizer
: BaseAction
1262 ShowVisualizer(): BaseAction(Type::ShowVisualizer
, "show_visualizer") { }
1265 virtual bool canBeRun() OVERRIDE
;
1266 virtual void run() OVERRIDE
;
1269 struct ShowClock
: BaseAction
1271 ShowClock(): BaseAction(Type::ShowClock
, "show_clock") { }
1274 virtual bool canBeRun() OVERRIDE
;
1275 virtual void run() OVERRIDE
;
1278 struct ShowServerInfo
: BaseAction
1280 ShowServerInfo(): BaseAction(Type::ShowServerInfo
, "show_server_info") { }
1283 # ifdef HAVE_TAGLIB_H
1284 virtual bool canBeRun() OVERRIDE
;
1285 # endif // HAVE_TAGLIB_H
1286 virtual void run() OVERRIDE
;
1291 #endif // NCMPCPP_ACTIONS_H