GetLastValidChannel

This commit is contained in:
kamel5 2019-07-11 12:41:19 +02:00
parent 1df9641621
commit 700543b394
3 changed files with 12 additions and 13 deletions

View File

@ -1,4 +1,5 @@
#include <vector>
#include "config.h"
#include "channelgroups.h"
cChannelGroups::cChannelGroups(void) {
@ -145,9 +146,15 @@ void cChannelGroups::CreateGroupGrid(const char *name, int number, int start, in
}
int cChannelGroups::GetLastValidChannel(void) {
if (channelGroups.size() > 0)
return channelGroups[channelGroups.size()-1].StopChannel();
return 0;
if (config.hideLastGroup && channelGroups.size() > 0) {
return channelGroups[channelGroups.size() - 1].StopChannel();
}
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
return Channels->MaxNumber();
#else
return Channels.MaxNumber();
#endif
}
void cChannelGroups::DumpGroups(void) {

View File

@ -3,6 +3,7 @@
#include <vector>
#include <vdr/channels.h>
#include "config.h"
#include "channelgroup.h"
// --- cChannelGroups -------------------------------------------------------------

View File

@ -10,16 +10,7 @@ cChannelJump::cChannelJump(cChannelGroups *channelGroups) {
this->channelGroups = channelGroups;
pixmapText = NULL;
channel = 0;
if (!config.hideLastGroup) {
#if VDRVERSNUM >= 20301
LOCK_CHANNELS_READ;
maxChannels = Channels->MaxNumber();
#else
maxChannels = Channels.MaxNumber();
#endif
} else {
maxChannels = channelGroups->GetLastValidChannel();
}
maxChannels = channelGroups->GetLastValidChannel();
timeout = Setup.ChannelEntryTimeout;
startTime = cTimeMs::Now();
SetPixmaps();