menu.h
author nathan
Sat, 29 Dec 2007 14:49:09 +0100
branchtrunk
changeset 2 4c1f7b705009
parent 0 474a1293c3c0
child 22 93aaf15c145a
permissions -rw-r--r--
release 0.10.1
     1 /*
     2  * MP3/MPlayer plugin to VDR (C++)
     3  *
     4  * (C) 2001-2006 Stefan Huelswitt <s.huelswitt@gmx.de>
     5  *
     6  * This code is free software; you can redistribute it and/or
     7  * modify it under the terms of the GNU General Public License
     8  * as published by the Free Software Foundation; either version 2
     9  * of the License, or (at your option) any later version.
    10  *
    11  * This code is distributed in the hope that it will be useful,
    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    14  * GNU General Public License for more details.
    15  *
    16  * You should have received a copy of the GNU General Public License
    17  * along with this program; if not, write to the Free Software
    18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    19  * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
    20  */
    21 
    22 #ifndef ___MENU_H
    23 #define ___MENU_H
    24 
    25 #include "common.h"
    26 #if APIVERSNUM >= 10307
    27 #include <vdr/osdbase.h>
    28 #else
    29 #include <vdr/osd.h>
    30 #endif
    31 
    32 // ----------------------------------------------------------------
    33 
    34 void Status(const char *text);
    35 void Error(const char *text);
    36 void Info(const char *text);
    37 
    38 // ----------------------------------------------------------------
    39 
    40 class cFileSources;
    41 class cFileSource;
    42 class cFileObj;
    43 class cDirList;
    44 
    45 // ----------------------------------------------------------------
    46 
    47 class cMenuBrowse : public cOsdMenu {
    48 private:
    49   eOSState Select(bool isred);
    50   eOSState Parent(void);
    51   bool LoadDir(const char *dir);
    52 protected:
    53   static cFileObj *lastselect;
    54   //
    55   cDirList *list;
    56   cFileSource *source;
    57   bool dirselectable, withID3;
    58   char *currentdir, *parent;
    59   const char * const *excl;
    60 //
    61   bool NewDir(const char *dir);
    62   void SetSource(cFileSource *Source);
    63   cFileObj *CurrentItem(void);
    64   virtual void SetButtons(void);
    65   virtual eOSState ID3Info(void);
    66   virtual eOSState ProcessStdKey(eKeys Key, eOSState state);
    67 public:
    68   cMenuBrowse(cFileSource *Source, bool Dirselect, bool WithID3, const char *title, const char * const *Excl);
    69   ~cMenuBrowse();
    70   static cFileObj *GetSelected(void) { return lastselect; }
    71   };
    72 
    73 // ----------------------------------------------------------------
    74 
    75 class cMenuSource : public cOsdMenu {
    76 private:
    77   static cFileSource *selected;
    78   cFileSource *current;
    79   //
    80   eOSState Mount(void);
    81   eOSState Unmount(void);
    82   eOSState Eject(void);
    83   eOSState Select(void);
    84   bool DoMount(cFileSource *src);
    85   bool CheckMount(void);
    86 public:
    87   cMenuSource(cFileSources *Sources, const char *title);
    88   virtual eOSState ProcessKey(eKeys Key);
    89   static cFileSource *GetSelected(void) { return selected; }
    90   };
    91 
    92 // ----------------------------------------------------------------
    93 
    94 class cProgressBar : public cBitmap {
    95 public:
    96   cProgressBar(int Width, int Height, int Current, int Total);
    97   };
    98 
    99 #endif //___MENU_H