diff options
-rw-r--r-- | CONTRIBUTORS | 2 | ||||
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | device.c | 10 | ||||
-rw-r--r-- | device.h | 4 | ||||
-rw-r--r-- | menu.c | 4 | ||||
-rw-r--r-- | player.h | 7 | ||||
-rw-r--r-- | status.c | 8 | ||||
-rw-r--r-- | status.h | 6 |
8 files changed, 36 insertions, 7 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 16fa7cc9..55c5b272 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1968,6 +1968,8 @@ Petri Hintukainen <Petri.Hintukainen@hut.fi> for pointing out that plugins from cRemote::PutMacro() and cRemote::CallPlugin() need to be handled separately for making cTimeMs use the monotonic clock + for implementing the cStatus, cDevice and cPlayer functions for setting subtitle + tracks in plugins Marcel Schaeben <mts280@gmx.de> for his "Easy Input" patch @@ -5631,3 +5631,5 @@ Video Disk Recorder Revision History recordings are removed, that actually are on the video directory file system(s). This prevents VDR from accidentally deleting recordings on other file systems, which would not add any free space to the video directory. +- Implemented the cStatus, cDevice and cPlayer functions for setting subtitle tracks + in plugins (thanks to Petri Hintukainen). @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 1.152 2008/02/09 16:10:56 kls Exp $ + * $Id: device.c 1.153 2008/02/16 13:52:11 kls Exp $ */ #include "device.h" @@ -890,6 +890,10 @@ void cDevice::SetAudioTrackDevice(eTrackType Type) { } +void cDevice::SetSubtitleTrackDevice(eTrackType Type) +{ +} + bool cDevice::ToggleMute(void) { int OldVolume = volume; @@ -1037,6 +1041,10 @@ bool cDevice::SetCurrentSubtitleTrack(eTrackType Type, bool Manual) DELETENULL(dvbSubtitleConverter); } DELETENULL(liveSubtitle); + if (player) + player->SetSubtitleTrack(currentSubtitleTrack, GetTrack(currentSubtitleTrack)); + else + SetSubtitleTrackDevice(currentSubtitleTrack); if (currentSubtitleTrack != ttNone && !Replaying() && !Transferring()) { const tTrackId *TrackId = GetTrack(currentSubtitleTrack); if (TrackId && TrackId->id) { @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.h 1.89 2008/02/09 16:05:24 kls Exp $ + * $Id: device.h 1.90 2008/02/16 13:50:11 kls Exp $ */ #ifndef __DEVICE_H @@ -386,6 +386,8 @@ private: protected: virtual void SetAudioTrackDevice(eTrackType Type); ///< Sets the current audio track to the given value. + virtual void SetSubtitleTrackDevice(eTrackType Type); + ///< Sets the current subtitle track to the given value. public: void ClrAvailableTracks(bool DescriptionsOnly = false, bool IdsOnly = false); ///< Clears the list of currently availabe tracks. If DescriptionsOnly @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 1.476 2008/02/16 12:04:12 kls Exp $ + * $Id: menu.c 1.477 2008/02/16 13:53:26 kls Exp $ */ #include "menu.h" @@ -3702,7 +3702,7 @@ void cDisplaySubtitleTracks::Show(void) { displayTracks->SetTrack(track, descriptions); displayTracks->Flush(); - //cStatus::MsgSetSubtitleTrack(track, descriptions); //TODO better make a more general cStatus::MsgSetTrack(tr("Subtitles"), track, descriptions) + cStatus::MsgSetSubtitleTrack(track, descriptions); } cDisplaySubtitleTracks *cDisplaySubtitleTracks::Create(void) @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: player.h 1.20 2007/10/13 12:18:10 kls Exp $ + * $Id: player.h 1.21 2008/02/16 13:50:11 kls Exp $ */ #ifndef __PLAYER_H @@ -22,6 +22,7 @@ protected: void DeviceClrAvailableTracks(bool DescriptionsOnly = false) { if (device) device->ClrAvailableTracks(DescriptionsOnly); } bool DeviceSetAvailableTrack(eTrackType Type, int Index, uint16_t Id, const char *Language = NULL, const char *Description = NULL) { return device ? device->SetAvailableTrack(Type, Index, Id, Language, Description) : false; } bool DeviceSetCurrentAudioTrack(eTrackType Type) { return device ? device->SetCurrentAudioTrack(Type) : false; } + bool DeviceSetCurrentSubtitleTrack(eTrackType Type) { return device ? device->SetCurrentSubtitleTrack(Type) : false; } bool DevicePoll(cPoller &Poller, int TimeoutMs = 0) { return device ? device->Poll(Poller, TimeoutMs) : false; } bool DeviceFlush(int TimeoutMs = 0) { return device ? device->Flush(TimeoutMs) : true; } bool DeviceHasIBPTrickSpeed(void) { return device ? device->HasIBPTrickSpeed() : false; } @@ -58,6 +59,10 @@ public: // Sets the current audio track to the given value. // This is just a virtual hook for players that need to do special things // in order to switch audio tracks. + virtual void SetSubtitleTrack(eTrackType Type, const tTrackId *TrackId) {} + // Sets the current subtitle track to the given value. + // This is just a virtual hook for players that need to do special things + // in order to switch subtitle tracks. }; class cControl : public cOsdObject { @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: status.c 1.8 2005/12/31 15:10:10 kls Exp $ + * $Id: status.c 1.9 2008/02/16 13:50:15 kls Exp $ */ #include "status.h" @@ -59,6 +59,12 @@ void cStatus::MsgSetAudioChannel(int AudioChannel) sm->SetAudioChannel(AudioChannel); } +void cStatus::MsgSetSubtitleTrack(int Index, const char * const *Tracks) +{ + for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) + sm->SetSubtitleTrack(Index, Tracks); +} + void cStatus::MsgOsdClear(void) { for (cStatus *sm = statusMonitors.First(); sm; sm = statusMonitors.Next(sm)) @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: status.h 1.10 2007/08/12 10:34:40 kls Exp $ + * $Id: status.h 1.11 2008/02/16 13:50:15 kls Exp $ */ #ifndef __STATUS_H @@ -44,6 +44,9 @@ protected: virtual void SetAudioChannel(int AudioChannel) {} // The audio channel has been set to the given value. // 0=stereo, 1=left, 2=right, -1=no information available. + virtual void SetSubtitleTrack(int Index, const char * const *Tracks) {} + // The subtitle track has been set to the one given by Index, which + // points into the Tracks array of strings. Tracks is NULL terminated. virtual void OsdClear(void) {} // The OSD has been cleared. virtual void OsdTitle(const char *Title) {} @@ -77,6 +80,7 @@ public: static void MsgSetVolume(int Volume, bool Absolute); static void MsgSetAudioTrack(int Index, const char * const *Tracks); static void MsgSetAudioChannel(int AudioChannel); + static void MsgSetSubtitleTrack(int Index, const char * const *Tracks); static void MsgOsdClear(void); static void MsgOsdTitle(const char *Title); static void MsgOsdStatusMessage(const char *Message); |