summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-01-08 10:15:30 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2005-01-08 10:15:30 +0100
commitec27c329cfeacf4687197f637d6abddd6fed25a8 (patch)
tree2ace8b248f6da329a1f7621d42c1444c61cb74a2 /menu.c
parent64623e762b0d0ed28f6079ba814511274f5fb428 (diff)
downloadvdr-ec27c329cfeacf4687197f637d6abddd6fed25a8.tar.gz
vdr-ec27c329cfeacf4687197f637d6abddd6fed25a8.tar.bz2
Displaying audio track description in channel display
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c69
1 files changed, 38 insertions, 31 deletions
diff --git a/menu.c b/menu.c
index ddaeee9b..1e8f1e4f 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 1.329 2005/01/06 13:27:00 kls Exp $
+ * $Id: menu.c 1.330 2005/01/08 10:15:00 kls Exp $
*/
#include "menu.h"
@@ -2541,6 +2541,40 @@ eOSState cMenuMain::ProcessKey(eKeys Key)
return state;
}
+// --- SetTrackDescriptions --------------------------------------------------
+
+static void SetTrackDescriptions(void)
+{
+ cDevice::PrimaryDevice()->ClrAvailableTracks(true);
+ cChannel *Channel = Channels.GetByNumber(cDevice::CurrentChannel());
+ if (Channel) {
+ cSchedulesLock SchedulesLock;
+ const cSchedules *Schedules = cSchedules::Schedules(SchedulesLock);
+ if (Schedules) {
+ const cSchedule *Schedule = Schedules->GetSchedule(Channel->GetChannelID());
+ if (Schedule) {
+ const cEvent *Present = Schedule->GetPresentEvent(true);
+ if (Present) {
+ const cComponents *Components = Present->Components();
+ if (Components) {
+ int indexAudio = 0;
+ int indexDolby = 0;
+ for (int i = 0; i < Components->NumComponents(); i++) {
+ const tComponent *p = Components->Component(i);
+ if (p->stream == 2) {
+ if (p->type == 0x05)
+ cDevice::PrimaryDevice()->SetAvailableTrack(ttDolby, indexDolby++, 0, NULL, p->description);
+ else
+ cDevice::PrimaryDevice()->SetAvailableTrack(ttAudio, indexAudio++, 0, NULL, p->description);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
// --- cDisplayChannel -------------------------------------------------------
#define DIRECTCHANNELTIMEOUT 1000 //ms
@@ -2599,6 +2633,7 @@ void cDisplayChannel::DisplayInfo(void)
const cEvent *Present = Schedule->GetPresentEvent(true);
const cEvent *Following = Schedule->GetFollowingEvent(true);
if (Present != lastPresent || Following != lastFollowing) {
+ SetTrackDescriptions();
displayChannel->SetEvents(Present, Following);
cStatus::MsgOsdProgramme(Present ? Present->StartTime() : 0, Present ? Present->Title() : NULL, Present ? Present->ShortText() : NULL, Following ? Following->StartTime() : 0, Following ? Following->Title() : NULL, Following ? Following->ShortText() : NULL);
lastPresent = Present;
@@ -2818,36 +2853,8 @@ cDisplayTracks::cDisplayTracks(void)
:cOsdObject(true)
{
// Get the actual audio track descriptions from the EPG if we're not replaying:
- if (!cDevice::PrimaryDevice()->Replaying() || cTransferControl::ReceiverDevice()) {
- cChannel *Channel = Channels.GetByNumber(cDevice::CurrentChannel());
- if (Channel) {
- cSchedulesLock SchedulesLock;
- const cSchedules *Schedules = cSchedules::Schedules(SchedulesLock);
- if (Schedules) {
- const cSchedule *Schedule = Schedules->GetSchedule(Channel->GetChannelID());
- if (Schedule) {
- const cEvent *Present = Schedule->GetPresentEvent(true);
- if (Present) {
- const cComponents *Components = Present->Components();
- if (Components) {
- int indexAudio = 0;
- int indexDolby = 0;
- for (int i = 0; i < Components->NumComponents(); i++) {
- const tComponent *p = Components->Component(i);
- if (p->stream == 2) {
- if (p->type == 0x05)
- cDevice::PrimaryDevice()->SetAvailableTrack(ttDolby, indexDolby++, 0, NULL, p->description);
- else
- cDevice::PrimaryDevice()->SetAvailableTrack(ttAudio, indexAudio++, 0, NULL, p->description);
- }
- }
- }
- }
- }
- }
- }
- }
-
+ if (!cDevice::PrimaryDevice()->Replaying() || cTransferControl::ReceiverDevice())
+ SetTrackDescriptions();
currentDisplayTracks = this;
numTracks = track = 0;
eTrackType CurrentAudioTrack = cDevice::PrimaryDevice()->GetCurrentAudioTrack();