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+
- [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,
temperatures,
vdrstatistics,
vdrstatus,
lastrecordings,
customtokens,
count
@ -735,6 +736,12 @@ enum class eDMVdrstatisticsIT {
count = 0
};
enum class eDMVdrstatusIT {
vdrIsRecordingsHandlersActive,
vdrIsRecording,
count
};
enum class eDMTemperaturesST {
count = 0
};

View File

@ -1059,6 +1059,7 @@ cViewMenuMain::cViewMenuMain(const char *name) : cSubView(name) {
load = NULL;
memory = NULL;
vdrstats = NULL;
vdrstatus = NULL;
temperatures = NULL;
currentSchedule = 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>("systemmemory", (int)eVeDisplayMenuMain::systemmemory));
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>("lastrecordings", (int)eVeDisplayMenuMain::lastrecordings));
viewElementNames.insert(pair<string, int>("customtokens", (int)eVeDisplayMenuMain::customtokens));
@ -1133,6 +1135,11 @@ void cViewMenuMain::SetViewElementObjects(void) {
else if (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])
temperatures = dynamic_cast<cVeDmTemperatures*>(viewElementsHorizontal[(int)eVeDisplayMenuMain::temperatures]);
else if (viewElements[(int)eVeDisplayMenuMain::temperatures])
@ -1154,6 +1161,7 @@ void cViewMenuMain::SetViewElementObjects(void) {
if (load) load->SetDetached();
if (memory) memory->SetDetached();
if (vdrstats) vdrstats->SetDetached();
if (vdrstatus) vdrstatus->SetDetached();
if (temperatures) temperatures->SetDetached();
if (timers) timers->SetDetached();
if (currentSchedule) currentSchedule->SetDetached();
@ -1190,6 +1198,10 @@ void cViewMenuMain::Clear(void) {
vdrstats->Reset();
vdrstats->Hide();
}
if (vdrstatus) {
vdrstatus->Hide();
}
if (temperatures) {
temperatures->Reset();
@ -1283,6 +1295,11 @@ void cViewMenuMain::DrawDynamicVEs(void) {
if (vdrstats->Parse())
vdrstats->Render();
}
if (vdrstatus) {
vdrstatus->Show();
if (vdrstatus->Parse())
vdrstatus->Render();
}
if (temperatures) {
temperatures->Show();
if (temperatures->Parse())

View File

@ -188,6 +188,7 @@ private:
cVeDmSystemload *load;
cVeDmSystemmemory *memory;
cVeDmVdrstatistics *vdrstats;
cVeDmVdrstatus *vdrstatus;
cVeDmTemperatures *temperatures;
cVeDmCurrentschedule *currentSchedule;
cVeDmLastrecordings *lastRecordings;
@ -322,4 +323,4 @@ public:
void SetTransparency(int transparency, bool forceDetached = false);
};
#endif //__VIEWDISPLAYMENU_H
#endif //__VIEWDISPLAYMENU_H

View File

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

View File

@ -867,6 +867,36 @@ bool cVeDmVdrstatistics::Parse(bool forced) {
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(void) {

View File

@ -178,6 +178,18 @@ public:
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
******************************************************************/
@ -253,4 +265,4 @@ public:
void SetActiveTab(int activeTab) { SetDirty(); this->activeTab = activeTab; };
bool Parse(bool forced = false);
};
#endif //__VIEWELEMENTSDM_H
#endif //__VIEWELEMENTSDM_H

View File

@ -218,6 +218,20 @@
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)*>
<!ATTLIST currentschedule
delay CDATA #IMPLIED
@ -316,7 +330,7 @@
>
<!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)*>
<!ATTLIST menumain
x CDATA #REQUIRED
@ -501,4 +515,4 @@
debug (true|false) #IMPLIED
>
%functions;
%functions;

View File

@ -91,6 +91,13 @@
<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:
{cputemp} current cpu temperature in °C
{gputemp} current gpu temperature in °C