Merge branch 'pbiering/recIsInUse-vdrIsRecording'

This commit is contained in:
kamel5 2021-05-04 13:58:03 +02:00
commit 4b2861e030
12 changed files with 111 additions and 4 deletions

View File

@ -503,3 +503,7 @@ Version 1.2.15
- [kamel5] Update Update italian tanslation in metrixhd and estuary4vdr - [kamel5] Update Update italian tanslation in metrixhd and estuary4vdr
- [pbiering] fix tuner device mapping in case tuners are not starting as first device - [pbiering] fix tuner device mapping in case tuners are not starting as first device
- [kamel5] Fix cutting marks wasn't updated - [kamel5] Fix cutting marks wasn't updated
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, 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
}; };
@ -1176,6 +1183,7 @@ enum class eLeMenuRecordingsIT {
isUHD, isUHD,
isRadio, isRadio,
isRecording, isRecording,
isInUse,
count count
}; };
@ -1226,6 +1234,7 @@ enum class eCeMenuRecordingsIT {
isUHD, isUHD,
isRadio, isRadio,
isRecording, isRecording,
isInUse,
count count
}; };
@ -1341,6 +1350,7 @@ enum class eDmDetailedHeaderRecIT {
isUHD, isUHD,
isRadio, isRadio,
isRecording, isRecording,
isInUse,
count count
}; };
@ -1453,6 +1463,7 @@ enum class eDmDetailedRecIT {
isUHD, isUHD,
isRadio, isRadio,
isRecording, isRecording,
isInUse,
count count
}; };
@ -1514,6 +1525,7 @@ enum class eDRRecInfoIT {
isHD, isHD,
isUHD, isUHD,
isRecording, isRecording,
isInUse,
isWideScreen, isWideScreen,
count count
}; };

View File

@ -151,6 +151,7 @@
tokenContainer->DefineIntToken("{isUHD}", (int)token_it::isUHD); \ tokenContainer->DefineIntToken("{isUHD}", (int)token_it::isUHD); \
tokenContainer->DefineIntToken("{isRadio}", (int)token_it::isRadio); \ tokenContainer->DefineIntToken("{isRadio}", (int)token_it::isRadio); \
tokenContainer->DefineIntToken("{isRecording}", (int)token_it::isRecording); \ tokenContainer->DefineIntToken("{isRecording}", (int)token_it::isRecording); \
tokenContainer->DefineIntToken("{isInUse}", (int)token_it::isInUse); \
tokenContainer->DefineStringToken("{recchannelname}", (int)token_st::recchannelname); \ tokenContainer->DefineStringToken("{recchannelname}", (int)token_st::recchannelname); \
tokenContainer->DefineStringToken("{recchannelid}", (int)token_st::recchannelid); \ tokenContainer->DefineStringToken("{recchannelid}", (int)token_st::recchannelid); \
} }
@ -209,6 +210,7 @@
tokenContainer->AddIntToken((int)token_it::isUHD, RecordingIsUHD(event)); /* detect UHD from 'info' */ \ tokenContainer->AddIntToken((int)token_it::isUHD, RecordingIsUHD(event)); /* detect UHD from 'info' */ \
tokenContainer->AddIntToken((int)token_it::isRadio, RecordingIsRadio(event, info->FramesPerSecond())); /* detect Radio from 'info' and FPS */ \ tokenContainer->AddIntToken((int)token_it::isRadio, RecordingIsRadio(event, info->FramesPerSecond())); /* detect Radio from 'info' and FPS */ \
tokenContainer->AddIntToken((int)token_it::isRecording, usedRecording->IsInUse() & ruTimer); \ tokenContainer->AddIntToken((int)token_it::isRecording, usedRecording->IsInUse() & ruTimer); \
tokenContainer->AddIntToken((int)token_it::isInUse, usedRecording->IsInUse()); \
SetScraperRecordingPoster(tokenContainer, usedRecording, true); \ SetScraperRecordingPoster(tokenContainer, usedRecording, true); \
} }

View File

@ -608,6 +608,7 @@ void cViewDetailRec::SetTokenContainer(void) {
tokenContainer->DefineIntToken("{isUHD}", (int)eDmDetailedRecIT::isUHD); tokenContainer->DefineIntToken("{isUHD}", (int)eDmDetailedRecIT::isUHD);
tokenContainer->DefineIntToken("{isRadio}", (int)eDmDetailedRecIT::isRadio); tokenContainer->DefineIntToken("{isRadio}", (int)eDmDetailedRecIT::isRadio);
tokenContainer->DefineIntToken("{isRecording}", (int)eDmDetailedRecIT::isRecording); tokenContainer->DefineIntToken("{isRecording}", (int)eDmDetailedRecIT::isRecording);
tokenContainer->DefineIntToken("{isInUse}", (int)eDmDetailedRecIT::isInUse);
tokenContainer->DefineIntToken("{ismovie}", (int)eScraperIT::ismovie); tokenContainer->DefineIntToken("{ismovie}", (int)eScraperIT::ismovie);
tokenContainer->DefineIntToken("{moviebudget}", (int)eScraperIT::moviebudget); tokenContainer->DefineIntToken("{moviebudget}", (int)eScraperIT::moviebudget);
tokenContainer->DefineIntToken("{movierevenue}", (int)eScraperIT::movierevenue); tokenContainer->DefineIntToken("{movierevenue}", (int)eScraperIT::movierevenue);
@ -701,6 +702,7 @@ bool cViewDetailRec::Parse(bool forced) {
tokenContainer->AddIntToken((int)eDmDetailedRecIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info' tokenContainer->AddIntToken((int)eDmDetailedRecIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info'
tokenContainer->AddIntToken((int)eDmDetailedRecIT::isRadio, RecordingIsRadio(event, info->FramesPerSecond())); // detect Radio from 'info' and FPS tokenContainer->AddIntToken((int)eDmDetailedRecIT::isRadio, RecordingIsRadio(event, info->FramesPerSecond())); // detect Radio from 'info' and FPS
tokenContainer->AddIntToken((int)eDmDetailedRecIT::isRecording, recording->IsInUse() & ruTimer); tokenContainer->AddIntToken((int)eDmDetailedRecIT::isRecording, recording->IsInUse() & ruTimer);
tokenContainer->AddIntToken((int)eDmDetailedRecIT::isInUse, recording->IsInUse());
} }
} }
SetRecInfos(); SetRecInfos();

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();
@ -1190,6 +1198,10 @@ void cViewMenuMain::Clear(void) {
vdrstats->Reset(); vdrstats->Reset();
vdrstats->Hide(); vdrstats->Hide();
} }
if (vdrstatus) {
vdrstatus->Hide();
}
if (temperatures) { if (temperatures) {
temperatures->Reset(); temperatures->Reset();
@ -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;
@ -322,4 +323,4 @@ public:
void SetTransparency(int transparency, bool forceDetached = false); 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(); 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) {
@ -1171,6 +1201,7 @@ void cVeDmDetailheaderRec::SetTokenContainer(void) {
tokenContainer->DefineIntToken("{isUHD}", (int)eDmDetailedHeaderRecIT::isUHD); tokenContainer->DefineIntToken("{isUHD}", (int)eDmDetailedHeaderRecIT::isUHD);
tokenContainer->DefineIntToken("{isRadio}", (int)eDmDetailedHeaderRecIT::isRadio); tokenContainer->DefineIntToken("{isRadio}", (int)eDmDetailedHeaderRecIT::isRadio);
tokenContainer->DefineIntToken("{isRecording}", (int)eDmDetailedHeaderRecIT::isRecording); tokenContainer->DefineIntToken("{isRecording}", (int)eDmDetailedHeaderRecIT::isRecording);
tokenContainer->DefineIntToken("{isInUse}", (int)eDmDetailedHeaderRecIT::isInUse);
InheritTokenContainer(); InheritTokenContainer();
} }
@ -1220,6 +1251,7 @@ bool cVeDmDetailheaderRec::Parse(bool forced) {
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info' tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info'
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isRadio, RecordingIsRadio(event, info->FramesPerSecond())); // detect Radio from 'info' and FPS tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isRadio, RecordingIsRadio(event, info->FramesPerSecond())); // detect Radio from 'info' and FPS
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isRecording, recording->IsInUse() & ruTimer); tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isRecording, recording->IsInUse() & ruTimer);
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isInUse, recording->IsInUse());
} }
if (info->ChannelName() && (strlen(info->ChannelName()) > 0)) { if (info->ChannelName() && (strlen(info->ChannelName()) > 0)) {

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

View File

@ -120,6 +120,7 @@ void cVeDrRecInfo::SetTokenContainer(void) {
tokenContainer->DefineIntToken("{isHD}", (int)eDRRecInfoIT::isHD); tokenContainer->DefineIntToken("{isHD}", (int)eDRRecInfoIT::isHD);
tokenContainer->DefineIntToken("{isUHD}", (int)eDRRecInfoIT::isUHD); tokenContainer->DefineIntToken("{isUHD}", (int)eDRRecInfoIT::isUHD);
tokenContainer->DefineIntToken("{isRecording}", (int)eDRRecInfoIT::isRecording); tokenContainer->DefineIntToken("{isRecording}", (int)eDRRecInfoIT::isRecording);
tokenContainer->DefineIntToken("{isInUse}", (int)eDRRecInfoIT::isInUse);
tokenContainer->DefineIntToken("{isWideScreen}", (int)eDRRecInfoIT::isWideScreen); tokenContainer->DefineIntToken("{isWideScreen}", (int)eDRRecInfoIT::isWideScreen);
InheritTokenContainer(); InheritTokenContainer();
} }
@ -150,6 +151,7 @@ bool cVeDrRecInfo::Parse(bool force) {
tokenContainer->AddIntToken((int)eDRRecInfoIT::isHD, isHD); tokenContainer->AddIntToken((int)eDRRecInfoIT::isHD, isHD);
tokenContainer->AddIntToken((int)eDRRecInfoIT::isUHD, isUHD); tokenContainer->AddIntToken((int)eDRRecInfoIT::isUHD, isUHD);
tokenContainer->AddIntToken((int)eDRRecInfoIT::isRecording, recording->IsInUse() & ruTimer); tokenContainer->AddIntToken((int)eDRRecInfoIT::isRecording, recording->IsInUse() & ruTimer);
tokenContainer->AddIntToken((int)eDRRecInfoIT::isInUse, recording->IsInUse());
tokenContainer->AddIntToken((int)eDRRecInfoIT::isWideScreen, isWideScreen); tokenContainer->AddIntToken((int)eDRRecInfoIT::isWideScreen, isWideScreen);
tokenContainer->AddStringToken((int)eDRRecInfoST::resolution, resName.c_str()); tokenContainer->AddStringToken((int)eDRRecInfoST::resolution, resName.c_str());
tokenContainer->AddStringToken((int)eDRRecInfoST::aspect, aspectName.c_str()); tokenContainer->AddStringToken((int)eDRRecInfoST::aspect, aspectName.c_str());

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
@ -501,4 +515,4 @@
debug (true|false) #IMPLIED debug (true|false) #IMPLIED
> >
%functions; %functions;

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