Analog on/off support

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@244 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Commit: 8fe922af32
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2010-02-01 (Mon, 01 Feb 2010)
This commit is contained in:
[CST] Focus
2010-02-01 14:54:07 +00:00
parent 90bbb36f07
commit c00db1bcde
9 changed files with 31 additions and 7 deletions

View File

@@ -125,7 +125,8 @@ GENRE.TRAVEL_HOBBIES.7 gardening
GENRE.UNKNOWN unknown GENRE.UNKNOWN unknown
apidselector.head Select language apidselector.head Select language
audiomenu.PCMOffset Volume Decrease PCM audiomenu.PCMOffset Volume Decrease PCM
audiomenu.analogout Analog Output audiomenu.analog_mode Analog mode
audiomenu.analog_out Analog output
audiomenu.avs avs audiomenu.avs avs
audiomenu.avs_control Volume Control avs/ost audiomenu.avs_control Volume Control avs/ost
audiomenu.dolbydigital Dolby Digital audiomenu.dolbydigital Dolby Digital

View File

@@ -57,6 +57,7 @@ class cAudio
bool hdmiDD; bool hdmiDD;
bool spdifDD; bool spdifDD;
bool hasMuteScheduled; bool hasMuteScheduled;
bool analogOut;
public: public:
/* construct & destruct */ /* construct & destruct */
cAudio(void * hBuffer, void * encHD, void * encSD); cAudio(void * hBuffer, void * encHD, void * encSD);
@@ -108,7 +109,7 @@ class cAudio
void SetHdmiDD(bool enable); void SetHdmiDD(bool enable);
void SetSpdifDD(bool enable); void SetSpdifDD(bool enable);
void ScheduleMute(bool On); void ScheduleMute(bool On);
void EnableAnalogOut(bool enable);
}; };
#endif #endif

View File

@@ -75,6 +75,13 @@ int CAudioSelectMenuHandler::exec(CMenuTarget* parent, const std::string &/*acti
return res; return res;
} }
#define OPTIONS_OFF0_ON1_OPTION_COUNT 2
const CMenuOptionChooser::keyval OPTIONS_OFF0_ON1_OPTIONS[OPTIONS_OFF0_ON1_OPTION_COUNT] =
{
{ 0, LOCALE_OPTIONS_OFF },
{ 1, LOCALE_OPTIONS_ON }
};
int CAudioSelectMenuHandler::doMenu () int CAudioSelectMenuHandler::doMenu ()
{ {
CMenuWidget AudioSelector(LOCALE_APIDSELECTOR_HEAD, NEUTRINO_ICON_AUDIO, 360); CMenuWidget AudioSelector(LOCALE_APIDSELECTOR_HEAD, NEUTRINO_ICON_AUDIO, 360);
@@ -93,13 +100,19 @@ int CAudioSelectMenuHandler::doMenu ()
// -- setup menue for to Dual Channel Stereo // -- setup menue for to Dual Channel Stereo
AudioSelector.addItem(GenericMenuSeparatorLine); AudioSelector.addItem(GenericMenuSeparatorLine);
CMenuOptionChooser* oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOGOUT, CMenuOptionChooser* oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOG_MODE,
&g_settings.audio_AnalogMode, &g_settings.audio_AnalogMode,
AUDIOMENU_ANALOGOUT_OPTIONS, AUDIOMENU_ANALOGOUT_OPTION_COUNT, AUDIOMENU_ANALOGOUT_OPTIONS, AUDIOMENU_ANALOGOUT_OPTION_COUNT,
true, audioSetupNotifier, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); true, audioSetupNotifier, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
AudioSelector.addItem( oj ); AudioSelector.addItem( oj );
oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOG_OUT, &g_settings.analog_out,
OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT,
true, audioSetupNotifier, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN);
AudioSelector.addItem( oj );
CChannelList *channelList = CNeutrinoApp::getInstance ()->channelList; CChannelList *channelList = CNeutrinoApp::getInstance ()->channelList;
int curnum = channelList->getActiveChannelNumber(); int curnum = channelList->getActiveChannelNumber();
CZapitChannel * cc = channelList->getChannel(curnum); CZapitChannel * cc = channelList->getChannel(curnum);

View File

@@ -758,6 +758,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.srs_nmgr_enable = configfile.getInt32( "srs_nmgr_enable", 0); g_settings.srs_nmgr_enable = configfile.getInt32( "srs_nmgr_enable", 0);
g_settings.hdmi_dd = configfile.getInt32( "hdmi_dd", 0); g_settings.hdmi_dd = configfile.getInt32( "hdmi_dd", 0);
g_settings.spdif_dd = configfile.getInt32( "spdif_dd", 1); g_settings.spdif_dd = configfile.getInt32( "spdif_dd", 1);
g_settings.analog_out = configfile.getInt32( "analog_out", 1);
g_settings.avsync = configfile.getInt32( "avsync", 1); g_settings.avsync = configfile.getInt32( "avsync", 1);
g_settings.clockrec = configfile.getInt32( "clockrec", 1); g_settings.clockrec = configfile.getInt32( "clockrec", 1);
g_settings.video_dbdr = configfile.getInt32("video_dbdr", 0); g_settings.video_dbdr = configfile.getInt32("video_dbdr", 0);
@@ -1263,6 +1264,7 @@ void CNeutrinoApp::saveSetup(const char * fname)
configfile.setInt32( "srs_ref_volume", g_settings.srs_ref_volume); configfile.setInt32( "srs_ref_volume", g_settings.srs_ref_volume);
configfile.setInt32( "srs_nmgr_enable", g_settings.srs_nmgr_enable); configfile.setInt32( "srs_nmgr_enable", g_settings.srs_nmgr_enable);
configfile.setInt32( "hdmi_dd", g_settings.hdmi_dd); configfile.setInt32( "hdmi_dd", g_settings.hdmi_dd);
configfile.setInt32( "analog_out", g_settings.analog_out);
configfile.setInt32( "spdif_dd", g_settings.spdif_dd); configfile.setInt32( "spdif_dd", g_settings.spdif_dd);
configfile.setInt32( "avsync", g_settings.avsync); configfile.setInt32( "avsync", g_settings.avsync);
configfile.setInt32( "clockrec", g_settings.clockrec); configfile.setInt32( "clockrec", g_settings.clockrec);
@@ -2320,6 +2322,8 @@ int CNeutrinoApp::run(int argc, char **argv)
audioDecoder->setVolume(g_settings.current_volume, g_settings.current_volume); audioDecoder->setVolume(g_settings.current_volume, g_settings.current_volume);
audioDecoder->SetHdmiDD(g_settings.hdmi_dd ? true : false); audioDecoder->SetHdmiDD(g_settings.hdmi_dd ? true : false);
audioDecoder->SetSpdifDD(g_settings.spdif_dd ? true : false); audioDecoder->SetSpdifDD(g_settings.spdif_dd ? true : false);
audioDecoder->EnableAnalogOut(g_settings.analog_out ? true : false);
videoDecoder->SetDBDR(g_settings.video_dbdr); videoDecoder->SetDBDR(g_settings.video_dbdr);
audioSetupNotifier->changeNotify(LOCALE_AUDIOMENU_AVSYNC, NULL); audioSetupNotifier->changeNotify(LOCALE_AUDIOMENU_AVSYNC, NULL);

View File

@@ -1637,7 +1637,7 @@ void CNeutrinoApp::InitAudioSettings(CMenuWidget &audioSettings, CAudioSetupNoti
{ {
addMenueIntroItems(audioSettings); addMenueIntroItems(audioSettings);
audioSettings.addItem(new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOGOUT, &g_settings.audio_AnalogMode, AUDIOMENU_ANALOGOUT_OPTIONS, AUDIOMENU_ANALOGOUT_OPTION_COUNT, true, audioSetupNotifier)); audioSettings.addItem(new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOG_MODE, &g_settings.audio_AnalogMode, AUDIOMENU_ANALOGOUT_OPTIONS, AUDIOMENU_ANALOGOUT_OPTION_COUNT, true, audioSetupNotifier));
audioSettings.addItem(new CMenuOptionChooser(LOCALE_AUDIOMENU_DOLBYDIGITAL, &g_settings.audio_DolbyDigital, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, audioSetupNotifier)); audioSettings.addItem(new CMenuOptionChooser(LOCALE_AUDIOMENU_DOLBYDIGITAL, &g_settings.audio_DolbyDigital, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, audioSetupNotifier));
audioSettings.addItem(new CMenuOptionChooser(LOCALE_EXTRA_ENGLISH, &g_settings.audio_english, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, audioSetupNotifier)); audioSettings.addItem(new CMenuOptionChooser(LOCALE_EXTRA_ENGLISH, &g_settings.audio_english, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, audioSetupNotifier));
audioSettings.addItem(new CMenuOptionChooser(LOCALE_AUDIOMENU_HDMI_DD, &g_settings.hdmi_dd, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, audioSetupNotifier)); audioSettings.addItem(new CMenuOptionChooser(LOCALE_AUDIOMENU_HDMI_DD, &g_settings.hdmi_dd, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, audioSetupNotifier));

View File

@@ -131,7 +131,8 @@ typedef enum {
LOCALE_GENRE_UNKNOWN, LOCALE_GENRE_UNKNOWN,
LOCALE_APIDSELECTOR_HEAD, LOCALE_APIDSELECTOR_HEAD,
LOCALE_AUDIOMENU_PCMOFFSET, LOCALE_AUDIOMENU_PCMOFFSET,
LOCALE_AUDIOMENU_ANALOGOUT, LOCALE_AUDIOMENU_ANALOG_MODE,
LOCALE_AUDIOMENU_ANALOG_OUT,
LOCALE_AUDIOMENU_AVS, LOCALE_AUDIOMENU_AVS,
LOCALE_AUDIOMENU_AVS_CONTROL, LOCALE_AUDIOMENU_AVS_CONTROL,
LOCALE_AUDIOMENU_DOLBYDIGITAL, LOCALE_AUDIOMENU_DOLBYDIGITAL,

View File

@@ -131,7 +131,8 @@ const char *locale_real_names[] = {
"GENRE.UNKNOWN", "GENRE.UNKNOWN",
"apidselector.head", "apidselector.head",
"audiomenu.PCMOffset", "audiomenu.PCMOffset",
"audiomenu.analogout", "audiomenu.analog_mode",
"audiomenu.analog_out",
"audiomenu.avs", "audiomenu.avs",
"audiomenu.avs_control", "audiomenu.avs_control",
"audiomenu.dolbydigital", "audiomenu.dolbydigital",

View File

@@ -484,8 +484,10 @@ bool CAudioSetupNotifier::changeNotify(const neutrino_locale_t OptionName, void
{ {
} }
#endif #endif
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_ANALOGOUT)) { if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_ANALOG_MODE)) {
g_Zapit->setAudioMode(g_settings.audio_AnalogMode); g_Zapit->setAudioMode(g_settings.audio_AnalogMode);
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_ANALOG_OUT)) {
audioDecoder->EnableAnalogOut(g_settings.analog_out ? true : false);
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_HDMI_DD)) { } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_HDMI_DD)) {
audioDecoder->SetHdmiDD(g_settings.hdmi_dd ? true : false); audioDecoder->SetHdmiDD(g_settings.hdmi_dd ? true : false);
} else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_SPDIF_DD)) { } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_SPDIF_DD)) {

View File

@@ -78,6 +78,7 @@ struct SNeutrinoSettings
int srs_nmgr_enable; int srs_nmgr_enable;
int hdmi_dd; int hdmi_dd;
int spdif_dd; int spdif_dd;
int analog_out;
int video_dbdr; int video_dbdr;
int enabled_video_modes[VIDEOMENU_VIDEOMODE_OPTION_COUNT]; int enabled_video_modes[VIDEOMENU_VIDEOMODE_OPTION_COUNT];
int cpufreq; int cpufreq;