diff options
| author | Klaus Schmidinger <vdr@tvdr.de> | 2012-04-28 13:09:42 +0200 | 
|---|---|---|
| committer | Klaus Schmidinger <vdr@tvdr.de> | 2012-04-28 13:09:42 +0200 | 
| commit | 97e242d1b54e0bfac3455ddeded37136156fea36 (patch) | |
| tree | e82354fa113c552f0bddb1c1a3d1c209ac8258c3 | |
| parent | 109586571a3cd6b011b6c2e348e3403a0d37c081 (diff) | |
| download | vdr-97e242d1b54e0bfac3455ddeded37136156fea36.tar.gz vdr-97e242d1b54e0bfac3455ddeded37136156fea36.tar.bz2 | |
The new functions cControl::GetRecording() and cControl::GetHeader() can be used to retrieve information about what the current player is playing
| -rw-r--r-- | HISTORY | 2 | ||||
| -rw-r--r-- | PLUGINS/src/pictures/HISTORY | 4 | ||||
| -rw-r--r-- | PLUGINS/src/pictures/pictures.c | 4 | ||||
| -rw-r--r-- | PLUGINS/src/pictures/player.c | 7 | ||||
| -rw-r--r-- | PLUGINS/src/pictures/player.h | 3 | ||||
| -rw-r--r-- | menu.c | 9 | ||||
| -rw-r--r-- | menu.h | 3 | ||||
| -rw-r--r-- | player.c | 12 | ||||
| -rw-r--r-- | player.h | 14 | 
9 files changed, 50 insertions, 8 deletions
| @@ -7091,3 +7091,5 @@ Video Disk Recorder Revision History    (reported by Lars Hanisch).  - cControl::Control() now has an additional boolean parameter, which can be set to    true to get the current player control even if it is hidden. +- The new functions cControl::GetRecording() and cControl::GetHeader() can be used +  to retrieve information about what the current player is playing. diff --git a/PLUGINS/src/pictures/HISTORY b/PLUGINS/src/pictures/HISTORY index 19c968ad..70f61456 100644 --- a/PLUGINS/src/pictures/HISTORY +++ b/PLUGINS/src/pictures/HISTORY @@ -71,3 +71,7 @@ VDR Plugin 'pictures' Revision History  2012-02-27: Version 0.1.2  - Removed an obsolete command line option. + +2012-04-2r8 Version 0.1.3 + +- Added cPictureControl::GetHeader(). diff --git a/PLUGINS/src/pictures/pictures.c b/PLUGINS/src/pictures/pictures.c index 57121b5e..77df0d9a 100644 --- a/PLUGINS/src/pictures/pictures.c +++ b/PLUGINS/src/pictures/pictures.c @@ -3,7 +3,7 @@   *   * See the README file for copyright information and how to reach the author.   * - * $Id: pictures.c 2.5 2012/02/27 12:35:45 kls Exp $ + * $Id: pictures.c 2.6 2012/04/28 11:58:42 kls Exp $   */  #include <getopt.h> @@ -11,7 +11,7 @@  #include "menu.h"  #include "player.h" -static const char *VERSION       = "0.1.2"; +static const char *VERSION       = "0.1.3";  static const char *DESCRIPTION   = trNOOP("A simple picture viewer");  static const char *MAINMENUENTRY = trNOOP("Pictures"); diff --git a/PLUGINS/src/pictures/player.c b/PLUGINS/src/pictures/player.c index 4b289ac9..6048d4cb 100644 --- a/PLUGINS/src/pictures/player.c +++ b/PLUGINS/src/pictures/player.c @@ -3,7 +3,7 @@   *   * See the README file for copyright information and how to reach the author.   * - * $Id: player.c 2.1 2011/02/20 17:15:25 kls Exp $ + * $Id: player.c 2.2 2012/04/28 11:58:15 kls Exp $   */  #include "player.h" @@ -204,6 +204,11 @@ void cPictureControl::DisplayCaption(void)    osd->Flush();  } +cString cPictureControl::GetHeader(void) +{ +  return tr("Pictures"); +} +  eOSState cPictureControl::ProcessKey(eKeys Key)  {    switch (Key) { diff --git a/PLUGINS/src/pictures/player.h b/PLUGINS/src/pictures/player.h index ab201bd8..7a0b401f 100644 --- a/PLUGINS/src/pictures/player.h +++ b/PLUGINS/src/pictures/player.h @@ -3,7 +3,7 @@   *   * See the README file for copyright information and how to reach the author.   * - * $Id: player.h 1.1 2008/01/13 11:29:27 kls Exp $ + * $Id: player.h 2.1 2012/04/28 11:56:01 kls Exp $   */  #ifndef _PLAYER_H @@ -39,6 +39,7 @@ private:  public:    cPictureControl(cPictureEntry *Pictures, const cPictureEntry *PictureEntry, bool SlideShow = false);    virtual ~cPictureControl(); +  virtual cString GetHeader(void);    virtual eOSState ProcessKey(eKeys Key);    static bool Active(void) { return active > 0; }    static const char *LastDisplayed(void); @@ -4,7 +4,7 @@   * See the main source file 'vdr.c' for copyright information and   * how to reach the author.   * - * $Id: menu.c 2.52 2012/04/25 09:42:54 kls Exp $ + * $Id: menu.c 2.53 2012/04/28 11:13:09 kls Exp $   */  #include "menu.h" @@ -4773,6 +4773,13 @@ cOsdObject *cReplayControl::GetInfo(void)    return NULL;  } +const cRecording *cReplayControl::GetRecording(void) +{ +  if (const cRecording *Recording = Recordings.GetByName(LastReplayed())) +     return Recording; +  return NULL; +} +  eOSState cReplayControl::ProcessKey(eKeys Key)  {    if (!Active()) @@ -4,7 +4,7 @@   * See the main source file 'vdr.c' for copyright information and   * how to reach the author.   * - * $Id: menu.h 2.7 2012/04/22 15:08:58 kls Exp $ + * $Id: menu.h 2.8 2012/04/28 11:13:03 kls Exp $   */  #ifndef __MENU_H @@ -283,6 +283,7 @@ public:    virtual ~cReplayControl();    void Stop(void);    virtual cOsdObject *GetInfo(void); +  virtual const cRecording *GetRecording(void);    virtual eOSState ProcessKey(eKeys Key);    virtual void Show(void);    virtual void Hide(void); @@ -4,7 +4,7 @@   * See the main source file 'vdr.c' for copyright information and   * how to reach the author.   * - * $Id: player.c 2.1 2012/04/28 10:56:00 kls Exp $ + * $Id: player.c 2.2 2012/04/28 11:52:50 kls Exp $   */  #include "player.h" @@ -60,6 +60,16 @@ cOsdObject *cControl::GetInfo(void)    return NULL;  } +const cRecording *cControl::GetRecording(void) +{ +  return NULL; +} + +cString cControl::GetHeader(void) +{ +  return ""; +} +  cControl *cControl::Control(bool Hidden)  {    cMutexLock MutexLock(&mutex); @@ -4,7 +4,7 @@   * See the main source file 'vdr.c' for copyright information and   * how to reach the author.   * - * $Id: player.h 2.5 2012/04/28 10:56:00 kls Exp $ + * $Id: player.h 2.6 2012/04/28 13:04:17 kls Exp $   */  #ifndef __PLAYER_H @@ -86,6 +86,18 @@ public:    virtual ~cControl();    virtual void Hide(void) = 0;    virtual cOsdObject *GetInfo(void); +         ///< Returns an OSD object that displays information about the currently +         ///< played programme. If no such information is available, NULL will be +         ///< returned. +  virtual const cRecording *GetRecording(void); +         ///< Returns the cRecording that is currently being replayed, or NULL if +         ///< this player is not playing a cRecording. +  virtual cString GetHeader(void); +         ///< This can be used by players that don't play a cRecording, but rather +         ///< do something completely different. The resulting string may be used by +         ///< skins as a last resort, in case they want to display the state of the +         ///< current player. The return value is expected to be a short, single line +         ///< string. The default implementation returns an empty string.    double FramesPerSecond(void) { return player->FramesPerSecond(); }    bool GetIndex(int &Current, int &Total, bool SnapToIFrame = false) { return player->GetIndex(Current, Total, SnapToIFrame); }    bool GetReplayMode(bool &Play, bool &Forward, int &Speed) { return player->GetReplayMode(Play, Forward, Speed); } | 
