summaryrefslogtreecommitdiff
path: root/vdr_menu.h
diff options
context:
space:
mode:
authorLarsAC <LarsAC@e10066b5-e1e2-0310-b819-94efdf66514b>2005-04-19 18:01:19 +0000
committerLarsAC <LarsAC@e10066b5-e1e2-0310-b819-94efdf66514b>2005-04-19 18:01:19 +0000
commite636aa59d86868039f39b0e39e944871cae5b9db (patch)
treef44f9f196ce7de52a2dacdff3588ec99e5d03e40 /vdr_menu.h
parent143d3397960c698935869cae65db8d8937e4d22a (diff)
downloadvdr-plugin-muggle-e636aa59d86868039f39b0e39e944871cae5b9db.tar.gz
vdr-plugin-muggle-e636aa59d86868039f39b0e39e944871cae5b9db.tar.bz2
Merged changes from 0.1.6-wr
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@637 e10066b5-e1e2-0310-b819-94efdf66514b
Diffstat (limited to 'vdr_menu.h')
-rw-r--r--vdr_menu.h80
1 files changed, 57 insertions, 23 deletions
diff --git a/vdr_menu.h b/vdr_menu.h
index ede022b..a46b4b8 100644
--- a/vdr_menu.h
+++ b/vdr_menu.h
@@ -14,7 +14,7 @@
#define _VDR_MENU_H
#include <string>
-#include <list>
+// #include <list>
#include <vector>
#include <osd.h>
@@ -24,8 +24,6 @@
#include "vdr_player.h"
-using namespace std;
-
//! \brief play a selection, aborting what is currently played
//! \param select if true, play only what the current position selects
void Play(mgSelection *sel,const bool select=false);
@@ -38,6 +36,7 @@ class cCommands;
class mgSelection;
class mgMenu;
class mgMainMenu;
+class mgIncrementalSearch;
//! \brief if a player is running, return it
mgPlayerControl * PlayerControl ();
@@ -145,7 +144,7 @@ class mgMainMenu:public cOsdMenu
}
//! \brief this is the collection things will be added to
- string default_collection;
+ std::string default_collection;
/*! \brief this is the "now playing" collection translated in
* the current language. When changing the OSD language, this
@@ -154,7 +153,7 @@ class mgMainMenu:public cOsdMenu
* previous language will stay, so the user can copy from the
* old one to the new one.
*/
- string play_collection;
+ std::string play_collection;
/*! \brief selects a certain line on the OSD and displays the OSD
*/
@@ -177,13 +176,13 @@ class mgMainMenu:public cOsdMenu
// because that might do forcerefresh which overwrites the message
void Message (const char *msg) { m_message = strdup(msg); }
void Message1 (const char *msg, const char *arg1);
- void Message1 (const char *msg, string arg1) { Message1(msg,arg1.c_str()); }
+ void Message1 (const char *msg, std::string arg1) { Message1(msg,arg1.c_str()); }
//! \brief Actions can request a new position. -1 means none wanted
int newposition;
//! \brief clears the screen, sets a title and the hotkey flag
- void InitOsd (const char *title,const bool hashotkeys);
+ void InitOsd (std::string title,const bool hashotkeys);
#if VDRVERSNUM >= 10307
//! \brief expose the protected DisplayMenu() from cOsdMenu
@@ -200,7 +199,7 @@ class mgMainMenu:public cOsdMenu
}
//! \brief the current selection
- mgSelection* selection ()
+ mgSelection* selection () const
{
if (UsingCollection)
return m_collectionsel;
@@ -209,13 +208,13 @@ class mgMainMenu:public cOsdMenu
}
//! \brief the collection selection
- mgSelection* collselection()
+ mgSelection* collselection() const
{
return m_collectionsel;
}
//! \brief the "now playing" selection
- mgSelection* playselection ()
+ mgSelection* playselection () const
{
return m_playsel;
}
@@ -227,13 +226,15 @@ class mgMainMenu:public cOsdMenu
bool DefaultCollectionSelected();
//! \brief true if the cursor is placed in the default collection
- bool CollectionEntered(string name);
+ bool CollectionEntered(std::string name);
void AddItem(mgAction *a);
- void CollectionChanged(string name);
+ void CollectionChanged(std::string name);
void CloseMenu();
+
+ void RefreshTitle();
};
//! \brief a generic muggle menu
@@ -243,6 +244,7 @@ class mgMenu
mgMainMenu* m_osd;
const char *HKey(const mgActions act,mgActions on);
protected:
+ unsigned int m_prevpos;
bool m_prevUsingCollection;
eOSState ExecuteButton(eKeys key);
//! \brief adds the wanted action to the OSD menu
@@ -258,7 +260,7 @@ class mgMenu
void AddSelectionItems (mgSelection *sel,mgActions act = actEntry);
//! \brief the name of the blue button depends of where we are
int m_parent_index;
- string m_parent_name;
+ std::string m_parent_name;
public:
/*! sets the correct help keys.
* \todo without data from mysql, no key is shown,
@@ -276,22 +278,22 @@ class mgMenu
void setParentIndex(int idx) { m_parent_index = idx; }
int getParentIndex() { return m_parent_index; }
- void setParentName(string name) { m_parent_name = name; }
- string getParentName() { return m_parent_name; }
+ void setParentName(std::string name) { m_parent_name = name; }
+ std::string getParentName() { return m_parent_name; }
//! \brief the pointer to the owning mgMainMenu
- mgMainMenu* osd ()
+ mgMainMenu* osd () const
{
return m_osd;
}
//! \brief the currently active selection of the owning mgMainMenu
- mgSelection* selection ()
+ mgSelection* selection () const
{
return osd ()->selection ();
}
//! \brief the playselection of the owning mgMainMenu
- mgSelection* playselection ()
+ mgSelection* playselection () const
{
return osd ()->playselection ();
}
@@ -302,8 +304,11 @@ class mgMenu
{
}
+//! \brief computes the title
+ virtual std::string Title() const = 0;
+
//! \brief clears the screen, sets a title and the hotkey flag
- void InitOsd (const char *title,const bool hashotkeys=true);
+ void InitOsd (const bool hashotkeys=true);
//! \brief display OSD and go to osd()->newposition
void Display ();
@@ -342,10 +347,28 @@ class mgMenu
class mgTree:public mgMenu
{
public:
+
mgTree();
- virtual eOSState Process (eKeys Key);
+
+ //! \brief computes the title
+ std::string Title() const;
+
+ bool UpdateIncrementalSearch( eKeys key );
+
+ void TerminateIncrementalSearch( bool remain_on_current );
+
protected:
void BuildOsd ();
+
+ private:
+
+ void UpdateSearchPosition();
+
+ mgIncrementalSearch *m_incsearch;
+
+ std::string m_filter;
+
+ int m_start_position;
};
//! \brief an mgMenu class for submenus
@@ -353,6 +376,8 @@ class mgSubmenu:public mgMenu
{
public:
mgSubmenu::mgSubmenu();
+//! \brief computes the title
+ std::string Title() const;
protected:
void BuildOsd ();
};
@@ -360,6 +385,9 @@ class mgSubmenu:public mgMenu
//! \brief an mgMenu class for selecting an order
class mgMenuOrders:public mgMenu
{
+ public:
+//! \brief computes the title
+ std::string Title() const;
protected:
void BuildOsd ();
};
@@ -369,6 +397,8 @@ class mgMenuOrder : public mgMenu
public:
mgMenuOrder();
~mgMenuOrder();
+//! \brief computes the title
+ std::string Title() const;
bool ChangeOrder(eKeys key);
void SaveOrder();
protected:
@@ -387,16 +417,19 @@ class mgTreeCollSelector:public mgMenu
public:
mgTreeCollSelector();
~mgTreeCollSelector();
+//! \brief computes the title
+ std::string Title() const;
protected:
void BuildOsd ();
virtual mgActions coll_action() = 0;
- string m_title;
+ std::string m_title;
};
class mgTreeAddToCollSelector:public mgTreeCollSelector
{
public:
- mgTreeAddToCollSelector(string title);
+//! \brief computes the title
+ mgTreeAddToCollSelector(std::string title);
protected:
virtual mgActions coll_action() { return actAddCollEntry; }
};
@@ -405,7 +438,8 @@ class mgTreeAddToCollSelector:public mgTreeCollSelector
class mgTreeRemoveFromCollSelector:public mgTreeCollSelector
{
public:
- mgTreeRemoveFromCollSelector(string title);
+//! \brief computes the title
+ mgTreeRemoveFromCollSelector(std::string title);
protected:
virtual mgActions coll_action() { return actRemoveCollEntry; }
};