summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2014-10-17 17:44:02 +0200
committerlouis <louis.braun@gmx.de>2014-10-17 17:44:02 +0200
commitdf57e20e06a4274e5cf0d98b05d33701e24842a9 (patch)
treedba8a3d0cf7a5f25d11bc6db4ec2da6d10799308
parent6b16f46272ad44d9fbf737ed43e696b95e972f34 (diff)
downloadvdr-plugin-skindesigner-df57e20e06a4274e5cf0d98b05d33701e24842a9.tar.gz
vdr-plugin-skindesigner-df57e20e06a4274e5cf0d98b05d33701e24842a9.tar.bz2
introduced new viewelement audioinfo in displaychannel
-rw-r--r--HISTORY2
-rw-r--r--displaychannel.c7
-rw-r--r--displaychannel.h1
-rw-r--r--dtd/displaychannel.dtd7
-rw-r--r--libtemplate/templateview.c6
-rw-r--r--libtemplate/templateviewelement.h1
-rw-r--r--skins/metrixhd/xmlfiles/displaychannel.xml13
-rw-r--r--skinskeleton/xmlfiles/displaychannel.xml10
-rw-r--r--views/displaychannelview.c55
-rw-r--r--views/displaychannelview.h6
10 files changed, 83 insertions, 25 deletions
diff --git a/HISTORY b/HISTORY
index a5d89e8..0c87141 100644
--- a/HISTORY
+++ b/HISTORY
@@ -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
diff --git a/displaychannel.c b/displaychannel.c
index 7442b87..a416073 100644
--- a/displaychannel.c
+++ b/displaychannel.c
@@ -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();
diff --git a/displaychannel.h b/displaychannel.h
index 44d69e5..75888fd 100644
--- a/displaychannel.h
+++ b/displaychannel.h
@@ -18,7 +18,6 @@ private:
int lastSignalQuality;
int lastScreenWidth;
int currentLast;
- bool showSignal;
const cEvent *present;
void SetProgressBar(const cEvent *present);
public:
diff --git a/dtd/displaychannel.dtd b/dtd/displaychannel.dtd
index be0f22e..33ae069 100644
--- a/dtd/displaychannel.dtd
+++ b/dtd/displaychannel.dtd
@@ -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
diff --git a/libtemplate/templateview.c b/libtemplate/templateview.c
index f1704f8..490426b 100644
--- a/libtemplate/templateview.c
+++ b/libtemplate/templateview.c
@@ -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")) {
diff --git a/libtemplate/templateviewelement.h b/libtemplate/templateviewelement.h
index 9c32a4c..5d61c13 100644
--- a/libtemplate/templateviewelement.h
+++ b/libtemplate/templateviewelement.h
@@ -32,6 +32,7 @@ enum eViewElement {
veProgressBar,
veProgressBarBack,
veStatusInfo,
+ veAudioInfo,
veScreenResolution,
veSignalQuality,
veSignalQualityBack,
diff --git a/skins/metrixhd/xmlfiles/displaychannel.xml b/skins/metrixhd/xmlfiles/displaychannel.xml
index 22ff0b2..060d951 100644
--- a/skins/metrixhd/xmlfiles/displaychannel.xml
+++ b/skins/metrixhd/xmlfiles/displaychannel.xml
@@ -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
diff --git a/skinskeleton/xmlfiles/displaychannel.xml b/skinskeleton/xmlfiles/displaychannel.xml
index efa41dd..38267d8 100644
--- a/skinskeleton/xmlfiles/displaychannel.xml
+++ b/skinskeleton/xmlfiles/displaychannel.xml
@@ -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
diff --git a/views/displaychannelview.c b/views/displaychannelview.c
index d55164a..6a68e25 100644
--- a/views/displaychannelview.c
+++ b/views/displaychannelview.c
@@ -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) {
diff --git a/views/displaychannelview.h b/views/displaychannelview.h
index 9d16e25..c87c2a1 100644
--- a/views/displaychannelview.h
+++ b/views/displaychannelview.h
@@ -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);