From 2ab15c23ca882eed66df0558c63fa77cfba8ff5b Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Sat, 26 Nov 2011 10:25:45 +0000 Subject: [PATCH] Add audio pid set code; Return menu result git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1912 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ccb5c4d8d3a66732ca4f467e6bb0006c505d5cdd Author: [CST] Focus Date: 2011-11-26 (Sat, 26 Nov 2011) ------------------ This commit was generated by Migit --- src/gui/audio_select.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/gui/audio_select.cpp b/src/gui/audio_select.cpp index dfae0a261..906fee43e 100644 --- a/src/gui/audio_select.cpp +++ b/src/gui/audio_select.cpp @@ -42,7 +42,6 @@ #include extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ -extern CAPIDChangeExec * APIDChanger; extern CAudioSetupNotifier * audioSetupNotifier; #include @@ -73,21 +72,23 @@ const CMenuOptionChooser::keyval AUDIOMENU_ANALOGOUT_OPTIONS[AUDIOMENU_ANALOGOUT { 2, LOCALE_AUDIOMENU_MONORIGHT } }; - - -int CAudioSelectMenuHandler::exec(CMenuTarget* parent, const std::string &) +int CAudioSelectMenuHandler::exec(CMenuTarget* parent, const std::string &actionkey) { - int res = menu_return::RETURN_EXIT_ALL; - + int sel= atoi(actionkey.c_str()); + if(sel >= 0) { + if (g_RemoteControl->current_PIDs.PIDs.selected_apid!= (unsigned int) sel ) + { + g_RemoteControl->setAPID(sel); + } + return menu_return::RETURN_EXIT; + } if (parent) parent->hide(); - doMenu (); - return res; + return doMenu (); } - int CAudioSelectMenuHandler::doMenu () { CMenuWidget AudioSelector(LOCALE_AUDIOSELECTMENUE_HEAD, NEUTRINO_ICON_AUDIO, width); @@ -108,7 +109,7 @@ int CAudioSelectMenuHandler::doMenu () { char apid[5]; sprintf(apid, "%d", i); - fw[i] = new CMenuForwarderNonLocalized(g_RemoteControl->current_PIDs.APIDs[i].desc, true, NULL, APIDChanger, apid, CRCInput::convertDigitToKey(i + 1)); + fw[i] = new CMenuForwarderNonLocalized(g_RemoteControl->current_PIDs.APIDs[i].desc, true, NULL, this, apid, CRCInput::convertDigitToKey(i + 1)); fw[i]->setItemButton(NEUTRINO_ICON_BUTTON_OKAY, true); AudioSelector.addItem(fw[i], (i == g_RemoteControl->current_PIDs.PIDs.selected_apid)); shortcut_num = i+1; @@ -181,6 +182,3 @@ int CAudioSelectMenuHandler::doMenu () return AudioSelector.exec(NULL, ""); } - - -