From 6cb812e8f208047e9e0878a25c7f933b0a24cbb4 Mon Sep 17 00:00:00 2001 From: lado Date: Thu, 20 Oct 2011 18:08:29 +0200 Subject: add support for delivering audi track --- vdr-vdrmanager/helpers.cpp | 30 ++++++++++++++++++++++++++++++ vdr-vdrmanager/helpers.h | 1 + 2 files changed, 31 insertions(+) diff --git a/vdr-vdrmanager/helpers.cpp b/vdr-vdrmanager/helpers.cpp index 7a4ec47..a20fc98 100644 --- a/vdr-vdrmanager/helpers.cpp +++ b/vdr-vdrmanager/helpers.cpp @@ -125,6 +125,11 @@ string cHelpers::GetChannelsIntern(string wantedChannels) { result += channel->Name(); result += ":"; result += channel->Provider(); + result += ":"; + result += channel->GetChannelID().ToString(); + result += ":"; + result += GetAudioTracks(channel); + result += ":"; result += "\r\n"; } } @@ -132,6 +137,31 @@ string cHelpers::GetChannelsIntern(string wantedChannels) { return result + "END\r\n"; } +string cHelpers::GetAudioTracks(const cChannel* channel){ + + string result = ""; + int count = 0; + for (int i = 0; channel->Apid(i) != 0; ++i, ++count) + ; + for (int i = 0; channel->Dpid(i) != 0; ++i, ++count) + ; + + if (count > 1) + { + int index = 1; + string sep = ""; + for (int i = 0; channel->Apid(i) != 0; ++i, ++index) { + result += sep +"a,"+(const char*)itoa(index) + "," + channel->Alang(i); + sep = "|"; + } + for (int i = 0; channel->Dpid(i) != 0; ++i, ++index) { + result += sep + "d," + (const char*)itoa(index) + "," + channel->Dlang(i); + } + sep = "|"; + } + return result; +} + string cHelpers::GetEventsIntern(string wantedChannels, string when) { when = ToUpper(when); diff --git a/vdr-vdrmanager/helpers.h b/vdr-vdrmanager/helpers.h index 4da5cca..a57d634 100644 --- a/vdr-vdrmanager/helpers.h +++ b/vdr-vdrmanager/helpers.h @@ -40,4 +40,5 @@ private: static string ToText(const cEvent * event); static string ToText(cTimer * timer); static string ToText(cRecording * recording); + static string GetAudioTracks(const cChannel* channel); }; -- cgit v1.2.3