mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 15:58:31 +00:00
added extented recording information
This commit is contained in:
@@ -309,47 +309,6 @@ void cDisplayChannelView::ClearScreenResolution(void) {
|
||||
lastScreenHeight = 0;
|
||||
}
|
||||
|
||||
string cDisplayChannelView::GetScreenResolutionString(int width, int height, bool *isHD) {
|
||||
string name = "";
|
||||
switch (width) {
|
||||
case 1920:
|
||||
case 1440:
|
||||
name = "hd1080i";
|
||||
*isHD = true;
|
||||
break;
|
||||
case 1280:
|
||||
if (height == 720)
|
||||
name = "hd720p";
|
||||
else
|
||||
name = "hd1080i";
|
||||
*isHD = true;
|
||||
break;
|
||||
case 720:
|
||||
name = "sd576i";
|
||||
break;
|
||||
default:
|
||||
name = "sd576i";
|
||||
break;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
string cDisplayChannelView::GetScreenAspectString(double aspect, bool *isWideScreen) {
|
||||
string name = "";
|
||||
*isWideScreen = false;
|
||||
if (aspect == 4.0/3.0) {
|
||||
name = "4:3";
|
||||
*isWideScreen = false;
|
||||
} else if (aspect == 16.0/9.0) {
|
||||
name = "16:9";
|
||||
*isWideScreen = true;
|
||||
} else if (aspect == 2.21) {
|
||||
name = "21:9";
|
||||
*isWideScreen = true;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
void cDisplayChannelView::DrawScraperContent(const cEvent *event) {
|
||||
if (!event)
|
||||
return;
|
||||
|
@@ -16,8 +16,6 @@ private:
|
||||
int lastAudioChannel;
|
||||
string lastTracDesc;
|
||||
string lastTrackLang;
|
||||
string GetScreenResolutionString(int width, int height, bool *isHD);
|
||||
string GetScreenAspectString(double aspect, bool *isWideScreen);
|
||||
string GetChannelSep(const cChannel *channel, bool prev);
|
||||
virtual void Action(void);
|
||||
public:
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#include "../services/scraper2vdr.h"
|
||||
#include "../libcore/helpers.h"
|
||||
#include "../libcore/recfolderinfo.h"
|
||||
#include "../libcore/extrecinfo.h"
|
||||
#include "displaymenuitemcurrentview.h"
|
||||
|
||||
|
||||
@@ -504,6 +505,8 @@ void cDisplayMenuItemCurrentRecordingView::Prepare(void) {
|
||||
void cDisplayMenuItemCurrentRecordingView::Render(void) {
|
||||
if (!recording)
|
||||
return;
|
||||
map < string, vector< map< string, string > > > loopTokens;
|
||||
|
||||
bool isFolder = (total > 0) ? true : false;
|
||||
intTokens.insert(pair<string,int>("folder", isFolder));
|
||||
|
||||
@@ -553,9 +556,44 @@ void cDisplayMenuItemCurrentRecordingView::Render(void) {
|
||||
|
||||
SetScraperPoster(NULL, usedRecording);
|
||||
|
||||
|
||||
const cRecordingInfo *info = usedRecording->Info();
|
||||
if (!info) return;
|
||||
|
||||
|
||||
bool extRecinfoAvailable = false;
|
||||
if (info->Aux()) {
|
||||
cExtRecInfo extRecInfo(info->Aux());
|
||||
if (extRecInfo.Parse()) {
|
||||
extRecinfoAvailable = true;
|
||||
intTokens.insert(pair<string,int>("screenwidth", extRecInfo.resWidth));
|
||||
intTokens.insert(pair<string,int>("screenheight", extRecInfo.resHeight));
|
||||
intTokens.insert(pair<string,int>("isHD", extRecInfo.isHD));
|
||||
intTokens.insert(pair<string,int>("isWideScreen", extRecInfo.isWideScreen));
|
||||
intTokens.insert(pair<string,int>("isDolby", extRecInfo.isDolby));
|
||||
stringTokens.insert(pair<string,string>("resolution", extRecInfo.resString));
|
||||
stringTokens.insert(pair<string,string>("aspect", extRecInfo.aspectratio));
|
||||
stringTokens.insert(pair<string,string>("codec", extRecInfo.codec));
|
||||
stringTokens.insert(pair<string,string>("format", extRecInfo.format));
|
||||
stringTokens.insert(pair<string,string>("framerate", extRecInfo.framerate));
|
||||
stringTokens.insert(pair<string,string>("interlace", extRecInfo.interlace));
|
||||
intTokens.insert(pair<string,int>("numtracks", extRecInfo.tracks.size()));
|
||||
vector< map<string,string> > trackTokens;
|
||||
int trackNumber = 1;
|
||||
for (vector<tAudioTrack>::iterator track = extRecInfo.tracks.begin(); track != extRecInfo.tracks.end(); track++) {
|
||||
map<string,string> element;
|
||||
stringstream trackNum;
|
||||
trackNum << trackNumber++;
|
||||
element.insert(pair<string,string>("track[num]", trackNum.str()));
|
||||
element.insert(pair<string,string>("track[codec]", (*track).codec));
|
||||
element.insert(pair<string,string>("track[bitrate]", (*track).bitrate));
|
||||
element.insert(pair<string,string>("track[language]", (*track).language));
|
||||
trackTokens.push_back(element);
|
||||
}
|
||||
loopTokens.insert(pair<string, vector< map< string, string > > >("track", trackTokens));
|
||||
}
|
||||
}
|
||||
intTokens.insert(pair<string,int>("extrecinfoavailable", extRecinfoAvailable));
|
||||
|
||||
stringTokens.insert(pair<string,string>("shorttext", info->ShortText() ? info->ShortText() : ""));
|
||||
stringTokens.insert(pair<string,string>("description", info->Description() ? info->Description() : ""));
|
||||
|
||||
@@ -588,7 +626,7 @@ void cDisplayMenuItemCurrentRecordingView::Render(void) {
|
||||
intTokens.insert(pair<string,int>("durationeventhours", duration / 60));
|
||||
stringTokens.insert(pair<string,string>("durationeventminutes", *cString::sprintf("%.2d", duration%60)));
|
||||
SetTokensPosMenuItem();
|
||||
DrawViewElement(veMenuCurrentItemDetail, &stringTokens, &intTokens);
|
||||
DrawViewElement(veMenuCurrentItemDetail, &stringTokens, &intTokens, &loopTokens);
|
||||
}
|
||||
|
||||
void cDisplayMenuItemCurrentRecordingView::Clear(void) {
|
||||
|
@@ -333,44 +333,3 @@ void cDisplayReplayView::Action(void) {
|
||||
DoFlush();
|
||||
cView::Action();
|
||||
}
|
||||
|
||||
string cDisplayReplayView::GetScreenResolutionString(int width, int height, bool *isHD) {
|
||||
string name = "";
|
||||
switch (width) {
|
||||
case 1920:
|
||||
case 1440:
|
||||
name = "hd1080i";
|
||||
*isHD = true;
|
||||
break;
|
||||
case 1280:
|
||||
if (height == 720)
|
||||
name = "hd720p";
|
||||
else
|
||||
name = "hd1080i";
|
||||
*isHD = true;
|
||||
break;
|
||||
case 720:
|
||||
name = "sd576i";
|
||||
break;
|
||||
default:
|
||||
name = "sd576i";
|
||||
break;
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
string cDisplayReplayView::GetScreenAspectString(double aspect, bool *isWideScreen) {
|
||||
string name = "";
|
||||
*isWideScreen = false;
|
||||
if (aspect == 4.0/3.0) {
|
||||
name = "4:3";
|
||||
*isWideScreen = false;
|
||||
} else if (aspect == 16.0/9.0) {
|
||||
name = "16:9";
|
||||
*isWideScreen = true;
|
||||
} else if (aspect == 2.21) {
|
||||
name = "21:9";
|
||||
*isWideScreen = true;
|
||||
}
|
||||
return name;
|
||||
}
|
@@ -7,8 +7,6 @@
|
||||
class cDisplayReplayView : public cView {
|
||||
private:
|
||||
cString lastDate;
|
||||
string GetScreenResolutionString(int width, int height, bool *isHD);
|
||||
string GetScreenAspectString(double aspect, bool *isWideScreen);
|
||||
virtual void Action(void);
|
||||
public:
|
||||
cDisplayReplayView(cTemplateView *tmplView);
|
||||
|
Reference in New Issue
Block a user