added timer type to epg2vdr interface

This commit is contained in:
horchi 2018-02-16 19:55:36 +01:00
parent beeb82bbda
commit e068cb93fd
5 changed files with 81 additions and 49 deletions

View File

@ -435,3 +435,7 @@ Version 0.7.2
Version 1.2.4 (horchi)
- added compatibility to vdr 2.3.8
Version 1.2.5 (horchi)
- added timer type to epg2vdr interface

View File

@ -1045,6 +1045,7 @@ enum class eLeMenuTimersST {
stateinfo,
action,
vdrname,
type,
count
};
@ -1086,6 +1087,7 @@ enum class eCeMenuTimersST {
stateinfo,
action,
vdrname,
type,
count
};

View File

@ -1307,6 +1307,7 @@ void cLeMenuTimers::SetTokenContainer(void) {
tokenContainer->DefineStringToken("{stateinfo}", (int)eLeMenuTimersST::stateinfo);
tokenContainer->DefineStringToken("{action}", (int)eLeMenuTimersST::action);
tokenContainer->DefineStringToken("{vdrname}", (int)eLeMenuTimersST::vdrname);
tokenContainer->DefineStringToken("{type}", (int)eLeMenuTimersST::type);
tokenContainer->DefineIntToken("{nummenuitem}", (int)eLeMenuTimersIT::nummenuitem);
tokenContainer->DefineIntToken("{current}", (int)eLeMenuTimersIT::current);
tokenContainer->DefineIntToken("{separator}", (int)eLeMenuTimersIT::separator);
@ -1417,6 +1418,8 @@ bool cLeMenuTimers::Parse(bool forced) {
tokenContainer->AddStringToken((int)eLeMenuTimersST::state, state.str().c_str());
tokenContainer->AddStringToken((int)eLeMenuTimersST::stateinfo, epgTimer->StateInfo());
tokenContainer->AddStringToken((int)eLeMenuTimersST::vdrname, epgTimer->VdrName());
char tp[2]; sprintf(tp, "%c", epgTimer->Type());
tokenContainer->AddStringToken((int)eLeMenuTimersST::type, tp);
stringstream action;
action << epgTimer->Action();
tokenContainer->AddStringToken((int)eLeMenuTimersST::action, action.str().c_str());
@ -1465,6 +1468,7 @@ void cCeMenuTimers::SetTokenContainer(void) {
tokenContainer->DefineStringToken("{stateinfo}", (int)eCeMenuTimersST::stateinfo);
tokenContainer->DefineStringToken("{action}", (int)eCeMenuTimersST::action);
tokenContainer->DefineStringToken("{vdrname}", (int)eCeMenuTimersST::vdrname);
tokenContainer->DefineStringToken("{type}", (int)eCeMenuTimersST::type);
tokenContainer->DefineIntToken("{menuitemx}", (int)eCeMenuTimersIT::menuitemx);
tokenContainer->DefineIntToken("{menuitemy}", (int)eCeMenuTimersIT::menuitemy);
tokenContainer->DefineIntToken("{menuitemwidth}", (int)eCeMenuTimersIT::menuitemwidth);
@ -1582,6 +1586,8 @@ bool cCeMenuTimers::Parse(bool forced) {
tokenContainer->AddStringToken((int)eCeMenuTimersST::state, state.str().c_str());
tokenContainer->AddStringToken((int)eCeMenuTimersST::stateinfo, epgTimer->StateInfo());
tokenContainer->AddStringToken((int)eCeMenuTimersST::vdrname, epgTimer->VdrName());
char tp[2]; sprintf(tp, "%c", epgTimer->Type());
tokenContainer->AddStringToken((int)eCeMenuTimersST::type, tp);
stringstream action;
action << epgTimer->Action();
tokenContainer->AddStringToken((int)eCeMenuTimersST::action, action.str().c_str());

View File

@ -39,20 +39,36 @@ class cEpgTimer_Interface_V1 : public cTimer
{
public:
cEpgTimer_Interface_V1(bool Instant = false, bool Pause = false, cChannel* Channel = 0)
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) {}
#else
: cTimer(Instant, Pause, (cChannel*)Channel) {}
#endif
long TimerId() { return timerid; }
long EventId() { return eventid; }
const char* VdrName() { return vdrName ? vdrName : ""; }
const char* VdrUuid() { return vdrUuid ? vdrUuid : ""; }
int isVdrRunning() { return vdrRunning; }
int isLocal() { return local; }
int isRemote() { return !isLocal(); }
char State() { return state; }
const char* StateInfo() { return stateInfo ? stateInfo : ""; }
char Action() { return action; }
long TimerId() const { return timerid; }
long EventId() const { return eventid; }
const char* VdrName() const { return vdrName ? vdrName : ""; }
const char* VdrUuid() const { return vdrUuid ? vdrUuid : ""; }
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:
@ -67,6 +83,10 @@ class cEpgTimer_Interface_V1 : public cTimer
char state;
char* stateInfo;
char action;
char type;
time_t createTime;
time_t modTime;
};
//***************************************************************************

View File

@ -20,7 +20,7 @@
#endif
static const char *VERSION = "1.2.4";
static const char *VERSION = "1.2.5";
static const char *DESCRIPTION = trNOOP("Skin Designer");
class cPluginSkinDesigner : public cPlugin, public skindesignerapi::SkindesignerAPI {