Implemented Setup.CurrentDolby

This commit is contained in:
Klaus Schmidinger 2005-01-08 13:53:30 +01:00
parent ec27c329cf
commit f79f81dfd4
5 changed files with 24 additions and 7 deletions

8
MANUAL
View File

@ -183,7 +183,7 @@ Version 1.2
selected for at least 3 seconds.
After switching to a different channel the channel number and name, as well
as the current time are displayed at the top of the screen. If available, the
as the current time are displayed in the OSD. If available, the
'current/next' information will be displayed below this line. This display
automatically goes away after about five seconds, or if any key is pressed.
To bring up the channel display without switching channels you can press
@ -208,6 +208,12 @@ Version 1.2
The "Audio" menu will automatically disappear after 5 seconds of user inactivity,
or if any key other than the ones described above is pressed.
Once a Dolby Digital track has been selected on any channel, further channel
switches will first search for a Dolby Digital track of one of the preferred
audio languages. If no such track can be found, a normal audio track will
be selected. Note that this only works is the broadcasters use actual language
codes in their PID data, not things like "dd" or "2ch".
* Switching through channel groups
If the 'channels.conf' file contains "group separators" you can switch

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.c 1.129 2005/01/04 13:48:49 kls Exp $
* $Id: config.c 1.130 2005/01/08 10:31:19 kls Exp $
*/
#include "config.h"
@ -298,6 +298,7 @@ cSetup::cSetup(void)
ResumeID = 0;
CurrentChannel = -1;
CurrentVolume = MAXVOLUME;
CurrentDolby = 0;
}
cSetup& cSetup::operator= (const cSetup &s)
@ -452,6 +453,7 @@ bool cSetup::Parse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "ResumeID")) ResumeID = atoi(Value);
else if (!strcasecmp(Name, "CurrentChannel")) CurrentChannel = atoi(Value);
else if (!strcasecmp(Name, "CurrentVolume")) CurrentVolume = atoi(Value);
else if (!strcasecmp(Name, "CurrentDolby")) CurrentDolby = atoi(Value);
else
return false;
return true;
@ -513,6 +515,7 @@ bool cSetup::Save(void)
Store("ResumeID", ResumeID);
Store("CurrentChannel", CurrentChannel);
Store("CurrentVolume", CurrentVolume);
Store("CurrentDolby", CurrentDolby);
Sort();

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.h 1.207 2005/01/04 13:47:38 kls Exp $
* $Id: config.h 1.208 2005/01/08 10:30:40 kls Exp $
*/
#ifndef __CONFIG_H
@ -252,6 +252,7 @@ public:
int ResumeID;
int CurrentChannel;
int CurrentVolume;
int CurrentDolby;
int __EndData__;
cSetup(void);
cSetup& operator= (const cSetup &s);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: device.c 1.71 2005/01/08 10:15:00 kls Exp $
* $Id: device.c 1.72 2005/01/08 13:48:19 kls Exp $
*/
#include "device.h"
@ -541,6 +541,7 @@ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
if (Result == scrOk) {
if (LiveView && IsPrimaryDevice()) {
currentChannel = Channel->Number();
// Set the available audio tracks:
ClrAvailableTracks();
currentAudioTrack = ttAudioFirst;
@ -551,16 +552,21 @@ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
// Select the preferred audio track:
eTrackType PreferredTrack = ttAudioFirst;
int LanguagePreference = -1;
for (int i = ttAudioFirst; i <= ttDolbyLast; i++) {
int StartCheck = Setup.CurrentDolby ? ttDolbyFirst : ttAudioFirst;
int EndCheck = ttDolbyLast;
for (int i = StartCheck; i <= EndCheck; i++) {
const tTrackId *TrackId = GetTrack(eTrackType(i));
if (TrackId && TrackId->id && I18nIsPreferredLanguage(Setup.AudioLanguages, I18nLanguageIndex(TrackId->language), LanguagePreference))
PreferredTrack = eTrackType(i);
if (Setup.CurrentDolby && i == ttDolbyLast) {
i = ttAudioFirst - 1;
EndCheck = ttAudioLast;
}
}
// Make sure we're set to an available audio track:
const tTrackId *Track = GetTrack(GetCurrentAudioTrack());
if (!Track || !Track->id || PreferredTrack != GetCurrentAudioTrack())
SetCurrentAudioTrack(PreferredTrack);
currentChannel = Channel->Number();
}
cStatus::MsgChannelSwitch(this, Channel->Number()); // only report status if channel switch successfull
}

3
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.c 1.330 2005/01/08 10:15:00 kls Exp $
* $Id: menu.c 1.331 2005/01/08 10:46:44 kls Exp $
*/
#include "menu.h"
@ -2951,6 +2951,7 @@ eOSState cDisplayTracks::ProcessKey(eKeys Key)
if (track != oldTrack) {
Show();
cDevice::PrimaryDevice()->SetCurrentAudioTrack(types[track]);
Setup.CurrentDolby = IS_DOLBY_TRACK(types[track]);
}
return timeout.TimedOut() ? osEnd : osContinue;
}