neutrino GUI: more places to disable anything record-related, if recording_type is RECORDING_OFF

This commit is contained in:
[CST] Focus
2013-04-09 18:37:25 +04:00
parent 8c2362374d
commit e14043dbfb
7 changed files with 51 additions and 24 deletions

View File

@@ -868,6 +868,8 @@ bool CRecordManager::Record(const CTimerd::RecordingInfo * const eventinfo, cons
printf("%s channel_id %" PRIx64 " epg: %" PRIx64 ", apidmode 0x%X\n", __func__, printf("%s channel_id %" PRIx64 " epg: %" PRIx64 ", apidmode 0x%X\n", __func__,
eventinfo->channel_id, eventinfo->epgID, eventinfo->apids); eventinfo->channel_id, eventinfo->epgID, eventinfo->apids);
if (g_settings.recording_type == CNeutrinoApp::RECORDING_OFF)
return false;
#if 0 #if 0
if(!CheckRecording(eventinfo)) if(!CheckRecording(eventinfo))
return false; return false;
@@ -1324,6 +1326,9 @@ void CRecordManager::StartTimeshift()
int CRecordManager::exec(CMenuTarget* parent, const std::string & actionKey ) int CRecordManager::exec(CMenuTarget* parent, const std::string & actionKey )
{ {
if (g_settings.recording_type == CNeutrinoApp::RECORDING_OFF)
return menu_return::RETURN_REPAINT;
if(parent) if(parent)
parent->hide(); parent->hide();

View File

@@ -652,7 +652,7 @@ int CChannelList::show()
} }
#endif #endif
if(SameTP()) { if((g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) && SameTP()) {
printf("[neutrino channellist] start direct recording...\n"); printf("[neutrino channellist] start direct recording...\n");
hide(); hide();
if (!CRecordManager::getInstance()->Record(chanlist[selected]->channel_id)) { if (!CRecordManager::getInstance()->Record(chanlist[selected]->channel_id)) {
@@ -1776,7 +1776,9 @@ void CChannelList::paintButtonBar(bool is_current)
} }
if (i == 4) { if (i == 4) {
//manage record button //manage record button
if (g_settings.recording_type != RECORDING_OFF && !displayNext){ if (g_settings.recording_type == RECORDING_OFF)
continue;
if (!displayNext){
if (do_record){ if (do_record){
Button[bcnt].locale = LOCALE_MAINMENU_RECORDING_STOP; Button[bcnt].locale = LOCALE_MAINMENU_RECORDING_STOP;
Button[bcnt].button = NEUTRINO_ICON_BUTTON_STOP; Button[bcnt].button = NEUTRINO_ICON_BUTTON_STOP;

View File

@@ -166,10 +166,12 @@ int CMediaPlayerMenu::initMenuMedia(CMenuWidget *m, CPersonalizeGui *p)
if (usage_mode == MODE_DEFAULT) if (usage_mode == MODE_DEFAULT)
{ {
//movieplayer //movieplayer
moviePlayer = new CMenuWidget(LOCALE_MAINMENU_MOVIEPLAYER, NEUTRINO_ICON_MULTIMEDIA, width, MN_WIDGET_ID_MEDIA_MOVIEPLAYER); if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) {
personalize->addWidget(moviePlayer); moviePlayer = new CMenuWidget(LOCALE_MAINMENU_MOVIEPLAYER, NEUTRINO_ICON_MULTIMEDIA, width, MN_WIDGET_ID_MEDIA_MOVIEPLAYER);
fw_mp = new CMenuForwarder(LOCALE_MAINMENU_MOVIEPLAYER, true, NULL, moviePlayer, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); personalize->addWidget(moviePlayer);
fw_mp->setHint(NEUTRINO_ICON_HINT_MOVIE, LOCALE_MENU_HINT_MOVIE); fw_mp = new CMenuForwarder(LOCALE_MAINMENU_MOVIEPLAYER, true, NULL, moviePlayer, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW);
fw_mp->setHint(NEUTRINO_ICON_HINT_MOVIE, LOCALE_MENU_HINT_MOVIE);
}
//pictureviewer //pictureviewer
pictureviewergui = new CPictureViewerGui(); pictureviewergui = new CPictureViewerGui();
@@ -204,8 +206,10 @@ int CMediaPlayerMenu::initMenuMedia(CMenuWidget *m, CPersonalizeGui *p)
personalize->addItem(media, fw_inet, &g_settings.personalize[SNeutrinoSettings::P_MEDIA_INETPLAY]); personalize->addItem(media, fw_inet, &g_settings.personalize[SNeutrinoSettings::P_MEDIA_INETPLAY]);
//movieplayer //movieplayer
showMoviePlayer(moviePlayer, personalize); if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) {
personalize->addItem(media, fw_mp, &g_settings.personalize[SNeutrinoSettings::P_MEDIA_MPLAYER], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ACCESS_OPTION); showMoviePlayer(moviePlayer, personalize);
personalize->addItem(media, fw_mp, &g_settings.personalize[SNeutrinoSettings::P_MEDIA_MPLAYER], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ACCESS_OPTION);
}
//picture viewer //picture viewer
personalize->addItem(media, fw_pviewer, &g_settings.personalize[SNeutrinoSettings::P_MEDIA_PVIEWER]); personalize->addItem(media, fw_pviewer, &g_settings.personalize[SNeutrinoSettings::P_MEDIA_PVIEWER]);

View File

@@ -1031,15 +1031,15 @@ const CMenuOptionChooser::keyval TIMERLIST_STANDBY_OPTIONS[TIMERLIST_STANDBY_OPT
#endif #endif
const CMenuOptionChooser::keyval TIMERLIST_TYPE_OPTIONS[TIMERLIST_TYPE_OPTION_COUNT] = const CMenuOptionChooser::keyval TIMERLIST_TYPE_OPTIONS[TIMERLIST_TYPE_OPTION_COUNT] =
{ {
{ CTimerd::TIMER_SHUTDOWN, LOCALE_TIMERLIST_TYPE_SHUTDOWN },
#if 0 #if 0
{ CTimerd::TIMER_NEXTPROGRAM, LOCALE_TIMERLIST_TYPE_NEXTPROGRAM }, { CTimerd::TIMER_NEXTPROGRAM, LOCALE_TIMERLIST_TYPE_NEXTPROGRAM },
#endif #endif
{ CTimerd::TIMER_RECORD, LOCALE_TIMERLIST_TYPE_RECORD },
{ CTimerd::TIMER_ZAPTO, LOCALE_TIMERLIST_TYPE_ZAPTO }, { CTimerd::TIMER_ZAPTO, LOCALE_TIMERLIST_TYPE_ZAPTO },
{ CTimerd::TIMER_STANDBY, LOCALE_TIMERLIST_TYPE_STANDBY }, { CTimerd::TIMER_STANDBY, LOCALE_TIMERLIST_TYPE_STANDBY },
{ CTimerd::TIMER_RECORD, LOCALE_TIMERLIST_TYPE_RECORD },
{ CTimerd::TIMER_SLEEPTIMER, LOCALE_TIMERLIST_TYPE_SLEEPTIMER }, { CTimerd::TIMER_SLEEPTIMER, LOCALE_TIMERLIST_TYPE_SLEEPTIMER },
{ CTimerd::TIMER_REMIND, LOCALE_TIMERLIST_TYPE_REMIND }, { CTimerd::TIMER_REMIND, LOCALE_TIMERLIST_TYPE_REMIND },
{ CTimerd::TIMER_SHUTDOWN, LOCALE_TIMERLIST_TYPE_SHUTDOWN },
{ CTimerd::TIMER_EXEC_PLUGIN, LOCALE_TIMERLIST_TYPE_EXECPLUGIN } { CTimerd::TIMER_EXEC_PLUGIN, LOCALE_TIMERLIST_TYPE_EXECPLUGIN }
}; };
@@ -1133,6 +1133,9 @@ int CTimerList::newTimer()
std::vector<CMenuWidget *> toDelete; std::vector<CMenuWidget *> toDelete;
// Defaults // Defaults
timerNew.eventType = CTimerd::TIMER_RECORD ; timerNew.eventType = CTimerd::TIMER_RECORD ;
if (g_settings.recording_type == CNeutrinoApp::RECORDING_OFF)
timerNew.eventType = CTimerd::TIMER_ZAPTO;
timerNew.eventRepeat = CTimerd::TIMERREPEAT_ONCE ; timerNew.eventRepeat = CTimerd::TIMERREPEAT_ONCE ;
timerNew.repeatCount = 0; timerNew.repeatCount = 0;
timerNew.alarmTime = (time(NULL)/60)*60; timerNew.alarmTime = (time(NULL)/60)*60;
@@ -1220,7 +1223,11 @@ int CTimerList::newTimer()
CTimerListNewNotifier notifier2((int *)&timerNew.eventType, CTimerListNewNotifier notifier2((int *)&timerNew.eventType,
&timerNew.stopTime,m2,m6,m8,m9,m10,m7, &timerNew.stopTime,m2,m6,m8,m9,m10,m7,
timerSettings_stopTime.getValue()); timerSettings_stopTime.getValue());
CMenuOptionChooser* m0 = new CMenuOptionChooser(LOCALE_TIMERLIST_TYPE, (int *)&timerNew.eventType, TIMERLIST_TYPE_OPTIONS, TIMERLIST_TYPE_OPTION_COUNT, true, &notifier2); CMenuOptionChooser* m0;
if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF)
m0 = new CMenuOptionChooser(LOCALE_TIMERLIST_TYPE, (int *)&timerNew.eventType, TIMERLIST_TYPE_OPTIONS, TIMERLIST_TYPE_OPTION_COUNT, true, &notifier2);
else
m0 = new CMenuOptionChooser(LOCALE_TIMERLIST_TYPE, (int *)&timerNew.eventType, &TIMERLIST_TYPE_OPTIONS[1], TIMERLIST_TYPE_OPTION_COUNT-1, true, &notifier2);
timerSettings.addItem( m0); timerSettings.addItem( m0);
timerSettings.addItem( m1); timerSettings.addItem( m1);

View File

@@ -75,7 +75,6 @@ const CMenuOptionChooser::keyval USERMENU_ITEM_OPTIONS[USERMENU_ITEM_OPTION_COUN
{ SNeutrinoSettings::ITEM_EPG_MISC, LOCALE_USERMENU_ITEM_EPG_MISC }, { SNeutrinoSettings::ITEM_EPG_MISC, LOCALE_USERMENU_ITEM_EPG_MISC },
{ SNeutrinoSettings::ITEM_AUDIO_SELECT, LOCALE_AUDIOSELECTMENUE_HEAD }, { SNeutrinoSettings::ITEM_AUDIO_SELECT, LOCALE_AUDIOSELECTMENUE_HEAD },
{ SNeutrinoSettings::ITEM_SUBCHANNEL, LOCALE_INFOVIEWER_SUBSERVICE }, { SNeutrinoSettings::ITEM_SUBCHANNEL, LOCALE_INFOVIEWER_SUBSERVICE },
{ SNeutrinoSettings::ITEM_RECORD, LOCALE_TIMERLIST_TYPE_RECORD },
{ SNeutrinoSettings::ITEM_MOVIEPLAYER_MB, LOCALE_MOVIEBROWSER_HEAD }, { SNeutrinoSettings::ITEM_MOVIEPLAYER_MB, LOCALE_MOVIEBROWSER_HEAD },
{ SNeutrinoSettings::ITEM_TIMERLIST, LOCALE_TIMERLIST_NAME }, { SNeutrinoSettings::ITEM_TIMERLIST, LOCALE_TIMERLIST_NAME },
{ SNeutrinoSettings::ITEM_REMOTE, LOCALE_RCLOCK_MENUEADD }, { SNeutrinoSettings::ITEM_REMOTE, LOCALE_RCLOCK_MENUEADD },
@@ -88,7 +87,8 @@ const CMenuOptionChooser::keyval USERMENU_ITEM_OPTIONS[USERMENU_ITEM_OPTION_COUN
{ SNeutrinoSettings::ITEM_CAM, LOCALE_CI_SETTINGS }, { SNeutrinoSettings::ITEM_CAM, LOCALE_CI_SETTINGS },
{ SNeutrinoSettings::ITEM_CLOCK, LOCALE_CLOCK_SWITCH_ON }, { SNeutrinoSettings::ITEM_CLOCK, LOCALE_CLOCK_SWITCH_ON },
{ SNeutrinoSettings::ITEM_GAMES, LOCALE_MAINMENU_GAMES }, { SNeutrinoSettings::ITEM_GAMES, LOCALE_MAINMENU_GAMES },
{ SNeutrinoSettings::ITEM_SCRIPTS, LOCALE_MAINMENU_SCRIPTS } { SNeutrinoSettings::ITEM_SCRIPTS, LOCALE_MAINMENU_SCRIPTS },
{ SNeutrinoSettings::ITEM_RECORD, LOCALE_TIMERLIST_TYPE_RECORD }
}; };
int CUserMenuSetup::exec(CMenuTarget* parent, const std::string &) int CUserMenuSetup::exec(CMenuTarget* parent, const std::string &)
@@ -130,7 +130,8 @@ int CUserMenuSetup::showSetup()
{ {
snprintf(text,max_char,"%d.",item+1); snprintf(text,max_char,"%d.",item+1);
text[max_char-1]=0;// terminate for sure text[max_char-1]=0;// terminate for sure
ums->addItem(new CMenuOptionChooser(text, &g_settings.usermenu[button][item], USERMENU_ITEM_OPTIONS, USERMENU_ITEM_OPTION_COUNT,true, NULL, CRCInput::RC_nokey, "", true )); int count = (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) ? USERMENU_ITEM_OPTION_COUNT : USERMENU_ITEM_OPTION_COUNT - 1;
ums->addItem(new CMenuOptionChooser(text, &g_settings.usermenu[button][item], USERMENU_ITEM_OPTIONS, count,true, NULL, CRCInput::RC_nokey, "", true ));
} }
int res = ums->exec(NULL, ""); int res = ums->exec(NULL, "");

View File

@@ -2178,7 +2178,8 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu)
} }
} }
else if( msg == CRCInput::RC_record) { else if( msg == CRCInput::RC_record) {
CRecordManager::getInstance()->exec(NULL, "Record"); if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF)
CRecordManager::getInstance()->exec(NULL, "Record");
} }
else if( msg == CRCInput::RC_stop ) { else if( msg == CRCInput::RC_stop ) {
CRecordManager::getInstance()->exec(NULL, "Stop_record"); CRecordManager::getInstance()->exec(NULL, "Stop_record");
@@ -2251,7 +2252,8 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu)
} }
else if( msg == CRCInput::RC_video || msg == CRCInput::RC_play ) { else if( msg == CRCInput::RC_video || msg == CRCInput::RC_play ) {
//open moviebrowser via media player menu object //open moviebrowser via media player menu object
CMediaPlayerMenu::getInstance()->exec(NULL,"movieplayer"); if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF)
CMediaPlayerMenu::getInstance()->exec(NULL,"movieplayer");
} }
else if (CRCInput::isNumeric(msg) && g_RemoteControl->director_mode ) { else if (CRCInput::isNumeric(msg) && g_RemoteControl->director_mode ) {
g_RemoteControl->setSubChannel(CRCInput::getNumericValue(msg)); g_RemoteControl->setSubChannel(CRCInput::getNumericValue(msg));
@@ -2648,8 +2650,10 @@ _repeat:
g_CamHandler->exec(NULL, "ca_ci_reset1"); g_CamHandler->exec(NULL, "ca_ci_reset1");
} }
} }
CRecordManager::getInstance()->Record((CTimerd::RecordingInfo *) data); if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) {
autoshift = CRecordManager::getInstance()->TimeshiftOnly(); CRecordManager::getInstance()->Record((CTimerd::RecordingInfo *) data);
autoshift = CRecordManager::getInstance()->TimeshiftOnly();
}
delete[] (unsigned char*) data; delete[] (unsigned char*) data;
return messages_return::handled | messages_return::cancel_all; return messages_return::handled | messages_return::cancel_all;

View File

@@ -298,9 +298,11 @@ void CNeutrinoApp::InitMenuSettings()
personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_NETWORK]); personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_NETWORK]);
// record settings // record settings
mf = new CMenuForwarder(LOCALE_MAINSETTINGS_RECORDING, true, NULL, new CRecordSetup()); if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) {
mf->setHint(NEUTRINO_ICON_HINT_RECORDING, LOCALE_MENU_HINT_RECORDING); mf = new CMenuForwarder(LOCALE_MAINSETTINGS_RECORDING, true, NULL, new CRecordSetup());
personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_RECORDING]); mf->setHint(NEUTRINO_ICON_HINT_RECORDING, LOCALE_MENU_HINT_RECORDING);
personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_RECORDING]);
}
// osdlang // osdlang
mf = new CMenuForwarder(LOCALE_MAINSETTINGS_LANGUAGE, true, NULL, new COsdLangSetup()); mf = new CMenuForwarder(LOCALE_MAINSETTINGS_LANGUAGE, true, NULL, new COsdLangSetup());
@@ -320,9 +322,11 @@ void CNeutrinoApp::InitMenuSettings()
} }
// drive settings // drive settings
mf = new CMenuForwarder(LOCALE_HDD_SETTINGS, true, NULL, new CHDDMenuHandler()); if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) {
mf->setHint(NEUTRINO_ICON_HINT_HDD, LOCALE_MENU_HINT_HDD); mf = new CMenuForwarder(LOCALE_HDD_SETTINGS, true, NULL, new CHDDMenuHandler());
personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_DRIVES]); mf->setHint(NEUTRINO_ICON_HINT_HDD, LOCALE_MENU_HINT_HDD);
personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_DRIVES]);
}
// cisettings // cisettings
mf = new CMenuForwarder(LOCALE_CI_SETTINGS, true, NULL, g_CamHandler); mf = new CMenuForwarder(LOCALE_CI_SETTINGS, true, NULL, g_CamHandler);