diff options
Diffstat (limited to 'recmenuitem.c')
-rw-r--r-- | recmenuitem.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/recmenuitem.c b/recmenuitem.c index cc7d7f8..83e7dd7 100644 --- a/recmenuitem.c +++ b/recmenuitem.c @@ -1943,14 +1943,21 @@ eRecMenuState cRecMenuItemEvent::ProcessKey(eKeys Key) { // --- cRecMenuItemChannelChooser ------------------------------------------------------- cRecMenuItemChannelChooser::cRecMenuItemChannelChooser(cString text, - const cChannel *initialChannel, bool active, int *callback, eRecMenuState action) { selectable = true; this->text = text; - this->channel = initialChannel; - if (initialChannel) +#if VDRVERSNUM >= 20301 + { + LOCK_CHANNELS_READ; + channels = Channels; + } +#else + channels = &Channels; +#endif + this->channel = channels->GetByNumber(*callback); + if (callback) initialChannelSet = true; else initialChannelSet = false; @@ -2029,12 +2036,6 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) { if (!channel) return rmsConsumed; const cChannel *prev = channel; -#if VDRVERSNUM >= 20301 - LOCK_CHANNELS_READ; - const cChannels* channels = Channels; -#else - const cChannels* channels = &Channels; -#endif const cChannel *firstChannel = channels->First(); if(firstChannel->GroupSep()) firstChannel = channels->Next(firstChannel); @@ -2060,12 +2061,6 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) { break; } case kRight: { fresh = true; -#if VDRVERSNUM >= 20301 - LOCK_CHANNELS_READ; - const cChannels* channels = Channels; -#else - const cChannels* channels = &Channels; -#endif if (!channel) { channel = channels->First(); if(channel->GroupSep()) @@ -2094,12 +2089,7 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) { fresh = false; } channelNumber = channelNumber * 10 + (Key - k0); -#if VDRVERSNUM >= 20301 - LOCK_CHANNELS_READ; - const cChannel *chanNew = Channels->GetByNumber(channelNumber); -#else - const cChannel *chanNew = Channels.GetByNumber(channelNumber); -#endif + chanNew = channels->GetByNumber(channelNumber); if (chanNew) { channel = chanNew; DrawValue(); |