From 97555c4c3daf4987b8958cb97a8bd8e82a5c756c Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sat, 6 Oct 2012 18:35:45 +0200 Subject: [PATCH] actions: make ActionType enum class --- src/actions.cpp | 8 +- src/actions.h | 308 +++++++++++++++++++++--------------------- src/bindings.cpp | 246 ++++++++++++++++----------------- src/bindings.h | 2 +- src/help.cpp | 290 +++++++++++++++++++-------------------- src/help.h | 4 +- src/macro_utilities.h | 8 +- 7 files changed, 433 insertions(+), 433 deletions(-) diff --git a/src/actions.cpp b/src/actions.cpp index 3e4f5deb..f9a1d3dc 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -69,7 +69,7 @@ namespace {// enum class Find { Forward, Backward }; -std::map AvailableActions; +std::map AvailableActions; void populateActions(); @@ -292,7 +292,7 @@ bool isMPDMusicDirSet() return true; } -BaseAction *get(ActionType at) +BaseAction *get(Actions::Type at) { if (AvailableActions.empty()) populateActions(); @@ -2566,8 +2566,8 @@ void seek() int old_timeout = wFooter->getTimeout(); wFooter->setTimeout(500); - auto seekForward = Actions::get(aSeekForward); - auto seekBackward = Actions::get(aSeekBackward); + auto seekForward = Actions::get(Actions::Type::SeekForward); + auto seekBackward = Actions::get(Actions::Type::SeekBackward); SeekingInProgress = true; while (true) diff --git a/src/actions.h b/src/actions.h index 55b2b6bc..cc12133f 100644 --- a/src/actions.h +++ b/src/actions.h @@ -25,40 +25,40 @@ #include #include "window.h" -enum ActionType -{ - aMacroUtility, - aDummy, aMouseEvent, aScrollUp, aScrollDown, aScrollUpArtist, aScrollUpAlbum, - aScrollDownArtist, aScrollDownAlbum, aPageUp, aPageDown, aMoveHome, aMoveEnd, - aToggleInterface, aJumpToParentDirectory, aPressEnter, aPressSpace, aPreviousColumn, - aNextColumn, aMasterScreen, aSlaveScreen, aVolumeUp, aVolumeDown, aDeletePlaylistItems, - aDeleteStoredPlaylist, aDeleteBrowserItems, aReplaySong, aPrevious, aNext, aPause, - aStop, aExecuteCommand, aSavePlaylist, aMoveSortOrderUp, aMoveSortOrderDown, - aMoveSelectedItemsUp, aMoveSelectedItemsDown, aMoveSelectedItemsTo, aAdd, - aSeekForward, aSeekBackward, aToggleDisplayMode, aToggleSeparatorsBetweenAlbums, - aToggleLyricsFetcher, aToggleFetchingLyricsInBackground, aTogglePlayingSongCentering, - aUpdateDatabase, aJumpToPlayingSong, aToggleRepeat, aShuffle, aToggleRandom, - aStartSearching, aSaveTagChanges, aToggleSingle, aToggleConsume, aToggleCrossfade, - aSetCrossfade, aEditSong, aEditLibraryTag, aEditLibraryAlbum, aEditDirectoryName, - aEditPlaylistName, aEditLyrics, aJumpToBrowser, aJumpToMediaLibrary, - aJumpToPlaylistEditor, aToggleScreenLock, aJumpToTagEditor, aJumpToPositionInSong, - aReverseSelection, aRemoveSelection, aSelectAlbum, aAddSelectedItems, - aCropMainPlaylist, aCropPlaylist, aClearMainPlaylist, aClearPlaylist, aSortPlaylist, - aReversePlaylist, aApplyFilter, aFind, aFindItemForward, aFindItemBackward, - aNextFoundItem, aPreviousFoundItem, aToggleFindMode, aToggleReplayGainMode, - aToggleSpaceMode, aToggleAddMode, aToggleMouse, aToggleBitrateVisibility, - aAddRandomItems, aToggleBrowserSortMode, aToggleLibraryTagType, - aToggleMediaLibrarySortMode, aRefetchLyrics, aRefetchArtistInfo, - aSetSelectedItemsPriority, aFilterPlaylistOnPriorities, aShowSongInfo, - aShowArtistInfo, aShowLyrics, aQuit, aNextScreen, aPreviousScreen, aShowHelp, - aShowPlaylist, aShowBrowser, aChangeBrowseMode, aShowSearchEngine, - aResetSearchEngine, aShowMediaLibrary, aToggleMediaLibraryColumnsMode, - aShowPlaylistEditor, aShowTagEditor, aShowOutputs, aShowVisualizer, - aShowClock, aShowServerInfo -}; - namespace Actions {// +enum class Type +{ + MacroUtility, + Dummy, MouseEvent, ScrollUp, ScrollDown, ScrollUpArtist, ScrollUpAlbum, + ScrollDownArtist, ScrollDownAlbum, PageUp, PageDown, MoveHome, MoveEnd, + ToggleInterface, JumpToParentDirectory, PressEnter, PressSpace, PreviousColumn, + NextColumn, MasterScreen, SlaveScreen, VolumeUp, VolumeDown, DeletePlaylistItems, + DeleteStoredPlaylist, DeleteBrowserItems, ReplaySong, Previous, Next, Pause, + Stop, ExecuteCommand, SavePlaylist, MoveSortOrderUp, MoveSortOrderDown, + MoveSelectedItemsUp, MoveSelectedItemsDown, MoveSelectedItemsTo, Add, + SeekForward, SeekBackward, ToggleDisplayMode, ToggleSeparatorsBetweenAlbums, + ToggleLyricsFetcher, ToggleFetchingLyricsInBackground, TogglePlayingSongCentering, + UpdateDatabase, JumpToPlayingSong, ToggleRepeat, Shuffle, ToggleRandom, + StartSearching, SaveTagChanges, ToggleSingle, ToggleConsume, ToggleCrossfade, + SetCrossfade, EditSong, EditLibraryTag, EditLibraryAlbum, EditDirectoryName, + EditPlaylistName, EditLyrics, JumpToBrowser, JumpToMediaLibrary, + JumpToPlaylistEditor, ToggleScreenLock, JumpToTagEditor, JumpToPositionInSong, + ReverseSelection, RemoveSelection, SelectAlbum, AddSelectedItems, + CropMainPlaylist, CropPlaylist, ClearMainPlaylist, ClearPlaylist, SortPlaylist, + ReversePlaylist, ApplyFilter, Find, FindItemForward, FindItemBackward, + NextFoundItem, PreviousFoundItem, ToggleFindMode, ToggleReplayGainMode, + ToggleSpaceMode, ToggleAddMode, ToggleMouse, ToggleBitrateVisibility, + AddRandomItems, ToggleBrowserSortMode, ToggleLibraryTagType, + ToggleMediaLibrarySortMode, RefetchLyrics, RefetchArtistInfo, + SetSelectedItemsPriority, FilterPlaylistOnPriorities, ShowSongInfo, + ShowArtistInfo, ShowLyrics, Quit, NextScreen, PreviousScreen, ShowHelp, + ShowPlaylist, ShowBrowser, ChangeBrowseMode, ShowSearchEngine, + ResetSearchEngine, ShowMediaLibrary, ToggleMediaLibraryColumnsMode, + ShowPlaylistEditor, ShowTagEditor, ShowOutputs, ShowVisualizer, + ShowClock, ShowServerInfo +}; + void validateScreenSize(); void initializeScreens(); void setResizeFlags(); @@ -69,7 +69,7 @@ bool connectToMPD(); bool askYesNoQuestion(const std::string &question, void (*callback)()); bool isMPDMusicDirSet(); -struct BaseAction *get(ActionType at); +struct BaseAction *get(Type at); struct BaseAction *get(const std::string &name); extern bool OriginalStatusbarVisibility; @@ -81,10 +81,10 @@ extern size_t FooterStartY; struct BaseAction { - BaseAction(ActionType type, const char *name) : m_type(type), m_name(name) { } + BaseAction(Type type, const char *name) : m_type(type), m_name(name) { } const char *name() const { return m_name; } - ActionType type() const { return m_type; } + Type type() const { return m_type; } virtual bool canBeRun() const { return true; } @@ -102,13 +102,13 @@ protected: virtual void run() = 0; private: - ActionType m_type; + Type m_type; const char *m_name; }; struct Dummy : public BaseAction { - Dummy() : BaseAction(aDummy, "dummy") { } + Dummy() : BaseAction(Type::Dummy, "dummy") { } protected: virtual void run() { } @@ -116,7 +116,7 @@ protected: struct MouseEvent : public BaseAction { - MouseEvent() : BaseAction(aMouseEvent, "mouse_event") { } + MouseEvent() : BaseAction(Type::MouseEvent, "mouse_event") { } protected: virtual bool canBeRun() const; @@ -129,7 +129,7 @@ protected: struct ScrollUp : public BaseAction { - ScrollUp() : BaseAction(aScrollUp, "scroll_up") { } + ScrollUp() : BaseAction(Type::ScrollUp, "scroll_up") { } protected: virtual void run(); @@ -137,7 +137,7 @@ protected: struct ScrollDown : public BaseAction { - ScrollDown() : BaseAction(aScrollDown, "scroll_down") { } + ScrollDown() : BaseAction(Type::ScrollDown, "scroll_down") { } protected: virtual void run(); @@ -145,7 +145,7 @@ protected: struct ScrollUpArtist : public BaseAction { - ScrollUpArtist() : BaseAction(aScrollUpArtist, "scroll_up_artist") { } + ScrollUpArtist() : BaseAction(Type::ScrollUpArtist, "scroll_up_artist") { } protected: virtual bool canBeRun() const; @@ -154,7 +154,7 @@ protected: struct ScrollUpAlbum : public BaseAction { - ScrollUpAlbum() : BaseAction(aScrollUpAlbum, "scroll_up_album") { } + ScrollUpAlbum() : BaseAction(Type::ScrollUpAlbum, "scroll_up_album") { } protected: virtual bool canBeRun() const; @@ -163,7 +163,7 @@ protected: struct ScrollDownArtist : public BaseAction { - ScrollDownArtist() : BaseAction(aScrollDownArtist, "scroll_down_artist") { } + ScrollDownArtist() : BaseAction(Type::ScrollDownArtist, "scroll_down_artist") { } protected: virtual bool canBeRun() const; @@ -172,7 +172,7 @@ protected: struct ScrollDownAlbum : public BaseAction { - ScrollDownAlbum() : BaseAction(aScrollDownAlbum, "scroll_down_album") { } + ScrollDownAlbum() : BaseAction(Type::ScrollDownAlbum, "scroll_down_album") { } protected: virtual bool canBeRun() const; @@ -181,7 +181,7 @@ protected: struct PageUp : public BaseAction { - PageUp() : BaseAction(aPageUp, "page_up") { } + PageUp() : BaseAction(Type::PageUp, "page_up") { } protected: virtual void run(); @@ -189,7 +189,7 @@ protected: struct PageDown : public BaseAction { - PageDown() : BaseAction(aPageDown, "page_down") { } + PageDown() : BaseAction(Type::PageDown, "page_down") { } protected: virtual void run(); @@ -197,7 +197,7 @@ protected: struct MoveHome : public BaseAction { - MoveHome() : BaseAction(aMoveHome, "move_home") { } + MoveHome() : BaseAction(Type::MoveHome, "move_home") { } protected: virtual void run(); @@ -205,7 +205,7 @@ protected: struct MoveEnd : public BaseAction { - MoveEnd() : BaseAction(aMoveEnd, "move_end") { } + MoveEnd() : BaseAction(Type::MoveEnd, "move_end") { } protected: virtual void run(); @@ -213,7 +213,7 @@ protected: struct ToggleInterface : public BaseAction { - ToggleInterface() : BaseAction(aToggleInterface, "toggle_interface") { } + ToggleInterface() : BaseAction(Type::ToggleInterface, "toggle_interface") { } protected: virtual void run(); @@ -221,7 +221,7 @@ protected: struct JumpToParentDirectory : public BaseAction { - JumpToParentDirectory() : BaseAction(aJumpToParentDirectory, "jump_to_parent_directory") { } + JumpToParentDirectory() : BaseAction(Type::JumpToParentDirectory, "jump_to_parent_directory") { } protected: virtual bool canBeRun() const; @@ -230,7 +230,7 @@ protected: struct PressEnter : public BaseAction { - PressEnter() : BaseAction(aPressEnter, "press_enter") { } + PressEnter() : BaseAction(Type::PressEnter, "press_enter") { } protected: virtual void run(); @@ -238,7 +238,7 @@ protected: struct PressSpace : public BaseAction { - PressSpace() : BaseAction(aPressSpace, "press_space") { } + PressSpace() : BaseAction(Type::PressSpace, "press_space") { } protected: virtual void run(); @@ -246,7 +246,7 @@ protected: struct PreviousColumn : public BaseAction { - PreviousColumn() : BaseAction(aPreviousColumn, "previous_column") { } + PreviousColumn() : BaseAction(Type::PreviousColumn, "previous_column") { } protected: virtual bool canBeRun() const; @@ -255,7 +255,7 @@ protected: struct NextColumn : public BaseAction { - NextColumn() : BaseAction(aNextColumn, "next_column") { } + NextColumn() : BaseAction(Type::NextColumn, "next_column") { } protected: virtual bool canBeRun() const; @@ -264,7 +264,7 @@ protected: struct MasterScreen : public BaseAction { - MasterScreen() : BaseAction(aMasterScreen, "master_screen") { } + MasterScreen() : BaseAction(Type::MasterScreen, "master_screen") { } protected: virtual bool canBeRun() const; @@ -273,7 +273,7 @@ protected: struct SlaveScreen : public BaseAction { - SlaveScreen() : BaseAction(aSlaveScreen, "slave_screen") { } + SlaveScreen() : BaseAction(Type::SlaveScreen, "slave_screen") { } protected: virtual bool canBeRun() const; @@ -282,7 +282,7 @@ protected: struct VolumeUp : public BaseAction { - VolumeUp() : BaseAction(aVolumeUp, "volume_up") { } + VolumeUp() : BaseAction(Type::VolumeUp, "volume_up") { } protected: virtual void run(); @@ -290,7 +290,7 @@ protected: struct VolumeDown : public BaseAction { - VolumeDown() : BaseAction(aVolumeDown, "volume_down") { } + VolumeDown() : BaseAction(Type::VolumeDown, "volume_down") { } protected: virtual void run(); @@ -298,7 +298,7 @@ protected: struct DeletePlaylistItems : public BaseAction { - DeletePlaylistItems() : BaseAction(aDeletePlaylistItems, "delete_playlist_items") { } + DeletePlaylistItems() : BaseAction(Type::DeletePlaylistItems, "delete_playlist_items") { } protected: virtual bool canBeRun() const; @@ -307,7 +307,7 @@ protected: struct DeleteStoredPlaylist : public BaseAction { - DeleteStoredPlaylist() : BaseAction(aDeleteStoredPlaylist, "delete_stored_playlist") { } + DeleteStoredPlaylist() : BaseAction(Type::DeleteStoredPlaylist, "delete_stored_playlist") { } protected: virtual bool canBeRun() const; @@ -316,7 +316,7 @@ protected: struct DeleteBrowserItems : public BaseAction { - DeleteBrowserItems() : BaseAction(aDeleteBrowserItems, "delete_browser_items") { } + DeleteBrowserItems() : BaseAction(Type::DeleteBrowserItems, "delete_browser_items") { } protected: virtual bool canBeRun() const; @@ -325,7 +325,7 @@ protected: struct ReplaySong : public BaseAction { - ReplaySong() : BaseAction(aReplaySong, "replay_song") { } + ReplaySong() : BaseAction(Type::ReplaySong, "replay_song") { } protected: virtual void run(); @@ -333,7 +333,7 @@ protected: struct PreviousSong : public BaseAction { - PreviousSong() : BaseAction(aPrevious, "previous") { } + PreviousSong() : BaseAction(Type::Previous, "previous") { } protected: virtual void run(); @@ -341,7 +341,7 @@ protected: struct NextSong : public BaseAction { - NextSong() : BaseAction(aNext, "next") { } + NextSong() : BaseAction(Type::Next, "next") { } protected: virtual void run(); @@ -349,7 +349,7 @@ protected: struct Pause : public BaseAction { - Pause() : BaseAction(aPause, "pause") { } + Pause() : BaseAction(Type::Pause, "pause") { } protected: virtual void run(); @@ -357,7 +357,7 @@ protected: struct Stop : public BaseAction { - Stop() : BaseAction(aStop, "stop") { } + Stop() : BaseAction(Type::Stop, "stop") { } protected: virtual void run(); @@ -365,7 +365,7 @@ protected: struct ExecuteCommand : public BaseAction { - ExecuteCommand() : BaseAction(aExecuteCommand, "execute_command") { } + ExecuteCommand() : BaseAction(Type::ExecuteCommand, "execute_command") { } protected: virtual void run(); @@ -373,7 +373,7 @@ protected: struct SavePlaylist : public BaseAction { - SavePlaylist() : BaseAction(aSavePlaylist, "save_playlist") { } + SavePlaylist() : BaseAction(Type::SavePlaylist, "save_playlist") { } protected: virtual void run(); @@ -381,7 +381,7 @@ protected: struct MoveSortOrderUp : public BaseAction { - MoveSortOrderUp() : BaseAction(aMoveSortOrderUp, "move_sort_order_up") { } + MoveSortOrderUp() : BaseAction(Type::MoveSortOrderUp, "move_sort_order_up") { } protected: virtual bool canBeRun() const; @@ -390,7 +390,7 @@ protected: struct MoveSortOrderDown : public BaseAction { - MoveSortOrderDown() : BaseAction(aMoveSortOrderDown, "move_sort_order_down") { } + MoveSortOrderDown() : BaseAction(Type::MoveSortOrderDown, "move_sort_order_down") { } protected: virtual bool canBeRun() const; @@ -399,7 +399,7 @@ protected: struct MoveSelectedItemsUp : public BaseAction { - MoveSelectedItemsUp() : BaseAction(aMoveSelectedItemsUp, "move_selected_items_up") { } + MoveSelectedItemsUp() : BaseAction(Type::MoveSelectedItemsUp, "move_selected_items_up") { } protected: virtual bool canBeRun() const; @@ -408,7 +408,7 @@ protected: struct MoveSelectedItemsDown : public BaseAction { - MoveSelectedItemsDown() : BaseAction(aMoveSelectedItemsDown, "move_selected_items_down") { } + MoveSelectedItemsDown() : BaseAction(Type::MoveSelectedItemsDown, "move_selected_items_down") { } protected: virtual bool canBeRun() const; @@ -417,7 +417,7 @@ protected: struct MoveSelectedItemsTo : public BaseAction { - MoveSelectedItemsTo() : BaseAction(aMoveSelectedItemsTo, "move_selected_items_to") { } + MoveSelectedItemsTo() : BaseAction(Type::MoveSelectedItemsTo, "move_selected_items_to") { } protected: virtual bool canBeRun() const; @@ -426,7 +426,7 @@ protected: struct Add : public BaseAction { - Add() : BaseAction(aAdd, "add") { } + Add() : BaseAction(Type::Add, "add") { } protected: virtual bool canBeRun() const; @@ -435,7 +435,7 @@ protected: struct SeekForward : public BaseAction { - SeekForward() : BaseAction(aSeekForward, "seek_forward") { } + SeekForward() : BaseAction(Type::SeekForward, "seek_forward") { } protected: virtual bool canBeRun() const; @@ -444,7 +444,7 @@ protected: struct SeekBackward : public BaseAction { - SeekBackward() : BaseAction(aSeekBackward, "seek_backward") { } + SeekBackward() : BaseAction(Type::SeekBackward, "seek_backward") { } protected: virtual bool canBeRun() const; @@ -453,7 +453,7 @@ protected: struct ToggleDisplayMode : public BaseAction { - ToggleDisplayMode() : BaseAction(aToggleDisplayMode, "toggle_display_mode") { } + ToggleDisplayMode() : BaseAction(Type::ToggleDisplayMode, "toggle_display_mode") { } protected: virtual bool canBeRun() const; @@ -463,7 +463,7 @@ protected: struct ToggleSeparatorsBetweenAlbums : public BaseAction { ToggleSeparatorsBetweenAlbums() - : BaseAction(aToggleSeparatorsBetweenAlbums, "toggle_separators_between_albums") { } + : BaseAction(Type::ToggleSeparatorsBetweenAlbums, "toggle_separators_between_albums") { } protected: virtual bool canBeRun() const; @@ -472,7 +472,7 @@ protected: struct ToggleLyricsFetcher : public BaseAction { - ToggleLyricsFetcher() : BaseAction(aToggleLyricsFetcher, "toggle_lyrics_fetcher") { } + ToggleLyricsFetcher() : BaseAction(Type::ToggleLyricsFetcher, "toggle_lyrics_fetcher") { } protected: # ifndef HAVE_CURL_CURL_H @@ -484,7 +484,7 @@ protected: struct ToggleFetchingLyricsInBackground : public BaseAction { ToggleFetchingLyricsInBackground() - : BaseAction(aToggleFetchingLyricsInBackground, "toggle_fetching_lyrics_in_background") { } + : BaseAction(Type::ToggleFetchingLyricsInBackground, "toggle_fetching_lyrics_in_background") { } protected: # ifndef HAVE_CURL_CURL_H @@ -496,7 +496,7 @@ protected: struct TogglePlayingSongCentering : public BaseAction { TogglePlayingSongCentering() - : BaseAction(aTogglePlayingSongCentering, "toggle_playing_song_centering") { } + : BaseAction(Type::TogglePlayingSongCentering, "toggle_playing_song_centering") { } protected: virtual void run(); @@ -504,7 +504,7 @@ protected: struct UpdateDatabase : public BaseAction { - UpdateDatabase() : BaseAction(aUpdateDatabase, "update_database") { } + UpdateDatabase() : BaseAction(Type::UpdateDatabase, "update_database") { } protected: virtual void run(); @@ -512,7 +512,7 @@ protected: struct JumpToPlayingSong : public BaseAction { - JumpToPlayingSong() : BaseAction(aJumpToPlayingSong, "jump_to_playing_song") { } + JumpToPlayingSong() : BaseAction(Type::JumpToPlayingSong, "jump_to_playing_song") { } protected: virtual bool canBeRun() const; @@ -521,7 +521,7 @@ protected: struct ToggleRepeat : public BaseAction { - ToggleRepeat() : BaseAction(aToggleRepeat, "toggle_repeat") { } + ToggleRepeat() : BaseAction(Type::ToggleRepeat, "toggle_repeat") { } protected: virtual void run(); @@ -529,7 +529,7 @@ protected: struct Shuffle : public BaseAction { - Shuffle() : BaseAction(aShuffle, "shuffle") { } + Shuffle() : BaseAction(Type::Shuffle, "shuffle") { } protected: virtual void run(); @@ -537,7 +537,7 @@ protected: struct ToggleRandom : public BaseAction { - ToggleRandom() : BaseAction(aToggleRandom, "toggle_random") { } + ToggleRandom() : BaseAction(Type::ToggleRandom, "toggle_random") { } protected: virtual void run(); @@ -545,7 +545,7 @@ protected: struct StartSearching : public BaseAction { - StartSearching() : BaseAction(aStartSearching, "start_searching") { } + StartSearching() : BaseAction(Type::StartSearching, "start_searching") { } protected: virtual bool canBeRun() const; @@ -554,7 +554,7 @@ protected: struct SaveTagChanges : public BaseAction { - SaveTagChanges() : BaseAction(aSaveTagChanges, "save_tag_changes") { } + SaveTagChanges() : BaseAction(Type::SaveTagChanges, "save_tag_changes") { } protected: virtual bool canBeRun() const; @@ -563,7 +563,7 @@ protected: struct ToggleSingle : public BaseAction { - ToggleSingle() : BaseAction(aToggleSingle, "toggle_single") { } + ToggleSingle() : BaseAction(Type::ToggleSingle, "toggle_single") { } protected: virtual void run(); @@ -571,7 +571,7 @@ protected: struct ToggleConsume : public BaseAction { - ToggleConsume() : BaseAction(aToggleConsume, "toggle_consume") { } + ToggleConsume() : BaseAction(Type::ToggleConsume, "toggle_consume") { } protected: virtual void run(); @@ -579,7 +579,7 @@ protected: struct ToggleCrossfade : public BaseAction { - ToggleCrossfade() : BaseAction(aToggleCrossfade, "toggle_crossfade") { } + ToggleCrossfade() : BaseAction(Type::ToggleCrossfade, "toggle_crossfade") { } protected: virtual void run(); @@ -587,7 +587,7 @@ protected: struct SetCrossfade : public BaseAction { - SetCrossfade() : BaseAction(aSetCrossfade, "set_crossfade") { } + SetCrossfade() : BaseAction(Type::SetCrossfade, "set_crossfade") { } protected: virtual void run(); @@ -595,7 +595,7 @@ protected: struct EditSong : public BaseAction { - EditSong() : BaseAction(aEditSong, "edit_song") { } + EditSong() : BaseAction(Type::EditSong, "edit_song") { } protected: virtual bool canBeRun() const; @@ -604,7 +604,7 @@ protected: struct EditLibraryTag : public BaseAction { - EditLibraryTag() : BaseAction(aEditLibraryTag, "edit_library_tag") { } + EditLibraryTag() : BaseAction(Type::EditLibraryTag, "edit_library_tag") { } protected: virtual bool canBeRun() const; @@ -613,7 +613,7 @@ protected: struct EditLibraryAlbum : public BaseAction { - EditLibraryAlbum() : BaseAction(aEditLibraryAlbum, "edit_library_album") { } + EditLibraryAlbum() : BaseAction(Type::EditLibraryAlbum, "edit_library_album") { } protected: virtual bool canBeRun() const; @@ -622,7 +622,7 @@ protected: struct EditDirectoryName : public BaseAction { - EditDirectoryName() : BaseAction(aEditDirectoryName, "edit_directory_name") { } + EditDirectoryName() : BaseAction(Type::EditDirectoryName, "edit_directory_name") { } protected: virtual bool canBeRun() const; @@ -631,7 +631,7 @@ protected: struct EditPlaylistName : public BaseAction { - EditPlaylistName() : BaseAction(aEditPlaylistName, "edit_playlist_name") { } + EditPlaylistName() : BaseAction(Type::EditPlaylistName, "edit_playlist_name") { } protected: virtual bool canBeRun() const; @@ -640,7 +640,7 @@ protected: struct EditLyrics : public BaseAction { - EditLyrics() : BaseAction(aEditLyrics, "edit_lyrics") { } + EditLyrics() : BaseAction(Type::EditLyrics, "edit_lyrics") { } protected: virtual bool canBeRun() const; @@ -649,7 +649,7 @@ protected: struct JumpToBrowser : public BaseAction { - JumpToBrowser() : BaseAction(aJumpToBrowser, "jump_to_browser") { } + JumpToBrowser() : BaseAction(Type::JumpToBrowser, "jump_to_browser") { } protected: virtual bool canBeRun() const; @@ -658,7 +658,7 @@ protected: struct JumpToMediaLibrary : public BaseAction { - JumpToMediaLibrary() : BaseAction(aJumpToMediaLibrary, "jump_to_media_library") { } + JumpToMediaLibrary() : BaseAction(Type::JumpToMediaLibrary, "jump_to_media_library") { } protected: virtual bool canBeRun() const; @@ -667,7 +667,7 @@ protected: struct JumpToPlaylistEditor : public BaseAction { - JumpToPlaylistEditor() : BaseAction(aJumpToPlaylistEditor, "jump_to_playlist_editor") { } + JumpToPlaylistEditor() : BaseAction(Type::JumpToPlaylistEditor, "jump_to_playlist_editor") { } protected: virtual bool canBeRun() const; @@ -676,7 +676,7 @@ protected: struct ToggleScreenLock : public BaseAction { - ToggleScreenLock() : BaseAction(aToggleScreenLock, "toggle_screen_lock") { } + ToggleScreenLock() : BaseAction(Type::ToggleScreenLock, "toggle_screen_lock") { } protected: virtual void run(); @@ -684,7 +684,7 @@ protected: struct JumpToTagEditor : public BaseAction { - JumpToTagEditor() : BaseAction(aJumpToTagEditor, "jump_to_tag_editor") { } + JumpToTagEditor() : BaseAction(Type::JumpToTagEditor, "jump_to_tag_editor") { } protected: virtual bool canBeRun() const; @@ -693,7 +693,7 @@ protected: struct JumpToPositionInSong : public BaseAction { - JumpToPositionInSong() : BaseAction(aJumpToPositionInSong, "jump_to_position_in_song") { } + JumpToPositionInSong() : BaseAction(Type::JumpToPositionInSong, "jump_to_position_in_song") { } protected: virtual bool canBeRun() const; @@ -702,7 +702,7 @@ protected: struct ReverseSelection : public BaseAction { - ReverseSelection() : BaseAction(aReverseSelection, "reverse_selection") { } + ReverseSelection() : BaseAction(Type::ReverseSelection, "reverse_selection") { } protected: virtual bool canBeRun() const; @@ -711,7 +711,7 @@ protected: struct RemoveSelection : public BaseAction { - RemoveSelection() : BaseAction(aRemoveSelection, "remove_selection") { } + RemoveSelection() : BaseAction(Type::RemoveSelection, "remove_selection") { } protected: virtual bool canBeRun() const; @@ -720,7 +720,7 @@ protected: struct SelectAlbum : public BaseAction { - SelectAlbum() : BaseAction(aSelectAlbum, "select_album") { } + SelectAlbum() : BaseAction(Type::SelectAlbum, "select_album") { } protected: virtual bool canBeRun() const; @@ -729,7 +729,7 @@ protected: struct AddSelectedItems : public BaseAction { - AddSelectedItems() : BaseAction(aAddSelectedItems, "add_selected_items") { } + AddSelectedItems() : BaseAction(Type::AddSelectedItems, "add_selected_items") { } protected: virtual bool canBeRun() const; @@ -738,7 +738,7 @@ protected: struct CropMainPlaylist : public BaseAction { - CropMainPlaylist() : BaseAction(aCropMainPlaylist, "crop_main_playlist") { } + CropMainPlaylist() : BaseAction(Type::CropMainPlaylist, "crop_main_playlist") { } protected: virtual void run(); @@ -746,7 +746,7 @@ protected: struct CropPlaylist : public BaseAction { - CropPlaylist() : BaseAction(aCropPlaylist, "crop_playlist") { } + CropPlaylist() : BaseAction(Type::CropPlaylist, "crop_playlist") { } protected: virtual bool canBeRun() const; @@ -755,7 +755,7 @@ protected: struct ClearMainPlaylist : public BaseAction { - ClearMainPlaylist() : BaseAction(aClearMainPlaylist, "clear_main_playlist") { } + ClearMainPlaylist() : BaseAction(Type::ClearMainPlaylist, "clear_main_playlist") { } protected: virtual void run(); @@ -763,7 +763,7 @@ protected: struct ClearPlaylist : public BaseAction { - ClearPlaylist() : BaseAction(aClearPlaylist, "clear_playlist") { } + ClearPlaylist() : BaseAction(Type::ClearPlaylist, "clear_playlist") { } protected: virtual bool canBeRun() const; @@ -772,7 +772,7 @@ protected: struct SortPlaylist : public BaseAction { - SortPlaylist() : BaseAction(aSortPlaylist, "sort_playlist") { } + SortPlaylist() : BaseAction(Type::SortPlaylist, "sort_playlist") { } protected: virtual bool canBeRun() const; @@ -781,7 +781,7 @@ protected: struct ReversePlaylist : public BaseAction { - ReversePlaylist() : BaseAction(aReversePlaylist, "reverse_playlist") { } + ReversePlaylist() : BaseAction(Type::ReversePlaylist, "reverse_playlist") { } protected: virtual bool canBeRun() const; @@ -790,7 +790,7 @@ protected: struct ApplyFilter : public BaseAction { - ApplyFilter() : BaseAction(aApplyFilter, "apply_filter") { } + ApplyFilter() : BaseAction(Type::ApplyFilter, "apply_filter") { } protected: virtual bool canBeRun() const; @@ -799,7 +799,7 @@ protected: struct Find : public BaseAction { - Find() : BaseAction(aFind, "find") { } + Find() : BaseAction(Type::Find, "find") { } protected: virtual bool canBeRun() const; @@ -808,7 +808,7 @@ protected: struct FindItemForward : public BaseAction { - FindItemForward() : BaseAction(aFindItemForward, "find_item_forward") { } + FindItemForward() : BaseAction(Type::FindItemForward, "find_item_forward") { } protected: virtual bool canBeRun() const; @@ -817,7 +817,7 @@ protected: struct FindItemBackward : public BaseAction { - FindItemBackward() : BaseAction(aFindItemBackward, "find_item_backward") { } + FindItemBackward() : BaseAction(Type::FindItemBackward, "find_item_backward") { } protected: virtual bool canBeRun() const; @@ -826,7 +826,7 @@ protected: struct NextFoundItem : public BaseAction { - NextFoundItem() : BaseAction(aNextFoundItem, "next_found_item") { } + NextFoundItem() : BaseAction(Type::NextFoundItem, "next_found_item") { } protected: virtual bool canBeRun() const; @@ -835,7 +835,7 @@ protected: struct PreviousFoundItem : public BaseAction { - PreviousFoundItem() : BaseAction(aPreviousFoundItem, "previous_found_item") { } + PreviousFoundItem() : BaseAction(Type::PreviousFoundItem, "previous_found_item") { } protected: virtual bool canBeRun() const; @@ -844,7 +844,7 @@ protected: struct ToggleFindMode : public BaseAction { - ToggleFindMode() : BaseAction(aToggleFindMode, "toggle_find_mode") { } + ToggleFindMode() : BaseAction(Type::ToggleFindMode, "toggle_find_mode") { } protected: virtual void run(); @@ -852,7 +852,7 @@ protected: struct ToggleReplayGainMode : public BaseAction { - ToggleReplayGainMode() : BaseAction(aToggleReplayGainMode, "toggle_replay_gain_mode") { } + ToggleReplayGainMode() : BaseAction(Type::ToggleReplayGainMode, "toggle_replay_gain_mode") { } protected: virtual void run(); @@ -860,7 +860,7 @@ protected: struct ToggleSpaceMode : public BaseAction { - ToggleSpaceMode() : BaseAction(aToggleSpaceMode, "toggle_space_mode") { } + ToggleSpaceMode() : BaseAction(Type::ToggleSpaceMode, "toggle_space_mode") { } protected: virtual void run(); @@ -868,7 +868,7 @@ protected: struct ToggleAddMode : public BaseAction { - ToggleAddMode() : BaseAction(aToggleAddMode, "toggle_add_mode") { } + ToggleAddMode() : BaseAction(Type::ToggleAddMode, "toggle_add_mode") { } protected: virtual void run(); @@ -876,7 +876,7 @@ protected: struct ToggleMouse : public BaseAction { - ToggleMouse() : BaseAction(aToggleMouse, "toggle_mouse") { } + ToggleMouse() : BaseAction(Type::ToggleMouse, "toggle_mouse") { } protected: virtual void run(); @@ -884,7 +884,7 @@ protected: struct ToggleBitrateVisibility : public BaseAction { - ToggleBitrateVisibility() : BaseAction(aToggleBitrateVisibility, "toggle_bitrate_visibility") { } + ToggleBitrateVisibility() : BaseAction(Type::ToggleBitrateVisibility, "toggle_bitrate_visibility") { } protected: virtual void run(); @@ -892,7 +892,7 @@ protected: struct AddRandomItems : public BaseAction { - AddRandomItems() : BaseAction(aAddRandomItems, "add_random_items") { } + AddRandomItems() : BaseAction(Type::AddRandomItems, "add_random_items") { } protected: virtual void run(); @@ -900,7 +900,7 @@ protected: struct ToggleBrowserSortMode : public BaseAction { - ToggleBrowserSortMode() : BaseAction(aToggleBrowserSortMode, "toggle_browser_sort_mode") { } + ToggleBrowserSortMode() : BaseAction(Type::ToggleBrowserSortMode, "toggle_browser_sort_mode") { } protected: virtual bool canBeRun() const; @@ -909,7 +909,7 @@ protected: struct ToggleLibraryTagType : public BaseAction { - ToggleLibraryTagType() : BaseAction(aToggleLibraryTagType, "toggle_library_tag_type") { } + ToggleLibraryTagType() : BaseAction(Type::ToggleLibraryTagType, "toggle_library_tag_type") { } protected: virtual bool canBeRun() const; @@ -919,7 +919,7 @@ protected: struct ToggleMediaLibrarySortMode : public BaseAction { ToggleMediaLibrarySortMode() - : BaseAction(aToggleMediaLibrarySortMode, "toggle_media_library_sort_mode") { } + : BaseAction(Type::ToggleMediaLibrarySortMode, "toggle_media_library_sort_mode") { } protected: virtual bool canBeRun() const; @@ -928,7 +928,7 @@ protected: struct RefetchLyrics : public BaseAction { - RefetchLyrics() : BaseAction(aRefetchLyrics, "refetch_lyrics") { } + RefetchLyrics() : BaseAction(Type::RefetchLyrics, "refetch_lyrics") { } protected: virtual bool canBeRun() const; @@ -937,7 +937,7 @@ protected: struct RefetchArtistInfo : public BaseAction { - RefetchArtistInfo() : BaseAction(aRefetchArtistInfo, "refetch_artist_info") { } + RefetchArtistInfo() : BaseAction(Type::RefetchArtistInfo, "refetch_artist_info") { } protected: virtual bool canBeRun() const; @@ -947,7 +947,7 @@ protected: struct SetSelectedItemsPriority : public BaseAction { SetSelectedItemsPriority() - : BaseAction(aSetSelectedItemsPriority, "set_selected_items_priority") { } + : BaseAction(Type::SetSelectedItemsPriority, "set_selected_items_priority") { } protected: virtual bool canBeRun() const; @@ -957,7 +957,7 @@ protected: struct FilterPlaylistOnPriorities : public BaseAction { FilterPlaylistOnPriorities() - : BaseAction(aFilterPlaylistOnPriorities, "filter_playlist_on_priorities") { } + : BaseAction(Type::FilterPlaylistOnPriorities, "filter_playlist_on_priorities") { } protected: virtual bool canBeRun() const; @@ -966,7 +966,7 @@ protected: struct ShowSongInfo : public BaseAction { - ShowSongInfo() : BaseAction(aShowSongInfo, "show_song_info") { } + ShowSongInfo() : BaseAction(Type::ShowSongInfo, "show_song_info") { } protected: virtual void run(); @@ -974,7 +974,7 @@ protected: struct ShowArtistInfo : public BaseAction { - ShowArtistInfo() : BaseAction(aShowArtistInfo, "show_artist_info") { } + ShowArtistInfo() : BaseAction(Type::ShowArtistInfo, "show_artist_info") { } protected: virtual bool canBeRun() const; @@ -983,7 +983,7 @@ protected: struct ShowLyrics : public BaseAction { - ShowLyrics() : BaseAction(aShowLyrics, "show_lyrics") { } + ShowLyrics() : BaseAction(Type::ShowLyrics, "show_lyrics") { } protected: virtual void run(); @@ -991,7 +991,7 @@ protected: struct Quit : public BaseAction { - Quit() : BaseAction(aQuit, "quit") { } + Quit() : BaseAction(Type::Quit, "quit") { } protected: virtual void run(); @@ -999,7 +999,7 @@ protected: struct NextScreen : public BaseAction { - NextScreen() : BaseAction(aNextScreen, "next_screen") { } + NextScreen() : BaseAction(Type::NextScreen, "next_screen") { } protected: virtual void run(); @@ -1007,7 +1007,7 @@ protected: struct PreviousScreen : public BaseAction { - PreviousScreen() : BaseAction(aPreviousScreen, "previous_screen") { } + PreviousScreen() : BaseAction(Type::PreviousScreen, "previous_screen") { } protected: virtual void run(); @@ -1015,7 +1015,7 @@ protected: struct ShowHelp : public BaseAction { - ShowHelp() : BaseAction(aShowHelp, "show_help") { } + ShowHelp() : BaseAction(Type::ShowHelp, "show_help") { } protected: virtual bool canBeRun() const; @@ -1024,7 +1024,7 @@ protected: struct ShowPlaylist : public BaseAction { - ShowPlaylist() : BaseAction(aShowPlaylist, "show_playlist") { } + ShowPlaylist() : BaseAction(Type::ShowPlaylist, "show_playlist") { } protected: virtual bool canBeRun() const; @@ -1033,7 +1033,7 @@ protected: struct ShowBrowser : public BaseAction { - ShowBrowser() : BaseAction(aShowBrowser, "show_browser") { } + ShowBrowser() : BaseAction(Type::ShowBrowser, "show_browser") { } protected: virtual bool canBeRun() const; @@ -1042,7 +1042,7 @@ protected: struct ChangeBrowseMode : public BaseAction { - ChangeBrowseMode() : BaseAction(aChangeBrowseMode, "change_browse_mode") { } + ChangeBrowseMode() : BaseAction(Type::ChangeBrowseMode, "change_browse_mode") { } protected: virtual bool canBeRun() const; @@ -1051,7 +1051,7 @@ protected: struct ShowSearchEngine : public BaseAction { - ShowSearchEngine() : BaseAction(aShowSearchEngine, "show_search_engine") { } + ShowSearchEngine() : BaseAction(Type::ShowSearchEngine, "show_search_engine") { } protected: virtual bool canBeRun() const; @@ -1060,7 +1060,7 @@ protected: struct ResetSearchEngine : public BaseAction { - ResetSearchEngine() : BaseAction(aResetSearchEngine, "reset_search_engine") { } + ResetSearchEngine() : BaseAction(Type::ResetSearchEngine, "reset_search_engine") { } protected: virtual bool canBeRun() const; @@ -1069,7 +1069,7 @@ protected: struct ShowMediaLibrary : public BaseAction { - ShowMediaLibrary() : BaseAction(aShowMediaLibrary, "show_media_library") { } + ShowMediaLibrary() : BaseAction(Type::ShowMediaLibrary, "show_media_library") { } protected: virtual bool canBeRun() const; @@ -1079,7 +1079,7 @@ protected: struct ToggleMediaLibraryColumnsMode : public BaseAction { ToggleMediaLibraryColumnsMode() - : BaseAction(aToggleMediaLibraryColumnsMode, "toggle_media_library_columns_mode") { } + : BaseAction(Type::ToggleMediaLibraryColumnsMode, "toggle_media_library_columns_mode") { } protected: virtual bool canBeRun() const; @@ -1088,7 +1088,7 @@ protected: struct ShowPlaylistEditor : public BaseAction { - ShowPlaylistEditor() : BaseAction(aShowPlaylistEditor, "show_playlist_editor") { } + ShowPlaylistEditor() : BaseAction(Type::ShowPlaylistEditor, "show_playlist_editor") { } protected: virtual bool canBeRun() const; @@ -1097,7 +1097,7 @@ protected: struct ShowTagEditor : public BaseAction { - ShowTagEditor() : BaseAction(aShowTagEditor, "show_tag_editor") { } + ShowTagEditor() : BaseAction(Type::ShowTagEditor, "show_tag_editor") { } protected: virtual bool canBeRun() const; @@ -1106,7 +1106,7 @@ protected: struct ShowOutputs : public BaseAction { - ShowOutputs() : BaseAction(aShowOutputs, "show_outputs") { } + ShowOutputs() : BaseAction(Type::ShowOutputs, "show_outputs") { } protected: virtual bool canBeRun() const; @@ -1115,7 +1115,7 @@ protected: struct ShowVisualizer : public BaseAction { - ShowVisualizer() : BaseAction(aShowVisualizer, "show_visualizer") { } + ShowVisualizer() : BaseAction(Type::ShowVisualizer, "show_visualizer") { } protected: virtual bool canBeRun() const; @@ -1124,7 +1124,7 @@ protected: struct ShowClock : public BaseAction { - ShowClock() : BaseAction(aShowClock, "show_clock") { } + ShowClock() : BaseAction(Type::ShowClock, "show_clock") { } protected: virtual bool canBeRun() const; @@ -1133,7 +1133,7 @@ protected: struct ShowServerInfo : public BaseAction { - ShowServerInfo() : BaseAction(aShowServerInfo, "show_server_info") { } + ShowServerInfo() : BaseAction(Type::ShowServerInfo, "show_server_info") { } protected: # ifdef HAVE_TAGLIB_H diff --git a/src/bindings.cpp b/src/bindings.cpp index d0c0cafb..3a9534b1 100644 --- a/src/bindings.cpp +++ b/src/bindings.cpp @@ -337,258 +337,258 @@ void BindingsConfiguration::generateDefaults() { Key k = Key::noOp; if (notBound(k = stringToKey("mouse"))) - bind(k, aMouseEvent); + bind(k, Actions::Type::MouseEvent); if (notBound(k = stringToKey("up"))) - bind(k, aScrollUp); + bind(k, Actions::Type::ScrollUp); if (notBound(k = stringToKey("down"))) - bind(k, aScrollDown); + bind(k, Actions::Type::ScrollDown); if (notBound(k = stringToKey("["))) - bind(k, aScrollUpAlbum); + bind(k, Actions::Type::ScrollUpAlbum); if (notBound(k = stringToKey("]"))) - bind(k, aScrollDownAlbum); + bind(k, Actions::Type::ScrollDownAlbum); if (notBound(k = stringToKey("{"))) - bind(k, aScrollUpArtist); + bind(k, Actions::Type::ScrollUpArtist); if (notBound(k = stringToKey("}"))) - bind(k, aScrollDownArtist); + bind(k, Actions::Type::ScrollDownArtist); if (notBound(k = stringToKey("page_up"))) - bind(k, aPageUp); + bind(k, Actions::Type::PageUp); if (notBound(k = stringToKey("page_down"))) - bind(k, aPageDown); + bind(k, Actions::Type::PageDown); if (notBound(k = stringToKey("home"))) - bind(k, aMoveHome); + bind(k, Actions::Type::MoveHome); if (notBound(k = stringToKey("end"))) - bind(k, aMoveEnd); + bind(k, Actions::Type::MoveEnd); if (notBound(k = stringToKey("space"))) - bind(k, aPressSpace); + bind(k, Actions::Type::PressSpace); if (notBound(k = stringToKey("enter"))) - bind(k, aPressEnter); + bind(k, Actions::Type::PressEnter); if (notBound(k = stringToKey("delete"))) { - bind(k, aDeletePlaylistItems); - bind(k, aDeleteStoredPlaylist); + bind(k, Actions::Type::DeletePlaylistItems); + bind(k, Actions::Type::DeleteStoredPlaylist); } if (notBound(k = stringToKey("right"))) { - bind(k, aNextColumn); - bind(k, aSlaveScreen); - bind(k, aVolumeUp); + bind(k, Actions::Type::NextColumn); + bind(k, Actions::Type::SlaveScreen); + bind(k, Actions::Type::VolumeUp); } if (notBound(k = stringToKey("+"))) - bind(k, aVolumeUp); + bind(k, Actions::Type::VolumeUp); if (notBound(k = stringToKey("left"))) { - bind(k, aPreviousColumn); - bind(k, aMasterScreen); - bind(k, aVolumeDown); + bind(k, Actions::Type::PreviousColumn); + bind(k, Actions::Type::MasterScreen); + bind(k, Actions::Type::VolumeDown); } if (notBound(k = stringToKey("-"))) - bind(k, aVolumeDown); + bind(k, Actions::Type::VolumeDown); if (notBound(k = stringToKey(":"))) - bind(k, aExecuteCommand); + bind(k, Actions::Type::ExecuteCommand); if (notBound(k = stringToKey("tab"))) - bind(k, aNextScreen); + bind(k, Actions::Type::NextScreen); if (notBound(k = stringToKey("shift_tab"))) - bind(k, aPreviousScreen); + bind(k, Actions::Type::PreviousScreen); if (notBound(k = stringToKey("f1"))) - bind(k, aShowHelp); + bind(k, Actions::Type::ShowHelp); if (notBound(k = stringToKey("1"))) - bind(k, aShowPlaylist); + bind(k, Actions::Type::ShowPlaylist); if (notBound(k = stringToKey("2"))) { - bind(k, aShowBrowser); - bind(k, aChangeBrowseMode); + bind(k, Actions::Type::ShowBrowser); + bind(k, Actions::Type::ChangeBrowseMode); } if (notBound(k = stringToKey("3"))) { - bind(k, aShowSearchEngine); - bind(k, aResetSearchEngine); + bind(k, Actions::Type::ShowSearchEngine); + bind(k, Actions::Type::ResetSearchEngine); } if (notBound(k = stringToKey("4"))) { - bind(k, aShowMediaLibrary); - bind(k, aToggleMediaLibraryColumnsMode); + bind(k, Actions::Type::ShowMediaLibrary); + bind(k, Actions::Type::ToggleMediaLibraryColumnsMode); } if (notBound(k = stringToKey("5"))) - bind(k, aShowPlaylistEditor); + bind(k, Actions::Type::ShowPlaylistEditor); if (notBound(k = stringToKey("6"))) - bind(k, aShowTagEditor); + bind(k, Actions::Type::ShowTagEditor); if (notBound(k = stringToKey("7"))) - bind(k, aShowOutputs); + bind(k, Actions::Type::ShowOutputs); if (notBound(k = stringToKey("8"))) - bind(k, aShowVisualizer); + bind(k, Actions::Type::ShowVisualizer); if (notBound(k = stringToKey("="))) - bind(k, aShowClock); + bind(k, Actions::Type::ShowClock); if (notBound(k = stringToKey("@"))) - bind(k, aShowServerInfo); + bind(k, Actions::Type::ShowServerInfo); if (notBound(k = stringToKey("s"))) - bind(k, aStop); + bind(k, Actions::Type::Stop); if (notBound(k = stringToKey("p"))) - bind(k, aPause); + bind(k, Actions::Type::Pause); if (notBound(k = stringToKey(">"))) - bind(k, aNext); + bind(k, Actions::Type::Next); if (notBound(k = stringToKey("<"))) - bind(k, aPrevious); + bind(k, Actions::Type::Previous); if (notBound(k = stringToKey("ctrl_h"))) { - bind(k, aJumpToParentDirectory); - bind(k, aReplaySong); + bind(k, Actions::Type::JumpToParentDirectory); + bind(k, Actions::Type::ReplaySong); } if (notBound(k = stringToKey("backspace"))) { - bind(k, aJumpToParentDirectory); - bind(k, aReplaySong); + bind(k, Actions::Type::JumpToParentDirectory); + bind(k, Actions::Type::ReplaySong); } if (notBound(k = stringToKey("backspace_2"))) { - bind(k, aJumpToParentDirectory); - bind(k, aReplaySong); + bind(k, Actions::Type::JumpToParentDirectory); + bind(k, Actions::Type::ReplaySong); } if (notBound(k = stringToKey("f"))) - bind(k, aSeekForward); + bind(k, Actions::Type::SeekForward); if (notBound(k = stringToKey("b"))) - bind(k, aSeekBackward); + bind(k, Actions::Type::SeekBackward); if (notBound(k = stringToKey("r"))) - bind(k, aToggleRepeat); + bind(k, Actions::Type::ToggleRepeat); if (notBound(k = stringToKey("z"))) - bind(k, aToggleRandom); + bind(k, Actions::Type::ToggleRandom); if (notBound(k = stringToKey("y"))) { - bind(k, aSaveTagChanges); - bind(k, aStartSearching); - bind(k, aToggleSingle); + bind(k, Actions::Type::SaveTagChanges); + bind(k, Actions::Type::StartSearching); + bind(k, Actions::Type::ToggleSingle); } if (notBound(k = stringToKey("R"))) - bind(k, aToggleConsume); + bind(k, Actions::Type::ToggleConsume); if (notBound(k = stringToKey("Y"))) - bind(k, aToggleReplayGainMode); + bind(k, Actions::Type::ToggleReplayGainMode); if (notBound(k = stringToKey("t"))) - bind(k, aToggleSpaceMode); + bind(k, Actions::Type::ToggleSpaceMode); if (notBound(k = stringToKey("T"))) - bind(k, aToggleAddMode); + bind(k, Actions::Type::ToggleAddMode); if (notBound(k = stringToKey("|"))) - bind(k, aToggleMouse); + bind(k, Actions::Type::ToggleMouse); if (notBound(k = stringToKey("#"))) - bind(k, aToggleBitrateVisibility); + bind(k, Actions::Type::ToggleBitrateVisibility); if (notBound(k = stringToKey("Z"))) - bind(k, aShuffle); + bind(k, Actions::Type::Shuffle); if (notBound(k = stringToKey("x"))) - bind(k, aToggleCrossfade); + bind(k, Actions::Type::ToggleCrossfade); if (notBound(k = stringToKey("X"))) - bind(k, aSetCrossfade); + bind(k, Actions::Type::SetCrossfade); if (notBound(k = stringToKey("u"))) - bind(k, aUpdateDatabase); + bind(k, Actions::Type::UpdateDatabase); if (notBound(k = stringToKey("ctrl_v"))) - bind(k, aSortPlaylist); + bind(k, Actions::Type::SortPlaylist); if (notBound(k = stringToKey("ctrl_r"))) - bind(k, aReversePlaylist); + bind(k, Actions::Type::ReversePlaylist); if (notBound(k = stringToKey("ctrl_f"))) - bind(k, aApplyFilter); + bind(k, Actions::Type::ApplyFilter); if (notBound(k = stringToKey("/"))) { - bind(k, aFind); - bind(k, aFindItemForward); + bind(k, Actions::Type::Find); + bind(k, Actions::Type::FindItemForward); } if (notBound(k = stringToKey("?"))) { - bind(k, aFind); - bind(k, aFindItemBackward); + bind(k, Actions::Type::Find); + bind(k, Actions::Type::FindItemBackward); } if (notBound(k = stringToKey("."))) - bind(k, aNextFoundItem); + bind(k, Actions::Type::NextFoundItem); if (notBound(k = stringToKey(","))) - bind(k, aPreviousFoundItem); + bind(k, Actions::Type::PreviousFoundItem); if (notBound(k = stringToKey("w"))) - bind(k, aToggleFindMode); + bind(k, Actions::Type::ToggleFindMode); if (notBound(k = stringToKey("e"))) { - bind(k, aEditSong); - bind(k, aEditLibraryTag); - bind(k, aEditLibraryAlbum); - bind(k, aEditDirectoryName); - bind(k, aEditPlaylistName); - bind(k, aEditLyrics); + bind(k, Actions::Type::EditSong); + bind(k, Actions::Type::EditLibraryTag); + bind(k, Actions::Type::EditLibraryAlbum); + bind(k, Actions::Type::EditDirectoryName); + bind(k, Actions::Type::EditPlaylistName); + bind(k, Actions::Type::EditLyrics); } if (notBound(k = stringToKey("i"))) - bind(k, aShowSongInfo); + bind(k, Actions::Type::ShowSongInfo); if (notBound(k = stringToKey("I"))) - bind(k, aShowArtistInfo); + bind(k, Actions::Type::ShowArtistInfo); if (notBound(k = stringToKey("g"))) - bind(k, aJumpToPositionInSong); + bind(k, Actions::Type::JumpToPositionInSong); if (notBound(k = stringToKey("l"))) - bind(k, aShowLyrics); + bind(k, Actions::Type::ShowLyrics); if (notBound(k = stringToKey("v"))) - bind(k, aReverseSelection); + bind(k, Actions::Type::ReverseSelection); if (notBound(k = stringToKey("V"))) - bind(k, aRemoveSelection); + bind(k, Actions::Type::RemoveSelection); if (notBound(k = stringToKey("B"))) - bind(k, aSelectAlbum); + bind(k, Actions::Type::SelectAlbum); if (notBound(k = stringToKey("a"))) - bind(k, aAddSelectedItems); + bind(k, Actions::Type::AddSelectedItems); if (notBound(k = stringToKey("c"))) { - bind(k, aClearPlaylist); - bind(k, aClearMainPlaylist); + bind(k, Actions::Type::ClearPlaylist); + bind(k, Actions::Type::ClearMainPlaylist); } if (notBound(k = stringToKey("C"))) { - bind(k, aCropPlaylist); - bind(k, aCropMainPlaylist); + bind(k, Actions::Type::CropPlaylist); + bind(k, Actions::Type::CropMainPlaylist); } if (notBound(k = stringToKey("m"))) { - bind(k, aMoveSortOrderUp); - bind(k, aMoveSelectedItemsUp); - bind(k, aToggleMediaLibrarySortMode); + bind(k, Actions::Type::MoveSortOrderUp); + bind(k, Actions::Type::MoveSelectedItemsUp); + bind(k, Actions::Type::ToggleMediaLibrarySortMode); } if (notBound(k = stringToKey("n"))) { - bind(k, aMoveSortOrderDown); - bind(k, aMoveSelectedItemsDown); + bind(k, Actions::Type::MoveSortOrderDown); + bind(k, Actions::Type::MoveSelectedItemsDown); } if (notBound(k = stringToKey("M"))) - bind(k, aMoveSelectedItemsTo); + bind(k, Actions::Type::MoveSelectedItemsTo); if (notBound(k = stringToKey("A"))) - bind(k, aAdd); + bind(k, Actions::Type::Add); if (notBound(k = stringToKey("S"))) - bind(k, aSavePlaylist); + bind(k, Actions::Type::SavePlaylist); if (notBound(k = stringToKey("o"))) - bind(k, aJumpToPlayingSong); + bind(k, Actions::Type::JumpToPlayingSong); if (notBound(k = stringToKey("G"))) { - bind(k, aJumpToBrowser); - bind(k, aJumpToPlaylistEditor); + bind(k, Actions::Type::JumpToBrowser); + bind(k, Actions::Type::JumpToPlaylistEditor); } if (notBound(k = stringToKey("~"))) - bind(k, aJumpToMediaLibrary); + bind(k, Actions::Type::JumpToMediaLibrary); if (notBound(k = stringToKey("E"))) - bind(k, aJumpToTagEditor); + bind(k, Actions::Type::JumpToTagEditor); if (notBound(k = stringToKey("U"))) - bind(k, aTogglePlayingSongCentering); + bind(k, Actions::Type::TogglePlayingSongCentering); if (notBound(k = stringToKey("P"))) - bind(k, aToggleDisplayMode); + bind(k, Actions::Type::ToggleDisplayMode); if (notBound(k = stringToKey("\\"))) - bind(k, aToggleInterface); + bind(k, Actions::Type::ToggleInterface); if (notBound(k = stringToKey("!"))) - bind(k, aToggleSeparatorsBetweenAlbums); + bind(k, Actions::Type::ToggleSeparatorsBetweenAlbums); if (notBound(k = stringToKey("L"))) - bind(k, aToggleLyricsFetcher); + bind(k, Actions::Type::ToggleLyricsFetcher); if (notBound(k = stringToKey("F"))) - bind(k, aToggleFetchingLyricsInBackground); + bind(k, Actions::Type::ToggleFetchingLyricsInBackground); if (notBound(k = stringToKey("ctrl_l"))) - bind(k, aToggleScreenLock); + bind(k, Actions::Type::ToggleScreenLock); if (notBound(k = stringToKey("`"))) { - bind(k, aToggleBrowserSortMode); - bind(k, aToggleLibraryTagType); - bind(k, aRefetchLyrics); - bind(k, aRefetchArtistInfo); - bind(k, aAddRandomItems); + bind(k, Actions::Type::ToggleBrowserSortMode); + bind(k, Actions::Type::ToggleLibraryTagType); + bind(k, Actions::Type::RefetchLyrics); + bind(k, Actions::Type::RefetchArtistInfo); + bind(k, Actions::Type::AddRandomItems); } if (notBound(k = stringToKey("ctrl_p"))) - bind(k, aSetSelectedItemsPriority); + bind(k, Actions::Type::SetSelectedItemsPriority); if (notBound(k = stringToKey("q"))) - bind(k, aQuit); + bind(k, Actions::Type::Quit); if (notBound(k = stringToKey("-"))) - bind(k, aVolumeDown); + bind(k, Actions::Type::VolumeDown); } diff --git a/src/bindings.h b/src/bindings.h index fa94be87..9a8397ff 100644 --- a/src/bindings.h +++ b/src/bindings.h @@ -74,7 +74,7 @@ struct Binding { typedef std::vector ActionChain; - Binding(ActionType at) : m_is_single(true), m_action(Actions::get(at)) { } + Binding(Actions::Type at) : m_is_single(true), m_action(Actions::get(at)) { } Binding(const ActionChain &actions) { assert(actions.size() > 0); if (actions.size() == 1) { diff --git a/src/help.cpp b/src/help.cpp index a1ec1214..8c03e000 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -123,7 +123,7 @@ std::wstring Help::title() return L"Help"; } -std::string Help::DisplayKeys(const ActionType at) +std::string Help::DisplayKeys(const Actions::Type at) { bool print_backspace = true; std::string result; @@ -148,7 +148,7 @@ void Help::Section(const char *type_, const char *title_) w << title_ << NC::fmtBoldEnd << "\n\n"; } -void Help::KeyDesc(const ActionType at, const char *desc) +void Help::KeyDesc(const Actions::Type at, const char *desc) { w << " " << DisplayKeys(at) << " : " << desc << '\n'; } @@ -168,212 +168,212 @@ void Help::MouseColumn(const char *column) void Help::GetKeybindings() { KeysSection("Movement"); - KeyDesc(aScrollUp, "Move cursor up"); - KeyDesc(aScrollDown, "Move cursor down"); - KeyDesc(aScrollUpAlbum, "Move cursor up one album"); - KeyDesc(aScrollDownAlbum, "Move cursor down one album"); - KeyDesc(aScrollUpArtist, "Move cursor up one artist"); - KeyDesc(aScrollDownArtist, "Move cursor down one artist"); - KeyDesc(aPageUp, "Page up"); - KeyDesc(aPageDown, "Page down"); - KeyDesc(aMoveHome, "Home"); - KeyDesc(aMoveEnd, "End"); + KeyDesc(Actions::Type::ScrollUp, "Move cursor up"); + KeyDesc(Actions::Type::ScrollDown, "Move cursor down"); + KeyDesc(Actions::Type::ScrollUpAlbum, "Move cursor up one album"); + KeyDesc(Actions::Type::ScrollDownAlbum, "Move cursor down one album"); + KeyDesc(Actions::Type::ScrollUpArtist, "Move cursor up one artist"); + KeyDesc(Actions::Type::ScrollDownArtist, "Move cursor down one artist"); + KeyDesc(Actions::Type::PageUp, "Page up"); + KeyDesc(Actions::Type::PageDown, "Page down"); + KeyDesc(Actions::Type::MoveHome, "Home"); + KeyDesc(Actions::Type::MoveEnd, "End"); w << '\n'; if (Config.screen_switcher_previous) { - KeyDesc(aNextScreen, "Switch between current and last screen"); - KeyDesc(aPreviousScreen, "Switch between current and last screen"); + KeyDesc(Actions::Type::NextScreen, "Switch between current and last screen"); + KeyDesc(Actions::Type::PreviousScreen, "Switch between current and last screen"); } else { - KeyDesc(aNextScreen, "Switch to next screen in sequence"); - KeyDesc(aPreviousScreen, "Switch to previous screen in sequence"); + KeyDesc(Actions::Type::NextScreen, "Switch to next screen in sequence"); + KeyDesc(Actions::Type::PreviousScreen, "Switch to previous screen in sequence"); } - KeyDesc(aShowHelp, "Show help"); - KeyDesc(aShowPlaylist, "Show playlist"); - KeyDesc(aShowBrowser, "Show browser"); - KeyDesc(aShowSearchEngine, "Show search engine"); - KeyDesc(aShowMediaLibrary, "Show media library"); - KeyDesc(aShowPlaylistEditor, "Show playlist editor"); + KeyDesc(Actions::Type::ShowHelp, "Show help"); + KeyDesc(Actions::Type::ShowPlaylist, "Show playlist"); + KeyDesc(Actions::Type::ShowBrowser, "Show browser"); + KeyDesc(Actions::Type::ShowSearchEngine, "Show search engine"); + KeyDesc(Actions::Type::ShowMediaLibrary, "Show media library"); + KeyDesc(Actions::Type::ShowPlaylistEditor, "Show playlist editor"); # ifdef HAVE_TAGLIB_H - KeyDesc(aShowTagEditor, "Show tag editor"); + KeyDesc(Actions::Type::ShowTagEditor, "Show tag editor"); # endif // HAVE_TAGLIB_H # ifdef ENABLE_OUTPUTS - KeyDesc(aShowOutputs, "Show outputs"); + KeyDesc(Actions::Type::ShowOutputs, "Show outputs"); # endif // ENABLE_OUTPUTS # ifdef ENABLE_VISUALIZER - KeyDesc(aShowVisualizer, "Show music visualizer"); + KeyDesc(Actions::Type::ShowVisualizer, "Show music visualizer"); # endif // ENABLE_VISUALIZER # ifdef ENABLE_CLOCK - KeyDesc(aShowClock, "Show clock"); + KeyDesc(Actions::Type::ShowClock, "Show clock"); # endif // ENABLE_CLOCK w << '\n'; - KeyDesc(aShowServerInfo, "Show server info"); + KeyDesc(Actions::Type::ShowServerInfo, "Show server info"); KeysSection("Global"); - KeyDesc(aStop, "Stop"); - KeyDesc(aPause, "Pause"); - KeyDesc(aNext, "Next track"); - KeyDesc(aPrevious, "Previous track"); - KeyDesc(aReplaySong, "Replay playing song"); - KeyDesc(aSeekForward, "Seek forward in playing song"); - KeyDesc(aSeekBackward, "Seek backward in playing song"); - KeyDesc(aVolumeDown, "Decrease volume by 2%"); - KeyDesc(aVolumeUp, "Increase volume by 2%"); + KeyDesc(Actions::Type::Stop, "Stop"); + KeyDesc(Actions::Type::Pause, "Pause"); + KeyDesc(Actions::Type::Next, "Next track"); + KeyDesc(Actions::Type::Previous, "Previous track"); + KeyDesc(Actions::Type::ReplaySong, "Replay playing song"); + KeyDesc(Actions::Type::SeekForward, "Seek forward in playing song"); + KeyDesc(Actions::Type::SeekBackward, "Seek backward in playing song"); + KeyDesc(Actions::Type::VolumeDown, "Decrease volume by 2%"); + KeyDesc(Actions::Type::VolumeUp, "Increase volume by 2%"); w << '\n'; - KeyDesc(aToggleSpaceMode, "Toggle space mode (select/add)"); - KeyDesc(aToggleAddMode, "Toggle add mode (add or remove/always add)"); - KeyDesc(aToggleMouse, "Toggle mouse support"); - KeyDesc(aReverseSelection, "Reverse selection"); - KeyDesc(aRemoveSelection, "Remove selection"); - KeyDesc(aSelectAlbum, "Select songs of album around the cursor"); - KeyDesc(aAddSelectedItems, "Add selected items to playlist"); - KeyDesc(aAddRandomItems, "Add random items to playlist"); + KeyDesc(Actions::Type::ToggleSpaceMode, "Toggle space mode (select/add)"); + KeyDesc(Actions::Type::ToggleAddMode, "Toggle add mode (add or remove/always add)"); + KeyDesc(Actions::Type::ToggleMouse, "Toggle mouse support"); + KeyDesc(Actions::Type::ReverseSelection, "Reverse selection"); + KeyDesc(Actions::Type::RemoveSelection, "Remove selection"); + KeyDesc(Actions::Type::SelectAlbum, "Select songs of album around the cursor"); + KeyDesc(Actions::Type::AddSelectedItems, "Add selected items to playlist"); + KeyDesc(Actions::Type::AddRandomItems, "Add random items to playlist"); w << '\n'; - KeyDesc(aToggleRepeat, "Toggle repeat mode"); - KeyDesc(aToggleRandom, "Toggle random mode"); - KeyDesc(aToggleSingle, "Toggle single mode"); - KeyDesc(aToggleConsume, "Toggle consume mode"); - KeyDesc(aToggleReplayGainMode, "Toggle replay gain mode"); - KeyDesc(aToggleBitrateVisibility, "Toggle bitrate visibility"); - KeyDesc(aShuffle, "Shuffle playlist"); - KeyDesc(aToggleCrossfade, "Toggle crossfade mode"); - KeyDesc(aSetCrossfade, "Set crossfade"); - KeyDesc(aUpdateDatabase, "Start music database update"); + KeyDesc(Actions::Type::ToggleRepeat, "Toggle repeat mode"); + KeyDesc(Actions::Type::ToggleRandom, "Toggle random mode"); + KeyDesc(Actions::Type::ToggleSingle, "Toggle single mode"); + KeyDesc(Actions::Type::ToggleConsume, "Toggle consume mode"); + KeyDesc(Actions::Type::ToggleReplayGainMode, "Toggle replay gain mode"); + KeyDesc(Actions::Type::ToggleBitrateVisibility, "Toggle bitrate visibility"); + KeyDesc(Actions::Type::Shuffle, "Shuffle playlist"); + KeyDesc(Actions::Type::ToggleCrossfade, "Toggle crossfade mode"); + KeyDesc(Actions::Type::SetCrossfade, "Set crossfade"); + KeyDesc(Actions::Type::UpdateDatabase, "Start music database update"); w << '\n'; - KeyDesc(aExecuteCommand, "Execute command"); - KeyDesc(aApplyFilter, "Apply filter"); - KeyDesc(aFindItemForward, "Find item forward"); - KeyDesc(aFindItemBackward, "Find item backward"); - KeyDesc(aPreviousFoundItem, "Jump to previous found item"); - KeyDesc(aNextFoundItem, "Jump to next found item"); - KeyDesc(aToggleFindMode, "Toggle find mode (normal/wrapped)"); - KeyDesc(aJumpToBrowser, "Locate song in browser"); - KeyDesc(aJumpToMediaLibrary, "Locate song in media library"); - KeyDesc(aToggleScreenLock, "Lock/unlock current screen"); - KeyDesc(aMasterScreen, "Switch to master screen (left one)"); - KeyDesc(aSlaveScreen, "Switch to slave screen (right one)"); + KeyDesc(Actions::Type::ExecuteCommand, "Execute command"); + KeyDesc(Actions::Type::ApplyFilter, "Apply filter"); + KeyDesc(Actions::Type::FindItemForward, "Find item forward"); + KeyDesc(Actions::Type::FindItemBackward, "Find item backward"); + KeyDesc(Actions::Type::PreviousFoundItem, "Jump to previous found item"); + KeyDesc(Actions::Type::NextFoundItem, "Jump to next found item"); + KeyDesc(Actions::Type::ToggleFindMode, "Toggle find mode (normal/wrapped)"); + KeyDesc(Actions::Type::JumpToBrowser, "Locate song in browser"); + KeyDesc(Actions::Type::JumpToMediaLibrary, "Locate song in media library"); + KeyDesc(Actions::Type::ToggleScreenLock, "Lock/unlock current screen"); + KeyDesc(Actions::Type::MasterScreen, "Switch to master screen (left one)"); + KeyDesc(Actions::Type::SlaveScreen, "Switch to slave screen (right one)"); # ifdef HAVE_TAGLIB_H - KeyDesc(aJumpToTagEditor, "Locate song in tag editor"); + KeyDesc(Actions::Type::JumpToTagEditor, "Locate song in tag editor"); # endif // HAVE_TAGLIB_H - KeyDesc(aToggleDisplayMode, "Toggle display mode"); - KeyDesc(aToggleInterface, "Toggle user interface"); - KeyDesc(aToggleSeparatorsBetweenAlbums, "Toggle displaying separators between albums"); - KeyDesc(aJumpToPositionInSong, "Jump to given position in playing song (formats: mm:ss, x%)"); - KeyDesc(aShowSongInfo, "Show song info"); + KeyDesc(Actions::Type::ToggleDisplayMode, "Toggle display mode"); + KeyDesc(Actions::Type::ToggleInterface, "Toggle user interface"); + KeyDesc(Actions::Type::ToggleSeparatorsBetweenAlbums, "Toggle displaying separators between albums"); + KeyDesc(Actions::Type::JumpToPositionInSong, "Jump to given position in playing song (formats: mm:ss, x%)"); + KeyDesc(Actions::Type::ShowSongInfo, "Show song info"); # ifdef HAVE_CURL_CURL_H - KeyDesc(aShowArtistInfo, "Show artist info"); - KeyDesc(aToggleLyricsFetcher, "Toggle lyrics fetcher"); - KeyDesc(aToggleFetchingLyricsInBackground, "Toggle fetching lyrics for playing songs in background"); + KeyDesc(Actions::Type::ShowArtistInfo, "Show artist info"); + KeyDesc(Actions::Type::ToggleLyricsFetcher, "Toggle lyrics fetcher"); + KeyDesc(Actions::Type::ToggleFetchingLyricsInBackground, "Toggle fetching lyrics for playing songs in background"); # endif // HAVE_CURL_CURL_H - KeyDesc(aShowLyrics, "Show/hide song lyrics"); + KeyDesc(Actions::Type::ShowLyrics, "Show/hide song lyrics"); w << '\n'; - KeyDesc(aQuit, "Quit"); + KeyDesc(Actions::Type::Quit, "Quit"); KeysSection("Playlist"); - KeyDesc(aPressEnter, "Play selected item"); - KeyDesc(aDeletePlaylistItems, "Delete selected item(s) from playlist"); - KeyDesc(aClearMainPlaylist, "Clear playlist"); - KeyDesc(aCropMainPlaylist, "Clear playlist except selected item(s)"); - KeyDesc(aSetSelectedItemsPriority, "Set priority of selected items"); - KeyDesc(aMoveSelectedItemsUp, "Move selected item(s) up"); - KeyDesc(aMoveSelectedItemsDown, "Move selected item(s) down"); - KeyDesc(aMoveSelectedItemsTo, "Move selected item(s) to cursor position"); - KeyDesc(aAdd, "Add item to playlist"); + KeyDesc(Actions::Type::PressEnter, "Play selected item"); + KeyDesc(Actions::Type::DeletePlaylistItems, "Delete selected item(s) from playlist"); + KeyDesc(Actions::Type::ClearMainPlaylist, "Clear playlist"); + KeyDesc(Actions::Type::CropMainPlaylist, "Clear playlist except selected item(s)"); + KeyDesc(Actions::Type::SetSelectedItemsPriority, "Set priority of selected items"); + KeyDesc(Actions::Type::MoveSelectedItemsUp, "Move selected item(s) up"); + KeyDesc(Actions::Type::MoveSelectedItemsDown, "Move selected item(s) down"); + KeyDesc(Actions::Type::MoveSelectedItemsTo, "Move selected item(s) to cursor position"); + KeyDesc(Actions::Type::Add, "Add item to playlist"); # ifdef HAVE_TAGLIB_H - KeyDesc(aEditSong, "Edit song"); + KeyDesc(Actions::Type::EditSong, "Edit song"); # endif // HAVE_TAGLIB_H - KeyDesc(aSavePlaylist, "Save playlist"); - KeyDesc(aSortPlaylist, "Sort playlist"); - KeyDesc(aReversePlaylist, "Reverse playlist"); - KeyDesc(aFilterPlaylistOnPriorities, "Filter playlist on priorities"); - KeyDesc(aJumpToPlayingSong, "Jump to playing song"); - KeyDesc(aTogglePlayingSongCentering, "Toggle playing song centering"); + KeyDesc(Actions::Type::SavePlaylist, "Save playlist"); + KeyDesc(Actions::Type::SortPlaylist, "Sort playlist"); + KeyDesc(Actions::Type::ReversePlaylist, "Reverse playlist"); + KeyDesc(Actions::Type::FilterPlaylistOnPriorities, "Filter playlist on priorities"); + KeyDesc(Actions::Type::JumpToPlayingSong, "Jump to playing song"); + KeyDesc(Actions::Type::TogglePlayingSongCentering, "Toggle playing song centering"); KeysSection("Browser"); - KeyDesc(aPressEnter, "Enter directory/Add item to playlist and play it"); - KeyDesc(aPressSpace, "Add item to playlist/select it"); + KeyDesc(Actions::Type::PressEnter, "Enter directory/Add item to playlist and play it"); + KeyDesc(Actions::Type::PressSpace, "Add item to playlist/select it"); # ifdef HAVE_TAGLIB_H - KeyDesc(aEditSong, "Edit song"); + KeyDesc(Actions::Type::EditSong, "Edit song"); # endif // HAVE_TAGLIB_H - KeyDesc(aEditDirectoryName, "Edit directory name"); - KeyDesc(aEditPlaylistName, "Edit playlist name"); - KeyDesc(aChangeBrowseMode, "Browse MPD database/local filesystem"); - KeyDesc(aToggleBrowserSortMode, "Toggle sort mode"); - KeyDesc(aJumpToPlayingSong, "Locate playing song"); - KeyDesc(aJumpToParentDirectory, "Jump to parent directory"); - KeyDesc(aDeleteBrowserItems, "Delete selected items from disk"); - KeyDesc(aJumpToPlaylistEditor, "Jump to playlist editor (playlists only)"); + KeyDesc(Actions::Type::EditDirectoryName, "Edit directory name"); + KeyDesc(Actions::Type::EditPlaylistName, "Edit playlist name"); + KeyDesc(Actions::Type::ChangeBrowseMode, "Browse MPD database/local filesystem"); + KeyDesc(Actions::Type::ToggleBrowserSortMode, "Toggle sort mode"); + KeyDesc(Actions::Type::JumpToPlayingSong, "Locate playing song"); + KeyDesc(Actions::Type::JumpToParentDirectory, "Jump to parent directory"); + KeyDesc(Actions::Type::DeleteBrowserItems, "Delete selected items from disk"); + KeyDesc(Actions::Type::JumpToPlaylistEditor, "Jump to playlist editor (playlists only)"); KeysSection("Search engine"); - KeyDesc(aPressEnter, "Add item to playlist and play it/change option"); - KeyDesc(aPressSpace, "Add item to playlist"); + KeyDesc(Actions::Type::PressEnter, "Add item to playlist and play it/change option"); + KeyDesc(Actions::Type::PressSpace, "Add item to playlist"); # ifdef HAVE_TAGLIB_H - KeyDesc(aEditSong, "Edit song"); + KeyDesc(Actions::Type::EditSong, "Edit song"); # endif // HAVE_TAGLIB_H - KeyDesc(aStartSearching, "Start searching"); - KeyDesc(aResetSearchEngine, "Reset search constraints and clear results"); + KeyDesc(Actions::Type::StartSearching, "Start searching"); + KeyDesc(Actions::Type::ResetSearchEngine, "Reset search constraints and clear results"); KeysSection("Media library"); - KeyDesc(aToggleMediaLibraryColumnsMode, "Switch between two/three columns mode"); - KeyDesc(aPreviousColumn, "Previous column"); - KeyDesc(aNextColumn, "Next column"); - KeyDesc(aPressEnter, "Add item to playlist and play it"); - KeyDesc(aPressSpace, "Add item to playlist"); + KeyDesc(Actions::Type::ToggleMediaLibraryColumnsMode, "Switch between two/three columns mode"); + KeyDesc(Actions::Type::PreviousColumn, "Previous column"); + KeyDesc(Actions::Type::NextColumn, "Next column"); + KeyDesc(Actions::Type::PressEnter, "Add item to playlist and play it"); + KeyDesc(Actions::Type::PressSpace, "Add item to playlist"); # ifdef HAVE_TAGLIB_H - KeyDesc(aEditSong, "Edit song"); + KeyDesc(Actions::Type::EditSong, "Edit song"); # endif // HAVE_TAGLIB_H - KeyDesc(aEditLibraryTag, "Edit tag (left column)/album (middle/right column)"); - KeyDesc(aToggleLibraryTagType, "Toggle type of tag used in left column"); - KeyDesc(aToggleMediaLibrarySortMode, "Toggle sort mode"); + KeyDesc(Actions::Type::EditLibraryTag, "Edit tag (left column)/album (middle/right column)"); + KeyDesc(Actions::Type::ToggleLibraryTagType, "Toggle type of tag used in left column"); + KeyDesc(Actions::Type::ToggleMediaLibrarySortMode, "Toggle sort mode"); KeysSection("Playlist editor"); - KeyDesc(aPreviousColumn, "Previous column"); - KeyDesc(aNextColumn, "Next column"); - KeyDesc(aPressEnter, "Add item to playlist and play it"); - KeyDesc(aPressSpace, "Add item to playlist/select it"); + KeyDesc(Actions::Type::PreviousColumn, "Previous column"); + KeyDesc(Actions::Type::NextColumn, "Next column"); + KeyDesc(Actions::Type::PressEnter, "Add item to playlist and play it"); + KeyDesc(Actions::Type::PressSpace, "Add item to playlist/select it"); # ifdef HAVE_TAGLIB_H - KeyDesc(aEditSong, "Edit song"); + KeyDesc(Actions::Type::EditSong, "Edit song"); # endif // HAVE_TAGLIB_H - KeyDesc(aEditPlaylistName, "Edit playlist name"); - KeyDesc(aMoveSelectedItemsUp, "Move selected item(s) up"); - KeyDesc(aMoveSelectedItemsDown, "Move selected item(s) down"); - KeyDesc(aDeleteStoredPlaylist, "Delete selected playlists (left column)"); - KeyDesc(aDeletePlaylistItems, "Delete selected item(s) from playlist (right column)"); - KeyDesc(aClearPlaylist, "Clear playlist"); - KeyDesc(aCropPlaylist, "Clear playlist except selected items"); + KeyDesc(Actions::Type::EditPlaylistName, "Edit playlist name"); + KeyDesc(Actions::Type::MoveSelectedItemsUp, "Move selected item(s) up"); + KeyDesc(Actions::Type::MoveSelectedItemsDown, "Move selected item(s) down"); + KeyDesc(Actions::Type::DeleteStoredPlaylist, "Delete selected playlists (left column)"); + KeyDesc(Actions::Type::DeletePlaylistItems, "Delete selected item(s) from playlist (right column)"); + KeyDesc(Actions::Type::ClearPlaylist, "Clear playlist"); + KeyDesc(Actions::Type::CropPlaylist, "Clear playlist except selected items"); KeysSection("Lyrics"); - KeyDesc(aPressSpace, "Toggle reloading lyrics upon song change"); - KeyDesc(aEditLyrics, "Open lyrics in external editor"); - KeyDesc(aRefetchLyrics, "Refetch lyrics"); + KeyDesc(Actions::Type::PressSpace, "Toggle reloading lyrics upon song change"); + KeyDesc(Actions::Type::EditLyrics, "Open lyrics in external editor"); + KeyDesc(Actions::Type::RefetchLyrics, "Refetch lyrics"); KeysSection("Artist info"); - KeyDesc(aRefetchArtistInfo, "Refetch artist info"); + KeyDesc(Actions::Type::RefetchArtistInfo, "Refetch artist info"); # ifdef HAVE_TAGLIB_H KeysSection("Tiny tag editor"); - KeyDesc(aPressEnter, "Edit tag"); - KeyDesc(aSaveTagChanges, "Save"); + KeyDesc(Actions::Type::PressEnter, "Edit tag"); + KeyDesc(Actions::Type::SaveTagChanges, "Save"); KeysSection("Tag editor"); - KeyDesc(aPressEnter, "Edit tag/filename of selected item (left column)"); - KeyDesc(aPressEnter, "Perform operation on all/selected items (middle column)"); - KeyDesc(aPressSpace, "Switch to albums/directories view (left column)"); - KeyDesc(aPressSpace, "Select item (right column)"); - KeyDesc(aPreviousColumn, "Previous column"); - KeyDesc(aNextColumn, "Next column"); - KeyDesc(aJumpToParentDirectory, "Jump to parent directory (left column, directories view)"); + KeyDesc(Actions::Type::PressEnter, "Edit tag/filename of selected item (left column)"); + KeyDesc(Actions::Type::PressEnter, "Perform operation on all/selected items (middle column)"); + KeyDesc(Actions::Type::PressSpace, "Switch to albums/directories view (left column)"); + KeyDesc(Actions::Type::PressSpace, "Select item (right column)"); + KeyDesc(Actions::Type::PreviousColumn, "Previous column"); + KeyDesc(Actions::Type::NextColumn, "Next column"); + KeyDesc(Actions::Type::JumpToParentDirectory, "Jump to parent directory (left column, directories view)"); # endif // HAVE_TAGLIB_H # ifdef ENABLE_OUTPUTS KeysSection("Outputs"); - KeyDesc(aPressEnter, "Toggle output"); + KeyDesc(Actions::Type::PressEnter, "Toggle output"); # endif // ENABLE_OUTPUTS # if defined(ENABLE_VISUALIZER) && defined(HAVE_FFTW3_H) KeysSection("Music visualizer"); - KeyDesc(aPressSpace, "Toggle visualization type"); + KeyDesc(Actions::Type::PressSpace, "Toggle visualization type"); # endif // ENABLE_VISUALIZER && HAVE_FFTW3_H MouseSection("Global"); diff --git a/src/help.h b/src/help.h index f8f90fa2..c775fd3c 100644 --- a/src/help.h +++ b/src/help.h @@ -49,11 +49,11 @@ private: void KeysSection(const char *title_) { Section("Keys", title_); } void MouseSection(const char *title_) { Section("Mouse", title_); } void Section(const char *type_, const char *title_); - void KeyDesc(const ActionType at, const char *desc); + void KeyDesc(const Actions::Type at, const char *desc); void MouseDesc(std::string action, const char *desc, bool indent = false); void MouseColumn(const char *column); - std::string DisplayKeys(const ActionType at); + std::string DisplayKeys(const Actions::Type at); void GetKeybindings(); }; diff --git a/src/macro_utilities.h b/src/macro_utilities.h index 3e0c7aed..347d041f 100644 --- a/src/macro_utilities.h +++ b/src/macro_utilities.h @@ -30,7 +30,7 @@ namespace Actions {// struct PushCharacters : public BaseAction { PushCharacters(NC::Window **w, std::vector &&queue) - : BaseAction(aMacroUtility, ""), m_window(w), m_queue(queue) { } + : BaseAction(Type::MacroUtility, ""), m_window(w), m_queue(queue) { } protected: virtual void run(); @@ -43,7 +43,7 @@ private: struct RequireRunnable : public BaseAction { RequireRunnable(BaseAction *action) - : BaseAction(aMacroUtility, ""), m_action(action) { assert(action); } + : BaseAction(Type::MacroUtility, ""), m_action(action) { assert(action); } protected: virtual bool canBeRun() const; @@ -56,7 +56,7 @@ private: struct RequireScreen : public BaseAction { RequireScreen(ScreenType screen_type) - : BaseAction(aMacroUtility, ""), m_screen_type(screen_type) { } + : BaseAction(Type::MacroUtility, ""), m_screen_type(screen_type) { } protected: virtual bool canBeRun() const; @@ -69,7 +69,7 @@ private: struct RunExternalCommand : public BaseAction { RunExternalCommand(std::string command) - : BaseAction(aMacroUtility, ""), m_command(command) { } + : BaseAction(Type::MacroUtility, ""), m_command(command) { } protected: virtual void run();