introduced new viewelement audioinfo in displaychannel

This commit is contained in:
louis 2014-10-17 17:44:02 +02:00
parent 6b16f46272
commit df57e20e06
10 changed files with 83 additions and 25 deletions

View File

@ -22,4 +22,4 @@ Version 0.0.2
- added support for custom tokens in dislaychannel - added support for custom tokens in dislaychannel
- added vps token in menudetailepg - added vps token in menudetailepg
- implemented cSDDisplayMenu::GetTextAreaFont() - implemented cSDDisplayMenu::GetTextAreaFont()
- introduced new viewelement audioinfo in displaychannel

View File

@ -63,12 +63,15 @@ void cSDDisplayChannel::SetChannel(const cChannel *Channel, int Number) {
channelView->ClearStatusIcons(); channelView->ClearStatusIcons();
channelView->ClearChannelGroups(); channelView->ClearChannelGroups();
channelView->ClearScraperContent(); channelView->ClearScraperContent();
channelView->ClearAudioInfo();
if (!groupSep) { if (!groupSep) {
channelView->DrawChannel(ChannelNumber, ChannelName, ChannelID, (Number > 0)?true:false); channelView->DrawChannel(ChannelNumber, ChannelName, ChannelID, (Number > 0)?true:false);
channelView->DrawProgressBarBack(); channelView->DrawProgressBarBack();
channelView->DrawSignalBackground(); channelView->DrawSignalBackground();
if (Channel) if (Channel) {
channelView->DrawStatusIcons(Channel); channelView->DrawStatusIcons(Channel);
channelView->DrawAudioInfo();
}
} else { } else {
channelView->ClearSignal(); channelView->ClearSignal();
channelView->ClearSignalBackground(); channelView->ClearSignalBackground();
@ -155,6 +158,7 @@ void cSDDisplayChannel::SetMessage(eMessageType Type, const char *Text) {
channelView->ClearSignal(); channelView->ClearSignal();
channelView->ClearSignalBackground(); channelView->ClearSignalBackground();
channelView->ClearScraperContent(); channelView->ClearScraperContent();
channelView->ClearAudioInfo();
channelView->DisplayMessage(Type, Text); channelView->DisplayMessage(Type, Text);
groupSep = true; groupSep = true;
} }
@ -180,6 +184,7 @@ void cSDDisplayChannel::Flush(void) {
if (!groupSep) { if (!groupSep) {
channelView->DrawScreenResolution(); channelView->DrawScreenResolution();
channelView->DrawSignal(); channelView->DrawSignal();
channelView->DrawAudioInfo();
} else { } else {
channelView->ClearStatusIcons(); channelView->ClearStatusIcons();
channelView->ClearScreenResolution(); channelView->ClearScreenResolution();

View File

@ -18,7 +18,6 @@ private:
int lastSignalQuality; int lastSignalQuality;
int lastScreenWidth; int lastScreenWidth;
int currentLast; int currentLast;
bool showSignal;
const cEvent *present; const cEvent *present;
void SetProgressBar(const cEvent *present); void SetProgressBar(const cEvent *present);
public: public:

View File

@ -3,7 +3,7 @@
<!ENTITY % functions SYSTEM "functions.dtd"> <!ENTITY % functions SYSTEM "functions.dtd">
<!ELEMENT displaychannel (background | channelinfo | epginfo | progressbar | progressbarback | <!ELEMENT displaychannel (background | channelinfo | epginfo | progressbar | progressbarback |
statusinfo | screenresolution | channelgroup | statusinfo | audioinfo | screenresolution | channelgroup |
signalquality | signalqualityback | scrapercontent | signalquality | signalqualityback | scrapercontent |
datetime | message | customtokens)* > datetime | message | customtokens)* >
<!ATTLIST displaychannel <!ATTLIST displaychannel
@ -48,6 +48,11 @@
debug CDATA #IMPLIED debug CDATA #IMPLIED
> >
<!ELEMENT audioinfo (area|areascroll)*>
<!ATTLIST audioinfo
debug CDATA #IMPLIED
>
<!ELEMENT screenresolution (area|areascroll)*> <!ELEMENT screenresolution (area|areascroll)*>
<!ATTLIST screenresolution <!ATTLIST screenresolution
debug CDATA #IMPLIED debug CDATA #IMPLIED

View File

@ -587,6 +587,7 @@ void cTemplateViewChannel::SetViewElements(void) {
viewElementsAllowed.insert("progressbar"); viewElementsAllowed.insert("progressbar");
viewElementsAllowed.insert("progressbarback"); viewElementsAllowed.insert("progressbarback");
viewElementsAllowed.insert("statusinfo"); viewElementsAllowed.insert("statusinfo");
viewElementsAllowed.insert("audioinfo");
viewElementsAllowed.insert("screenresolution"); viewElementsAllowed.insert("screenresolution");
viewElementsAllowed.insert("signalquality"); viewElementsAllowed.insert("signalquality");
viewElementsAllowed.insert("signalqualityback"); viewElementsAllowed.insert("signalqualityback");
@ -620,6 +621,9 @@ string cTemplateViewChannel::GetViewElementName(eViewElement ve) {
case veStatusInfo: case veStatusInfo:
name = "StatusInfo"; name = "StatusInfo";
break; break;
case veAudioInfo:
name = "AudioInfo";
break;
case veScreenResolution: case veScreenResolution:
name = "Screen Resolution"; name = "Screen Resolution";
break; break;
@ -665,6 +669,8 @@ void cTemplateViewChannel::AddPixmap(string sViewElement, cTemplatePixmap *pix,
ve = veProgressBarBack; ve = veProgressBarBack;
} else if (!sViewElement.compare("statusinfo")) { } else if (!sViewElement.compare("statusinfo")) {
ve = veStatusInfo; ve = veStatusInfo;
} else if (!sViewElement.compare("audioinfo")) {
ve = veAudioInfo;
} else if (!sViewElement.compare("screenresolution")) { } else if (!sViewElement.compare("screenresolution")) {
ve = veScreenResolution; ve = veScreenResolution;
} else if (!sViewElement.compare("signalquality")) { } else if (!sViewElement.compare("signalquality")) {

View File

@ -32,6 +32,7 @@ enum eViewElement {
veProgressBar, veProgressBar,
veProgressBarBack, veProgressBarBack,
veStatusInfo, veStatusInfo,
veAudioInfo,
veScreenResolution, veScreenResolution,
veSignalQuality, veSignalQuality,
veSignalQualityBack, veSignalQualityBack,

View File

@ -90,10 +90,6 @@
{isDolby} true if a dolby audio track is available {isDolby} true if a dolby audio track is available
{isEncrypted} true if channel is encrypted {isEncrypted} true if channel is encrypted
{isRecording} true if currently a recording is running on this channel {isRecording} true if currently a recording is running on this channel
{numaudiotracks} number of available audio tracks for current channel
{audiochannel} 0 if current channel is stereo, 1 for left chanel only, 2 for right channel only
{trackdesc} description of the current audio track
{tracklang} language of the current audio track
--> -->
<statusinfo> <statusinfo>
<area x="22%" y="94%" width="76%" height="6%" layer="2"> <area x="22%" y="94%" width="76%" height="6%" layer="2">
@ -112,6 +108,15 @@
</area> </area>
</statusinfo> </statusinfo>
<!-- Available Variables audioinfo:
{numaudiotracks} number of available audio tracks for current channel
{audiochannel} 0 if current channel is stereo, 1 for left chanel only, 2 for right channel only
{trackdesc} description of the current audio track
{tracklang} language of the current audio track
-->
<audioinfo>
</audioinfo>
<!-- Available Variables screenresolution: <!-- Available Variables screenresolution:
{screenwidth} width of currently displayed channel in px {screenwidth} width of currently displayed channel in px
{screenheight} height of currently displayed channel in px {screenheight} height of currently displayed channel in px

View File

@ -57,13 +57,19 @@
{isDolby} true if a dolby audio track is available {isDolby} true if a dolby audio track is available
{isEncrypted} true if channel is encrypted {isEncrypted} true if channel is encrypted
{isRecording} true if currently a recording is running on this channel {isRecording} true if currently a recording is running on this channel
-->
<statusinfo>
</statusinfo>
<!-- Available Variables audioinfo:
{numaudiotracks} number of available audio tracks for current channel {numaudiotracks} number of available audio tracks for current channel
{audiochannel} 0 if current channel is stereo, 1 for left chanel only, 2 for right channel only {audiochannel} 0 if current channel is stereo, 1 for left chanel only, 2 for right channel only
{trackdesc} description of the current audio track {trackdesc} description of the current audio track
{tracklang} language of the current audio track {tracklang} language of the current audio track
--> -->
<statusinfo> <audioinfo>
</statusinfo> </audioinfo>
<!-- Available Variables screenresolution: <!-- Available Variables screenresolution:
{screenwidth} width of currently displayed channel in px {screenwidth} width of currently displayed channel in px

View File

@ -13,6 +13,10 @@ cDisplayChannelView::cDisplayChannelView(cTemplateView *tmplView) : cView(tmplVi
lastSignalDisplay = 0; lastSignalDisplay = 0;
lastSignalStrength = 0; lastSignalStrength = 0;
lastSignalQuality = 0; lastSignalQuality = 0;
lastNumAudioTracks = 0;
lastAudioChannel = -1;
lastTracDesc = "";
lastTrackLang = "";
DeleteOsdOnExit(); DeleteOsdOnExit();
SetFadeTime(tmplView->GetNumericParameter(ptFadeTime)); SetFadeTime(tmplView->GetNumericParameter(ptFadeTime));
} }
@ -201,7 +205,25 @@ void cDisplayChannelView::DrawStatusIcons(const cChannel *Channel) {
if (Timer->Recording()) if (Timer->Recording())
isRecording = true; isRecording = true;
//enhanced audio information intTokens.insert(pair<string,int>("isRadio", isRadio));
intTokens.insert(pair<string,int>("hasVT", hasVT));
intTokens.insert(pair<string,int>("isStereo", isStereo));
intTokens.insert(pair<string,int>("isDolby", isDolby));
intTokens.insert(pair<string,int>("isEncrypted", isEncrypted));
intTokens.insert(pair<string,int>("isRecording", isRecording));
DrawViewElement(veStatusInfo, &stringTokens, &intTokens);
}
void cDisplayChannelView::ClearStatusIcons(void) {
ClearViewElement(veStatusInfo);
}
void cDisplayChannelView::DrawAudioInfo(void) {
if (!ViewElementImplemented(veAudioInfo)) {
return;
}
int numAudioTracks = 0; int numAudioTracks = 0;
int audioChannel = -1; int audioChannel = -1;
string trackDescription = ""; string trackDescription = "";
@ -219,23 +241,26 @@ void cDisplayChannelView::DrawStatusIcons(const cChannel *Channel) {
} }
} }
} }
if (lastNumAudioTracks != numAudioTracks || lastAudioChannel != audioChannel || lastTracDesc.compare(trackDescription) || lastTrackLang.compare(trackLanguage)) {
lastNumAudioTracks = numAudioTracks;
lastAudioChannel = audioChannel;
lastTracDesc = trackDescription;
lastTrackLang = trackLanguage;
intTokens.insert(pair<string,int>("isRadio", isRadio)); map < string, int > intTokens;
intTokens.insert(pair<string,int>("hasVT", hasVT)); map < string, string > stringTokens;
intTokens.insert(pair<string,int>("isStereo", isStereo)); intTokens.insert(pair<string,int>("numaudiotracks", numAudioTracks));
intTokens.insert(pair<string,int>("isDolby", isDolby)); intTokens.insert(pair<string,int>("audiochannel", audioChannel));
intTokens.insert(pair<string,int>("isEncrypted", isEncrypted)); stringTokens.insert(pair<string,string>("trackdesc", trackDescription));
intTokens.insert(pair<string,int>("isRecording", isRecording)); stringTokens.insert(pair<string,string>("tracklang", trackLanguage));
intTokens.insert(pair<string,int>("numaudiotracks", numAudioTracks));
intTokens.insert(pair<string,int>("audiochannel", audioChannel));
stringTokens.insert(pair<string,string>("trackdesc", trackDescription));
stringTokens.insert(pair<string,string>("tracklang", trackLanguage));
DrawViewElement(veStatusInfo, &stringTokens, &intTokens); ClearAudioInfo();
DrawViewElement(veAudioInfo, &stringTokens, &intTokens);
}
} }
void cDisplayChannelView::ClearStatusIcons(void) { void cDisplayChannelView::ClearAudioInfo(void) {
ClearViewElement(veStatusInfo); ClearViewElement(veAudioInfo);
} }
void cDisplayChannelView::DrawScreenResolution(void) { void cDisplayChannelView::DrawScreenResolution(void) {

View File

@ -12,6 +12,10 @@ private:
int lastSignalDisplay; int lastSignalDisplay;
int lastSignalStrength; int lastSignalStrength;
int lastSignalQuality; int lastSignalQuality;
int lastNumAudioTracks;
int lastAudioChannel;
string lastTracDesc;
string lastTrackLang;
string GetScreenResolutionString(int width, int height, bool *isHD); string GetScreenResolutionString(int width, int height, bool *isHD);
string GetScreenAspectString(double aspect, bool *isWideScreen); string GetScreenAspectString(double aspect, bool *isWideScreen);
string GetChannelSep(const cChannel *channel, bool prev); string GetChannelSep(const cChannel *channel, bool prev);
@ -32,6 +36,8 @@ public:
void ClearEPGInfo(void); void ClearEPGInfo(void);
void DrawStatusIcons(const cChannel *Channel); void DrawStatusIcons(const cChannel *Channel);
void ClearStatusIcons(void); void ClearStatusIcons(void);
void DrawAudioInfo(void);
void ClearAudioInfo(void);
void DrawScreenResolution(void); void DrawScreenResolution(void);
void ClearScreenResolution(void); void ClearScreenResolution(void);
void DrawScraperContent(const cEvent *event); void DrawScraperContent(const cEvent *event);