
#ifndef __XINE_OSD_H__
#define __XINE_OSD_H__

#include <vdr/osdbase.h>
#include <vdr/status.h>
#include <vdr/debugmacros.h>
#include <string>
#include <vector>
#include <time.h>

namespace Reel{
	namespace XineMediaplayer{

		using namespace std;

		class Control; // forward declaration
		class cXineStatus;
                
                enum { NO_PLUGIN=0, FILEBROWSER_PLUGIN, SHOUTCAST_PLUGIN, IPOD_PLUGIN, MMFILES_PLUGIN};
                enum eXineControl { xine_browse, xine_edit, xine_exit };

                void            CallFilebrowser(eXineControl);    //call filebrowser plugin

		class cXineOsd : public cOsdMenu
		{
			private:
                                int FunctionMode;                       // For more options, Normal/Shuffle/Repeat

				int currentlySelected; 			// position of the selected mediafile in the playlist
				int currentlyPlaying; 			// position of the mediafile in the playlist, that is being played
				int index;
				int total;


				cXineStatus		*xineStatus;
                                void ShowPlayMode(bool force = false);
			public:

				// kPause was pressed
				static int kPausePressed;

				static char		*mrl;
				static bool 		isPlaylist; 
                static int      browserInstance;
				static std::vector<std::string> 	playListEntries; // the playlist
                                static std::vector<std::string>   nameListEntries; // the display names of each playlist entry
				static Control		*control;	 // pointer to the current Control
				static bool		isPlaying;	 // if Not playing donot update OSD
				static bool		isOpen;	 	 // Donot show Skins.Message() if OSD is open when playing-next file
                                static bool             closeOsd;
                                static bool             firstOpen;
				static bool		isNew;	 	 // needs refresh of display?
				static int		k_blue;	 	 // which plugin to call: filebrowser/shoutcast ?
				static std::string      openError;

				static void 		ClearStaticVariables(); // clears the above variables, eg. when nomore xinemediaplayer is running

				cXineOsd();
				~cXineOsd();

				void		ShowEntries(); 	// display the whole playlist
				void		UpdateEntries(); 	//updates  progressBar 
                                void            CallExt_Plugin();    //call External plugin: filebrowser/shoutcast
                                void            SetHelpButtons();    //set help  "filebrowser"/"shoutcast"
				eOSState 	ProcessKey(eKeys Key);
                                
                                // Only filebrowser can have different modes
                                bool            CanHaveDifferentModes();

				//	void		MsgSetVolume(int, bool); //cStatus

				static time_t lastVolShownTime;
		};


		class cXineStatus: public cStatus
		{
			protected:
				void SetVolume(int vol, bool abs);
		};


	} //namespace xinemediaplayer
} //namespace Reel

#endif

