From 464b109c8f60f26f4cb3aaee0b3b42ef3c9ae917 Mon Sep 17 00:00:00 2001 From: Martin Schirrmacher Date: Mon, 10 Jun 2013 16:53:07 +0200 Subject: fix save last channel selection in groups --- HISTORY | 3 ++ osdmenu.c | 144 +++++++++++++++++++++++++++++++------------------------------- osdmenu.h | 1 + 3 files changed, 75 insertions(+), 73 deletions(-) diff --git a/HISTORY b/HISTORY index 487806e..c4ec493 100644 --- a/HISTORY +++ b/HISTORY @@ -1,5 +1,8 @@ VDR Plugin 'neutrinoepg' Revision History +2013-XX-XX: Version 0.3.5 +- [Fix] Speicherung der letzten Kanalauswahl in den Gruppen + 2013-05-05: Version 0.3.4 - [Fix] Bufferoverflow bei Tastendruck 0 - [Feature] Beschleunigter Start des Plugin, besonders bei großen channels.conf mit vielen Gruppen diff --git a/osdmenu.c b/osdmenu.c index 328a85e..4a6ae6a 100644 --- a/osdmenu.c +++ b/osdmenu.c @@ -9,6 +9,8 @@ int *CurrentGroupChannel; int *FirstGroupChannel; int *LastGroupChannel; +int LastMaxGroup; + int ChannelsShown; int ChannelsBefore; int ChannelsAfter; @@ -67,85 +69,81 @@ myOsdMenu::myOsdMenu() : cOsdMenu("") ChannelsAfter = (ChannelsShown / 2)-1; } - // Count the groups and channels - int GroupCount = 0; - for(cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) - { - if( Channel->GroupSep() ) - GroupCount++; - } - MaxGroup = GroupCount; - - if( !Channels.First()->GroupSep() ) - MaxGroup++; - - //syslog(LOG_ERR, "neutrinoepg: MaxGroup %d", MaxGroup); - - // Hide Groups? - if( HideGroupsAt > MaxGroup ) - HideGroupsAt = MaxGroup; - if( HideGroupsAt < 1 ) - HideGroupsAt = 0; - if( HideGroupsAt > 0 ) - { - MaxGroup -= MaxGroup - HideGroupsAt; - } - - //syslog(LOG_ERR, "neutrinoepg: HideGroup %d MaxGroup %d", HideGroupsAt, MaxGroup); + // Count the groups and channels + int GroupCount = 0; + for(cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) + { + if( Channel->GroupSep() ) + GroupCount++; + } + MaxGroup = GroupCount; + + if( !Channels.First()->GroupSep() ) + MaxGroup++; + //syslog(LOG_ERR, "neutrinoepg: MaxGroup %d", MaxGroup); + // Hide Groups? + if( HideGroupsAt > MaxGroup ) + HideGroupsAt = MaxGroup; + if( HideGroupsAt < 1 ) + HideGroupsAt = 0; + if( HideGroupsAt > 0 ) + MaxGroup -= MaxGroup - HideGroupsAt; + + // test for different group count + if( LastMaxGroup != MaxGroup ) + { + //:(LOG_ERR, "neutrinoepg: HideGroup %d MaxGroup %d", HideGroupsAt, MaxGroup); - if( GroupIndex != NULL ) - delete[] GroupIndex; - if( CurrentGroupChannel != NULL ) - delete[] CurrentGroupChannel; - if( FirstGroupChannel != NULL ) - delete[] FirstGroupChannel; - if( LastGroupChannel != NULL ) - delete[] LastGroupChannel; - - // store max group count and add a little reserve - GroupIndex = new int[MaxGroup+1]; - CurrentGroupChannel = new int[MaxGroup+1]; - FirstGroupChannel = new int[MaxGroup+1]; - LastGroupChannel = new int[MaxGroup+1]; - - for( int i = 0; i < MaxGroup; i++) - { - CurrentGroupChannel[i] = -1; - FirstGroupChannel[i] = -1; - LastGroupChannel[i] = -1; - } + if( GroupIndex != NULL ) + delete[] GroupIndex; + if( CurrentGroupChannel != NULL ) + delete[] CurrentGroupChannel; + if( FirstGroupChannel != NULL ) + delete[] FirstGroupChannel; + if( LastGroupChannel != NULL ) + delete[] LastGroupChannel; + + // store max group count and add a little reserve + GroupIndex = new int[MaxGroup+1]; + CurrentGroupChannel = new int[MaxGroup+1]; + FirstGroupChannel = new int[MaxGroup+1]; + LastGroupChannel = new int[MaxGroup+1]; + + for( int i = 0; i < MaxGroup; i++) + { + CurrentGroupChannel[i] = -1; + FirstGroupChannel[i] = -1; + LastGroupChannel[i] = -1; + } - int index = 0; - if( FirstChannelsHasGroup() == false ) - { - GroupIndex[0] = -1; - index = 1; - } - for( cChannel *Channel = Channels.First(); Channel && index < MaxGroup; Channel = Channels.Next(Channel) ) + int index = 0; + if( FirstChannelsHasGroup() == false ) + { + GroupIndex[0] = -1; + index = 1; + } + for( cChannel *Channel = Channels.First(); Channel && index < MaxGroup; Channel = Channels.Next(Channel) ) + { + if( Channel->GroupSep() ) { - if( Channel->GroupSep() ) - { - GroupIndex[index] = Channel->Index(); - index++; - } + GroupIndex[index] = Channel->Index(); + index++; } + } - for( int Group = 0; Group < MaxGroup; Group++) - { - if( CurrentGroupChannel[Group] == -1 ) - { - CurrentGroupChannel[Group] = GetFirstChannelOfGroup(Group); - } - if( FirstGroupChannel[Group] == -1 ) - { - FirstGroupChannel[Group] = GetFirstChannelOfGroup(Group); - } - if( LastGroupChannel[Group] == -1 ) - { - LastGroupChannel[Group] = GetLastChannelOfGroup(Group); - } - } + for( int Group = 0; Group < MaxGroup; Group++) + { + if( CurrentGroupChannel[Group] == -1 ) + CurrentGroupChannel[Group] = GetFirstChannelOfGroup(Group); + if( FirstGroupChannel[Group] == -1 ) + FirstGroupChannel[Group] = GetFirstChannelOfGroup(Group); + if( LastGroupChannel[Group] == -1 ) + LastGroupChannel[Group] = GetLastChannelOfGroup(Group); + } + LastMaxGroup = MaxGroup; + + } // what is the current watching channel? int CurrentChannelNr = cDevice::CurrentChannel(); cChannel *CurrentChannel = Channels.GetByNumber(CurrentChannelNr); diff --git a/osdmenu.h b/osdmenu.h index 497fce2..b8cf5f1 100644 --- a/osdmenu.h +++ b/osdmenu.h @@ -9,6 +9,7 @@ extern int *GroupIndex; extern int *CurrentGroupChannel; extern int *FirstGroupChannel; extern int *LastGroupChannel; +extern int LastMaxGroup; // --- myMenuWhatsOn ---------------------------------------------------------- class myOsdMenu : public cOsdMenu -- cgit v1.2.3 From 121dc833912fb97dcec11d389f9dd0e70d622137 Mon Sep 17 00:00:00 2001 From: Martin Schirrmacher Date: Mon, 29 Jul 2013 05:41:28 +0200 Subject: release version 0.3.5 --- HISTORY | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HISTORY b/HISTORY index c4ec493..f17db96 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,6 @@ VDR Plugin 'neutrinoepg' Revision History -2013-XX-XX: Version 0.3.5 +2013-29-07: Version 0.3.5 - [Fix] Speicherung der letzten Kanalauswahl in den Gruppen 2013-05-05: Version 0.3.4 -- cgit v1.2.3 From 56b84e6317b7fab4e1b128d8fb0191d03d3e764b Mon Sep 17 00:00:00 2001 From: Martin Schirrmacher Date: Mon, 29 Jul 2013 05:48:41 +0200 Subject: change version in header --- neutrinoepg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neutrinoepg.h b/neutrinoepg.h index e57effc..d34d32a 100644 --- a/neutrinoepg.h +++ b/neutrinoepg.h @@ -29,7 +29,7 @@ extern int switchgroupkey; extern int ChannelNameWidth; extern int HideGroupsAt; -static const char *VERSION = "0.3.4"; +static const char *VERSION = "0.3.5"; static const char *DESCRIPTION = "View the EPG like neutrino does"; static const char *MAINMENUENTRY = "Neutrino EPG"; -- cgit v1.2.3