added some more tokens with more detailed audio information in displaychannel -> statusinfo

This commit is contained in:
louis 2014-10-03 07:17:16 +02:00
parent 45d84b7d8a
commit 86ec43925f
5 changed files with 40 additions and 4 deletions

View File

@ -5,3 +5,6 @@ VDR Plugin 'skindesigner' Revision History
- Initial revision.
Version 0.0.2
- added some more tokens with more detailed audio information in displaychannel -> statusinfo

View File

@ -20,7 +20,7 @@
#endif
static const char *VERSION = "0.0.1";
static const char *VERSION = "0.0.2";
static const char *DESCRIPTION = "SkinDesigner";
static const char *MAINMENUENTRY = "Skin Designer";

View File

@ -85,8 +85,12 @@
{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>
<statusinfo debug="true">
<area x="22%" y="94%" width="76%" height="6%" layer="2">
<!-- encrypted / decrypted icon -->
<drawimage name="enc" condition="{isEncrypted}" imagetype="icon" path="ico_crypt_on" x="{areawidth} - {width(enc)}" valign="center" width="{areaheight}*0.8*1.76" height="{areaheight}*0.8"/>

View File

@ -52,6 +52,10 @@
{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>
</statusinfo>

View File

@ -176,6 +176,9 @@ void cDisplayChannelView::DrawStatusIcons(const cChannel *Channel) {
return;
}
map < string, int > intTokens;
map < string, string > stringTokens;
bool isRadio = !Channel->Vpid() && Channel->Apid(0);
bool hasVT = Channel->Vpid() && Channel->Tpid();
bool isStereo = Channel->Apid(0);
@ -188,15 +191,37 @@ void cDisplayChannelView::DrawStatusIcons(const cChannel *Channel) {
if (Timer->Recording())
isRecording = true;
map < string, int > intTokens;
//enhanced audio information
int numAudioTracks = 0;
int audioChannel = -1;
string trackDescription = "";
string trackLanguage = "";
cDevice *device = cDevice::PrimaryDevice();
if (device) {
numAudioTracks = device->NumAudioTracks();
audioChannel = device->GetAudioChannel();
if (numAudioTracks > 0) {
const tTrackId *track = device->GetTrack(device->GetCurrentAudioTrack());
if (track) {
trackDescription = track->description ? track->description : "";
trackLanguage = track->language ? track->language : "";
}
}
}
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, NULL, &intTokens);
DrawViewElement(veStatusInfo, &stringTokens, &intTokens);
}
void cDisplayChannelView::ClearStatusIcons(void) {