summaryrefslogtreecommitdiff
path: root/muggle-plugin/vdr_menu.h
blob: 76317bc3e5afd068a4013ffafb0c7ca34470e221 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*******************************************************************/
/*! \file   vdr_menu.h
 *  \brief  Implements menu handling for broswing media libraries within VDR
 ******************************************************************** 
 * \version $Revision: 1.8 $
 * \date    $Date: 2004/02/08 10:48:44 $
 * \author  Ralf Klueber, Lars von Wedel, Andreas Kellner
 * \author  file owner: $Author: LarsAC $
 *
 * $Id: vdr_menu.h,v 1.8 2004/02/08 10:48:44 LarsAC Exp $
 *
 */
/*******************************************************************/

#ifndef _VDR_MENU_H
#define _VDR_MENU_H

#undef SHELL_TEST

#ifdef SHELL_TEST
  #include "myosd.h"
  #include "mymenuitems.h"
#else
  #include <osd.h>
#endif

#include <list>

class mgMedia;
class mgSelectionTreeNode;
class mgPlaylist;
class mgTracklist;

class mgMenuTreeItem : public cOsdItem
{
 public:

  mgMenuTreeItem( mgSelectionTreeNode *node );

  mgSelectionTreeNode *Node();

  void Set();

 private: 

  mgSelectionTreeNode *m_node;

};

class mgMainMenu : public cOsdMenu
{
 public:
  
  mgMainMenu(mgMedia *media, mgSelectionTreeNode *root, mgPlaylist *playlist);

  mgSelectionTreeNode *CurrentNode();
  mgMenuTreeItem *CurrentItem();
  
  eOSState ProcessKey(eKeys Key);
  void Move( int from, int to);

 protected:

  enum MuggleStatus
    { 
      TREE, TREE_SUBMENU,
      PLAYLIST, PLAYLIST_TRACKINFO, PLAYLIST_ALBUMINFO, 
      FILTER
    };

  void SetButtons();

  // Tree view handling
  void DisplayTree( mgSelectionTreeNode *node, int select = 0 );
  void DisplayTreeViewSelector();
  void DisplayTreeSubmenu();
  void TreeSubmenuAction( int n );

  // Filter view handling
  void DisplayFilter();
  void DisplayFilterSelector();

  // Playlist view handling
  void DisplayPlaylist();
  void DisplayTrackInfo();
  void DisplayAlbumInfo();  

 private:

  // content stuff
  mgMedia *m_media;
  mgSelectionTreeNode *m_root;
  mgSelectionTreeNode *m_node;
  mgPlaylist          *m_current_playlist;
  mgTracklist         *m_tracklist;
 
  // filter items
  char *m_title, *m_interpret, *m_album, *m_playlist, *m_filtername;
  int   m_year_min, m_year_max, m_filter;

  MuggleStatus m_state;

  std::list<int> m_history;
};

#endif

/************************************************************
 *
 * $Log: vdr_menu.h,v $
 * Revision 1.8  2004/02/08 10:48:44  LarsAC
 * Made major revisions in OSD behavior
 *
 * Revision 1.7  2004/02/03 19:28:46  LarsAC
 * Playlist now created in plugin instead of in menu.
 *
 * Revision 1.6  2004/02/03 19:15:08  LarsAC
 * OSD selection now jumps back to parent when collapsing.
 *
 * Revision 1.5  2004/02/03 00:13:24  LarsAC
 * Improved OSD handling of collapse/back
 *
 *
 ************************************************************
 */