diff options
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | epg_item.c | 9 | ||||
-rw-r--r-- | monitor.c | 5 | ||||
-rw-r--r-- | setup-zaphistory.c | 5 | ||||
-rw-r--r-- | zaphistorychannel.c | 5 | ||||
-rw-r--r-- | zaphistoryosd.c | 35 | ||||
-rw-r--r-- | zaplist.c | 9 | ||||
-rw-r--r-- | zaplist.h | 10 |
8 files changed, 72 insertions, 8 deletions
@@ -1,5 +1,7 @@ VDR Plugin 'zaphistory' Revision History ---------------------------------------- +XXXX-XX-XX: Version 0.9.7 (Martin Schirrmacher) +- add support for vdr-2.3.1 2013-08-15: Version 0.9.6 (Martin Schirrmacher) - add options to set progress view - old text bar, VDRSymbols, percent @@ -63,10 +63,17 @@ bool cMenuMyScheduleItem::Update(bool Force) const cChannel* channel = zapChannel->GetChannel(); eTimerMatch OldTimerMatch = timerMatch; - cTimer* hasMatch = NULL; +#if APIVERSNUM >= 20301 + LOCK_TIMERS_READ + const cTimer* hasMatch = NULL; + if (event) + hasMatch = Timers->GetMatch(event, &timerMatch); +#else + cTimer* hasMatch = NULL; if (event) hasMatch = Timers.GetMatch(event, &timerMatch); +#endif if (Force || timerMatch != OldTimerMatch) { @@ -18,7 +18,12 @@ void cZapHistoryMonitor::ChannelSwitch(const cDevice *Device, int ChannelNumber, // Inform history, that channel has been switched if (ChannelNumber > 0 && Device->IsPrimaryDevice() && LiveView ) { +#if APIVERSNUM >= 20301 + LOCK_CHANNELS_READ; + ZapHistory.ChannelSwitch( Channels->GetByNumber (ChannelNumber) ); +#else ZapHistory.ChannelSwitch( Channels.GetByNumber (ChannelNumber) ); +#endif } } diff --git a/setup-zaphistory.c b/setup-zaphistory.c index 93ba52e..b34c3f8 100644 --- a/setup-zaphistory.c +++ b/setup-zaphistory.c @@ -73,7 +73,12 @@ cMenuSetupZapHistory::cMenuSetupZapHistory(void) // add menu items SetSection(tr("Zaphistory")); +#if APIVERSNUM >= 20301 + LOCK_CHANNELS_READ; + Add(new cMenuEditIntItem(tr("Number of entries"), &ZapHistorySetup.EntryCount, 0, Channels->Count() )); +#else Add(new cMenuEditIntItem(tr("Number of entries"), &ZapHistorySetup.EntryCount, 0, Channels.Count() )); +#endif Add(new cMenuEditBoolItem(tr("Hide mainmenu entry"), &ZapHistorySetup.HideMainMenu)); Add(new cMenuEditStraItem(tr("Default view"), &ZapHistorySetup.DummyDefaultView, 2, viewStrs)); Add(new cMenuEditStraItem(tr("Default sort"), &ZapHistorySetup.DummyDefaultSort, 3, sortStrs)); diff --git a/zaphistorychannel.c b/zaphistorychannel.c index 1049f7e..dc730a0 100644 --- a/zaphistorychannel.c +++ b/zaphistorychannel.c @@ -21,7 +21,12 @@ cZapHistoryChannel::cZapHistoryChannel() { // Getter/Setter for wrapped cChannel const cChannel *cZapHistoryChannel::GetChannel() { +#if APIVERSNUM >= 20301 + LOCK_CHANNELS_READ; + return Channels->GetByChannelID(channelID); +#else return Channels.GetByChannelID(channelID); +#endif } tChannelID cZapHistoryChannel::GetChannelID() { diff --git a/zaphistoryosd.c b/zaphistoryosd.c index 95ee375..71d45e6 100644 --- a/zaphistoryosd.c +++ b/zaphistoryosd.c @@ -79,6 +79,14 @@ void cMenuZappedChannels::SortInfoItem() { // Builds the EPG based view void cMenuZappedChannels::SetupEPGView() { // Get schedules to retrieve EPG data +#if APIVERSNUM >= 20301 + LOCK_SCHEDULES_READ; + if( Schedules == NULL ) { + esyslog("ZAPHISTORY: could not get schedules - switching to statistic view"); + SetupStatisticView(); + return; + } +#else cSchedulesLock *schedLock = new cSchedulesLock(); const cSchedules *schedules = cSchedules::Schedules( *schedLock ); @@ -88,6 +96,7 @@ void cMenuZappedChannels::SetupEPGView() { SetupStatisticView(); return; } +#endif // Set tab-stops for menu columns SetCols( 10, 6, 6, 4); @@ -108,7 +117,9 @@ void cMenuZappedChannels::SetupEPGView() { // As long as history counter as not greater that maxEntry from setup if (ZapHistorySetup.EntryCount == 0 || historyPosition <= ZapHistorySetup.EntryCount) { // get schedule for history item -#if VDRVERSNUM >= 10338 +#if APIVERSNUM >= 20301 + const cSchedule *schedule = Schedules->GetSchedule( zapChannel->GetChannel() ); +#elif VDRVERSNUM >= 10338 const cSchedule *schedule = schedules->GetSchedule( zapChannel->GetChannel() ); #else const cSchedule *schedule = schedules->GetSchedule( zapChannel->GetChannelID() ); @@ -126,9 +137,10 @@ void cMenuZappedChannels::SetupEPGView() { historyPosition++; } +#if APIVERSNUM < 20301 // release schedules delete schedLock; - +#endif // buttons SetHelp(tr("Button$Sort"), tr("Button$Statistic"), tr("Button$Reset"), tr("Button$Info") ); } @@ -200,23 +212,36 @@ eOSState cMenuZappedChannels::ShowInfo() { if (channel == NULL || channel->GetChannel() == NULL) return osUnknown; - +#if APIVERSNUM >= 20301 + LOCK_SCHEDULES_READ; +#else // Get schedules to retrieve EPG data cSchedulesLock *schedLock = new cSchedulesLock(); const cSchedules *schedules = cSchedules::Schedules( *schedLock ); +#endif -#if VDRVERSNUM >= 10338 +#if APIVERSNUM >= 20301 + const cSchedule *schedule = Schedules->GetSchedule( channel->GetChannel() ); +#elif VDRVERSNUM >= 10338 const cSchedule *schedule = schedules->GetSchedule( channel->GetChannel() ); #else const cSchedule *schedule = schedules->GetSchedule( channel->GetChannel()->GetChannelID() ); #endif + +#if APIVERSNUM < 20301 delete schedLock; +#endif if (schedule == NULL) return osUnknown; +#if APIVERSNUM >= 20301 + LOCK_TIMERS_READ; + LOCK_CHANNELS_READ; + return AddSubMenu( new cMenuEvent(Timers, Channels, schedule->GetEventAround(time(NULL)) ) ); +#else return AddSubMenu( new cMenuEvent(schedule->GetEventAround(time(NULL)) ) ); - +#endif } eOSState cMenuZappedChannels::ProcessKey(eKeys Key) @@ -13,7 +13,11 @@ cZapHistory ZapHistory; +#if APIVERSNUM >= 20301 +cZapHistoryChannel* cZapHistory::FindChannel(const cChannel *channel) { +#else cZapHistoryChannel* cZapHistory::FindChannel(cChannel *channel) { +#endif if (channel == NULL) return NULL; @@ -100,8 +104,11 @@ void cZapHistory::UpdateWatchTime() { void cZapHistory::ViewContinue() { lastSwitch = time(NULL); } - +#if APIVERSNUM >= 20301 +void cZapHistory::ChannelSwitch( const cChannel *channel ) { +#else void cZapHistory::ChannelSwitch( cChannel *channel ) { +#endif cZapHistoryChannel *zapChan = FindChannel( channel ); // Channel not in history management @@ -24,13 +24,21 @@ class cZapHistory : public cConfig<cZapHistoryChannel> { cZapHistoryChannel *currentChannel; time_t lastSwitch; +#if APIVERSNUM >= 20301 + cZapHistoryChannel* FindChannel( const cChannel *channel ); +#else cZapHistoryChannel* FindChannel( cChannel *channel ); +#endif cZapHistorySortMode sortMode; void UpdateHistory( cZapHistoryChannel *zapChan); public: cZapHistory(); - void ChannelSwitch( cChannel *channel ); +#if APIVERSNUM >= 20301 + void ChannelSwitch( const cChannel *channel ); +#else + void ChannelSwitch( cChannel *channel ); +#endif void ViewInterrupted(); void ViewContinue(); void UpdateWatchTime(); |