*neutrino: rework clock and radio/tv switch functionality

- move clock function from red button (main menu) into features menu
- ...so it's customizable in all user menus
- switching between tv and radio only with red button (main menu) depend of current mode
- add timerlist into main menu

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1985 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
thilo
2011-12-20 21:56:44 +00:00
parent b2aa68e063
commit ed0166e600
10 changed files with 72 additions and 54 deletions

View File

@@ -223,6 +223,8 @@ ci.reset_standby Reset nach Standby
ci.settings Zugangskontrolle
ci.timeout CAM antwortet nicht
ci.waiting Warte auf CAM-Antwort
clock_switch_off Uhr ausblenden
clock_switch_on Uhr einblenden
colorchooser.alpha alpha
colorchooser.blue blau
colorchooser.green grün
@@ -646,7 +648,7 @@ mainmenu.service Service
mainmenu.settings Einstellungen
mainmenu.shutdown Ausschalten
mainmenu.sleeptimer SleepTimer
mainmenu.tvmode TV-Modus/Uhr
mainmenu.tvmode TV/Radio Umschaltung
mainsettings.audio Audio
mainsettings.head Einstellungen
mainsettings.keybinding Tasten

View File

@@ -223,6 +223,8 @@ ci.reset_standby Reset after standby
ci.settings Conditional access
ci.timeout Timeout waiting CI menu ready
ci.waiting Waiting for CI answer
clock_switch_off Clock off
clock_switch_on Clock on
colorchooser.alpha alpha
colorchooser.blue blue
colorchooser.green green
@@ -646,7 +648,7 @@ mainmenu.service Service
mainmenu.settings Settings
mainmenu.shutdown Shutdown
mainmenu.sleeptimer SleepTimer
mainmenu.tvmode TV-Mode
mainmenu.tvmode TV/Radio-Mode
mainsettings.audio Audio
mainsettings.head Settings
mainsettings.keybinding Key Setup

View File

@@ -119,7 +119,8 @@ bool CUserMenu::showUserMenu(int button)
CRCLock *rcLock = NULL;
CStreamFeaturesChangeExec *StreamFeaturesChanger = NULL;
CImageInfo *imageinfo = NULL;
CDBoxInfoWidget *boxinfo = NULL;
CDBoxInfoWidget *boxinfo = NULL;
CNeutrinoApp * neutrino = NULL;
std::string txt = g_settings.usermenu_text[button];
neutrino_locale_t caption = user_menu[button].caption;
@@ -335,6 +336,16 @@ bool CUserMenu::showUserMenu(int button)
menu->addItem(new CMenuForwarder(LOCALE_CI_SETTINGS, true, NULL, g_CamHandler, NULL, key, icon));
}
break;
case SNeutrinoSettings::ITEM_CLOCK:
{
menu_items++;
menu_prev = SNeutrinoSettings::ITEM_CLOCK;
keyhelper.get(&key,&icon, CRCInput::RC_green);
neutrino = CNeutrinoApp::getInstance();
menu_item = new CMenuForwarder(!g_settings.mode_clock ? LOCALE_CLOCK_SWITCH_ON:LOCALE_CLOCK_SWITCH_OFF, true, NULL, neutrino, "clock_switch", key, icon);
menu->addItem(menu_item, false);
}
break;
#if 0 // FIXME not supported yet
case SNeutrinoSettings::ITEM_MOVIEPLAYER_TS:

View File

@@ -83,7 +83,8 @@ const CMenuOptionChooser::keyval USERMENU_ITEM_OPTIONS[USERMENU_ITEM_OPTION_COUN
{ SNeutrinoSettings::ITEM_VTXT, LOCALE_USERMENU_ITEM_VTXT },
{ SNeutrinoSettings::ITEM_IMAGEINFO, LOCALE_SERVICEMENU_IMAGEINFO },
{ SNeutrinoSettings::ITEM_BOXINFO, LOCALE_EXTRA_DBOXINFO },
{ SNeutrinoSettings::ITEM_CAM, LOCALE_CI_SETTINGS }
{ SNeutrinoSettings::ITEM_CAM, LOCALE_CI_SETTINGS },
{ SNeutrinoSettings::ITEM_CLOCK, LOCALE_CLOCK_SWITCH_ON }
};
int CUserMenuSetup::exec(CMenuTarget* parent, const std::string &)

View File

@@ -768,7 +768,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
"2,3,4,13", // RED
"6", // GREEN
"7", // YELLOW
"12,10,11,14,15" // BLUE
"12,10,11,19,14,15" // BLUE
};
char txt1[81];
std::string txt2;
@@ -2095,19 +2095,11 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu)
saveSetup(NEUTRINO_SETTINGS_FILE);
}
}
else if( msg == (neutrino_msg_t) g_settings.key_tvradio_mode ) {
if( mode == mode_tv )
radioMode();
else if( mode == mode_radio )
tvMode();
}
else if( ((msg == CRCInput::RC_tv) || (msg == CRCInput::RC_radio)) && ((neutrino_msg_t)g_settings.key_tvradio_mode == CRCInput::RC_nokey)) {
if(mode == mode_radio ) {
tvMode();
}
else if(mode == mode_tv) {
radioMode();
}
switchTvRadioMode();//used with defined default tv/radio rc key
}
else if( msg == (neutrino_msg_t) g_settings.key_tvradio_mode ) {
switchTvRadioMode(); //used with defined rc key TODO: do we really need this, because we already have a specified key on the remote control
}
else if( msg == (neutrino_msg_t) g_settings.key_subchannel_up ) {
if(g_RemoteControl->subChannels.size() > 0) {
@@ -3337,18 +3329,7 @@ void CNeutrinoApp::tvMode( bool rezap )
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
CVFD::getInstance()->ShowIcon(VFD_ICON_TV, true);
if( mode == mode_tv ) {
if(g_settings.mode_clock) {
InfoClock->StopClock();
g_settings.mode_clock=false;
} else {
InfoClock->StartClock();
g_settings.mode_clock=true;
}
return;
} else if( mode == mode_scart ) {
//g_Controld->setScartMode( 0 );
} else if( mode == mode_standby ) {
if( mode == mode_standby ) {
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
videoDecoder->Standby(false);
}
@@ -3552,20 +3533,7 @@ void CNeutrinoApp::radioMode( bool rezap)
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
CVFD::getInstance()->ShowIcon(VFD_ICON_RADIO, true);
if( mode==mode_radio ) {
if(g_settings.mode_clock) {
InfoClock->StopClock();
g_settings.mode_clock=false;
} else {
InfoClock->StartClock();
g_settings.mode_clock=true;
}
return;
}
else if( mode == mode_scart ) {
//g_Controld->setScartMode( 0 );
}
else if( mode == mode_standby ) {
if( mode == mode_standby ) {
CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
videoDecoder->Standby(false);
}
@@ -3587,6 +3555,27 @@ void CNeutrinoApp::radioMode( bool rezap)
}
}
//switching from current mode to next mode between tv or radio
void CNeutrinoApp::switchTvRadioMode()
{
if (mode == mode_radio )
tvMode();
else if(mode == mode_tv)
radioMode();
}
//switching clock on or off depends of current displayed or not
void CNeutrinoApp::switchClockOnOff()
{
if(g_settings.mode_clock) {
InfoClock->StopClock();
g_settings.mode_clock=false;
} else {
InfoClock->StartClock();
g_settings.mode_clock=true;
}
}
/**************************************************************************************
* CNeutrinoApp - exec, menuitem callback (shutdown) *
**************************************************************************************/
@@ -3611,12 +3600,14 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey)
unlink("/tmp/.reboot");
returnval = menu_return::RETURN_NONE;
}
else if(actionKey=="tv") {
tvMode();
else if (actionKey=="clock_switch")
{
switchClockOnOff();
returnval = menu_return::RETURN_EXIT_ALL;
}
else if(actionKey=="radio") {
radioMode();
else if (actionKey=="tv_radio_switch")//used in mainmenu
{
switchTvRadioMode();
returnval = menu_return::RETURN_EXIT_ALL;
}
else if(actionKey=="scart") {

View File

@@ -206,6 +206,9 @@ public:
int getLastMode() {
return lastMode;
}
void switchTvRadioMode();
void switchClockOnOff();
bool isMuted() {
return current_muted;
}

View File

@@ -101,11 +101,14 @@ void CNeutrinoApp::InitMainMenu(CMenuWidget &mainMenu, CMenuWidget &mainSettings
dprintf(DEBUG_DEBUG, "init mainmenue\n");
mainMenu.addItem(GenericMenuSeparator);
mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_TVMODE, true, NULL, this, "tv", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED), true);
mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_RADIOMODE, true, NULL, this, "radio", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
//mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_SCARTMODE, true, NULL, this, "scart", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_TVMODE, true, NULL, this, "tv_radio_switch", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED), true);
//games
if (g_PluginList->hasPlugin(CPlugins::P_TYPE_GAME))
mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_GAMES, true, NULL, new CPluginList(LOCALE_MAINMENU_GAMES,CPlugins::P_TYPE_GAME), "", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_GAMES, true, NULL, new CPluginList(LOCALE_MAINMENU_GAMES,CPlugins::P_TYPE_GAME), "", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
//timer
mainMenu.addItem(new CMenuForwarder(LOCALE_TIMERLIST_NAME, true, NULL, new CTimerList(), NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
//multimedia menu
mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_MEDIA, true, NULL, CMediaPlayerMenu::getInstance(), NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));

View File

@@ -250,6 +250,8 @@ typedef enum
LOCALE_CI_SETTINGS,
LOCALE_CI_TIMEOUT,
LOCALE_CI_WAITING,
LOCALE_CLOCK_SWITCH_OFF,
LOCALE_CLOCK_SWITCH_ON,
LOCALE_COLORCHOOSER_ALPHA,
LOCALE_COLORCHOOSER_BLUE,
LOCALE_COLORCHOOSER_GREEN,

View File

@@ -250,6 +250,8 @@ const char * locale_real_names[] =
"ci.settings",
"ci.timeout",
"ci.waiting",
"clock_switch_off",
"clock_switch_on",
"colorchooser.alpha",
"colorchooser.blue",
"colorchooser.green",

View File

@@ -506,9 +506,10 @@ struct SNeutrinoSettings
ITEM_TECHINFO = 13,
ITEM_REMOTE = 14,
ITEM_PLUGIN = 15,
ITEM_IMAGEINFO,
ITEM_BOXINFO,
ITEM_CAM,
ITEM_IMAGEINFO = 16,
ITEM_BOXINFO = 17,
ITEM_CAM = 18,
ITEM_CLOCK = 19,
#if 0
ITEM_MOVIEPLAYER_TS,
ITEM_RESTART_CAMD,