*neutrino record: reduce multiple code for record calls

Some lines with recording-actions calls in record.cpp and neutrino.cpp were redundant.
Now we use only the exec() call with action key "Record" from record.cpp.
So we use the same functions with record button and with the recording menu item
in  user menu. This also causes, that we can see the infobar as response for user
on used menu item in user menu.

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1803 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
thilo
2011-11-01 23:41:48 +00:00
parent 728f78c7b4
commit 432a2db13f
3 changed files with 14 additions and 28 deletions

View File

@@ -1213,9 +1213,18 @@ int CRecordManager::exec(CMenuTarget* parent, const std::string & actionKey )
{
printf("[neutrino] direct record\n");
t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID();
if(!CRecordManager::getInstance()->RecordingStatus(live_channel_id))
if(!CRecordManager::getInstance()->RecordingStatus(live_channel_id))
{
CRecordManager::getInstance()->Record(live_channel_id);
return menu_return::RETURN_EXIT_ALL;
if(!g_InfoViewer->is_visible) // show Infoviewer
CNeutrinoApp::getInstance()->showInfo();
return menu_return::RETURN_EXIT_ALL;
}
else
DisplayInfoMessage(g_Locale->getText(LOCALE_RECORDING_IS_RUNNING));
}else if(actionKey == "Timeshift")
{
StartTimeshift();

View File

@@ -174,17 +174,8 @@ bool CUserMenu::showUserMenu(int button)
menu_items++;
menu_prev = SNeutrinoSettings::ITEM_RECORD;
keyhelper.get(&key,&icon,CRCInput::RC_red);
#if 1 //NEW, show menu, how better ?
menu_item = new CMenuForwarder(LOCALE_MAINMENU_RECORDING, true, NULL, CRecordManager::getInstance(), "-1", key, icon);
#else //OLD, show start/stop chooser
menu_item = new CMenuOptionChooser(LOCALE_MAINMENU_RECORDING, &CRecordManager::getInstance()->recordingstatus,
MAINMENU_RECORDING_OPTIONS, MAINMENU_RECORDING_OPTION_COUNT, true,
CRecordManager::getInstance(), key, icon);
#endif
menu->addItem(menu_item, false);
//if(has_hdd)
// menu->addItem(new CMenuForwarder(LOCALE_EXTRA_AUTO_TO_RECORD, autoshift, NULL, CNeutrinoApp::getInstance(), "autolink"), false);
break;
}
case SNeutrinoSettings::ITEM_MOVIEPLAYER_MB:

View File

@@ -2340,22 +2340,8 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu)
CMoviePlayerGui::getInstance().exec(NULL, "rtimeshift");
}
}
else if( msg == CRCInput::RC_record /* || msg == CRCInput::RC_stop*/ ) {
printf("[neutrino] direct record\n");
t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID();
if(!CRecordManager::getInstance()->RecordingStatus(live_channel_id)) {
#if 0 // uncomment, if ChooseRecDir and g_settings.recording_choose_direct_rec_dir ever used to select recording dir
CRecordManager::getInstance()->recordingstatus = 1;
CRecordManager::getInstance()->doGuiRecord();
#else // direct record without any GUI
CRecordManager::getInstance()->Record(live_channel_id);
if(!g_InfoViewer->is_visible) // show Infoviewer
showInfo();
#endif
}
else
DisplayInfoMessage(g_Locale->getText(LOCALE_RECORDING_IS_RUNNING));
else if( msg == CRCInput::RC_record) {
CRecordManager::getInstance()->exec(NULL, "Record");
}
else if( msg == CRCInput::RC_stop ) {
if(CRecordManager::getInstance()->RecordingStatus())
@@ -3816,7 +3802,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey)
}
else if(actionKey=="recording") {
setupRecordingDevice();
}
}
else if(actionKey=="reloadplugins") {
CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_GETPLUGINS_HINT));
hintBox->paint();