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
This commit is contained in:
focus
2011-11-26 10:25:45 +00:00
parent 27e639cb0d
commit ccb5c4d8d3

View File

@@ -42,7 +42,6 @@
#include <driver/screen_max.h>
extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */
extern CAPIDChangeExec * APIDChanger;
extern CAudioSetupNotifier * audioSetupNotifier;
#include <gui/audio_select.h>
@@ -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, "");
}