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: ccb5c4d8d3
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2011-11-26 (Sat, 26 Nov 2011)



------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2011-11-26 10:25:45 +00:00
parent 6e288088b9
commit 2ab15c23ca

View File

@@ -42,7 +42,6 @@
#include <driver/screen_max.h> #include <driver/screen_max.h>
extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */
extern CAPIDChangeExec * APIDChanger;
extern CAudioSetupNotifier * audioSetupNotifier; extern CAudioSetupNotifier * audioSetupNotifier;
#include <gui/audio_select.h> #include <gui/audio_select.h>
@@ -73,21 +72,23 @@ const CMenuOptionChooser::keyval AUDIOMENU_ANALOGOUT_OPTIONS[AUDIOMENU_ANALOGOUT
{ 2, LOCALE_AUDIOMENU_MONORIGHT } { 2, LOCALE_AUDIOMENU_MONORIGHT }
}; };
int CAudioSelectMenuHandler::exec(CMenuTarget* parent, const std::string &actionkey)
int CAudioSelectMenuHandler::exec(CMenuTarget* parent, const std::string &)
{ {
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) if (parent)
parent->hide(); parent->hide();
doMenu (); return doMenu ();
return res;
} }
int CAudioSelectMenuHandler::doMenu () int CAudioSelectMenuHandler::doMenu ()
{ {
CMenuWidget AudioSelector(LOCALE_AUDIOSELECTMENUE_HEAD, NEUTRINO_ICON_AUDIO, width); CMenuWidget AudioSelector(LOCALE_AUDIOSELECTMENUE_HEAD, NEUTRINO_ICON_AUDIO, width);
@@ -108,7 +109,7 @@ int CAudioSelectMenuHandler::doMenu ()
{ {
char apid[5]; char apid[5];
sprintf(apid, "%d", i); 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); fw[i]->setItemButton(NEUTRINO_ICON_BUTTON_OKAY, true);
AudioSelector.addItem(fw[i], (i == g_RemoteControl->current_PIDs.PIDs.selected_apid)); AudioSelector.addItem(fw[i], (i == g_RemoteControl->current_PIDs.PIDs.selected_apid));
shortcut_num = i+1; shortcut_num = i+1;
@@ -181,6 +182,3 @@ int CAudioSelectMenuHandler::doMenu ()
return AudioSelector.exec(NULL, ""); return AudioSelector.exec(NULL, "");
} }