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 vps token in menudetailepg
- 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->ClearChannelGroups();
channelView->ClearScraperContent();
channelView->ClearAudioInfo();
if (!groupSep) {
channelView->DrawChannel(ChannelNumber, ChannelName, ChannelID, (Number > 0)?true:false);
channelView->DrawProgressBarBack();
channelView->DrawSignalBackground();
if (Channel)
if (Channel) {
channelView->DrawStatusIcons(Channel);
channelView->DrawAudioInfo();
}
} else {
channelView->ClearSignal();
channelView->ClearSignalBackground();
@ -155,6 +158,7 @@ void cSDDisplayChannel::SetMessage(eMessageType Type, const char *Text) {
channelView->ClearSignal();
channelView->ClearSignalBackground();
channelView->ClearScraperContent();
channelView->ClearAudioInfo();
channelView->DisplayMessage(Type, Text);
groupSep = true;
}
@ -180,6 +184,7 @@ void cSDDisplayChannel::Flush(void) {
if (!groupSep) {
channelView->DrawScreenResolution();
channelView->DrawSignal();
channelView->DrawAudioInfo();
} else {
channelView->ClearStatusIcons();
channelView->ClearScreenResolution();

View File

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

View File

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

View File

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

View File

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

View File

@ -90,10 +90,6 @@
{isDolby} true if a dolby audio track is available
{isEncrypted} true if channel is encrypted
{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>
<area x="22%" y="94%" width="76%" height="6%" layer="2">
@ -112,6 +108,15 @@
</area>
</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:
{screenwidth} width 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
{isEncrypted} true if channel is encrypted
{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
{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>
<audioinfo>
</audioinfo>
<!-- Available Variables screenresolution:
{screenwidth} width of currently displayed channel in px

View File

@ -13,6 +13,10 @@ cDisplayChannelView::cDisplayChannelView(cTemplateView *tmplView) : cView(tmplVi
lastSignalDisplay = 0;
lastSignalStrength = 0;
lastSignalQuality = 0;
lastNumAudioTracks = 0;
lastAudioChannel = -1;
lastTracDesc = "";
lastTrackLang = "";
DeleteOsdOnExit();
SetFadeTime(tmplView->GetNumericParameter(ptFadeTime));
}
@ -201,7 +205,25 @@ void cDisplayChannelView::DrawStatusIcons(const cChannel *Channel) {
if (Timer->Recording())
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 audioChannel = -1;
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));
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));
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);
map < string, int > intTokens;
map < string, string > stringTokens;
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));
ClearAudioInfo();
DrawViewElement(veAudioInfo, &stringTokens, &intTokens);
}
}
void cDisplayChannelView::ClearStatusIcons(void) {
ClearViewElement(veStatusInfo);
void cDisplayChannelView::ClearAudioInfo(void) {
ClearViewElement(veAudioInfo);
}
void cDisplayChannelView::DrawScreenResolution(void) {

View File

@ -12,6 +12,10 @@ private:
int lastSignalDisplay;
int lastSignalStrength;
int lastSignalQuality;
int lastNumAudioTracks;
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);
@ -32,6 +36,8 @@ public:
void ClearEPGInfo(void);
void DrawStatusIcons(const cChannel *Channel);
void ClearStatusIcons(void);
void DrawAudioInfo(void);
void ClearAudioInfo(void);
void DrawScreenResolution(void);
void ClearScreenResolution(void);
void DrawScraperContent(const cEvent *event);