From 858b73f023ecca56631bccca3d8dac66d12b5de5 Mon Sep 17 00:00:00 2001 From: satbaby Date: Mon, 21 Feb 2011 12:27:06 +0000 Subject: [PATCH] -add zapit start channel menu git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1188 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- data/locale/deutsch.locale | 7 ++++- data/locale/english.locale | 5 ++++ src/gui/Makefile.am | 3 ++- src/neutrino.cpp | 29 ++++++++++++++++++++- src/neutrino_menue.cpp | 2 ++ src/system/locals.h | 7 ++++- src/system/locals_intern.h | 7 ++++- src/system/settings.h | 9 +++++++ src/zapit/include/zapit/client/zapittypes.h | 11 ++++++++ src/zapit/src/zapit.cpp | 17 +++++++++--- 10 files changed, 89 insertions(+), 8 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index aa93b017a..fe7c302ce 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1469,4 +1469,9 @@ zapit.scantype.radio Nur Radio zapit.scantype.tv Nur TV zapit.scantype.tvradio Nur TV & Radio zaptotimer.announce In einer Minute wird umgeschaltet. -word.from ab \ No newline at end of file +word.from ab +zapitsetup.head Zapit Einstellungen +zapitsetup.info Zapit +zapitsetup.last_radio Start Radio Kanal +zapitsetup.last_use Start von Letzten Kanal +zapitsetup.last_tv Start TV Kanal \ No newline at end of file diff --git a/data/locale/english.locale b/data/locale/english.locale index 2d0cb5b65..d07ee8d45 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1471,3 +1471,8 @@ upnpbrowser.scanning Scanning for UPnP servers wizard.welcome_head Welcome to the Setup Wizard wizard.welcome_text Next steps will guide you through initial installation of the device.\nImportant: Your CoolStream set-top box can be conveniently controlled\nwith the web interface for timer management or live TV on the Web browser.\nDo not make it accessible to untrusted networks!\nDo you want to continue? word.from from +zapitsetup.head Zapit Settings +zapitsetup.info Zapit +zapitsetup.last_radio Start Radio Channel +zapitsetup.last_use Start from last Channel +zapitsetup.last_tv Start TV Channel \ No newline at end of file diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index b20b74a53..73d11e05d 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -82,7 +82,8 @@ libneutrino_gui_a_SOURCES = \ update.cpp \ user_menue_setup.cpp \ vfd_setup.cpp \ - videosettings.cpp + videosettings.cpp \ + zapit_setup.cpp libneutrino_gui2_a_SOURCES = \ alphasetup.cpp \ diff --git a/src/neutrino.cpp b/src/neutrino.cpp index fa1c33e25..7fb403fa8 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -801,6 +801,15 @@ printf("***************************** rec dir %s timeshift dir %s\n", g_settings if ((g_settings.filebrowser_sortmethod < 0) || (g_settings.filebrowser_sortmethod >= FILEBROWSER_NUMBER_OF_SORT_VARIANTS)) g_settings.filebrowser_sortmethod = 0; g_settings.filebrowser_denydirectoryleave = configfile.getBool("filebrowser_denydirectoryleave", false); + //zapit setup + g_settings.StartChannelTV = configfile.getString("startchanneltv",""); + g_settings.StartChannelRadio = configfile.getString("startchannelradio",""); + g_settings.startchanneltv_id = configfile.getInt64("startchanneltv_id", 0); + g_settings.startchannelradio_id = configfile.getInt64("startchannelradio_id", 0); + g_settings.startchanneltv_nr = configfile.getInt32("startchanneltv_nr", 0); + g_settings.startchannelradio_nr = configfile.getInt32("startchannelradio_nr", 0); + g_settings.uselastchannel = configfile.getInt32("uselastchannel" , 1); + // USERMENU -> in system/settings.h //------------------------------------------- @@ -1302,6 +1311,15 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("filebrowser_sortmethod", g_settings.filebrowser_sortmethod); configfile.setBool("filebrowser_denydirectoryleave", g_settings.filebrowser_denydirectoryleave); + //zapit setup + configfile.setString( "startchanneltv", g_settings.StartChannelTV ); + configfile.setString( "startchannelradio", g_settings.StartChannelRadio ); + configfile.setInt64("startchanneltv_id", g_settings.startchanneltv_id); + configfile.setInt64("startchannelradio_id", g_settings.startchannelradio_id); + configfile.setInt32("startchanneltv_nr", g_settings.startchanneltv_nr); + configfile.setInt32("startchannelradio_nr", g_settings.startchannelradio_nr); + configfile.setInt32("uselastchannel", g_settings.uselastchannel); + // USERMENU //--------------------------------------- char txt1[81]; @@ -2066,7 +2084,16 @@ int CNeutrinoApp::run(int argc, char **argv) CVFD::getInstance()->Clear(); CVFD::getInstance()->ShowText((char *) g_Locale->getText(LOCALE_NEUTRINO_STARTING)); - pthread_create (&zapit_thread, NULL, zapit_main_thread, (void *) g_settings.video_Mode); + //zapit start parameters + Z_start_arg ZapStart_arg; + ZapStart_arg.startchanneltv_id = g_settings.startchanneltv_id; + ZapStart_arg.startchannelradio_id = g_settings.startchannelradio_id; + ZapStart_arg.startchanneltv_nr = g_settings.startchanneltv_nr; + ZapStart_arg.startchannelradio_nr = g_settings.startchannelradio_nr; + ZapStart_arg.uselastchannel = g_settings.uselastchannel; + ZapStart_arg.video_mode = g_settings.video_Mode; + + pthread_create (&zapit_thread, NULL, zapit_main_thread, (void *) &ZapStart_arg); audioSetupNotifier = new CAudioSetupNotifier; while(!zapit_ready) diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index f48421da6..307b53019 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -75,6 +75,7 @@ #endif /*TEST_MENU*/ #include "gui/update.h" #include "gui/vfd_setup.h" +#include "gui/zapit_setup.h" #include "gui/widget/stringinput.h" #include "gui/widget/stringinput_ext.h" @@ -1030,6 +1031,7 @@ void CNeutrinoApp::InitMiscSettings(CMenuWidget &miscSettings) miscSettingsFilebrowser->addItem(new CMenuOptionChooser(LOCALE_FILEBROWSER_DENYDIRECTORYLEAVE, &g_settings.filebrowser_denydirectoryleave, MESSAGEBOX_NO_YES_OPTIONS , MESSAGEBOX_NO_YES_OPTION_COUNT , true )); miscSettings.addItem( new CMenuForwarder(LOCALE_FILEBROWSER_HEAD, true, NULL, miscSettingsFilebrowser, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE) ); miscSettings.addItem(new CMenuForwarder(LOCALE_VIDEOMENU_HDMI_CEC, true, NULL, new CCECSetup() , NULL, CRCInput::RC_0)); + miscSettings.addItem(new CMenuForwarder(LOCALE_ZAPITSETUP_HEAD, true, NULL, new CZapitSetup() , NULL, CRCInput::RC_1)); #if 0 //infobar diff --git a/src/system/locals.h b/src/system/locals.h index 6e4b53985..65f74a7dc 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1474,7 +1474,12 @@ typedef enum { LOCALE_CPU_FREQ_DEFAULT, LOCALE_WIZARD_WELCOME_HEAD, LOCALE_WIZARD_WELCOME_TEXT, - LOCALE_WORD_FROM + LOCALE_WORD_FROM, + LOCALE_ZAPITSETUP_HEAD, + LOCALE_ZAPITSETUP_INFO, + LOCALE_ZAPITSETUP_LAST_RADIO, + LOCALE_ZAPITSETUP_LAST_USE, + LOCALE_ZAPITSETUP_LAST_TV } neutrino_locale_t; #endif diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 864440002..cbaf7ba21 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1474,7 +1474,12 @@ const char *locale_real_names[] = { "cpu.freq_default", "wizard.welcome_head", "wizard.welcome_text", - "word.from" + "word.from", + "zapitsetup.head", + "zapitsetup.info", + "zapitsetup.last_radio", + "zapitsetup.last_use", + "zapitsetup.last_tv" }; #endif diff --git a/src/system/settings.h b/src/system/settings.h index dfeb97081..8fbe478c4 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -436,6 +436,15 @@ struct SNeutrinoSettings int filebrowser_sortmethod; int filebrowser_denydirectoryleave; + //zapit setup + std::string StartChannelTV; + std::string StartChannelRadio; + t_channel_id startchanneltv_id; + t_channel_id startchannelradio_id; + int startchanneltv_nr; + int startchannelradio_nr; + int uselastchannel; + //uboot int uboot_lcd_inverse; int uboot_lcd_contrast; diff --git a/src/zapit/include/zapit/client/zapittypes.h b/src/zapit/include/zapit/client/zapittypes.h index 5492aea4e..db6f3ba41 100644 --- a/src/zapit/include/zapit/client/zapittypes.h +++ b/src/zapit/include/zapit/client/zapittypes.h @@ -138,6 +138,17 @@ typedef struct Channel_parameter uint32_t TP_id; /* diseqc<<24 | feparams->frequency>>8 */ } CH_params; +/* complete zapit start thread-parameters in a struct */ +typedef struct ZAPIT_start_arg +{ + t_channel_id startchanneltv_id; + t_channel_id startchannelradio_id; + int startchanneltv_nr; + int startchannelradio_nr; + int uselastchannel; + int video_mode; +} Z_start_arg; + typedef struct TP_map { TP_params TP; diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 991973ac6..a14dc5dd6 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -2167,7 +2167,8 @@ void signal_handler(int signum) int zapit_main_thread(void *data) { - int video_mode = (int) data; + Z_start_arg *ZapStart_arg = (Z_start_arg *) data; + int video_mode = ZapStart_arg->video_mode; time_t stime; printf("[zapit] starting... tid %ld\n", syscall(__NR_gettid)); @@ -2228,10 +2229,20 @@ int zapit_main_thread(void *data) /* create bouquet manager */ g_bouquetManager = new CBouquetManager(); - if (config.getInt32("lastChannelMode", 0)) + bool tv_mode = true; + if (config.getInt32("lastChannelMode", 0)){ setRadioMode(); - else + tv_mode = false; + } + else{ setTVMode(); + tv_mode = true; + } + if(ZapStart_arg->uselastchannel == 0){ + live_channel_id = tv_mode ? ZapStart_arg->startchanneltv_id : ZapStart_arg->startchannelradio_id; + lastChannelRadio = ZapStart_arg->startchannelradio_nr; + lastChannelTV = ZapStart_arg->startchanneltv_nr; + } if (prepare_channels(frontend->getInfo()->type, diseqcType) < 0) WARN("error parsing services");