Home

Dokumentation

Impressum

Dokumentation VDR
 

Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

player.h

Go to the documentation of this file.
00001 
00010 #ifndef __PLAYER_H
00011 #define __PLAYER_H
00012 
00013 #include "device.h"
00014 #include "osd.h"
00015 
00016 
00018 class cPlayer {
00019   friend class cDevice;
00020 private:
00021   cDevice *device;
00022   ePlayMode playMode;
00023 protected:
00024   bool DevicePoll(cPoller &Poller, int TimeoutMs = 0) { return device ? device->Poll(Poller, TimeoutMs) : false; }
00025   void DeviceTrickSpeed(int Speed) { if (device) device->TrickSpeed(Speed); }
00026   void DeviceClear(void) { if (device) device->Clear(); }
00027   void DevicePlay(void) { if (device) device->Play(); }
00028   void DeviceFreeze(void) { if (device) device->Freeze(); }
00029   void DeviceMute(void) { if (device) device->Mute(); }
00030   void DeviceStillPicture(const uchar *Data, int Length) { if (device) device->StillPicture(Data, Length); }
00031   void Detach(void);
00032 
00038   virtual void Activate(bool On) {}
00039 
00045   int PlayVideo(const uchar *Data, int Length);
00046 
00050   void PlayAudio(const uchar *Data, int Length);
00051 
00052 public:
00053   cPlayer(ePlayMode PlayMode = pmAudioVideo);
00054   virtual ~cPlayer();
00055   bool IsAttached(void) { return device != NULL; }
00056 
00061   virtual bool GetIndex(int &Current, int &Total, bool SnapToIFrame = false) { return false; }
00062 
00070   virtual bool GetReplayMode(bool &Play, bool &Forward, int &Speed) { return false; }
00071 
00080   virtual int NumAudioTracks(void) const { return 0; }
00081 
00093   virtual const char **GetAudioTracks(int *CurrentTrack = NULL) const { return NULL; }
00094 
00100   virtual void SetAudioTrack(int Index) {}
00101 
00102   };
00103 
00105 class cControl : public cOsdObject {
00106 private:
00107   static cControl *control;
00108   bool attached;
00109   bool hidden;
00110 protected:
00111   cPlayer *player;
00112 public:
00113   cControl(cPlayer *Player, bool Hidden = false);
00114   virtual ~cControl();
00115   virtual void Hide(void) = 0;
00116   bool GetIndex(int &Current, int &Total, bool SnapToIFrame = false) { return player->GetIndex(Current, Total, SnapToIFrame); }
00117   bool GetReplayMode(bool &Play, bool &Forward, int &Speed) { return player->GetReplayMode(Play, Forward, Speed); }
00118   static void Launch(cControl *Control);
00119   static void Attach(void);
00120   static void Shutdown(void);
00121   static cControl *Control(void);
00122   };
00123 
00124 #endif //__PLAYER_H
00125 

Generated on Wed Feb 5 23:30:11 2003 for VDR by doxygen1.3-rc2