diff options
author | Tobias Grimm <git@e-tobi.net> | 2010-02-07 22:07:47 +0100 |
---|---|---|
committer | Tobias Grimm <git@e-tobi.net> | 2010-02-08 02:01:01 +0100 |
commit | 60814863813b4f44b25e00244ef9d0b0414aea89 (patch) | |
tree | 8cf4a28dc5d9c271291d117b147d9e117eae4ad0 | |
parent | b277ac0d01dfef989c122d8954a551d18e715b92 (diff) | |
download | vdr-plugin-ttxtsubs-60814863813b4f44b25e00244ef9d0b0414aea89.tar.gz vdr-plugin-ttxtsubs-60814863813b4f44b25e00244ef9d0b0414aea89.tar.bz2 |
When replaying a recording, look up the manual page number assigned to the recordings channel
-rw-r--r-- | ttxtsubs.c | 21 | ||||
-rw-r--r-- | ttxtsubschannelsettings.h | 4 |
2 files changed, 24 insertions, 1 deletions
@@ -168,6 +168,7 @@ private: char mOldLanguage[4]; // language chosen from previous version int mOldHearingImpaired; // HI setting chosen from previous version bool mReplay; + tChannelID mReplayChannelId; // wait for channel switch sem_t chswitchwait; @@ -356,6 +357,20 @@ void cPluginTtxtsubs::Action(void) if (cn!=lastc) { StopTtxt(); lastc=0; + if (mReplay) { + cTtxtSubsChannelSetting *cs = TtxtSubsChannelSettings.Get(mReplayChannelId); + cString x = mReplayChannelId.ToString(); + if (cs && cs->PageMode() == PAGE_MODE_MANUAL) { + int tmp = cs->PageNumber(); + int page = (tmp / 100); + tmp = tmp % 100; + page = (page << 4) + (tmp / 10); + page = (page << 4) + tmp % 10; + StartTtxtPlay(page); + lastc=cn; + } + } + else { cChannel *c = Channels.GetByNumber(cn); if(c) { //int manual_page = TtxtSubsChannelSettings.Page(c->GetChannelID()); @@ -412,6 +427,7 @@ void cPluginTtxtsubs::Action(void) lastc=cn; //} } + } } } } @@ -445,8 +461,11 @@ void cPluginTtxtsubs::ChannelSwitch(const cDevice *Device, int ChannelNumber) void cPluginTtxtsubs::Replaying(const cControl *Control, const char *Name, const char *FileName, bool On) { //dprint("cPluginTtxtsubs::Replaying\n"); // XXX + cRecordingInfo recInfo(FileName) ; + recInfo.Read(); + mReplayChannelId = recInfo.ChannelID(); mReplay = On; - lastc=0; + lastc=-1; sem_post(&chswitchwait); } diff --git a/ttxtsubschannelsettings.h b/ttxtsubschannelsettings.h index 81dda6d..90048e9 100644 --- a/ttxtsubschannelsettings.h +++ b/ttxtsubschannelsettings.h @@ -46,8 +46,12 @@ public: class cTtxtSubsChannelSettings:public cConfig<cTtxtSubsChannelSetting> { public: + // TODO: This methode can be dropped when using only the ChannelID cTtxtSubsChannelSetting *Get(const cChannel *Channel) { tChannelID ChannelID=Channel->GetChannelID(); + return Get(ChannelID); + } + cTtxtSubsChannelSetting *Get(tChannelID ChannelID) { for (cTtxtSubsChannelSetting *p=First(); p; p=Next(p)) { if (p->ChannelID()==ChannelID) return p; } |