mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 08:51:04 +02:00
gui/audio_select.cpp: add PID volume adjusting
Origin commit data
------------------
Branch: ni/coolstream
Commit: b8f78e9c5d
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-08-16 (Thu, 16 Aug 2012)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -40,6 +40,8 @@
|
||||
#include <gui/widget/icons.h>
|
||||
#include <gui/widget/menue.h>
|
||||
#include <driver/screen_max.h>
|
||||
#include <driver/volume.h>
|
||||
#include <zapit/zapit.h>
|
||||
|
||||
extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */
|
||||
extern CAudioSetupNotifier * audioSetupNotifier;
|
||||
@@ -103,23 +105,20 @@ int CAudioSelectMenuHandler::doMenu ()
|
||||
|
||||
unsigned int shortcut_num = 1;
|
||||
|
||||
// -- setup menue due to Audio PIDs
|
||||
if (g_RemoteControl->current_PIDs.APIDs.size() > 1)
|
||||
{
|
||||
uint p_count = g_RemoteControl->current_PIDs.APIDs.size();
|
||||
CMenuForwarderNonLocalized* fw[p_count];
|
||||
|
||||
// -- setup menue due to Audio PIDs
|
||||
for( uint i=0; i < p_count; i++ )
|
||||
{
|
||||
char apid[5];
|
||||
sprintf(apid, "%d", i);
|
||||
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));
|
||||
CMenuForwarderNonLocalized *fw = new CMenuForwarderNonLocalized(g_RemoteControl->current_PIDs.APIDs[i].desc,
|
||||
true, NULL, this, apid, CRCInput::convertDigitToKey(i + 1));
|
||||
fw->setItemButton(NEUTRINO_ICON_BUTTON_OKAY, true);
|
||||
AudioSelector.addItem(fw, (i == g_RemoteControl->current_PIDs.PIDs.selected_apid));
|
||||
shortcut_num = i+1;
|
||||
}
|
||||
if (p_count)
|
||||
AudioSelector.addItem(GenericMenuSeparatorLine);
|
||||
}
|
||||
|
||||
// -- setup menue for to Dual Channel Stereo
|
||||
CMenuOptionChooser* oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOG_MODE,
|
||||
@@ -184,5 +183,19 @@ int CAudioSelectMenuHandler::doMenu ()
|
||||
AudioSelector.addItem(new CMenuForwarder(LOCALE_SUBTITLES_STOP, true, NULL, &SubtitleChanger, "off", CRCInput::RC_stop));
|
||||
}
|
||||
|
||||
AudioSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUST));
|
||||
|
||||
/* setting volume percent to zapit with channel_id/apid = 0 means current channel and pid */
|
||||
CVolume::getInstance()->SetCurrentChannel(0);
|
||||
CVolume::getInstance()->SetCurrentPid(0);
|
||||
int percent[p_count];
|
||||
for (uint i=0; i < p_count; i++) {
|
||||
percent[i] = CZapit::getInstance()->GetPidVolume(0, g_RemoteControl->current_PIDs.APIDs[i].pid);
|
||||
AudioSelector.addItem(new CMenuOptionNumberChooser(NONEXISTANT_LOCALE, &percent[i],
|
||||
i == g_RemoteControl->current_PIDs.PIDs.selected_apid,
|
||||
0, 999, CVolume::getInstance(), 0, 0, NONEXISTANT_LOCALE,
|
||||
g_RemoteControl->current_PIDs.APIDs[i].desc));
|
||||
}
|
||||
|
||||
return AudioSelector.exec(NULL, "");
|
||||
}
|
||||
|
Reference in New Issue
Block a user