diff options
-rw-r--r-- | HISTORY.h | 7 | ||||
-rw-r--r-- | lib/epgservice.h | 2 | ||||
-rw-r--r-- | menu.c | 29 | ||||
-rw-r--r-- | menu.h | 10 | ||||
-rw-r--r-- | menutimers.c | 16 | ||||
-rw-r--r-- | po/de_DE.po | 5 | ||||
-rw-r--r-- | po/it_IT.po | 5 | ||||
-rw-r--r-- | service.c | 9 | ||||
-rw-r--r-- | service.h | 26 | ||||
-rw-r--r-- | timer.c | 6 | ||||
-rw-r--r-- | ttools.c | 3 |
11 files changed, 91 insertions, 27 deletions
@@ -5,8 +5,8 @@ * */ -#define _VERSION "1.1.83" -#define VERSION_DATE "10.02.2018" +#define _VERSION "1.1.84" +#define VERSION_DATE "13.02.2018" #define DB_API 6 @@ -19,6 +19,9 @@ /* * ------------------------------------ +2018-02-13 version 1.1.84 (horchi) + - added: Timer 'type' to timers menu + 2018-02-10 version 1.1.83 (horchi) - bugfix: Fixed delete of Switch timer - added: Fill recording images table with images of existing recordings diff --git a/lib/epgservice.h b/lib/epgservice.h index 36d513e..1cd27b1 100644 --- a/lib/epgservice.h +++ b/lib/epgservice.h @@ -106,6 +106,8 @@ enum TimerAction taReject = 'T' }; +// ATTENTION: Update type also in service.h when changing timer types here!! + enum TimerType { ttRecord = 'R', // Aufnahme-Timer @@ -621,14 +621,27 @@ int cMenuDb::lookupTimer(const cEvent* event, int& timerMatch, int& remote, int // Modify Timer // // - timerRow contain the actual vdrUuid -// - for move destUuid is set +// - for move destUuid or newType is set //*************************************************************************** -int cMenuDb::modifyTimer(cDbRow* timerRow, const char* destUuid) +int cMenuDb::modifyTimer(cDbRow* timerRow, const char* destUuid, char destType) { - int knownTimer = !timerRow->hasValue("ID", (long)na); - int move = knownTimer && destUuid && !timerRow->hasValue("VDRUUID", destUuid); int timerid = timerDb->getIntValue("ID"); + int knownTimer = !timerRow->hasValue("ID", (long)na); + int move = no; + + if (knownTimer) + { + // mive to other VDR? + + if (!timerRow->hasValue("VDRUUID", destUuid)) + move = yes; + + // move to other type + + else if (!timerRow->hasCharValue("TYPE", destType)) + move = yes; + } // lookup known (existing) timer @@ -667,11 +680,11 @@ int cMenuDb::modifyTimer(cDbRow* timerRow, const char* destUuid) timerDb->setValue("VDRUUID", destUuid); timerDb->setCharValue("ACTION", taCreate); timerDb->setValue("SOURCE", Epg2VdrConfig.uuid); - timerDb->setCharValue("TYPE", ttRecord); + timerDb->setCharValue("TYPE", destType); timerDb->insert(); - tell(0, "Created 'move' request for timer (%d) at vdr '%s'", - timerid, timerDb->getStrValue("VDRUUID")); + tell(0, "Created 'move' request for timer (%d) at vdr '%s' and type '%s'", + timerid, timerDb->getStrValue("VDRUUID"), timerDb->getStrValue("TYPE")); } else { @@ -682,7 +695,7 @@ int cMenuDb::modifyTimer(cDbRow* timerRow, const char* destUuid) timerDb->setCharValue("ACTION", knownTimer ? taModify : taCreate); timerDb->getValue("STATE")->setNull(); timerDb->setValue("SOURCE", Epg2VdrConfig.uuid); - timerDb->setCharValue("TYPE", ttRecord); + timerDb->setCharValue("TYPE", destType); if (!knownTimer) timerDb->setValue("NAMINGMODE", tnmAuto); @@ -76,7 +76,7 @@ class cMenuDb : public cParameters int createSwitchTimer(const cEvent* event); int createTimer(cDbRow* timerRow, const char* destUuid, int type = ttRecord); - int modifyTimer(cDbRow* timerRow, const char* destUuid = 0); + int modifyTimer(cDbRow* timerRow, const char* destUuid, char destType); int deleteTimer(long timerid); // @@ -206,6 +206,8 @@ class cMenuEpgEditTimer : public cOsdMenu strcpy(file, Timer->File()); vdrIndex = 0; free(aux); aux = 0; + createTime = Timer->CreateTime(); + modTime = Timer->ModTime(); if (New) flags |= tfActive; @@ -218,6 +220,7 @@ class cMenuEpgEditTimer : public cOsdMenu state = Timer->State(); sprintf(stateInfo, "%.300s", Timer->StateInfo()); action = Timer->Action(); + type = Timer->Type(); strcpy(lastVdrUuid, Timer->VdrUuid()); for (int i = 0; i < db->vdrCount; i++) @@ -247,6 +250,7 @@ class cMenuEpgEditTimer : public cOsdMenu timerRow->setValue("PRIORITY", priority); timerRow->setValue("LIFETIME", lifetime); timerRow->setValue("EVENTID", eventid); + // don't set TYPE here !!! timerRow->setValue("TYPE", type); if needed we have to do it via lastType like VdrUuid return done; } @@ -263,7 +267,11 @@ class cMenuEpgEditTimer : public cOsdMenu char state; char stateInfo[300+TB]; char action; + char type; int vdrIndex; + int typeIndex; + time_t createTime; + time_t modTime; const cChannel* channel; mutable time_t day; mutable char file[NAME_MAX*2 + TB]; // *2 to be able to hold 'title' and 'episode', which can each be up to 255 characters long diff --git a/menutimers.c b/menutimers.c index 58bdc0c..ea60d91 100644 --- a/menutimers.c +++ b/menutimers.c @@ -12,6 +12,13 @@ #include "plgconfig.h" #include "menu.h" +const char* actions[] = +{ + "Record", + "Switch", + 0 +}; + //*************************************************************************** // cMenuEpgEditTimer //*************************************************************************** @@ -28,9 +35,11 @@ cMenuEpgEditTimer::cMenuEpgEditTimer(cMenuDb* db, cEpgTimer* Timer, bool New) if (Timer) { data.fromTimer(Timer); + data.typeIndex = data.type == ttView ? 1 : 0; // default 'Record' channelNr = data.channel->Number(); Add(new cMenuEditBitItem(tr("Active"), &data.flags, tfActive)); + Add(new cMenuEditStraItem(tr("Type"), &data.typeIndex, 2, actions)); if (menuDb->vdrCount) Add(new cMenuEditStraItem(tr("VDR"), &data.vdrIndex, menuDb->vdrCount, menuDb->vdrList)); @@ -61,6 +70,8 @@ cMenuEpgEditTimer::cMenuEpgEditTimer(cMenuDb* db, cEpgTimer* Timer, bool New) Add(new cOsdItem(cString::sprintf("\t%s", data.stateInfo))); Add(new cOsdItem(cString::sprintf("Pending action:\t%s", toName((TimerAction)data.action, yes)))); + Add(new cOsdItem(cString::sprintf("Created:\t%s", l2pTime(data.createTime).c_str()))); + Add(new cOsdItem(cString::sprintf("Modified:\t%s", l2pTime(data.modTime).c_str()))); } SetHelpKeys(); @@ -153,11 +164,12 @@ eOSState cMenuEpgEditTimer::ProcessKey(eKeys Key) if (!*data.file) strcpy(data.file, data.channel->ShortName(true)); + char newType = data.typeIndex == 0 ? ttRecord : ttView; cDbRow timerRow("timers"); data.toRow(&timerRow); - // get actual timer state from database + // get actual timer state from database (only for check if it is running) menuDb->timerDb->clear(); menuDb->timerDb->setValue("ID", data.TimerId()); @@ -176,7 +188,7 @@ eOSState cMenuEpgEditTimer::ProcessKey(eKeys Key) return osContinue; } - menuDb->modifyTimer(&timerRow, data.getVdrUuid()); + menuDb->modifyTimer(&timerRow, data.getVdrUuid(), newType); return osBack; } diff --git a/po/de_DE.po b/po/de_DE.po index 7253b39..74fba70 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <vdr@jwendel.de>\n" -"POT-Creation-Date: 2018-02-09 11:16+0100\n" +"POT-Creation-Date: 2018-02-12 08:57+0100\n" "PO-Revision-Date: 2009-08-27 21:40+0200\n" "Last-Translator: Klaus Schmidinger <kls@cadsoft.de>\n" "Language-Team: <vdr@linuxtv.org>\n" @@ -253,6 +253,9 @@ msgstr "Timer bearbeiten" msgid "Active" msgstr "Aktiv" +msgid "Type" +msgstr "" + msgid "VDR" msgstr "" diff --git a/po/it_IT.po b/po/it_IT.po index 078b72f..4385faf 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: VDR 1.5.7\n" "Report-Msgid-Bugs-To: <vdr@jwendel.de>\n" -"POT-Creation-Date: 2018-02-09 11:16+0100\n" +"POT-Creation-Date: 2018-02-12 08:57+0100\n" "PO-Revision-Date: 2009-08-27 21:45+0100\n" "Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" "Language-Team: <vdr@linuxtv.org>\n" @@ -258,6 +258,9 @@ msgstr "" msgid "Active" msgstr "" +msgid "Type" +msgstr "" + msgid "VDR" msgstr "" @@ -20,6 +20,10 @@ cEpgTimer::cEpgTimer(bool Instant, bool Pause, const cChannel* Channel) vdrRunning = no; stateInfo = 0; local = yes; + type = ttRecord; + action = '-'; + createTime = 0; + modTime = 0; } cEpgTimer::~cEpgTimer() @@ -39,11 +43,6 @@ void cEpgTimer::setState(char s, const char* info) stateInfo = strdup(info); } -void cEpgTimer::setAction(char a) -{ - action = a; -} - void cEpgTimer::setVdr(const char* name, const char* uuid, int running) { local = yes; // the default @@ -22,6 +22,13 @@ class cEpgTimer_Interface_V1 : public cTimer { public: + enum TimerType + { + ttRecord = 'R', // Aufnahme-Timer + ttView = 'V', // Umschalt-Timer + ttSearch = 'S' // Such-Timer + }; + cEpgTimer_Interface_V1(bool Instant = false, bool Pause = false, const cChannel* Channel = 0) #if defined (APIVERSNUM) && (APIVERSNUM >= 20301) : cTimer(Instant, Pause, Channel) {} @@ -36,11 +43,15 @@ class cEpgTimer_Interface_V1 : public cTimer int isVdrRunning() const { return vdrRunning; } int isLocal() const { return local; } int isRemote() const { return !isLocal(); } - + int isRecordTimer() const { return type == ttRecord; } + int isSwithTimer() const { return type == ttView; } char State() const { return state; } int hasState(char s) const { return state == s; } const char* StateInfo() const { return stateInfo ? stateInfo : ""; } char Action() const { return action; } + char Type() const { return type; } + time_t CreateTime() const { return createTime; } + time_t ModTime() const { return modTime; } protected: @@ -55,6 +66,10 @@ class cEpgTimer_Interface_V1 : public cTimer char state; char* stateInfo; char action; + + char type; + time_t createTime; + time_t modTime; }; //*************************************************************************** @@ -110,10 +125,13 @@ class cEpgTimer : public cEpgTimer_Interface_V1 cEpgTimer(bool Instant = false, bool Pause = false, const cChannel* Channel = 0); virtual ~cEpgTimer(); - void setTimerId(long id) { timerid = id; } - void setEventId(long id) { eventid = id; } + void setTimerId(long id) { timerid = id; } + void setEventId(long id) { eventid = id; } + void setAction(char a) { action = a; } + void setType(char t) { type = t; } + void setCreateTime(time_t t) { createTime = t; } + void setModTime(time_t t) { modTime = t; } void setState(char s, const char* info); - void setAction(char a); void setVdr(const char* name, const char* uuid = 0, int running = 0); }; @@ -595,7 +595,7 @@ int cUpdate::updateTimerTable() continue; // count my timers to detect truncated (epmty) table - // on empty table ignore known timer ids + // -> on empty table ignore known timer ids cnt++; @@ -613,8 +613,8 @@ int cUpdate::updateTimerTable() // compare by start-time and channelid - if (t->StartTime() == timerDb->getIntValue("StartTime") && - strcmp(t->Channel()->GetChannelID().ToString(), timerDb->getStrValue("ChannelId")) == 0) + if (t->StartTime() == timerDb->getIntValue("STARTTIME") && + strcmp(t->Channel()->GetChannelID().ToString(), timerDb->getStrValue("CHANNELID")) == 0) { exist = yes; break; @@ -471,9 +471,12 @@ cEpgTimer* newTimerObjectFromRow(cDbRow* timerRow, cDbRow* vdrRow) timer->setTimerId(timerRow->getIntValue("ID")); timer->setEventId(timerRow->getIntValue("EVENTID")); + timer->setType(!timerRow->getValue("TYPE")->isNull() ? timerRow->getStrValue("TYPE")[0] : ttRecord); timer->setAction(!timerRow->getValue("ACTION")->isNull() ? timerRow->getStrValue("ACTION")[0] : ' '); timer->setVdr(vdrRow->getStrValue("NAME"), vdrRow->getStrValue("UUID"), vdrRow->hasValue("STATE", "attached")); timer->setState(!timerRow->getValue("STATE")->isNull() ? timerRow->getStrValue("STATE")[0] : ' ', timerRow->getStrValue("INFO")); + timer->setCreateTime(timerRow->getIntValue("INSSP")); + timer->setModTime(timerRow->getIntValue("UPDSP")); #ifdef WITH_PIN timer->SetFskProtection(timerRow->getIntValue("CHILDLOCK")); |