mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
extended epg2vdr timer interface for schedules
This commit is contained in:
parent
e068cb93fd
commit
9647640dc7
4
HISTORY
4
HISTORY
@ -439,3 +439,7 @@ Version 1.2.4 (horchi)
|
|||||||
Version 1.2.5 (horchi)
|
Version 1.2.5 (horchi)
|
||||||
|
|
||||||
- added timer type to epg2vdr interface
|
- added timer type to epg2vdr interface
|
||||||
|
|
||||||
|
Version 1.2.6 (horchi)
|
||||||
|
|
||||||
|
- extended epg2vdr timer interface for schedules
|
||||||
|
@ -855,6 +855,7 @@ enum class eLeMenuSchedulesST {
|
|||||||
durationminutes,
|
durationminutes,
|
||||||
channelname,
|
channelname,
|
||||||
channelid,
|
channelid,
|
||||||
|
timertype,
|
||||||
count
|
count
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -879,6 +880,7 @@ enum class eLeMenuSchedulesIT {
|
|||||||
whatsonfavorites,
|
whatsonfavorites,
|
||||||
timerpartitial,
|
timerpartitial,
|
||||||
timerfull,
|
timerfull,
|
||||||
|
isremotetimer,
|
||||||
hasVPS,
|
hasVPS,
|
||||||
count
|
count
|
||||||
};
|
};
|
||||||
@ -895,6 +897,7 @@ enum class eCeMenuSchedulesST {
|
|||||||
channelid,
|
channelid,
|
||||||
posterpath,
|
posterpath,
|
||||||
bannerpath,
|
bannerpath,
|
||||||
|
timertype,
|
||||||
count
|
count
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -934,6 +937,7 @@ enum class eCeMenuSchedulesIT {
|
|||||||
whatsonfavorites,
|
whatsonfavorites,
|
||||||
timerpartitial,
|
timerpartitial,
|
||||||
timerfull,
|
timerfull,
|
||||||
|
isremotetimer,
|
||||||
count
|
count
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -683,6 +683,7 @@ void cLeMenuSchedules::SetTokenContainer(void) {
|
|||||||
tokenContainer->DefineStringToken("{durationminutes}", (int)eLeMenuSchedulesST::durationminutes);
|
tokenContainer->DefineStringToken("{durationminutes}", (int)eLeMenuSchedulesST::durationminutes);
|
||||||
tokenContainer->DefineStringToken("{channelname}", (int)eLeMenuSchedulesST::channelname);
|
tokenContainer->DefineStringToken("{channelname}", (int)eLeMenuSchedulesST::channelname);
|
||||||
tokenContainer->DefineStringToken("{channelid}", (int)eLeMenuSchedulesST::channelid);
|
tokenContainer->DefineStringToken("{channelid}", (int)eLeMenuSchedulesST::channelid);
|
||||||
|
tokenContainer->DefineStringToken("{timertype}", (int)eLeMenuSchedulesST::timertype);
|
||||||
tokenContainer->DefineIntToken("{nummenuitem}", (int)eLeMenuSchedulesIT::nummenuitem);
|
tokenContainer->DefineIntToken("{nummenuitem}", (int)eLeMenuSchedulesIT::nummenuitem);
|
||||||
tokenContainer->DefineIntToken("{current}", (int)eLeMenuSchedulesIT::current);
|
tokenContainer->DefineIntToken("{current}", (int)eLeMenuSchedulesIT::current);
|
||||||
tokenContainer->DefineIntToken("{separator}", (int)eLeMenuSchedulesIT::separator);
|
tokenContainer->DefineIntToken("{separator}", (int)eLeMenuSchedulesIT::separator);
|
||||||
@ -703,6 +704,7 @@ void cLeMenuSchedules::SetTokenContainer(void) {
|
|||||||
tokenContainer->DefineIntToken("{whatsonfavorites}", (int)eLeMenuSchedulesIT::whatsonfavorites);
|
tokenContainer->DefineIntToken("{whatsonfavorites}", (int)eLeMenuSchedulesIT::whatsonfavorites);
|
||||||
tokenContainer->DefineIntToken("{timerpartitial}", (int)eLeMenuSchedulesIT::timerpartitial);
|
tokenContainer->DefineIntToken("{timerpartitial}", (int)eLeMenuSchedulesIT::timerpartitial);
|
||||||
tokenContainer->DefineIntToken("{timerfull}", (int)eLeMenuSchedulesIT::timerfull);
|
tokenContainer->DefineIntToken("{timerfull}", (int)eLeMenuSchedulesIT::timerfull);
|
||||||
|
tokenContainer->DefineIntToken("{isremotetimer}", (int)eLeMenuSchedulesIT::isremotetimer);
|
||||||
tokenContainer->DefineIntToken("{hasVPS}", (int)eLeMenuSchedulesIT::hasVPS);
|
tokenContainer->DefineIntToken("{hasVPS}", (int)eLeMenuSchedulesIT::hasVPS);
|
||||||
InheritTokenContainer();
|
InheritTokenContainer();
|
||||||
}
|
}
|
||||||
@ -780,6 +782,19 @@ bool cLeMenuSchedules::Parse(bool forced) {
|
|||||||
tokenContainer->AddIntToken((int)eLeMenuSchedulesIT::durationhours, event->Duration() / 3600);
|
tokenContainer->AddIntToken((int)eLeMenuSchedulesIT::durationhours, event->Duration() / 3600);
|
||||||
tokenContainer->AddStringToken((int)eLeMenuSchedulesST::durationminutes, *cString::sprintf("%.2d", (event->Duration() / 60)%60));
|
tokenContainer->AddStringToken((int)eLeMenuSchedulesST::durationminutes, *cString::sprintf("%.2d", (event->Duration() / 60)%60));
|
||||||
tokenContainer->AddIntToken((int)eLeMenuSchedulesIT::hasVPS, (bool)event->Vps());
|
tokenContainer->AddIntToken((int)eLeMenuSchedulesIT::hasVPS, (bool)event->Vps());
|
||||||
|
|
||||||
|
if (timerMatch == tmFull || timerMatch == tmPartial) {
|
||||||
|
cTimer_Detail_V1 data;
|
||||||
|
data.eventid = event->EventID();
|
||||||
|
data.hastimer = false;
|
||||||
|
data.local = true;
|
||||||
|
data.type = 'R';
|
||||||
|
if (cPlugin* pEpg2Vdr = cPluginManager::GetPlugin("epg2vdr"))
|
||||||
|
pEpg2Vdr->Service(EPG2VDR_TIMER_DETAIL_SERVICE, &data);
|
||||||
|
tokenContainer->AddIntToken((int)eLeMenuSchedulesIT::isremotetimer, !data.local);
|
||||||
|
char tp[2]; sprintf(tp, "%c", data.type);
|
||||||
|
tokenContainer->AddStringToken((int)eLeMenuSchedulesST::timertype, tp);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
char *sep = ParseSeparator(event->Title());
|
char *sep = ParseSeparator(event->Title());
|
||||||
tokenContainer->AddStringToken((int)eLeMenuSchedulesST::title, sep);
|
tokenContainer->AddStringToken((int)eLeMenuSchedulesST::title, sep);
|
||||||
@ -834,6 +849,7 @@ void cCeMenuSchedules::SetTokenContainer(void) {
|
|||||||
tokenContainer->DefineStringToken("{channelid}", (int)eCeMenuSchedulesST::channelid);
|
tokenContainer->DefineStringToken("{channelid}", (int)eCeMenuSchedulesST::channelid);
|
||||||
tokenContainer->DefineStringToken("{posterpath}", (int)eCeMenuSchedulesST::posterpath);
|
tokenContainer->DefineStringToken("{posterpath}", (int)eCeMenuSchedulesST::posterpath);
|
||||||
tokenContainer->DefineStringToken("{bannerpath}", (int)eCeMenuSchedulesST::bannerpath);
|
tokenContainer->DefineStringToken("{bannerpath}", (int)eCeMenuSchedulesST::bannerpath);
|
||||||
|
tokenContainer->DefineStringToken("{timertype}", (int)eCeMenuSchedulesST::timertype);
|
||||||
tokenContainer->DefineIntToken("{menuitemx}", (int)eCeMenuSchedulesIT::menuitemx);
|
tokenContainer->DefineIntToken("{menuitemx}", (int)eCeMenuSchedulesIT::menuitemx);
|
||||||
tokenContainer->DefineIntToken("{menuitemy}", (int)eCeMenuSchedulesIT::menuitemy);
|
tokenContainer->DefineIntToken("{menuitemy}", (int)eCeMenuSchedulesIT::menuitemy);
|
||||||
tokenContainer->DefineIntToken("{menuitemwidth}", (int)eCeMenuSchedulesIT::menuitemwidth);
|
tokenContainer->DefineIntToken("{menuitemwidth}", (int)eCeMenuSchedulesIT::menuitemwidth);
|
||||||
@ -861,6 +877,7 @@ void cCeMenuSchedules::SetTokenContainer(void) {
|
|||||||
tokenContainer->DefineIntToken("{whatsonfavorites}", (int)eCeMenuSchedulesIT::whatsonfavorites);
|
tokenContainer->DefineIntToken("{whatsonfavorites}", (int)eCeMenuSchedulesIT::whatsonfavorites);
|
||||||
tokenContainer->DefineIntToken("{timerpartitial}", (int)eCeMenuSchedulesIT::timerpartitial);
|
tokenContainer->DefineIntToken("{timerpartitial}", (int)eCeMenuSchedulesIT::timerpartitial);
|
||||||
tokenContainer->DefineIntToken("{timerfull}", (int)eCeMenuSchedulesIT::timerfull);
|
tokenContainer->DefineIntToken("{timerfull}", (int)eCeMenuSchedulesIT::timerfull);
|
||||||
|
tokenContainer->DefineIntToken("{isremotetimer}", (int)eCeMenuSchedulesIT::isremotetimer);
|
||||||
tokenContainer->DefineLoopToken("{schedule[title]}", (int)eCeMenuSchedulesLT::title);
|
tokenContainer->DefineLoopToken("{schedule[title]}", (int)eCeMenuSchedulesLT::title);
|
||||||
tokenContainer->DefineLoopToken("{schedule[shorttext]}", (int)eCeMenuSchedulesLT::shorttext);
|
tokenContainer->DefineLoopToken("{schedule[shorttext]}", (int)eCeMenuSchedulesLT::shorttext);
|
||||||
tokenContainer->DefineLoopToken("{schedule[start]}", (int)eCeMenuSchedulesLT::start);
|
tokenContainer->DefineLoopToken("{schedule[start]}", (int)eCeMenuSchedulesLT::start);
|
||||||
@ -925,6 +942,19 @@ bool cCeMenuSchedules::Parse(bool forced) {
|
|||||||
}
|
}
|
||||||
tokenContainer->AddIntToken((int)eCeMenuSchedulesIT::duration, event->Duration() / 60);
|
tokenContainer->AddIntToken((int)eCeMenuSchedulesIT::duration, event->Duration() / 60);
|
||||||
tokenContainer->AddIntToken((int)eCeMenuSchedulesIT::durationhours, event->Duration() / 3600);
|
tokenContainer->AddIntToken((int)eCeMenuSchedulesIT::durationhours, event->Duration() / 3600);
|
||||||
|
|
||||||
|
if (timerMatch == tmFull || timerMatch == tmPartial) {
|
||||||
|
cTimer_Detail_V1 data;
|
||||||
|
data.eventid = event->EventID();
|
||||||
|
data.hastimer = false;
|
||||||
|
data.local = true;
|
||||||
|
data.type = 'R';
|
||||||
|
if (cPlugin* pEpg2Vdr = cPluginManager::GetPlugin("epg2vdr"))
|
||||||
|
pEpg2Vdr->Service(EPG2VDR_TIMER_DETAIL_SERVICE, &data);
|
||||||
|
tokenContainer->AddIntToken((int)eCeMenuSchedulesIT::isremotetimer, !data.local);
|
||||||
|
char tp[2]; sprintf(tp, "%c", data.type);
|
||||||
|
tokenContainer->AddStringToken((int)eCeMenuSchedulesST::timertype, tp);
|
||||||
|
}
|
||||||
if (LoadFullScrapInfo(event, NULL))
|
if (LoadFullScrapInfo(event, NULL))
|
||||||
SetScraperPosterBanner(tokenContainer);
|
SetScraperPosterBanner(tokenContainer);
|
||||||
}
|
}
|
||||||
|
@ -17,24 +17,6 @@
|
|||||||
// Timer - Skin Interface
|
// Timer - Skin Interface
|
||||||
//***************************************************************************
|
//***************************************************************************
|
||||||
|
|
||||||
class cEpgEvent_Interface_V1 : public cEvent
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
cEpgEvent_Interface_V1(tEventID EventID)
|
|
||||||
: cEvent(EventID) {}
|
|
||||||
|
|
||||||
// #TODO ... getter
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// #TODO ... attributes
|
|
||||||
};
|
|
||||||
|
|
||||||
//***************************************************************************
|
|
||||||
// Timer - Skin Interface
|
|
||||||
//***************************************************************************
|
|
||||||
|
|
||||||
class cEpgTimer_Interface_V1 : public cTimer
|
class cEpgTimer_Interface_V1 : public cTimer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -90,7 +72,7 @@ class cEpgTimer_Interface_V1 : public cTimer
|
|||||||
};
|
};
|
||||||
|
|
||||||
//***************************************************************************
|
//***************************************************************************
|
||||||
// Timer - Service Interface
|
// Timer Service
|
||||||
//***************************************************************************
|
//***************************************************************************
|
||||||
|
|
||||||
struct cEpgTimer_Service_V1
|
struct cEpgTimer_Service_V1
|
||||||
@ -98,23 +80,28 @@ struct cEpgTimer_Service_V1
|
|||||||
std::list<cEpgTimer_Interface_V1*> epgTimers;
|
std::list<cEpgTimer_Interface_V1*> epgTimers;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
// Timer Detail Service
|
||||||
|
//***************************************************************************
|
||||||
|
|
||||||
|
struct cTimer_Detail_V1
|
||||||
|
{
|
||||||
|
long eventid;
|
||||||
|
int hastimer;
|
||||||
|
int local;
|
||||||
|
char type;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define EPG2VDR_TIMER_DETAIL_SERVICE "Epg2Vdr_Timer_Detail_Service-v1.0"
|
||||||
#define EPG2VDR_TIMER_SERVICE "Epg2Vdr_Timer_Service-v1.0"
|
#define EPG2VDR_TIMER_SERVICE "Epg2Vdr_Timer_Service-v1.0"
|
||||||
|
|
||||||
#ifdef EPG2VDR
|
#ifdef EPG2VDR
|
||||||
|
|
||||||
//***************************************************************************
|
//***************************************************************************
|
||||||
// Class cEpgEvent
|
|
||||||
//***************************************************************************
|
//***************************************************************************
|
||||||
|
//***************************************************************************
|
||||||
class cEpgEvent : public cEpgEvent_Interface_V1
|
// EPG2VDR Internal Stuff
|
||||||
{
|
//***************************************************************************
|
||||||
public:
|
|
||||||
|
|
||||||
cEpgEvent(tEventID EventID);
|
|
||||||
virtual ~cEpgEvent() {}
|
|
||||||
|
|
||||||
// #TODO ... setter
|
|
||||||
};
|
|
||||||
|
|
||||||
//***************************************************************************
|
//***************************************************************************
|
||||||
// Class cEpgTimer
|
// Class cEpgTimer
|
||||||
@ -124,13 +111,16 @@ class cEpgTimer : public cEpgTimer_Interface_V1
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
cEpgTimer(bool Instant = false, bool Pause = false, cChannel* Channel = 0);
|
cEpgTimer(bool Instant = false, bool Pause = false, const cChannel* Channel = 0);
|
||||||
virtual ~cEpgTimer();
|
virtual ~cEpgTimer();
|
||||||
|
|
||||||
void setTimerId(long id) { timerid = id; }
|
void setTimerId(long id) { timerid = id; }
|
||||||
void setEventId(long id) { eventid = 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 setState(char s, const char* info);
|
||||||
void setAction(char a);
|
|
||||||
void setVdr(const char* name, const char* uuid = 0, int running = 0);
|
void setVdr(const char* name, const char* uuid = 0, int running = 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static const char *VERSION = "1.2.5";
|
static const char *VERSION = "1.2.6";
|
||||||
static const char *DESCRIPTION = trNOOP("Skin Designer");
|
static const char *DESCRIPTION = trNOOP("Skin Designer");
|
||||||
|
|
||||||
class cPluginSkinDesigner : public cPlugin, public skindesignerapi::SkindesignerAPI {
|
class cPluginSkinDesigner : public cPlugin, public skindesignerapi::SkindesignerAPI {
|
||||||
|
Loading…
Reference in New Issue
Block a user