mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Implemented preferred audio languages
This commit is contained in:
parent
da59a45f61
commit
42ab8c8797
3
HISTORY
3
HISTORY
@ -3266,3 +3266,6 @@ Video Disk Recorder Revision History
|
|||||||
- Skins need to implement the new cSkinDisplayTrack class to display the audio
|
- Skins need to implement the new cSkinDisplayTrack class to display the audio
|
||||||
track menu.
|
track menu.
|
||||||
- Fixed reusing OSD in cDvbSpuDecoder (thanks to Reinhard Nissl).
|
- Fixed reusing OSD in cDvbSpuDecoder (thanks to Reinhard Nissl).
|
||||||
|
- The new setup option "DVB/Audio languages" can be used to control which audio
|
||||||
|
language shall be selected in case a channel broadcasts in different languages
|
||||||
|
(see MANUAL for details).
|
||||||
|
9
MANUAL
9
MANUAL
@ -580,6 +580,15 @@ Version 1.2
|
|||||||
updates and also add newly found channels, and '4' will
|
updates and also add newly found channels, and '4' will
|
||||||
also add newly found transponders.
|
also add newly found transponders.
|
||||||
|
|
||||||
|
Audio languages = 0 Some tv stations broadcast various audio tracks in different
|
||||||
|
languages. This option allows you to define which language(s)
|
||||||
|
you prefer in such cases. By default, or if none of the
|
||||||
|
preferred languages is broadcast, the first audio track will
|
||||||
|
be selected when switching to such a channel. If this option
|
||||||
|
is set to a non-zero value, the menu page will contain that
|
||||||
|
many "Audio language" options which allow you to select the
|
||||||
|
individual preferred languages.
|
||||||
|
|
||||||
LNB:
|
LNB:
|
||||||
|
|
||||||
SLOF = 11700 The switching frequency (in MHz) between low and
|
SLOF = 11700 The switching frequency (in MHz) between low and
|
||||||
|
5
config.c
5
config.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: config.c 1.128 2004/10/31 16:17:39 kls Exp $
|
* $Id: config.c 1.129 2005/01/04 13:48:49 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@ -262,6 +262,7 @@ cSetup::cSetup(void)
|
|||||||
TimeTransponder = 0;
|
TimeTransponder = 0;
|
||||||
MarginStart = 2;
|
MarginStart = 2;
|
||||||
MarginStop = 10;
|
MarginStop = 10;
|
||||||
|
AudioLanguages[0] = -1;
|
||||||
EPGLanguages[0] = -1;
|
EPGLanguages[0] = -1;
|
||||||
EPGScanTimeout = 5;
|
EPGScanTimeout = 5;
|
||||||
EPGBugfixLevel = 2;
|
EPGBugfixLevel = 2;
|
||||||
@ -415,6 +416,7 @@ bool cSetup::Parse(const char *Name, const char *Value)
|
|||||||
else if (!strcasecmp(Name, "TimeTransponder")) TimeTransponder = atoi(Value);
|
else if (!strcasecmp(Name, "TimeTransponder")) TimeTransponder = atoi(Value);
|
||||||
else if (!strcasecmp(Name, "MarginStart")) MarginStart = atoi(Value);
|
else if (!strcasecmp(Name, "MarginStart")) MarginStart = atoi(Value);
|
||||||
else if (!strcasecmp(Name, "MarginStop")) MarginStop = atoi(Value);
|
else if (!strcasecmp(Name, "MarginStop")) MarginStop = atoi(Value);
|
||||||
|
else if (!strcasecmp(Name, "AudioLanguages")) return ParseLanguages(Value, AudioLanguages);
|
||||||
else if (!strcasecmp(Name, "EPGLanguages")) return ParseLanguages(Value, EPGLanguages);
|
else if (!strcasecmp(Name, "EPGLanguages")) return ParseLanguages(Value, EPGLanguages);
|
||||||
else if (!strcasecmp(Name, "EPGScanTimeout")) EPGScanTimeout = atoi(Value);
|
else if (!strcasecmp(Name, "EPGScanTimeout")) EPGScanTimeout = atoi(Value);
|
||||||
else if (!strcasecmp(Name, "EPGBugfixLevel")) EPGBugfixLevel = atoi(Value);
|
else if (!strcasecmp(Name, "EPGBugfixLevel")) EPGBugfixLevel = atoi(Value);
|
||||||
@ -475,6 +477,7 @@ bool cSetup::Save(void)
|
|||||||
Store("TimeTransponder", TimeTransponder);
|
Store("TimeTransponder", TimeTransponder);
|
||||||
Store("MarginStart", MarginStart);
|
Store("MarginStart", MarginStart);
|
||||||
Store("MarginStop", MarginStop);
|
Store("MarginStop", MarginStop);
|
||||||
|
StoreLanguages("AudioLanguages", AudioLanguages);
|
||||||
StoreLanguages("EPGLanguages", EPGLanguages);
|
StoreLanguages("EPGLanguages", EPGLanguages);
|
||||||
Store("EPGScanTimeout", EPGScanTimeout);
|
Store("EPGScanTimeout", EPGScanTimeout);
|
||||||
Store("EPGBugfixLevel", EPGBugfixLevel);
|
Store("EPGBugfixLevel", EPGBugfixLevel);
|
||||||
|
3
config.h
3
config.h
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: config.h 1.206 2004/11/22 16:49:39 kls Exp $
|
* $Id: config.h 1.207 2005/01/04 13:47:38 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __CONFIG_H
|
#ifndef __CONFIG_H
|
||||||
@ -222,6 +222,7 @@ public:
|
|||||||
int TimeSource;
|
int TimeSource;
|
||||||
int TimeTransponder;
|
int TimeTransponder;
|
||||||
int MarginStart, MarginStop;
|
int MarginStart, MarginStop;
|
||||||
|
int AudioLanguages[I18nNumLanguages + 1];
|
||||||
int EPGLanguages[I18nNumLanguages + 1];
|
int EPGLanguages[I18nNumLanguages + 1];
|
||||||
int EPGScanTimeout;
|
int EPGScanTimeout;
|
||||||
int EPGBugfixLevel;
|
int EPGBugfixLevel;
|
||||||
|
15
device.c
15
device.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: device.c 1.66 2005/01/04 13:13:24 kls Exp $
|
* $Id: device.c 1.67 2005/01/04 15:38:46 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
@ -541,11 +541,24 @@ eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
|
|||||||
|
|
||||||
if (Result == scrOk) {
|
if (Result == scrOk) {
|
||||||
if (LiveView && IsPrimaryDevice()) {
|
if (LiveView && IsPrimaryDevice()) {
|
||||||
|
// Set the available audio tracks:
|
||||||
ClrAvailableTracks();
|
ClrAvailableTracks();
|
||||||
for (int i = 0; i < MAXAPIDS; i++) {
|
for (int i = 0; i < MAXAPIDS; i++) {
|
||||||
SetAvailableTrack(ttAudio, i, Channel->Apid(i), Channel->Alang(i));
|
SetAvailableTrack(ttAudio, i, Channel->Apid(i), Channel->Alang(i));
|
||||||
SetAvailableTrack(ttDolby, i, Channel->Dpid(i), Channel->Dlang(i));
|
SetAvailableTrack(ttDolby, i, Channel->Dpid(i), Channel->Dlang(i));
|
||||||
}
|
}
|
||||||
|
// Select the preferred audio track:
|
||||||
|
eTrackType PreferredTrack = ttAudioFirst;
|
||||||
|
int LanguagePreference = -1;
|
||||||
|
for (int i = ttAudioFirst; i <= ttDolbyLast; i++) {
|
||||||
|
const tTrackId *TrackId = GetTrack(eTrackType(i));
|
||||||
|
if (TrackId && TrackId->id && I18nIsPreferredLanguage(Setup.AudioLanguages, I18nLanguageIndex(TrackId->language), LanguagePreference))
|
||||||
|
PreferredTrack = eTrackType(i);
|
||||||
|
}
|
||||||
|
// 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();
|
currentChannel = Channel->Number();
|
||||||
}
|
}
|
||||||
cStatus::MsgChannelSwitch(this, Channel->Number()); // only report status if channel switch successfull
|
cStatus::MsgChannelSwitch(this, Channel->Number()); // only report status if channel switch successfull
|
||||||
|
54
menu.c
54
menu.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: menu.c 1.327 2005/01/04 13:40:38 kls Exp $
|
* $Id: menu.c 1.328 2005/01/05 10:26:59 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
@ -1911,6 +1911,9 @@ eOSState cMenuSetupEPG::ProcessKey(eKeys Key)
|
|||||||
|
|
||||||
class cMenuSetupDVB : public cMenuSetupBase {
|
class cMenuSetupDVB : public cMenuSetupBase {
|
||||||
private:
|
private:
|
||||||
|
int originalNumAudioLanguages;
|
||||||
|
int numAudioLanguages;
|
||||||
|
void Setup(void);
|
||||||
const char *updateChannelsTexts[5];
|
const char *updateChannelsTexts[5];
|
||||||
public:
|
public:
|
||||||
cMenuSetupDVB(void);
|
cMenuSetupDVB(void);
|
||||||
@ -1919,6 +1922,9 @@ public:
|
|||||||
|
|
||||||
cMenuSetupDVB::cMenuSetupDVB(void)
|
cMenuSetupDVB::cMenuSetupDVB(void)
|
||||||
{
|
{
|
||||||
|
for (numAudioLanguages = 0; numAudioLanguages < I18nNumLanguages && data.AudioLanguages[numAudioLanguages] >= 0; numAudioLanguages++)
|
||||||
|
;
|
||||||
|
originalNumAudioLanguages = numAudioLanguages;
|
||||||
updateChannelsTexts[0] = tr("no");
|
updateChannelsTexts[0] = tr("no");
|
||||||
updateChannelsTexts[1] = tr("names only");
|
updateChannelsTexts[1] = tr("names only");
|
||||||
updateChannelsTexts[2] = tr("names and PIDs");
|
updateChannelsTexts[2] = tr("names and PIDs");
|
||||||
@ -1926,22 +1932,58 @@ cMenuSetupDVB::cMenuSetupDVB(void)
|
|||||||
updateChannelsTexts[4] = tr("add new transponders");
|
updateChannelsTexts[4] = tr("add new transponders");
|
||||||
|
|
||||||
SetSection(tr("DVB"));
|
SetSection(tr("DVB"));
|
||||||
|
Setup();
|
||||||
|
}
|
||||||
|
|
||||||
|
void cMenuSetupDVB::Setup(void)
|
||||||
|
{
|
||||||
|
int current = Current();
|
||||||
|
|
||||||
|
Clear();
|
||||||
|
|
||||||
Add(new cMenuEditIntItem( tr("Setup.DVB$Primary DVB interface"), &data.PrimaryDVB, 1, cDevice::NumDevices()));
|
Add(new cMenuEditIntItem( tr("Setup.DVB$Primary DVB interface"), &data.PrimaryDVB, 1, cDevice::NumDevices()));
|
||||||
Add(new cMenuEditBoolItem(tr("Setup.DVB$Video format"), &data.VideoFormat, "4:3", "16:9"));
|
Add(new cMenuEditBoolItem(tr("Setup.DVB$Video format"), &data.VideoFormat, "4:3", "16:9"));
|
||||||
Add(new cMenuEditStraItem(tr("Setup.DVB$Update channels"), &data.UpdateChannels, 5, updateChannelsTexts));
|
Add(new cMenuEditStraItem(tr("Setup.DVB$Update channels"), &data.UpdateChannels, 5, updateChannelsTexts));
|
||||||
|
Add(new cMenuEditIntItem( tr("Setup.DVB$Audio languages"), &numAudioLanguages, 0, I18nNumLanguages));
|
||||||
|
for (int i = 0; i < numAudioLanguages; i++)
|
||||||
|
Add(new cMenuEditStraItem(tr("Setup.EPG$Audio language"), &data.AudioLanguages[i], I18nNumLanguages, I18nLanguages()));
|
||||||
|
|
||||||
|
SetCurrent(Get(current));
|
||||||
|
Display();
|
||||||
}
|
}
|
||||||
|
|
||||||
eOSState cMenuSetupDVB::ProcessKey(eKeys Key)
|
eOSState cMenuSetupDVB::ProcessKey(eKeys Key)
|
||||||
{
|
{
|
||||||
int oldPrimaryDVB = Setup.PrimaryDVB;
|
int oldPrimaryDVB = ::Setup.PrimaryDVB;
|
||||||
bool oldVideoFormat = Setup.VideoFormat;
|
bool oldVideoFormat = ::Setup.VideoFormat;
|
||||||
|
int oldnumAudioLanguages = numAudioLanguages;
|
||||||
eOSState state = cMenuSetupBase::ProcessKey(Key);
|
eOSState state = cMenuSetupBase::ProcessKey(Key);
|
||||||
|
|
||||||
|
if (Key != kNone) {
|
||||||
|
if (numAudioLanguages != oldnumAudioLanguages) {
|
||||||
|
for (int i = oldnumAudioLanguages; i < numAudioLanguages; i++) {
|
||||||
|
data.AudioLanguages[i] = 0;
|
||||||
|
for (int l = 0; l < I18nNumLanguages; l++) {
|
||||||
|
int k;
|
||||||
|
for (k = 0; k < oldnumAudioLanguages; k++) {
|
||||||
|
if (data.AudioLanguages[k] == l)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (k >= oldnumAudioLanguages) {
|
||||||
|
data.AudioLanguages[i] = l;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data.AudioLanguages[numAudioLanguages] = -1;
|
||||||
|
Setup();
|
||||||
|
}
|
||||||
|
}
|
||||||
if (state == osBack && Key == kOk) {
|
if (state == osBack && Key == kOk) {
|
||||||
if (Setup.PrimaryDVB != oldPrimaryDVB)
|
if (::Setup.PrimaryDVB != oldPrimaryDVB)
|
||||||
state = osSwitchDvb;
|
state = osSwitchDvb;
|
||||||
if (Setup.VideoFormat != oldVideoFormat)
|
if (::Setup.VideoFormat != oldVideoFormat)
|
||||||
cDevice::PrimaryDevice()->SetVideoFormat(Setup.VideoFormat);
|
cDevice::PrimaryDevice()->SetVideoFormat(::Setup.VideoFormat);
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user