diff options
author | Dave <vdr@pickles.me.uk> | 2012-02-01 15:32:48 +0000 |
---|---|---|
committer | Dave <vdr@pickles.me.uk> | 2012-02-01 15:32:48 +0000 |
commit | f09ad86867502ded5f30e030b98689f767027a05 (patch) | |
tree | 60c06d1fa18c2522521eaaea0ece3caa2032e04a | |
parent | bf302580e9e60b263b0dcdc82b4a324484991465 (diff) | |
download | vdrtva-0.1.0.tar.gz vdrtva-0.1.0.tar.bz2 |
Fixed OSD. 'Suggests' list de-duped.v0.1.0
-rw-r--r-- | HISTORY | 9 | ||||
-rw-r--r-- | README | 12 | ||||
-rw-r--r-- | TODO | 6 | ||||
-rw-r--r-- | vdrtva.c | 67 |
4 files changed, 49 insertions, 45 deletions
@@ -2,26 +2,21 @@ VDR Plugin 'vdrtva' Revision History ------------------------------------- 2007-10-07: Version 0.0.1 - - Initial experimental plugin. 2011-06-18: Version 0.0.2 - - First functional proof-of-concept. 2011-07-17: Version 0.0.3 - - Handling of Links file moved from Perl script into plugin. - Implemented config settings. 2011-08-18: Version 0.0.4 - - Major functions of Perl script built into plugin. - Auto-execution of series link updates. - Simplified internal data structures. 2011-09-02: Version 0.0.5 - - Added check for series links whenever a new timer is added. - Added setup menu (not fully tested). @@ -34,3 +29,7 @@ VDR Plugin 'vdrtva' Revision History - Added collection of 'Suggested' CRIDs and SVDRP command to display them. - Added notification of split events. - Fixed (again) expiration of links. + +2012-02-01: Version 0.1.0 +- Fixed OSD setup menu. +- Removed duplicates from 'suggestions' report. @@ -49,8 +49,8 @@ Operation: The use of the 'Accurate Recording' feature is described in README-vps. -The plugin runs every 24 hours at a time set by the '-u' parameter (default -03:00). It captures CRID data for a time (10 minutes) then: +The plugin runs every 24 hours at a time set by the '-u' parameter or in VDR's +OSD (default 03:00). It captures CRID data for a time (default 10 minutes) then: - Checks for new manually-created timers and adds series links for them. @@ -63,7 +63,7 @@ The plugin runs every 24 hours at a time set by the '-u' parameter (default timer was set (ie that the EPG has not changed in the meantime) - Flags any split events (eg a long programme with a news sumary in the middle). - At present a manual check is needed that all perts of the programme are set to + At present a manual check is needed that all parts of the programme are set to be recorded. The plugin logs its activity through the VDR syslog. @@ -101,8 +101,8 @@ Points to remember: - This plugin has not been tested with multiple tuner cards or with mixed DVB-T and DVB-S setups. -- The 'suggested' events list may contain duplicates and may have CRIDs which - do not appear in the events list. +- The 'suggested' events list may have CRIDs which do not appear in the events + list. -Although I use this software on my VDR installation, this is Alpha-quality code +Although I use this software on my VDR installation, this is Beta-quality code - USE AT YOUR OWN RISK!! @@ -4,10 +4,10 @@ Check split recordings should create timers if necessary. Timer clash check code needs to cope with multiple tuner cards. -Test GUI configuration and Config file. +I18n (for OSD). Some events have a series CRID but no item CRID - how to handle these? Bugs: - 'Suggestions' list contains duplicates. - Rare crash 'pure virtual method called' in plugin. + 'Suggestions' list in memory contains duplicates (removed by SVDRP output). + Very rare crash 'pure virtual method called' in plugin. @@ -22,9 +22,9 @@ cEventCRIDs *EventCRIDs; cSuggestCRIDs *SuggestCRIDs; cLinks *Links; -static const char *VERSION = "0.0.6"; +static const char *VERSION = "0.1.0"; static const char *DESCRIPTION = "TV-Anytime plugin"; -static const char *MAINMENUENTRY = "vdrTva"; +//static const char *MAINMENUENTRY = "vdrTva"; int collectionperiod; // Time to collect all CRID data (default 10 minutes) int lifetime; // Lifetime of series link recordings (default 99) @@ -62,7 +62,7 @@ private: void StopDataCapture(void); void Update(void); void Check(void); -// void Reset(); + public: cPluginvdrTva(void); virtual ~cPluginvdrTva(); @@ -77,8 +77,6 @@ public: virtual void MainThreadHook(void); virtual cString Active(void); virtual time_t WakeupTime(void); - virtual const char *MainMenuEntry(void) { return MAINMENUENTRY; } - virtual cOsdObject *MainMenuAction(void); virtual cMenuSetupPage *SetupMenu(void); virtual bool SetupParse(const char *Name, const char *Value); virtual bool Service(const char *Id, void *Data = NULL); @@ -249,12 +247,6 @@ time_t cPluginvdrTva::WakeupTime(void) return 0; } -cOsdObject *cPluginvdrTva::MainMenuAction(void) -{ - // Perform the action when selected from the main VDR menu. - return NULL; -} - cMenuSetupPage *cPluginvdrTva::SetupMenu(void) { // Return a setup menu in case the plugin supports one. @@ -264,8 +256,8 @@ cMenuSetupPage *cPluginvdrTva::SetupMenu(void) bool cPluginvdrTva::SetupParse(const char *Name, const char *Value) { // Parse your own setup parameters and store their values. - if (!strcasecmp(Name, "CollectionPeriod")) collectionperiod = atoi(Value); - else if (!strcasecmp(Name, "SeriesLifetime")) seriesLifetime = atoi(Value); + if (!strcasecmp(Name, "CollectionPeriod")) collectionperiod = atoi(Value) * 60; + else if (!strcasecmp(Name, "SeriesLifetime")) seriesLifetime = atoi(Value) * SECONDSPERDAY; else if (!strcasecmp(Name, "TimerLifetime")) lifetime = atoi(Value); else if (!strcasecmp(Name, "TimerPriority")) priority = atoi(Value); else if (!strcasecmp(Name, "UpdateTime")) updatetime = atoi(Value); @@ -318,18 +310,22 @@ cString cPluginvdrTva::SVDRPCommand(const char *Command, const char *Option, int } else if (strcasecmp(Command, "LSTS") == 0) { if (SuggestCRIDs && (SuggestCRIDs->MaxNumber() >= 1)) { - ReplyCode = 250; - for (cSuggestCRID *suggestCRID = SuggestCRIDs->First(); suggestCRID; suggestCRID = SuggestCRIDs->Next(suggestCRID)) { + SuggestCRIDs->Sort(); + ReplyCode = 250; + for (cSuggestCRID *suggestCRID = SuggestCRIDs->First(); suggestCRID; suggestCRID = SuggestCRIDs->Next(suggestCRID)) { +// if (strcmp(SuggestCRIDs->Next(suggestCRID)->iCRID(), suggestCRID->iCRID()) || +// strcmp(SuggestCRIDs->Next(suggestCRID)->gCRID(), suggestCRID->gCRID())) { cChanDA *chanDA = ChanDAs->GetByChannelID(suggestCRID->Cid()); if(chanDA) { Append("%s%s %s%s\n", chanDA->DA(), suggestCRID->iCRID(), chanDA->DA(), suggestCRID->gCRID()); } - } - if (buffer && length > 0) return cString(Reply(), true); - else return cString::sprintf("Nothing in the buffer!"); +// } + } + if (buffer && length > 0) return cString(Reply(), true); + else return cString::sprintf("Nothing in the buffer!"); } else - return cString::sprintf("No suggested events defined"); + return cString::sprintf("No suggested events defined"); } else if (strcasecmp(Command, "LSTY") == 0) { if (EventCRIDs && (EventCRIDs->MaxNumber() >= 1)) { @@ -787,25 +783,25 @@ void cTvaStatusMonitor::ClearTimerAdded(void) cTvaMenuSetup::cTvaMenuSetup(void) { - newcollectionperiod = collectionperiod; + newcollectionperiod = collectionperiod / 60; newlifetime = lifetime; newpriority = priority; - newseriesLifetime = seriesLifetime; + newseriesLifetime = seriesLifetime / SECONDSPERDAY; newupdatetime = updatetime; - Add(new cMenuEditIntItem(tr("Collection period (min)"), &newcollectionperiod)); - Add(new cMenuEditIntItem(tr("Series link lifetime (days)"), &newseriesLifetime)); - Add(new cMenuEditIntItem(tr("New timer lifetime"), &newlifetime)); - Add(new cMenuEditIntItem(tr("New timer priority"), &newpriority)); - Add(new cMenuEditIntItem(tr("Update Time (HHMM)"), &newupdatetime)); + Add(new cMenuEditIntItem(tr("Collection period (min)"), &newcollectionperiod, 1, 99)); + Add(new cMenuEditIntItem(tr("Series link lifetime (days)"), &newseriesLifetime, 1, 366)); + Add(new cMenuEditIntItem(tr("New timer lifetime"), &newlifetime, 0, 99)); + Add(new cMenuEditIntItem(tr("New timer priority"), &newpriority, 0, 99)); + Add(new cMenuEditTimeItem(tr("Update Time (HH:MM)"), &newupdatetime)); } void cTvaMenuSetup::Store(void) { - SetupStore("CollectionPeriod", newcollectionperiod); - SetupStore("SeriesLifetime", newseriesLifetime); - SetupStore("TimerLifetime", newlifetime); - SetupStore("TimerPriority", newpriority); - SetupStore("UpdateTime", newupdatetime); + SetupStore("CollectionPeriod", newcollectionperiod); collectionperiod = newcollectionperiod * 60; + SetupStore("SeriesLifetime", newseriesLifetime); seriesLifetime = newseriesLifetime * SECONDSPERDAY; + SetupStore("TimerLifetime", newlifetime); lifetime = newlifetime; + SetupStore("TimerPriority", newpriority); priority = newpriority; + SetupStore("UpdateTime", newupdatetime); updatetime = newupdatetime; } @@ -1076,6 +1072,15 @@ void cSuggestCRID::Set(int Cid, char *iCRID, char *gCRID) { cid = Cid; } +int cSuggestCRID::Compare(const cListObject &ListObject) const +{ + cSuggestCRID *s = (cSuggestCRID *) &ListObject; + if (int r = cid - s->Cid()) return r; + if (int r = strcmp(iCrid, s->iCRID())) return r; + if (int r = strcmp(gCrid, s->gCRID())) return r; + return 0; +} + /* cSuggestCRIDs - in-memory list of suggested events |