diff options
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/markad.cpp | 1 | ||||
-rw-r--r-- | plugin/menu.cpp | 14 | ||||
-rw-r--r-- | plugin/menu.h | 1 | ||||
-rw-r--r-- | plugin/status.cpp | 45 | ||||
-rw-r--r-- | plugin/status.h | 3 |
5 files changed, 57 insertions, 7 deletions
diff --git a/plugin/markad.cpp b/plugin/markad.cpp index 718f756..7a03526 100644 --- a/plugin/markad.cpp +++ b/plugin/markad.cpp @@ -169,6 +169,7 @@ bool cPluginMarkAd::SetupParse(const char *Name, const char *Value) else if (!strcasecmp(Name,"whileReplaying")) setup.whileReplaying=atoi(Value); else if (!strcasecmp(Name,"OSDMessage")) setup.OSDMessage=atoi(Value); else if (!strcasecmp(Name,"BackupMarks")) setup.BackupMarks=atoi(Value); + else if (!strcasecmp(Name,"GenIndex")) setup.GenIndex=atoi(Value); else if (!strcasecmp(Name,"Verbose")) setup.Verbose=atoi(Value); else if (!strcasecmp(Name,"IgnoreMargins")) setup.NoMargins=atoi(Value); else return false; diff --git a/plugin/menu.cpp b/plugin/menu.cpp index 2d7c9a7..3269fda 100644 --- a/plugin/menu.cpp +++ b/plugin/menu.cpp @@ -80,6 +80,7 @@ cMenuMarkAd::cMenuMarkAd(cStatusMarkAd *Status):cOsdMenu(tr("markad status"),15) { SetHelpText(NULL); } + lastpos=0; } @@ -87,7 +88,7 @@ bool cMenuMarkAd::write() { Clear(); - bool header=false,first=true; + bool header=false; struct recs *Entry=NULL; status->ResetActPos(); do @@ -100,8 +101,12 @@ bool cMenuMarkAd::write() header=true; Add(new cOsdItem(tr("Recording\t Status"),osUnknown,false)); } - Add(new cOsdMarkAd(Entry)); - first=false; + cOsdMarkAd *osd = new cOsdMarkAd(Entry); + if (osd) + { + Add(osd); + if (osd->Index()==lastpos) SetCurrent(osd); + } } } while (Entry); @@ -109,6 +114,7 @@ bool cMenuMarkAd::write() if (!header) { Add(new cOsdItem(tr("no running markad found"),osUnknown,false),true); + lastpos=NULL; } Display(); return header; @@ -185,6 +191,7 @@ eOSState cMenuMarkAd::ProcessKey(eKeys Key) if ((osd) && (osd->Selectable())) { SetHelpText(osd->GetEntry()); + lastpos=Current(); } break; @@ -194,6 +201,7 @@ eOSState cMenuMarkAd::ProcessKey(eKeys Key) if ((osd) && (osd->Selectable())) { SetHelpText(osd->GetEntry()); + lastpos=Current(); } break; diff --git a/plugin/menu.h b/plugin/menu.h index 1557e19..39f09ef 100644 --- a/plugin/menu.h +++ b/plugin/menu.h @@ -31,6 +31,7 @@ private: void SetHelpText(struct recs *Entry); bool write(); time_t last; + int lastpos; public: cMenuMarkAd(cStatusMarkAd *Status); eOSState ProcessKey(eKeys Key); diff --git a/plugin/status.cpp b/plugin/status.cpp index 1068b34..aa0b085 100644 --- a/plugin/status.cpp +++ b/plugin/status.cpp @@ -65,16 +65,34 @@ void cStatusMarkAd::Replaying(const cControl *UNUSED(Control), const char *UNUSE } } -bool cStatusMarkAd::Start(const char *FileName, const char *Name, bool Direct) +bool cStatusMarkAd::Start(const char *FileName, const char *Name, const bool Direct, + const int tStart, const int tStop) { if ((Direct) && (Get(FileName)!=-1)) return false; - cString cmd = cString::sprintf("\"%s\"/markad %s%s%s%s%s -l \"%s\" %s \"%s\"",bindir, + char sstart[20]=""; + char sstop[20]=""; + + if (tStart>0) + { + snprintf(sstart,sizeof(sstart)," --tstart %i ",tStart); + sstart[19]=0; + } + + if (tStop>0) + { + snprintf(sstop,sizeof(sstop)," --tstop %i ",tStop); + sstop[19]=0; + } + + cString cmd = cString::sprintf("\"%s\"/markad %s%s%s%s%s%s%s -l \"%s\" %s \"%s\"",bindir, setup->Verbose ? " -v " : "", setup->BackupMarks ? " -B " : "", setup->GenIndex ? " -G " : "", setup->OSDMessage ? " -O " : "", setup->NoMargins ? " -i 4 " : "", + (tStart>0) ? sstart : "", + (tStop>0) ? sstop : "", logodir,Direct ? "-O after" : "--online=2 before", FileName); dsyslog("markad: executing %s",*cmd); if (SystemExec(cmd)!=-1) @@ -121,10 +139,31 @@ void cStatusMarkAd::Recording(const cDevice *UNUSED(Device), const char *Name, if (!bindir) return; // we cannot operate without bindir if (!logodir) return; // we dont want to operate without logodir + int tstart=0; + int tstop=0; + if ((Name) && (!setup->NoMargins) && (!strchr(Name,'@'))) + { + for (cTimer *Timer = Timers.First(); Timer; Timer=Timers.Next(Timer)) + { + if (Timer->Recording() && (!strcmp(Timer->File(),Name))) + { + if (Timer->Event()) + { + if (Timer->Event()->StartTime()>time(NULL)) + { + tstart=Timer->Event()->StartTime()-Timer->StartTime(); + } + tstop=Timer->StopTime()-Timer->Event()->EndTime(); + } + break; + } + } + } + if (On) { // Start markad with recording - Start(FileName,Name); + Start(FileName,Name,false,tstart,tstop); } else { diff --git a/plugin/status.h b/plugin/status.h index 238de3b..8ce9b45 100644 --- a/plugin/status.h +++ b/plugin/status.h @@ -55,7 +55,8 @@ public: actpos=0; } bool GetNextActive(struct recs **RecEntry); - bool Start(const char *FileName, const char *Name, bool Direct=false); + bool Start(const char *FileName, const char *Name, const bool Direct=false, + const int tStart=0, const int tStop=0); }; #endif |