mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 15:58:31 +00:00
Merge branch 'pbiering/skindesigner-add-isRadio-to-recording'
This commit is contained in:
@@ -1169,6 +1169,7 @@ enum class eLeMenuRecordingsIT {
|
||||
framesPerSecond,
|
||||
isHD,
|
||||
isUHD,
|
||||
isRadio,
|
||||
count
|
||||
};
|
||||
|
||||
@@ -1215,6 +1216,7 @@ enum class eCeMenuRecordingsIT {
|
||||
framesPerSecond,
|
||||
isHD,
|
||||
isUHD,
|
||||
isRadio,
|
||||
count
|
||||
};
|
||||
|
||||
@@ -1328,6 +1330,7 @@ enum class eDmDetailedHeaderRecIT {
|
||||
framesPerSecond,
|
||||
isHD,
|
||||
isUHD,
|
||||
isRadio,
|
||||
count
|
||||
};
|
||||
|
||||
@@ -1438,6 +1441,7 @@ enum class eDmDetailedRecIT {
|
||||
framesPerSecond,
|
||||
isHD,
|
||||
isUHD,
|
||||
isRadio,
|
||||
count
|
||||
};
|
||||
|
||||
|
@@ -1753,6 +1753,7 @@ void cLeMenuRecordings::SetTokenContainer(void) {
|
||||
tokenContainer->DefineIntToken("{fps}", (int)eLeMenuRecordingsIT::framesPerSecond);
|
||||
tokenContainer->DefineIntToken("{isHD}", (int)eLeMenuRecordingsIT::isHD);
|
||||
tokenContainer->DefineIntToken("{isUHD}", (int)eLeMenuRecordingsIT::isUHD);
|
||||
tokenContainer->DefineIntToken("{isRadio}", (int)eLeMenuRecordingsIT::isRadio);
|
||||
InheritTokenContainer();
|
||||
}
|
||||
|
||||
@@ -1883,6 +1884,7 @@ bool cLeMenuRecordings::Parse(bool forced) {
|
||||
tokenContainer->AddIntToken((int)eLeMenuRecordingsIT::framesPerSecond, info->FramesPerSecond());
|
||||
tokenContainer->AddIntToken((int)eLeMenuRecordingsIT::isHD, RecordingIsHD(event)); // detect HD from 'info'
|
||||
tokenContainer->AddIntToken((int)eLeMenuRecordingsIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info'
|
||||
tokenContainer->AddIntToken((int)eLeMenuRecordingsIT::isRadio, RecordingIsRadio(event)); // detect Radio from 'info'
|
||||
|
||||
SetScraperRecordingPoster(tokenContainer, usedRecording, true);
|
||||
|
||||
@@ -2006,6 +2008,7 @@ void cCeMenuRecordings::SetTokenContainer(void) {
|
||||
tokenContainer->DefineIntToken("{fps}", (int)eCeMenuRecordingsIT::framesPerSecond);
|
||||
tokenContainer->DefineIntToken("{isHD}", (int)eCeMenuRecordingsIT::isHD);
|
||||
tokenContainer->DefineIntToken("{isUHD}", (int)eCeMenuRecordingsIT::isUHD);
|
||||
tokenContainer->DefineIntToken("{isRadio}", (int)eCeMenuRecordingsIT::isRadio);
|
||||
InheritTokenContainer();
|
||||
}
|
||||
|
||||
@@ -2143,6 +2146,7 @@ bool cCeMenuRecordings::Parse(bool forced) {
|
||||
tokenContainer->AddIntToken((int)eCeMenuRecordingsIT::framesPerSecond, info->FramesPerSecond());
|
||||
tokenContainer->AddIntToken((int)eCeMenuRecordingsIT::isHD, RecordingIsHD(event)); // detect HD from 'info'
|
||||
tokenContainer->AddIntToken((int)eCeMenuRecordingsIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info'
|
||||
tokenContainer->AddIntToken((int)eCeMenuRecordingsIT::isRadio, RecordingIsRadio(event)); // detect Radio from 'info'
|
||||
|
||||
SetScraperRecordingPoster(tokenContainer, usedRecording, false);
|
||||
|
||||
|
@@ -606,6 +606,7 @@ void cViewDetailRec::SetTokenContainer(void) {
|
||||
tokenContainer->DefineIntToken("{fps}", (int)eDmDetailedRecIT::framesPerSecond);
|
||||
tokenContainer->DefineIntToken("{isHD}", (int)eDmDetailedRecIT::isHD);
|
||||
tokenContainer->DefineIntToken("{isUHD}", (int)eDmDetailedRecIT::isUHD);
|
||||
tokenContainer->DefineIntToken("{isRadio}", (int)eDmDetailedRecIT::isRadio);
|
||||
tokenContainer->DefineIntToken("{ismovie}", (int)eScraperIT::ismovie);
|
||||
tokenContainer->DefineIntToken("{moviebudget}", (int)eScraperIT::moviebudget);
|
||||
tokenContainer->DefineIntToken("{movierevenue}", (int)eScraperIT::movierevenue);
|
||||
@@ -696,7 +697,8 @@ bool cViewDetailRec::Parse(bool forced) {
|
||||
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'
|
||||
tokenContainer->AddIntToken((int)eDmDetailedRecIT::isUHD, RecordingIsUHD(event)); // detect HD from 'info'
|
||||
tokenContainer->AddIntToken((int)eDmDetailedRecIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info'
|
||||
tokenContainer->AddIntToken((int)eDmDetailedRecIT::isRadio, RecordingIsRadio(event)); // detect Radio from 'info'
|
||||
}
|
||||
}
|
||||
SetRecInfos();
|
||||
|
@@ -596,17 +596,17 @@ bool RecordingIsHD(const cEvent* event) {
|
||||
int type = -1;
|
||||
|
||||
// #1: HVEC (stream content: 9)
|
||||
Component = Components->GetComponent(0, 9, 0);
|
||||
Component = Components->GetComponent(0, 9, 0); // recording info: "X 9 <type>"
|
||||
if (Component) {
|
||||
isHD = true; // HVEC is always HD, type 4|5|6|7 would be even UHD (see below dedicated detection function)
|
||||
} else {
|
||||
// #2: H.264 (stream content: 5)
|
||||
Component = Components->GetComponent(0, 5, 0);
|
||||
Component = Components->GetComponent(0, 5, 0); // recording info: "X 5 <type>"
|
||||
if (Component) {
|
||||
type = Component->type;
|
||||
} else {
|
||||
// #3: MPEG2 (stream content: 1)
|
||||
Component = Components->GetComponent(0, 1, 0);
|
||||
Component = Components->GetComponent(0, 1, 0); // recording info: "X 1 <type>"
|
||||
if (Component) {
|
||||
type = Component->type;
|
||||
};
|
||||
@@ -641,7 +641,7 @@ bool RecordingIsUHD(const cEvent* event) {
|
||||
int type = -1;
|
||||
|
||||
// HVEC (stream content: 9)
|
||||
Component = Components->GetComponent(0, 9, 0);
|
||||
Component = Components->GetComponent(0, 9, 0); // recording info: "X 9 <type>"
|
||||
if (Component) {
|
||||
type = Component->type;
|
||||
};
|
||||
@@ -656,3 +656,56 @@ bool RecordingIsUHD(const cEvent* event) {
|
||||
};
|
||||
return isUHD;
|
||||
};
|
||||
|
||||
bool RecordingIsRadio(const cEvent* event) {
|
||||
// detect Radio from 'info'
|
||||
bool isRadio = false;
|
||||
bool hasAudio = false;
|
||||
bool hasVideo = false;
|
||||
cComponents *Components = (cComponents *)event->Components();
|
||||
if (Components) {
|
||||
// Stream: 1 = MPEG2-Video, 2 = MPEG2 Audio, 3 = Untertitel, 4 = AC3-Audio, 5 = H.264-Video, 6 = HEAAC-Audio, 7 = DTS/DTS HD audio, 8 = SRM/CPCM data, 9 = HEVC Video, AC4 Audio
|
||||
|
||||
tComponent *Component;
|
||||
|
||||
Component = Components->GetComponent(0, 2, 0); // recording info: "X 2 <type>"
|
||||
if (Component) {
|
||||
hasAudio = true;
|
||||
};
|
||||
|
||||
Component = Components->GetComponent(0, 4, 0); // recording info: "X 4 <type>"
|
||||
if (Component) {
|
||||
hasAudio = true;
|
||||
};
|
||||
|
||||
Component = Components->GetComponent(0, 6, 0); // recording info: "X 6 <type>"
|
||||
if (Component) {
|
||||
hasAudio = true;
|
||||
};
|
||||
|
||||
Component = Components->GetComponent(0, 7, 0); // recording info: "X 7 <type>"
|
||||
if (Component) {
|
||||
hasAudio = true;
|
||||
};
|
||||
|
||||
Component = Components->GetComponent(0, 1, 0); // recording info: "X 1 <type>"
|
||||
if (Component) {
|
||||
hasVideo = true;
|
||||
};
|
||||
|
||||
Component = Components->GetComponent(0, 5, 0); // recording info: "X 5 <type>"
|
||||
if (Component) {
|
||||
hasVideo = true;
|
||||
};
|
||||
|
||||
Component = Components->GetComponent(0, 9, 0); // recording info: "X 9 <type>"
|
||||
if (Component) {
|
||||
hasVideo = true;
|
||||
};
|
||||
};
|
||||
|
||||
if ((hasAudio == true) && (hasVideo == false))
|
||||
isRadio = true;
|
||||
|
||||
return isRadio;
|
||||
};
|
||||
|
@@ -115,5 +115,6 @@ public:
|
||||
******************************************************************/
|
||||
bool RecordingIsHD(const cEvent* event);
|
||||
bool RecordingIsUHD(const cEvent* event);
|
||||
bool RecordingIsRadio(const cEvent* event);
|
||||
|
||||
#endif //__VIEWELEMENT_H
|
||||
|
@@ -1169,6 +1169,7 @@ void cVeDmDetailheaderRec::SetTokenContainer(void) {
|
||||
tokenContainer->DefineIntToken("{fps}", (int)eDmDetailedHeaderRecIT::framesPerSecond);
|
||||
tokenContainer->DefineIntToken("{isHD}", (int)eDmDetailedHeaderRecIT::isHD);
|
||||
tokenContainer->DefineIntToken("{isUHD}", (int)eDmDetailedHeaderRecIT::isUHD);
|
||||
tokenContainer->DefineIntToken("{isRadio}", (int)eDmDetailedHeaderRecIT::isRadio);
|
||||
InheritTokenContainer();
|
||||
}
|
||||
|
||||
@@ -1216,6 +1217,7 @@ bool cVeDmDetailheaderRec::Parse(bool forced) {
|
||||
tokenContainer->AddStringToken((int)eDmDetailedHeaderRecST::durationeventminutes, *cString::sprintf("%.2d", duration%60));
|
||||
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isHD, RecordingIsHD(event)); // detect HD from 'info'
|
||||
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isUHD, RecordingIsUHD(event)); // detect UHD from 'info'
|
||||
tokenContainer->AddIntToken((int)eDmDetailedHeaderRecIT::isRadio, RecordingIsRadio(event)); // detect Radio from 'info'
|
||||
}
|
||||
#if defined (APIVERSNUM) && (APIVERSNUM >= 20301)
|
||||
LOCK_CHANNELS_READ;
|
||||
|
Reference in New Issue
Block a user