added tokens for framesPerSecond and isHD (Submitted by Peter Bieringer)

This commit is contained in:
kamel5 2021-01-17 14:23:33 +01:00
parent bc9cb23ed7
commit c5f0b5d3f8
8 changed files with 74 additions and 3 deletions

View File

@ -1159,6 +1159,8 @@ enum class eLeMenuRecordingsIT {
hasposter,
posterwidth,
posterheight,
framesPerSecond,
isHD,
count
};
@ -1202,6 +1204,8 @@ enum class eCeMenuRecordingsIT {
hasposter,
posterwidth,
posterheight,
framesPerSecond,
isHD,
count
};
@ -1312,6 +1316,8 @@ enum class eDmDetailedHeaderRecIT {
durationeventhours,
recimgavailable,
recchannelnumber,
framesPerSecond,
isHD,
count
};
@ -1419,6 +1425,8 @@ enum class eDmDetailedRecIT {
recimg1avaialble,
recimg2avaialble,
recimg3avaialble,
framesPerSecond,
isHD,
count
};

View File

@ -1710,6 +1710,8 @@ void cLeMenuRecordings::SetTokenContainer(void) {
tokenContainer->DefineIntToken("{hasposter}", (int)eLeMenuRecordingsIT::hasposter);
tokenContainer->DefineIntToken("{posterwidth}", (int)eLeMenuRecordingsIT::posterwidth);
tokenContainer->DefineIntToken("{posterheight}", (int)eLeMenuRecordingsIT::posterheight);
tokenContainer->DefineIntToken("{fps}", (int)eLeMenuRecordingsIT::framesPerSecond);
tokenContainer->DefineIntToken("{isHD}", (int)eLeMenuRecordingsIT::isHD);
InheritTokenContainer();
}
@ -1837,6 +1839,8 @@ bool cLeMenuRecordings::Parse(bool forced) {
tokenContainer->AddStringToken((int)eLeMenuRecordingsST::shorttext, info->ShortText());
tokenContainer->AddStringToken((int)eLeMenuRecordingsST::description, info->Description());
tokenContainer->AddIntToken((int)eLeMenuRecordingsIT::framesPerSecond, info->FramesPerSecond());
tokenContainer->AddIntToken((int)eLeMenuRecordingsIT::isHD, RecordingIsHD(event)); // detect HD from 'info'
SetScraperRecordingPoster(tokenContainer, usedRecording, true);
@ -1957,6 +1961,8 @@ void cCeMenuRecordings::SetTokenContainer(void) {
tokenContainer->DefineIntToken("{hasposter}", (int)eCeMenuRecordingsIT::hasposter);
tokenContainer->DefineIntToken("{posterwidth}", (int)eCeMenuRecordingsIT::posterwidth);
tokenContainer->DefineIntToken("{posterheight}", (int)eCeMenuRecordingsIT::posterheight);
tokenContainer->DefineIntToken("{fps}", (int)eCeMenuRecordingsIT::framesPerSecond);
tokenContainer->DefineIntToken("{isHD}", (int)eCeMenuRecordingsIT::isHD);
InheritTokenContainer();
}
@ -2091,6 +2097,8 @@ bool cCeMenuRecordings::Parse(bool forced) {
tokenContainer->AddStringToken((int)eCeMenuRecordingsST::shorttext, info->ShortText());
tokenContainer->AddStringToken((int)eCeMenuRecordingsST::description, info->Description());
tokenContainer->AddIntToken((int)eCeMenuRecordingsIT::framesPerSecond, info->FramesPerSecond());
tokenContainer->AddIntToken((int)eCeMenuRecordingsIT::isHD, RecordingIsHD(event)); // detect HD from 'info'
SetScraperRecordingPoster(tokenContainer, usedRecording, false);

View File

@ -603,6 +603,8 @@ void cViewDetailRec::SetTokenContainer(void) {
tokenContainer->DefineIntToken("{recimg1avaialble}", (int)eDmDetailedRecIT::recimg1avaialble);
tokenContainer->DefineIntToken("{recimg2avaialble}", (int)eDmDetailedRecIT::recimg2avaialble);
tokenContainer->DefineIntToken("{recimg3avaialble}", (int)eDmDetailedRecIT::recimg3avaialble);
tokenContainer->DefineIntToken("{fps}", (int)eDmDetailedRecIT::framesPerSecond);
tokenContainer->DefineIntToken("{isHD}", (int)eDmDetailedRecIT::isHD);
tokenContainer->DefineIntToken("{ismovie}", (int)eScraperIT::ismovie);
tokenContainer->DefineIntToken("{moviebudget}", (int)eScraperIT::moviebudget);
tokenContainer->DefineIntToken("{movierevenue}", (int)eScraperIT::movierevenue);
@ -666,6 +668,7 @@ bool cViewDetailRec::Parse(bool forced) {
tokenContainer->AddStringToken((int)eDmDetailedRecST::epgname, info->Title());
tokenContainer->AddStringToken((int)eDmDetailedRecST::shorttext, info->ShortText());
tokenContainer->AddStringToken((int)eDmDetailedRecST::description, info->Description());
tokenContainer->AddIntToken((int)eDmDetailedRecIT::framesPerSecond, info->FramesPerSecond());
const cEvent *event = info->GetEvent();
if (event) {
cString recDate = event->GetDateString();
@ -691,6 +694,7 @@ bool cViewDetailRec::Parse(bool forced) {
tokenContainer->AddIntToken((int)eDmDetailedRecIT::durationevent, duration);
tokenContainer->AddIntToken((int)eDmDetailedRecIT::durationeventhours, duration / 60);
tokenContainer->AddStringToken((int)eDmDetailedRecST::durationeventminutes, *cString::sprintf("%.2d", duration%60));
tokenContainer->AddIntToken((int)eDmDetailedRecIT::isHD, RecordingIsHD(event)); // detect HD from 'info'
}
}
SetRecInfos();

View File

@ -577,4 +577,37 @@ void cViewElement::StopAnimation(void) {
cView::RemoveAnimation(shifter);
if (fader)
cView::RemoveAnimation(fader);
}
}
/******************************************************************
* helper function (did not find any other common place)
******************************************************************/
bool RecordingIsHD(const cEvent* event) {
// detect HD from 'info'
bool isHD = false;
cComponents *Components = (cComponents *)event->Components();
if (Components) {
// detect HD
// Stream: 1 = MPEG2-Video, 2 = MPEG2 Audio, 3 = Untertitel, 4 = AC3-Audio, 5 = H.264-Video, 6 = HEAAC-Audio
// Stream == Video: 01 = 05 = 4:3, 02 = 03 = 06 = 07 = 16:9, 04 = 08 = >16:9, 09 = 0D = HD 4:3, 0A = 0B = 0E = 0F = HD 16:9, 0C = 10 = HD >16:9
// get video stream component
tComponent *Component = Components->GetComponent(0, 5, 0);
if (Component) {
switch (Component->type) {
case 0x09: // HD 4:3
case 0x0D: // HD 4:3
case 0x0A: // HD 16:9
case 0x0B: // HD 16:9
case 0x0E: // HD 16:9
case 0x0F: // HD 16:9
case 0x0C: // HD > 16:9
case 0x10: // HD > 16:9
isHD = true;
};
};
};
return isHD;
};

View File

@ -109,4 +109,10 @@ public:
virtual void Debug(bool full = false);
};
#endif //__VIEWELEMENT_H
/******************************************************************
* helper function (did not find any other common place)
******************************************************************/
bool RecordingIsHD(const cEvent* event);
#endif //__VIEWELEMENT_H

View File

@ -1166,6 +1166,8 @@ void cVeDmDetailheaderRec::SetTokenContainer(void) {
tokenContainer->DefineIntToken("{durationeventhours}", (int)eDmDetailedHeaderRecIT::durationeventhours);
tokenContainer->DefineIntToken("{recimgavailable}", (int)eDmDetailedHeaderRecIT::recimgavailable);
tokenContainer->DefineIntToken("{recchannelnumber}", (int)eDmDetailedHeaderRecIT::recchannelnumber);
tokenContainer->DefineIntToken("{fps}", (int)eDmDetailedHeaderRecIT::framesPerSecond);
tokenContainer->DefineIntToken("{isHD}", (int)eDmDetailedHeaderRecIT::isHD);
InheritTokenContainer();
}
@ -1185,6 +1187,7 @@ bool cVeDmDetailheaderRec::Parse(bool forced) {
if (info) {
tokenContainer->AddStringToken((int)eDmDetailedHeaderRecST::epgname, info->Title());
tokenContainer->AddStringToken((int)eDmDetailedHeaderRecST::shorttext, info->ShortText());
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::framesPerSecond, info->FramesPerSecond());
const cEvent *event = info->GetEvent();
if (event) {
cString recDate = event->GetDateString();
@ -1210,6 +1213,7 @@ bool cVeDmDetailheaderRec::Parse(bool forced) {
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::durationevent, duration);
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::durationeventhours, duration / 60);
tokenContainer->AddStringToken((int)eDmDetailedHeaderRecST::durationeventminutes, *cString::sprintf("%.2d", duration%60));
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isHD, RecordingIsHD(event)); // detect HD from 'info'
}
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
LOCK_CHANNELS_READ;

View File

@ -29,6 +29,8 @@
{recchannelname} name of channel from which was recorded
{recchannelid} id of channel from which was recorded
{recchannelnumber} number of channel from which was recorded
{framesPerSecond} frames per second (from EPG info)
{isHD} true if recording is HD (from EPG info)
-->
<detailheader>
</detailheader>
@ -49,6 +51,8 @@
{durationeventhours} event duration, full hours
{durationeventminutes} event duration, rest of minutes
{cutted} true if recording is cutted
{framesPerSecond} frames per second (from EPG info)
{isHD} true if recording is HD (from EPG info)
{recordingsize} size of recording (automatically in GB / MB)
{recordingsizecutted} size of cutted recording (automatically in GB / MB)

View File

@ -33,6 +33,8 @@
{posterwidth} width of scraped poster
{posterheight} height of scraped poster
{posterpath} absolute path of scraped poster
{framesPerSecond} frames per second (from EPG info)
{isHD} true if recording is HD (from EPG info)
-->
<listelement>
</listelement>
@ -72,9 +74,11 @@
{bannerwidth} width of scraped banner
{bannerheight} height of scraped banner
{bannerpath} absolute path of scraped banner
{framesPerSecond} frames per second (from EPG info)
{isHD} true if recording is HD (from EPG info)
-->
<currentelement delay="500" fadetime="0">
</currentelement>
</menuitems>
</menurecordings>
</menurecordings>