add additional vdrstatus exposing "vdrIsRecordingsHandlersActive" and "vdrIsRecording" - can be used in skins for e.g. IDLE/BUSY REC/FREE

This commit is contained in:
Peter Bieringer 2021-05-03 10:53:55 +02:00
parent 700798ba21
commit 0ca96e8b3a
9 changed files with 95 additions and 4 deletions

View File

@ -506,3 +506,4 @@ Version 1.2.15
Upcoming for Version 1.2.16+ Upcoming for Version 1.2.16+
- [pbiering] add additional recording flag "isInUse" - can be used in skins for e.g. records in cutting/copy(queue) - [pbiering] add additional recording flag "isInUse" - can be used in skins for e.g. records in cutting/copy(queue)
- [pbiering] add additional vdrstatus exposing "vdrIsRecordingsHandlersActive" and "vdrIsRecording" - can be used in skins for e.g. IDLE/BUSY REC/FREE

View File

@ -79,6 +79,7 @@ enum class eVeDisplayMenuMain {
systemmemory, systemmemory,
temperatures, temperatures,
vdrstatistics, vdrstatistics,
vdrstatus,
lastrecordings, lastrecordings,
customtokens, customtokens,
count count
@ -735,6 +736,12 @@ enum class eDMVdrstatisticsIT {
count = 0 count = 0
}; };
enum class eDMVdrstatusIT {
vdrIsRecordingsHandlersActive,
vdrIsRecording,
count
};
enum class eDMTemperaturesST { enum class eDMTemperaturesST {
count = 0 count = 0
}; };

View File

@ -1059,6 +1059,7 @@ cViewMenuMain::cViewMenuMain(const char *name) : cSubView(name) {
load = NULL; load = NULL;
memory = NULL; memory = NULL;
vdrstats = NULL; vdrstats = NULL;
vdrstatus = NULL;
temperatures = NULL; temperatures = NULL;
currentSchedule = NULL; currentSchedule = NULL;
lastRecordings = NULL; lastRecordings = NULL;
@ -1084,6 +1085,7 @@ void cViewMenuMain::SetViewElements(void) {
viewElementNames.insert(pair<string, int>("systemload", (int)eVeDisplayMenuMain::systemload)); viewElementNames.insert(pair<string, int>("systemload", (int)eVeDisplayMenuMain::systemload));
viewElementNames.insert(pair<string, int>("systemmemory", (int)eVeDisplayMenuMain::systemmemory)); viewElementNames.insert(pair<string, int>("systemmemory", (int)eVeDisplayMenuMain::systemmemory));
viewElementNames.insert(pair<string, int>("vdrstatistics", (int)eVeDisplayMenuMain::vdrstatistics)); viewElementNames.insert(pair<string, int>("vdrstatistics", (int)eVeDisplayMenuMain::vdrstatistics));
viewElementNames.insert(pair<string, int>("vdrstatus", (int)eVeDisplayMenuMain::vdrstatus));
viewElementNames.insert(pair<string, int>("temperatures", (int)eVeDisplayMenuMain::temperatures)); viewElementNames.insert(pair<string, int>("temperatures", (int)eVeDisplayMenuMain::temperatures));
viewElementNames.insert(pair<string, int>("lastrecordings", (int)eVeDisplayMenuMain::lastrecordings)); viewElementNames.insert(pair<string, int>("lastrecordings", (int)eVeDisplayMenuMain::lastrecordings));
viewElementNames.insert(pair<string, int>("customtokens", (int)eVeDisplayMenuMain::customtokens)); viewElementNames.insert(pair<string, int>("customtokens", (int)eVeDisplayMenuMain::customtokens));
@ -1133,6 +1135,11 @@ void cViewMenuMain::SetViewElementObjects(void) {
else if (viewElements[(int)eVeDisplayMenuMain::vdrstatistics]) else if (viewElements[(int)eVeDisplayMenuMain::vdrstatistics])
vdrstats = dynamic_cast<cVeDmVdrstatistics*>(viewElements[(int)eVeDisplayMenuMain::vdrstatistics]); vdrstats = dynamic_cast<cVeDmVdrstatistics*>(viewElements[(int)eVeDisplayMenuMain::vdrstatistics]);
if (orientation == eOrientation::horizontal && viewElementsHorizontal[(int)eVeDisplayMenuMain::vdrstatus])
vdrstatus = dynamic_cast<cVeDmVdrstatus*>(viewElementsHorizontal[(int)eVeDisplayMenuMain::vdrstatus]);
else if (viewElements[(int)eVeDisplayMenuMain::vdrstatus])
vdrstatus = dynamic_cast<cVeDmVdrstatus*>(viewElements[(int)eVeDisplayMenuMain::vdrstatus]);
if (orientation == eOrientation::horizontal && viewElementsHorizontal[(int)eVeDisplayMenuMain::temperatures]) if (orientation == eOrientation::horizontal && viewElementsHorizontal[(int)eVeDisplayMenuMain::temperatures])
temperatures = dynamic_cast<cVeDmTemperatures*>(viewElementsHorizontal[(int)eVeDisplayMenuMain::temperatures]); temperatures = dynamic_cast<cVeDmTemperatures*>(viewElementsHorizontal[(int)eVeDisplayMenuMain::temperatures]);
else if (viewElements[(int)eVeDisplayMenuMain::temperatures]) else if (viewElements[(int)eVeDisplayMenuMain::temperatures])
@ -1154,6 +1161,7 @@ void cViewMenuMain::SetViewElementObjects(void) {
if (load) load->SetDetached(); if (load) load->SetDetached();
if (memory) memory->SetDetached(); if (memory) memory->SetDetached();
if (vdrstats) vdrstats->SetDetached(); if (vdrstats) vdrstats->SetDetached();
if (vdrstatus) vdrstatus->SetDetached();
if (temperatures) temperatures->SetDetached(); if (temperatures) temperatures->SetDetached();
if (timers) timers->SetDetached(); if (timers) timers->SetDetached();
if (currentSchedule) currentSchedule->SetDetached(); if (currentSchedule) currentSchedule->SetDetached();
@ -1191,6 +1199,10 @@ void cViewMenuMain::Clear(void) {
vdrstats->Hide(); vdrstats->Hide();
} }
if (vdrstatus) {
vdrstatus->Hide();
}
if (temperatures) { if (temperatures) {
temperatures->Reset(); temperatures->Reset();
temperatures->Hide(); temperatures->Hide();
@ -1283,6 +1295,11 @@ void cViewMenuMain::DrawDynamicVEs(void) {
if (vdrstats->Parse()) if (vdrstats->Parse())
vdrstats->Render(); vdrstats->Render();
} }
if (vdrstatus) {
vdrstatus->Show();
if (vdrstatus->Parse())
vdrstatus->Render();
}
if (temperatures) { if (temperatures) {
temperatures->Show(); temperatures->Show();
if (temperatures->Parse()) if (temperatures->Parse())

View File

@ -188,6 +188,7 @@ private:
cVeDmSystemload *load; cVeDmSystemload *load;
cVeDmSystemmemory *memory; cVeDmSystemmemory *memory;
cVeDmVdrstatistics *vdrstats; cVeDmVdrstatistics *vdrstats;
cVeDmVdrstatus *vdrstatus;
cVeDmTemperatures *temperatures; cVeDmTemperatures *temperatures;
cVeDmCurrentschedule *currentSchedule; cVeDmCurrentschedule *currentSchedule;
cVeDmLastrecordings *lastRecordings; cVeDmLastrecordings *lastRecordings;

View File

@ -147,6 +147,8 @@ cViewElement *cViewElement::CreateViewElement(const char *name, const char *view
e = new cVeDmTemperatures(); e = new cVeDmTemperatures();
else if (!strcmp(name, "vdrstatistics")) else if (!strcmp(name, "vdrstatistics"))
e = new cVeDmVdrstatistics(); e = new cVeDmVdrstatistics();
else if (!strcmp(name, "vdrstatus"))
e = new cVeDmVdrstatus();
else if (!strcmp(name, "lastrecordings")) else if (!strcmp(name, "lastrecordings"))
e = new cVeDmLastrecordings(); e = new cVeDmLastrecordings();
else if (!strcmp(name, "detailheaderepg")) else if (!strcmp(name, "detailheaderepg"))

View File

@ -867,6 +867,36 @@ bool cVeDmVdrstatistics::Parse(bool forced) {
return true; return true;
} }
/****************************************************************** /******************************************************************
* cVeDmVdrstatus
******************************************************************/
cVeDmVdrstatus::cVeDmVdrstatus(void) {
}
cVeDmVdrstatus::~cVeDmVdrstatus(void) {
}
void cVeDmVdrstatus::Close(void) {
cViewElement::Close();
}
void cVeDmVdrstatus::SetTokenContainer(void) {
tokenContainer = new skindesignerapi::cTokenContainer();
tokenContainer->DefineIntToken("{vdrIsRecordingsHandlersActive}", (int)eDMVdrstatusIT::vdrIsRecordingsHandlersActive);
tokenContainer->DefineIntToken("{vdrIsRecording}", (int)eDMVdrstatusIT::vdrIsRecording);
InheritTokenContainer();
}
bool cVeDmVdrstatus::Parse(bool forced) {
if (!cViewElement::Parse(forced))
return false;
tokenContainer->Clear();
tokenContainer->AddIntToken((int)eDMVdrstatusIT::vdrIsRecordingsHandlersActive, RecordingsHandler.Active());
tokenContainer->AddIntToken((int)eDMVdrstatusIT::vdrIsRecording, cRecordControls::Active());
SetDirty();
return true;
}
/******************************************************************
* cVeDmLastrecordings * cVeDmLastrecordings
******************************************************************/ ******************************************************************/
cVeDmLastrecordings::cVeDmLastrecordings(void) { cVeDmLastrecordings::cVeDmLastrecordings(void) {

View File

@ -178,6 +178,18 @@ public:
bool Parse(bool forced = false); bool Parse(bool forced = false);
}; };
/******************************************************************
* cVeDmVdrstatus
******************************************************************/
class cVeDmVdrstatus : public cViewElement {
public:
cVeDmVdrstatus(void);
virtual ~cVeDmVdrstatus(void);
void Close(void);
void SetTokenContainer(void);
bool Parse(bool forced = false);
};
/****************************************************************** /******************************************************************
* cVeDmLastrecordings * cVeDmLastrecordings
******************************************************************/ ******************************************************************/

View File

@ -218,6 +218,20 @@
condition CDATA #IMPLIED condition CDATA #IMPLIED
> >
<!ELEMENT vdrstatus (areacontainer|area|areascroll)*>
<!ATTLIST vdrstatus
delay CDATA #IMPLIED
orientation CDATA #IMPLIED
fadetime CDATA #IMPLIED
shifttime CDATA #IMPLIED
shifttype CDATA #IMPLIED
shiftmode CDATA #IMPLIED
startx CDATA #IMPLIED
starty CDATA #IMPLIED
debug CDATA #IMPLIED
condition CDATA #IMPLIED
>
<!ELEMENT currentschedule (areacontainer|area|areascroll)*> <!ELEMENT currentschedule (areacontainer|area|areascroll)*>
<!ATTLIST currentschedule <!ATTLIST currentschedule
delay CDATA #IMPLIED delay CDATA #IMPLIED
@ -316,7 +330,7 @@
> >
<!ELEMENT menumain (background | header | datetime | time | colorbuttons | scrollbar | sortmode | timers | <!ELEMENT menumain (background | header | datetime | time | colorbuttons | scrollbar | sortmode | timers |
discusage | devices | systemload | systemmemory | vdrstatistics | temperatures | currentschedule | discusage | devices | systemload | systemmemory | vdrstatistics | vdrstatus | temperatures | currentschedule |
currentweather | lastrecordings | customtokens | menuitems)*> currentweather | lastrecordings | customtokens | menuitems)*>
<!ATTLIST menumain <!ATTLIST menumain
x CDATA #REQUIRED x CDATA #REQUIRED

View File

@ -91,6 +91,13 @@
<vdrstatistics> <vdrstatistics>
</vdrstatistics> </vdrstatistics>
<!-- Available Variables vdrstatus
{vdrIsRecordingsHandlersActive} true if active RecordingsHandlers (cut,copy,move) aka "busy"
{vdrIsRecording} true if active recording
-->
<vdrstatus>
</vdrstatus>
<!-- Available Variables tempreatures: <!-- Available Variables tempreatures:
{cputemp} current cpu temperature in °C {cputemp} current cpu temperature in °C
{gputemp} current gpu temperature in °C {gputemp} current gpu temperature in °C