diff options
Diffstat (limited to 'mg_actions.h')
-rw-r--r-- | mg_actions.h | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/mg_actions.h b/mg_actions.h index 3712191..3994b10 100644 --- a/mg_actions.h +++ b/mg_actions.h @@ -27,10 +27,11 @@ class mgMainMenu; /*! \brief defines all actions which can appear in command submenus. * Since these values are saved in muggle.state, new actions should - * always be appended. The order does not matter. Value 0 means undefined. + * always be appended. The order does not matter. actNone should be 0. */ enum mgActions { - actChooseOrder=1, //!< show a menu with all possible orders + actNone, + actChooseOrder, //!< show a menu with all possible orders actToggleSelection, //!< toggle between search and collection view actClearCollection, //!< clear a collection, actCreateCollection, @@ -45,15 +46,17 @@ enum mgActions { actRemoveThisFromCollection, //!< remove selected item from default collection actEntry, //!< used for normal data base items actSetButton, //!< connect a button with an action - ActOrderCollItem, //!< order by collections - ActOrderArtistAlbumTitle, //!< order by Artist/Album/Title - ActOrderArtistTitle, //!< order by Artist/Title - ActOrderAlbumTitle, //!< order by Album/Title - ActOrderGenreYearTitle, //!< order by Genre1/Year/Title - ActOrderGenreArtistAlbumTitle, //!< order by Genre1/Artist/Album/Title + actShowList, + actShowCommands, + actCreateOrder, + actDeleteOrder, + actUnused5, //!< order by Genre1/Artist/Album/Title actAddAllToDefaultCollection, actAddThisToDefaultCollection, actSetDefaultCollection, + actOrder, + actUnused6, + actEditOrder, actExternal0 = 1000, //!< used for external commands, the number is the entry number in the .conf file starting with line 0 actExternal1, //!< used for external commands, the number is the entry number in the .conf file actExternal2, //!< used for external commands, the number is the entry number in the .conf file @@ -88,7 +91,7 @@ class mgAction virtual bool Enabled(mgActions on = mgActions(0)); //! \brief the action to be executed - virtual void Execute () = 0; + virtual void Execute () {} //! \brief handles the kBack key virtual eOSState Back(); @@ -98,14 +101,17 @@ class mgAction */ virtual const char *ButtonName () { - return NULL; + return ""; } /*! \brief the name for a menu entry. If empty, no button will be able * to execute this. The returned C string must be freeable at any time. * \param value a string that can be used for building the menu name. */ - virtual const char *MenuName (const unsigned int idx=0,const string value="") = 0; + virtual const char *MenuName (const unsigned int idx=0,const string value="") + { + return strdup(ButtonName()); + } //! \brief default constructor mgAction (); @@ -149,12 +155,24 @@ class mgAction mgSelection* playselection (); virtual void Notify(); + eOSState ProcessKey(eKeys key); + virtual eOSState Process(eKeys key) { return osUnknown; } private: mgMainMenu *m_osd; }; +class mgActionWithIntValue: public mgAction +{ + public: + mgActionWithIntValue() { intval=0; } + void setValue(int i) { intval = i; } + protected: + int intval; +}; + //! \brief generate an mgAction for action mgAction* actGenerate(const mgActions action); +mgAction* actGenerateKeyItem(const char *Name, int *Value, int NumStrings, const char * const * Strings); #endif |