diff options
-rw-r--r-- | HISTORY | 3 | ||||
-rw-r--r-- | neutrinoepg.c | 52 | ||||
-rw-r--r-- | neutrinoepg.h | 2 | ||||
-rw-r--r-- | osditem.c | 2 | ||||
-rw-r--r-- | osdmenu.c | 45 | ||||
-rw-r--r-- | po/de_DE.po | 9 |
6 files changed, 84 insertions, 29 deletions
@@ -3,7 +3,8 @@ VDR Plugin 'neutrinoepg' Revision History 2013-XX-XX: Version 0.3.4 - [Fix] Bufferoverflow bei Tastendruck 0 - [Feature] Beschleunigter Start des Plugin, besonders bei großen channels.conf mit vielen Gruppen -- [Feature] Neuer Parameter 'HideGroupsAt' zum ausblenden aller Gruppen ab dieser Gruppennr +- [Feature] Neuer Parameter 'HideGroupsAt' zum ausblenden aller Gruppen ab dieser Gruppe +- [Feature] neue Möglichkeit mittels links/rechts in der EPG-Info zwischen den Sendungen zu wechseln 2013-04-12: Version 0.3.3 - [Fix] komplette Neuimplementierung der Kanal- und Gruppenbehandlung innerhalb des Plugins. diff --git a/neutrinoepg.c b/neutrinoepg.c index 3e395ef..f173d22 100644 --- a/neutrinoepg.c +++ b/neutrinoepg.c @@ -20,13 +20,14 @@ int switchgroupkey = 0; int ChannelNameWidth = 15; int HideGroupsAt = 0; -bool ReloadFilters = false; // --- myMenuSetup ------------------------------------------------------------ class myMenuSetup : public cMenuSetupPage { private: const char *SwitchGroupKeyTexts[2]; const char *SitchWithOKTexts[2]; + const char **HideGroupsAtTexts; + int GroupCount; protected: virtual void Store() { @@ -43,12 +44,53 @@ class myMenuSetup : public cMenuSetupPage SetupStore("switchgroupkey", switchgroupkey); SetupStore("ChannelNameWidth", ChannelNameWidth); SetupStore("HideGroupsAt", HideGroupsAt); - - ReloadFilters = true; } public: + ~myMenuSetup() + { + for(int i = 0; i < GroupCount; i++) + delete[] HideGroupsAtTexts[i]; + delete[] HideGroupsAtTexts; + } myMenuSetup() { + GroupCount = 0; + int index = 0; + bool HideFirst = true; + + for(cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) + { + if( Channel->GroupSep() ) + GroupCount++; + } + // add one group if the first is not one + if( !Channels.First()->GroupSep() ) + { + GroupCount++; + HideFirst = false; + HideGroupsAtTexts[index] = tr("no filter"); + index++; + } + HideGroupsAtTexts = new const char*[GroupCount]; + + for(cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) + { + if( Channel->GroupSep() ) + { + if( HideFirst ) + { + HideFirst = false; + HideGroupsAtTexts[index] = new char( strlen(tr("no filter")) + 1 ); + strcpy((char *)HideGroupsAtTexts[index], (char *)tr("no filter")); + index++; + continue; + } + HideGroupsAtTexts[index] = new char( strlen(Channel->Name()) + 1 ); + strcpy((char *)HideGroupsAtTexts[index], (char *)Channel->Name()); + index++; + } + } + SwitchGroupKeyTexts[0] = tr("left/right"); SwitchGroupKeyTexts[1] = tr("prev/next"); @@ -67,7 +109,7 @@ class myMenuSetup : public cMenuSetupPage Add(new cMenuEditIntItem(tr("Channel name width"), &ChannelNameWidth)); Add(new cMenuEditBoolItem(tr("Keep display after switching"), &keeposd)); Add(new cMenuEditBoolItem(tr("Show channel numbers"), &showchannelnumbers)); - Add(new cMenuEditIntItem(tr("Hide Groups at Groupnr"), &HideGroupsAt)); + Add(new cMenuEditStraItem(tr("Hide Groups at"), &HideGroupsAt, GroupCount, HideGroupsAtTexts)); Add(new cMenuEditBoolItem(tr("Hide encrypted channels"), &hideencryptedchannels)); Add(new cMenuEditBoolItem(tr("Hide radio channels"), &hideradiochannels)); Add(new cMenuEditBoolItem(tr("Progress as percent"), &percentprogress)); @@ -106,8 +148,6 @@ bool cPluginNeutrinoEpg::Start(void) FirstGroupChannel = NULL; LastGroupChannel = NULL; - ReloadFilters = true; - return true; } diff --git a/neutrinoepg.h b/neutrinoepg.h index 8d57d15..eb22ef3 100644 --- a/neutrinoepg.h +++ b/neutrinoepg.h @@ -33,8 +33,6 @@ static const char *VERSION = "0.3.3"; static const char *DESCRIPTION = "View the EPG like neutrino does"; static const char *MAINMENUENTRY = "Neutrino EPG"; -extern bool ReloadFilters; - // --- cPluginNeutrinoEpg --------------------------------------------------- class cPluginNeutrinoEpg:public cPlugin { @@ -36,7 +36,7 @@ void Icons::InitCharSet() } // --- myWhatsOnItem ---------------------------------------------------------- -myOsdItem::myOsdItem(const cEvent *Event,cChannel *Channel,bool Next) +myOsdItem::myOsdItem(const cEvent *Event, cChannel *Channel, bool Next) { event = Event; channel = Channel; @@ -67,10 +67,6 @@ myOsdMenu::myOsdMenu() : cOsdMenu("") ChannelsAfter = (ChannelsShown / 2)-1; } - clock_t begin = clock(); - clock_t end = clock(); - ReloadFilters = false; - // Count the groups and channels int GroupCount = 0; for(cChannel *Channel = Channels.First(); Channel; Channel = Channels.Next(Channel)) @@ -83,16 +79,20 @@ myOsdMenu::myOsdMenu() : cOsdMenu("") if( !Channels.First()->GroupSep() ) MaxGroup++; + //syslog(LOG_ERR, "neutrinoepg: MaxGroup %d", MaxGroup); + // Hide Groups? if( HideGroupsAt > MaxGroup ) HideGroupsAt = MaxGroup; - if( HideGroupsAt <= 1 ) + if( HideGroupsAt < 1 ) HideGroupsAt = 0; - if( HideGroupsAt > 1 ) + if( HideGroupsAt > 0 ) { - MaxGroup -= MaxGroup - HideGroupsAt + 1; + MaxGroup -= MaxGroup - HideGroupsAt; } + //syslog(LOG_ERR, "neutrinoepg: HideGroup %d MaxGroup %d", HideGroupsAt, MaxGroup); + if( GroupIndex != NULL ) delete[] GroupIndex; if( CurrentGroupChannel != NULL ) @@ -130,7 +130,6 @@ myOsdMenu::myOsdMenu() : cOsdMenu("") } } - end = clock(); for( int Group = 0; Group < MaxGroup; Group++) { if( CurrentGroupChannel[Group] == -1 ) @@ -145,7 +144,6 @@ myOsdMenu::myOsdMenu() : cOsdMenu("") { LastGroupChannel[Group] = GetLastChannelOfGroup(Group); } - end = clock(); } // what is the current watching channel? @@ -161,8 +159,6 @@ myOsdMenu::myOsdMenu() : cOsdMenu("") CurrentGroup = GetGroupFromChannel( CurrentChannel->Index() ); CurrentGroupChannel[CurrentGroup] = CurrentChannel->Index(); - //syslog(LOG_ERR, "neutrinoepg: Group %d Channel %d", CurrentGroup, CurrentGroupChannel[CurrentGroup]); - LoadSchedules(0); } @@ -187,7 +183,7 @@ int myOsdMenu::GetGroupByGroupIndex(int groupIndex) if( GroupIndex[index] == groupIndex ) return index; } - return -1; + return 0; } int myOsdMenu::GetGroupFromChannel(int ChanIndex) { @@ -441,12 +437,25 @@ void myOsdMenu::SetMyTitle(void) CurrentGroup + 1, MaxGroup, tr("without group"), trVDR("What's on now?")); } else { + int groupindex = GetGroupIndex(CurrentGroup); if( next ) - asprintf(&buffer, "%d/%d %s - %s", - CurrentGroup + 1, MaxGroup, Channels.Get( GetGroupIndex(CurrentGroup) )->Name(), *DayDateTime(t)); + { + if( groupindex == -1 ) + asprintf(&buffer, "%d/%d %s - %s", + CurrentGroup + 1, MaxGroup, "no group", *DayDateTime(t)); + else + asprintf(&buffer, "%d/%d %s - %s", + CurrentGroup + 1, MaxGroup, Channels.Get( groupindex )->Name(), *DayDateTime(t)); + } else - asprintf(&buffer, "%d/%d %s - %s", - CurrentGroup + 1, MaxGroup, Channels.Get( GetGroupIndex(CurrentGroup) )->Name(), trVDR("What's on now?")); + { + if( groupindex == -1 ) + asprintf(&buffer, "%d/%d %s - %s", + CurrentGroup + 1, MaxGroup, "no group", trVDR("What's on now?")); + else + asprintf(&buffer, "%d/%d %s - %s", + CurrentGroup + 1, MaxGroup, Channels.Get( groupindex )->Name(), trVDR("What's on now?")); + } } SetTitle(buffer); free(buffer); @@ -751,6 +760,8 @@ eOSState myOsdMenu::ProcessKey(eKeys Key) } case kLeft|k_Repeat: case kLeft: + if( isMenuEvent ) + return osContinue; if( switchgroupkey == 1 ) // if we not switch groups by left/right we let do vdr the rest (page up) { if( CurrentGroupChannel[CurrentGroup] == FirstGroupChannel[CurrentGroup] ) @@ -784,6 +795,8 @@ eOSState myOsdMenu::ProcessKey(eKeys Key) break; case kRight|k_Repeat: case kRight: + if( isMenuEvent ) + return osContinue; if( switchgroupkey == 1 ) // if we not switch groups by left/right we let do vdr the rest (page down) { if( CurrentGroupChannel[CurrentGroup] == LastGroupChannel[CurrentGroup] ) diff --git a/po/de_DE.po b/po/de_DE.po index ea1c47e..3967e7e 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Neutrinoepg-Plugin 0.3.3\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-04-17 09:28+0200\n" +"POT-Creation-Date: 2013-04-23 18:46+0200\n" "PO-Revision-Date: 2008-03-30 19:58+0200\n" "Last-Translator: \n" "Language-Team: <nordlicht@martins-kabuff.de>\n" @@ -31,6 +31,9 @@ msgstr "keine Programminformation" msgid "Can't switch channel!" msgstr "Kann Kanal nicht wechseln!" +msgid "no filter" +msgstr "<kein filter>" + msgid "left/right" msgstr "links/rechts" @@ -76,8 +79,8 @@ msgstr "Anzeige nach Umschalten beibehalten" msgid "Show channel numbers" msgstr "Kanalnummern anzeigen" -msgid "Hide Groups at Groupnr" -msgstr "Gruppen ausblenden ab Gruppennr" +msgid "Hide Groups at" +msgstr "Gruppen ausblenden ab Gruppe" msgid "Hide encrypted channels" msgstr "Verschlüsselte Kanäle ausblenden" |