From 3230ff1c5874cd6ee8d5fce1c32ddac94f78d866 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Wed, 16 Nov 2011 21:19:34 +0000 Subject: [PATCH] *Use of One touch recording - When instant recording the current EPG data will be used for the receiving end. - Function is switchable separately, original condition is Default. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1855 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- data/locale/deutsch.locale | 3 +++ data/locale/english.locale | 3 +++ src/driver/record.cpp | 15 ++++++++++++++- src/gui/record_setup.cpp | 11 +++++++++++ src/neutrino.cpp | 2 ++ src/system/locals.h | 3 +++ src/system/locals_intern.h | 3 +++ src/system/settings.h | 1 + 8 files changed, 40 insertions(+), 1 deletion(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 4fd7b7e47..20048ea48 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1129,6 +1129,9 @@ recordingmenu.apids_alt Alternative Tonspuren aufn. recordingmenu.apids_std Standard Tonspur aufnehmen recordingmenu.choose_direct_rec_dir Bei Sofortaufn. Verzeichnisauswahl recordingmenu.defdir Aufnahmeverzeichnis +recordingmenu.end_of_recording_epg EPG aktuelles Event +recordingmenu.end_of_recording_max max. Aufnahmezeit +recordingmenu.end_of_recording_name Ende der Sofortaufnahme recordingmenu.epg_for_filename lange Dateinamen (mit EPG-Daten) recordingmenu.file Direkt (Datei) recordingmenu.filesettings Direktaufnahme Einstellungen diff --git a/data/locale/english.locale b/data/locale/english.locale index 132bfeed2..e3f499134 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1129,6 +1129,9 @@ recordingmenu.apids_alt record alternative streams recordingmenu.apids_std record standard stream recordingmenu.choose_direct_rec_dir choose dir on imm. recording recordingmenu.defdir Recording directory +recordingmenu.end_of_recording_epg EPG act. Event +recordingmenu.end_of_recording_max max. Recordingtime +recordingmenu.end_of_recording_name Endtime of Recording recordingmenu.epg_for_filename long filenames (with EPG data) recordingmenu.file direct (file) recordingmenu.filesettings direct recording settings diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 635654ce2..83ad590cf 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -388,7 +388,20 @@ record_error_msg_t CRecordInstance::Record() //FIXME recording_id (timerd eventID) is 0 means its user recording, in this case timer always added ? if(ret == RECORD_OK && recording_id == 0) { time_t now = time(NULL); - recording_id = g_Timerd->addImmediateRecordTimerEvent(channel_id, now, now+g_settings.record_hours*60*60, epgid, epg_time, apidmode); + int record_end = now+g_settings.record_hours*60*60; + if (g_settings.recording_epg_for_end) + { + int pre=0, post=0; + CEPGData epgData; + epgData.epg_times.startzeit = 0; + epgData.epg_times.dauer = 0; + if (sectionsd_getActualEPGServiceKey(channel_id&0xFFFFFFFFFFFFULL, &epgData )) { + g_Timerd->getRecordingSafety(pre, post); + if (epgData.epg_times.startzeit > 0) + record_end = epgData.epg_times.startzeit + epgData.epg_times.dauer + post; + } + } + recording_id = g_Timerd->addImmediateRecordTimerEvent(channel_id, now, record_end, epgid, epg_time, apidmode); printf("%s: channel %llx -> timer eventID %d\n", __FUNCTION__, channel_id, recording_id); } return ret; diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 522af6113..b03f107f6 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -160,6 +160,13 @@ const CMenuOptionChooser::keyval CHOOSE_DIRECT_REC_DIR[RECORDINGMENU_RECORDING_T {2, LOCALE_NFS_LOCALDIR} }; +#define END_OF_RECORDING_COUNT 2 +const CMenuOptionChooser::keyval END_OF_RECORDING[END_OF_RECORDING_COUNT] = +{ + {0, LOCALE_RECORDINGMENU_END_OF_RECORDING_MAX}, + {1, LOCALE_RECORDINGMENU_END_OF_RECORDING_EPG} +}; + void CRecordSetup::showRecordSetup() { //menue init @@ -177,6 +184,10 @@ void CRecordSetup::showRecordSetup() CMenuOptionChooser* channel_rec_dir = new CMenuOptionChooser(LOCALE_RECORDINGMENU_SAVE_IN_CHANNELDIR, &g_settings.recording_save_in_channeldir, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); recordingSettings->addItem(channel_rec_dir); + // end of recording + CMenuOptionChooser* end_of_recording = new CMenuOptionChooser(LOCALE_RECORDINGMENU_END_OF_RECORDING_NAME, &g_settings.recording_epg_for_end, END_OF_RECORDING, END_OF_RECORDING_COUNT, true); + recordingSettings->addItem(end_of_recording); + // //template // CStringInput * recordingSettings_filenameTemplate = new CStringInput(LOCALE_RECORDINGMENU_FILENAME_TEMPLATE, &g_settings.recording_filename_template[0], 21, LOCALE_RECORDINGMENU_FILENAME_TEMPLATE_HINT, LOCALE_IPSETUP_HINT_2, "%/-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 "); // CMenuForwarder* mf11 = new CMenuForwarder(LOCALE_RECORDINGMENU_FILENAME_TEMPLATE, true, g_settings.recording_filename_template[0],recordingSettings_filenameTemplate); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 74f036b18..cc7876e4b 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -641,6 +641,7 @@ int CNeutrinoApp::loadSetup(const char * fname) strcpy( g_settings.recording_ringbuffers, configfile.getString( "recordingmenu.ringbuffers", "20").c_str() ); g_settings.recording_choose_direct_rec_dir = configfile.getInt32( "recording_choose_direct_rec_dir", 0 ); g_settings.recording_epg_for_filename = configfile.getBool("recording_epg_for_filename" , true); + g_settings.recording_epg_for_end = configfile.getBool("recording_epg_for_end" , false); g_settings.recording_save_in_channeldir = configfile.getBool("recording_save_in_channeldir" , false); g_settings.recording_in_spts_mode = true; @@ -1178,6 +1179,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setString("recordingmenu.ringbuffers" , g_settings.recording_ringbuffers); configfile.setInt32 ("recording_choose_direct_rec_dir" , g_settings.recording_choose_direct_rec_dir); configfile.setBool ("recording_epg_for_filename" , g_settings.recording_epg_for_filename ); + configfile.setBool ("recording_epg_for_end" , g_settings.recording_epg_for_end ); configfile.setBool ("recording_save_in_channeldir" , g_settings.recording_save_in_channeldir ); configfile.setBool ("recording_in_spts_mode" , g_settings.recording_in_spts_mode ); diff --git a/src/system/locals.h b/src/system/locals.h index 3ce2a7da3..e8150076a 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1156,6 +1156,9 @@ typedef enum LOCALE_RECORDINGMENU_APIDS_STD, LOCALE_RECORDINGMENU_CHOOSE_DIRECT_REC_DIR, LOCALE_RECORDINGMENU_DEFDIR, + LOCALE_RECORDINGMENU_END_OF_RECORDING_EPG, + LOCALE_RECORDINGMENU_END_OF_RECORDING_MAX, + LOCALE_RECORDINGMENU_END_OF_RECORDING_NAME, LOCALE_RECORDINGMENU_EPG_FOR_FILENAME, LOCALE_RECORDINGMENU_FILE, LOCALE_RECORDINGMENU_FILESETTINGS, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 75e0197a3..73b780354 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1156,6 +1156,9 @@ const char * locale_real_names[] = "recordingmenu.apids_std", "recordingmenu.choose_direct_rec_dir", "recordingmenu.defdir", + "recordingmenu.end_of_recording_epg", + "recordingmenu.end_of_recording_max", + "recordingmenu.end_of_recording_name", "recordingmenu.epg_for_filename", "recordingmenu.file", "recordingmenu.filesettings", diff --git a/src/system/settings.h b/src/system/settings.h index 6ccead768..975922414 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -250,6 +250,7 @@ struct SNeutrinoSettings char recording_ringbuffers[10]; int recording_choose_direct_rec_dir; int recording_epg_for_filename; + int recording_epg_for_end; int recording_save_in_channeldir; int recording_in_spts_mode; int recording_zap_on_announce;