diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index aec24bafe..f7769be5b 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -582,14 +582,24 @@ keybindingmenu.channelup Kanal hoch keybindingmenu.head Tasten-Belegungen bearbeiten keybindingmenu.lastchannel Letzter Kanal keybindingmenu.misc Sonstige +keybindingmenu.mode_left_right_key_tv Funktion li/re Tasten im TV-Modus +keybindingmenu.mode_left_right_key_tv_infobar Infobar einblenden +keybindingmenu.mode_left_right_key_tv_volume Lautstärkeregelung +keybindingmenu.mode_left_right_key_tv_vzap Virtual Zap +keybindingmenu.mode_left_right_key_tv_zap Umschalten keybindingmenu.modechange Moduswechsel keybindingmenu.pagedown Seite weiter keybindingmenu.pageup Seite zurück keybindingmenu.poweroff Umschalter keybindingmenu.quickzap Schnellumschaltung -keybindingmenu.remotecontrol Typ -keybindingmenu.remotecontrol_neo1 Neo1 -keybindingmenu.remotecontrol_standard Standard +keybindingmenu.remotecontrol_hardware Hardware +keybindingmenu.remotecontrol_hardware_coolstream Coolstream +keybindingmenu.remotecontrol_hardware_dbox dbox +keybindingmenu.remotecontrol_hardware_msg_part1 Die Fernbedienung wurde von ' +keybindingmenu.remotecontrol_hardware_msg_part2 ' auf ' +keybindingmenu.remotecontrol_hardware_msg_part3 ' geändert.\nIst dies korrekt?\nBitte die Auswahl innerhalb 15 Sekunden mit der neuen Fernbedienung\nbestätigen. Ansonsten wird die Auswahl zurückgesetzt. +keybindingmenu.remotecontrol_hardware_philips Philips +keybindingmenu.remotecontrol_hardware_tripledragon Triple Dragon keybindingmenu.repeatblock Anfangsverzögerung keybindingmenu.repeatblockgeneric Wiederholungsverzögerung keybindingmenu.sort Sortierreihenfolge ändern @@ -726,7 +736,6 @@ miscsettings.shutdown_count_hint2 den Deep-Standby geschalten wird (0 = aus) miscsettings.shutdown_real Standbymodus miscsettings.shutdown_real_rcdelay Verzögertes Ausschalten miscsettings.sleeptimer Ausschalten nach Inaktivität -miscsettings.virtual_zap_mode Virtual Zap miscsettings.zapto_pre_time Umschaltstart-Vorlaufzeit (Minuten) motorcontrol.calc_positions Positionen (Neu)-Berechne(n)) motorcontrol.disable_limit Deaktiviere (soft) Limit diff --git a/data/locale/english.locale b/data/locale/english.locale index 6cf86290d..ac95b7d87 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -583,14 +583,24 @@ keybindingmenu.channelup channel up keybindingmenu.head Edit Keybindings keybindingmenu.lastchannel Quick Zap keybindingmenu.misc Misc +keybindingmenu.mode_left_right_key_tv Left/Right Key Behavior in TV-Mode +keybindingmenu.mode_left_right_key_tv_infobar Show Infobar +keybindingmenu.mode_left_right_key_tv_volume Volume Control +keybindingmenu.mode_left_right_key_tv_vzap Virtual Zap +keybindingmenu.mode_left_right_key_tv_zap Zap keybindingmenu.modechange Modechange keybindingmenu.pagedown page down keybindingmenu.pageup page up keybindingmenu.poweroff Power toggle keybindingmenu.quickzap Quickzap -keybindingmenu.remotecontrol Type -keybindingmenu.remotecontrol_neo1 Neo1 -keybindingmenu.remotecontrol_standard Standard +keybindingmenu.remotecontrol_hardware Hardware +keybindingmenu.remotecontrol_hardware_coolstream Coolstream +keybindingmenu.remotecontrol_hardware_dbox dbox +keybindingmenu.remotecontrol_hardware_msg_part1 The remote control has been changed from ' +keybindingmenu.remotecontrol_hardware_msg_part2 ' to ' +keybindingmenu.remotecontrol_hardware_msg_part3 ' \nIs this correct?\nPlease confirm the selection within 15 seconds by using the new remote control.\nOtherwise the selection will be reverted. +keybindingmenu.remotecontrol_hardware_philips Philips +keybindingmenu.remotecontrol_hardware_tripledragon Triple Dragon keybindingmenu.repeatblock generic delay keybindingmenu.repeatblockgeneric repeat delay keybindingmenu.sort change sort order @@ -727,7 +737,6 @@ miscsettings.shutdown_count_hint2 to deep standby (0 = off). miscsettings.shutdown_real Enable standby miscsettings.shutdown_real_rcdelay Delayed shutdown miscsettings.sleeptimer Inactivity shutdown timer -miscsettings.virtual_zap_mode Virtual zap miscsettings.zapto_pre_time Zapto Start Time Correction (minutes) motorcontrol.calc_positions (Re)-Calculate Positions motorcontrol.disable_limit Disable (soft) Limits diff --git a/lib/libdvbsub/dvbsubtitle.cpp b/lib/libdvbsub/dvbsubtitle.cpp index d1e760a7f..8bea202f9 100644 --- a/lib/libdvbsub/dvbsubtitle.cpp +++ b/lib/libdvbsub/dvbsubtitle.cpp @@ -121,16 +121,15 @@ void cDvbSubtitleBitmaps::Draw(int &min_x, int &min_y, int &max_x, int &max_y) int height = sub.rects[i]->h; int xoff, yoff; - int nw = (double) width * xc; + int nw = width == 1280 ? ((double) width / xc) : ((double) width * xc); int nh = (double) height * yc; int xdiff = (wd > xf) ? ((wd - xf) / 2) : 0; xoff = sub.rects[i]->x*xc + xstart + xdiff; - if(sub.rects[i]->y < 576/2) { yoff = ystart + sub.rects[i]->y*yc; } else { - yoff = yend - (576 - (double) (sub.rects[i]->y + height))*yc - nh; + yoff = yend - ((width == 1280 ? 704:576) - (double) (sub.rects[i]->y + height))*yc - nh; if(yoff < ystart) yoff = ystart; } diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index cd6bf8676..76bdd0645 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -70,10 +70,10 @@ static struct termio orig_termio; static bool saved_orig_termio = false; #endif /* KEYBOARD_INSTEAD_OF_REMOTE_CONTROL */ -/************************************************************************** -* Constructor - opens rc-input device and starts threads +/********************************************************************************* +* Constructor - opens rc-input device, selects rc-hardware and starts threads * -**************************************************************************/ +*********************************************************************************/ CRCInput::CRCInput() { timerid= 1; @@ -139,6 +139,9 @@ CRCInput::CRCInput() repeat_block = repeat_block_generic = 0; open(); rc_last_key = KEY_MAX; + + //select and setup remote control hardware + set_rc_hw(); } void CRCInput::open() @@ -153,7 +156,7 @@ void CRCInput::open() { fcntl(fd_rc[i], F_SETFL, O_NONBLOCK); } -printf("CRCInput::open: %s fd %d\n", RC_EVENT_DEVICE[i], fd_rc[i]); + printf("CRCInput::open: %s fd %d\n", RC_EVENT_DEVICE[i], fd_rc[i]); } //+++++++++++++++++++++++++++++++++++++++ @@ -1524,3 +1527,73 @@ void CRCInput::set_dsp() void CRCInput::play_click() { } + + +#ifdef HAVE_COOLSTREAM_NEVIS_IR_H +// hint: ir_protocol_t and other useful things are defined in nevis_ir.h +void CRCInput::set_rc_hw(ir_protocol_t ir_protocol, unsigned int ir_address) +{ + int ioctl_ret = -1; + + //fixme?: for now fd_rc[] is hardcoded to 0 since only fd_rc[0] is used at the moment + ioctl_ret = ::ioctl(fd_rc[0], IOC_IR_SET_PRI_PROTOCOL, ir_protocol); + if(ioctl_ret < 0) + perror("IOC_IR_SET_PRI_PROTOCOL"); + else + printf("CRCInput::set_rc_hw: Set IOCTRL : IOC_IR_SET_PRI_PROTOCOL, %05X\n", ir_protocol); + + //bypass setting of IR Address with ir_address=0 + if(ir_address > 0) + { + //fixme?: for now fd_rc[] is hardcoded to 0 since only fd_rc[0] is used at the moment + ioctl_ret = ::ioctl(fd_rc[0], IOC_IR_SET_PRI_ADDRESS, ir_address); + if(ioctl_ret < 0) + perror("IOC_IR_SET_PRI_ADDRESS"); + else + printf("CRCInput::set_rc_hw: Set IOCTRL : IOC_IR_SET_PRI_ADDRESS, %05X\n", ir_address); + } +} + +// hint: ir_protocol_t and other useful things are defined in nevis_ir.h +void CRCInput::set_rc_hw(void) +{ + ir_protocol_t ir_protocol = IR_PROTOCOL_UNKNOWN; + unsigned int ir_address = 0x00; + + switch(g_settings.remote_control_hardware) + { + case RC_HW_COOLSTREAM: + ir_protocol = IR_PROTOCOL_NECE; + ir_address = 0xFF80; + break; + case RC_HW_DBOX: + ir_protocol = IR_PROTOCOL_NRC17; + ir_address = 0x00C5; + break; + case RC_HW_PHILIPS: + ir_protocol = IR_PROTOCOL_RC5; + ir_address = 0x000A; + break; + case RC_HW_TRIPLEDRAGON: + ir_protocol = IR_PROTOCOL_RMAP_E; + ir_address = 0x000A; // with device id 0 +// ir_address = 0x100A; // with device id 1 +// ir_address = 0x200A; // with device id 2 +// ir_address = 0x300A; // with device id 3 +// ir_address = 0x400A; // with device id 4 +// ir_address = 0x500A; // with device id 5 +// ir_address = 0x600A; // with device id 6 +// ir_address = 0x700A; // with device id 7 + break; + default: + ir_protocol = IR_PROTOCOL_NECE; + ir_address = 0xFF80; + } + + set_rc_hw(ir_protocol, ir_address); +} +#else +void CRCInput::set_rc_hw(void) +{ +} +#endif diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h index 056a295b3..981a878bf 100644 --- a/src/driver/rcinput.h +++ b/src/driver/rcinput.h @@ -32,11 +32,15 @@ #ifndef __MOD_rcinput__ #define __MOD_rcinput__ +#include #include #include #include #include #include +#ifdef HAVE_COOLSTREAM_NEVIS_IR_H +#include +#endif #ifndef KEY_OK #define KEY_OK 0x160 @@ -148,6 +152,9 @@ class CRCInput int translate(int code, int num); void calculateMaxFd(void); int checkTimers(); +#ifdef HAVE_COOLSTREAM_NEVIS_IR_H + void set_rc_hw(ir_protocol_t ir_protocol, unsigned int ir_address); +#endif public: //rc-code definitions static const neutrino_msg_t RC_Repeat = 0x0400; @@ -242,6 +249,16 @@ class CRCInput RC_nokey = 0xFFFFFFFE }; + //rc-hardware definitions + enum + { + RC_HW_COOLSTREAM = 0, + RC_HW_DBOX = 1, + RC_HW_PHILIPS = 2, + RC_HW_TRIPLEDRAGON = 3, + }; + void set_rc_hw(void); + inline int getFileHandle(void) /* used for plugins (i.e. games) only */ { return fd_rc[0]; diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 7bac82d78..581d86c6b 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -48,7 +48,6 @@ #include #include -#include #include #include #include @@ -868,8 +867,7 @@ void CInfoViewer::loop(bool show_dot) showIcon_16_9(); showIcon_Resolution(); - } else if ((g_settings.remote_control_hardware != CKeybindSetup::REMOTECONTROL_NEO1) && - ( g_settings.virtual_zap_mode && ((msg == CRCInput::RC_right) || msg == CRCInput::RC_left ))) { + } else if ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) && ((msg == CRCInput::RC_right) || (msg == CRCInput::RC_left ))) { virtual_zap_mode = true; res = messages_return::cancel_all; hideIt = true; diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index b7952fe86..4587b47d7 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -42,6 +42,7 @@ #include #include +#include #include #include "gui/filebrowser.h" @@ -102,15 +103,26 @@ int CKeybindSetup::exec(CMenuTarget* parent, const std::string &actionKey) } res = showKeySetup(); - + return res; } -#define KEYBINDINGMENU_REMOTECONTROL_OPTION_COUNT 2 -const CMenuOptionChooser::keyval KEYBINDINGMENU_REMOTECONTROL_OPTIONS[KEYBINDINGMENU_REMOTECONTROL_OPTION_COUNT] = +#define KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTION_COUNT 4 +const CMenuOptionChooser::keyval KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTIONS[KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTION_COUNT] = { - { CKeybindSetup::REMOTECONTROL_STANDARD, LOCALE_KEYBINDINGMENU_REMOTECONTROL_STANDARD }, - { CKeybindSetup::REMOTECONTROL_NEO1, LOCALE_KEYBINDINGMENU_REMOTECONTROL_NEO1 } + { CRCInput::RC_HW_COOLSTREAM, LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_COOLSTREAM }, + { CRCInput::RC_HW_DBOX, LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_DBOX }, + { CRCInput::RC_HW_PHILIPS, LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_PHILIPS }, + { CRCInput::RC_HW_TRIPLEDRAGON, LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_TRIPLEDRAGON } +}; + +#define KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_COUNT 4 +const CMenuOptionChooser::keyval KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_OPTIONS[KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_COUNT] = +{ + { SNeutrinoSettings::ZAP, LOCALE_KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_ZAP }, + { SNeutrinoSettings::VZAP, LOCALE_KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_VZAP }, + { SNeutrinoSettings::VOLUME, LOCALE_KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_VOLUME }, + { SNeutrinoSettings::INFOBAR, LOCALE_KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_INFOBAR } }; #define KEYBINDINGMENU_BOUQUETHANDLING_OPTION_COUNT 3 @@ -174,12 +186,22 @@ const key_settings_struct_t key_settings[CKeybindSetup::KEYBINDS_COUNT] = int CKeybindSetup::showKeySetup() { + //save original rc hardware selection and initialize text strings + int org_remote_control_hardware = g_settings.remote_control_hardware; + char RC_HW_str[4][32]; + snprintf(RC_HW_str[CRCInput::RC_HW_COOLSTREAM], sizeof(RC_HW_str[CRCInput::RC_HW_COOLSTREAM])-1, "%s", g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_COOLSTREAM)); + snprintf(RC_HW_str[CRCInput::RC_HW_DBOX], sizeof(RC_HW_str[CRCInput::RC_HW_DBOX])-1, "%s", g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_DBOX)); + snprintf(RC_HW_str[CRCInput::RC_HW_PHILIPS], sizeof(RC_HW_str[CRCInput::RC_HW_PHILIPS])-1, "%s", g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_PHILIPS)); + snprintf(RC_HW_str[CRCInput::RC_HW_TRIPLEDRAGON], sizeof(RC_HW_str[CRCInput::RC_HW_TRIPLEDRAGON])-1, "%s", g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_TRIPLEDRAGON)); + char RC_HW_msg[256]; + snprintf(RC_HW_msg, sizeof(RC_HW_msg)-1, "%s", g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_MSG_PART1)); + //keysetup menu CMenuWidget* keySettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_KEYBINDING, width, MN_WIDGET_ID_KEYSETUP); + keySettings->addIntroItems(LOCALE_MAINSETTINGS_KEYBINDING); //keybindings menu CMenuWidget* bindSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_KEYBINDING, width, MN_WIDGET_ID_KEYSETUP_KEYBINDING); - keySettings->addIntroItems(LOCALE_MAINSETTINGS_KEYBINDING); //keybindings int shortcut = 1; @@ -196,13 +218,26 @@ int CKeybindSetup::showKeySetup() keySetupNotifier->changeNotify(NONEXISTANT_LOCALE, NULL); keySettings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_KEYBINDINGMENU_RC)); + keySettings->addItem(new CMenuOptionChooser(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE, &g_settings.remote_control_hardware, KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTIONS, KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTION_COUNT, true)); keySettings->addItem(new CMenuForwarder(LOCALE_KEYBINDINGMENU_REPEATBLOCK, true, g_settings.repeat_blocker, keySettings_repeatBlocker)); keySettings->addItem(new CMenuForwarder(LOCALE_KEYBINDINGMENU_REPEATBLOCKGENERIC, true, g_settings.repeat_genericblocker, keySettings_repeat_genericblocker)); - keySettings->addItem(new CMenuOptionChooser(LOCALE_KEYBINDINGMENU_REMOTECONTROL, &g_settings.remote_control_hardware, KEYBINDINGMENU_REMOTECONTROL_OPTIONS, KEYBINDINGMENU_REMOTECONTROL_OPTION_COUNT, true)); - int res = keySettings->exec(NULL, ""); keySettings->hide(); + + //check if rc hardware selection has changed before leaving the menu + if (org_remote_control_hardware != g_settings.remote_control_hardware) { + g_RCInput->CRCInput::set_rc_hw(); + strcat(RC_HW_msg, RC_HW_str[org_remote_control_hardware]); + strcat(RC_HW_msg, g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_MSG_PART2)); + strcat(RC_HW_msg, RC_HW_str[g_settings.remote_control_hardware]); + strcat(RC_HW_msg, g_Locale->getText(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_MSG_PART3)); + if(ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, RC_HW_msg, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO, 450, 15, true) == CMessageBox::mbrNo) { + g_settings.remote_control_hardware = org_remote_control_hardware; + g_RCInput->CRCInput::set_rc_hw(); + } + } + delete keySettings; return res; } @@ -244,8 +279,8 @@ void CKeybindSetup::showKeyBindSetup(CMenuWidget *bindSettings) bindSettings->addItem(new CMenuOptionChooser(LOCALE_SCREENSHOT_FORMAT, &g_settings.screenshot_format, KEYBINDINGMENU_SCREENSHOT_FMT_OPTIONS, KEYBINDINGMENU_SCREENSHOT_FMT_OPTION_COUNT, true)); //bindSettings->addItem(new CMenuOptionChooser(LOCALE_EXTRA_ZAP_CYCLE, &g_settings.zap_cycle, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); bindSettings->addItem(new CMenuOptionChooser(LOCALE_EXTRA_MENU_LEFT_EXIT, &g_settings.menu_left_exit, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); - bindSettings->addItem(new CMenuOptionChooser(LOCALE_EXTRA_AUDIO_RUN_PLAYER, &g_settings.audio_run_player, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); + bindSettings->addItem(new CMenuOptionChooser(LOCALE_KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV, &g_settings.mode_left_right_key_tv, KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_OPTIONS, KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_COUNT, true)); } void CKeybindSetup::showKeyBindModeSetup(CMenuWidget *bindSettings_modes) diff --git a/src/gui/keybind_setup.h b/src/gui/keybind_setup.h index 5891133d1..16854b7af 100644 --- a/src/gui/keybind_setup.h +++ b/src/gui/keybind_setup.h @@ -79,19 +79,10 @@ class CKeybindSetup : public CMenuTarget KEYBINDS_COUNT }; - enum remote_control_t - { - REMOTECONTROL_STANDARD = 0, - REMOTECONTROL_NEO1 = 1, - - REMOTECONTROL_COUNT - }; - private: CFrameBuffer *frameBuffer; CKeySetupNotifier *keySetupNotifier; - CKeyChooser * keychooser[KEYBINDS_COUNT]; - + CKeyChooser *keychooser[KEYBINDS_COUNT]; int width; int showKeySetup(); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 94d3d4ccc..b17dec81c 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -50,7 +50,6 @@ #include #include #include -#include #include @@ -69,8 +68,6 @@ COsdSetup::COsdSetup(bool wizard_mode) fontsizenotifier = new CFontSizeNotifier; radiotextNotifier = NULL; osd_menu = NULL; - - tmp_virtual_zap_mode = 0; is_wizard = wizard_mode; @@ -274,16 +271,8 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) return menu_return::RETURN_REPAINT; } - - // Display virtual zap = off when RC neo1 - tmp_virtual_zap_mode = (g_settings.remote_control_hardware == CKeybindSetup::REMOTECONTROL_STANDARD) ? g_settings.virtual_zap_mode : false; - int res = showOsdSetup(); - // Restore g_settings.virtual_zap_mode - if (g_settings.remote_control_hardware == CKeybindSetup::REMOTECONTROL_STANDARD) - g_settings.virtual_zap_mode = tmp_virtual_zap_mode; - //return menu_return::RETURN_REPAINT; return res; } @@ -617,10 +606,6 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar) menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_DISPLAY, &g_settings.casystem_display, INFOBAR_CASYSTEM_MODE_OPTIONS, INFOBAR_CASYSTEM_MODE_OPTION_COUNT, true)); menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_DISP_LOG, &g_settings.infobar_show_channellogo, LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS, LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS_COUNT, true)); menu_infobar->addItem(new CMenuForwarder(LOCALE_MISCSETTINGS_INFOBAR_LOGO_HDD_DIR, true, g_settings.logo_hdd_dir, this, "logo_dir")); - - // Disable virtual zap when Neo1 remote control - menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_VIRTUAL_ZAP_MODE, &tmp_virtual_zap_mode, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, (g_settings.remote_control_hardware == CKeybindSetup::REMOTECONTROL_STANDARD))); - menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SAT_DISPLAY, &g_settings.infobar_sat_display, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW_VAR_HDD, &g_settings.infobar_show_var_hdd, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW_RES, &g_settings.infobar_show_res, INFOBAR_SHOW_RES_MODE_OPTIONS, INFOBAR_SHOW_RES_MODE_OPTION_COUNT, true)); diff --git a/src/gui/osd_setup.h b/src/gui/osd_setup.h index 048eaabc9..f58652a0d 100644 --- a/src/gui/osd_setup.h +++ b/src/gui/osd_setup.h @@ -47,10 +47,8 @@ class COsdSetup : public CMenuTarget, public CChangeObserver CFontSizeNotifier *fontsizenotifier; CRadiotextNotifier *radiotextNotifier; CMenuWidget *osd_menu; - int tmp_virtual_zap_mode; int width; - bool is_wizard; int showOsdSetup(); diff --git a/src/gui/widget/drawable.cpp b/src/gui/widget/drawable.cpp index ecd348e51..bfb41c807 100644 --- a/src/gui/widget/drawable.cpp +++ b/src/gui/widget/drawable.cpp @@ -80,7 +80,7 @@ DText::DText(const char *text) void DText::init() { - m_width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(m_text, true); // UTF-8 + m_width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(m_text, true); // UTF-8 m_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); } diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 4a7a574a8..2a3bdbaa9 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -60,6 +60,8 @@ void CHintBox::init(const char * const Caption, const char * const Text, const i char * begin; char * pos; int nw; + int scrollWidth = 0; + int maxLineWidth = 0; message = strdup(Text); @@ -68,6 +70,7 @@ void CHintBox::init(const char * const Caption, const char * const Text, const i theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); height = theight + fheight; + textStartX = 0; caption = Caption; @@ -98,9 +101,10 @@ void CHintBox::init(const char * const Caption, const char * const Text, const i unsigned int additional_width; if (entries_per_page < line.size()) - additional_width = 20 + 15; + scrollWidth = 15; else - additional_width = 20 + 0; + scrollWidth = 0; + additional_width = 20 + scrollWidth; if (Icon != NULL) { @@ -118,7 +122,9 @@ void CHintBox::init(const char * const Caption, const char * const Text, const i for (std::vector::const_iterator it = line.begin(); it != line.end(); it++) { - nw = additional_width + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(*it, true); // UTF-8 + int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(*it, true); // UTF-8 + maxLineWidth = std::max(maxLineWidth, w); + nw = additional_width + w; if (nw > width) width = nw; } @@ -126,6 +132,7 @@ void CHintBox::init(const char * const Caption, const char * const Text, const i /* make sure we don't overflow the usable area */ if (nw > (int)CFrameBuffer::getInstance()->getScreenWidth()) width = CFrameBuffer::getInstance()->getScreenWidth(); + textStartX = (width - scrollWidth - maxLineWidth) / 2; window = NULL; } @@ -195,7 +202,7 @@ void CHintBox::refresh(void) int ypos = theight + (fheight >> 1); for (std::vector::const_iterator it = line.begin() + (entries_per_page * current_page); ((it != line.end()) && (count > 0)); it++, count--) - window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU], 10, (ypos += fheight), width, *it, (CFBWindow::color_t)COL_MENUCONTENT, 0, true); // UTF-8 + window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU], textStartX, (ypos += fheight), width, *it, (CFBWindow::color_t)COL_MENUCONTENT, 0, true); // UTF-8 if (entries_per_page < line.size()) { diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index 035ec2b56..7e7a5f36b 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -51,6 +51,7 @@ class CHintBox int width; int height; + int textStartX; int fheight; int theight; diff --git a/src/gui/widget/hintboxext.cpp b/src/gui/widget/hintboxext.cpp index f4e966329..da24aece3 100644 --- a/src/gui/widget/hintboxext.cpp +++ b/src/gui/widget/hintboxext.cpp @@ -105,6 +105,9 @@ void CHintBoxExt::init(const neutrino_locale_t Caption, const int Width, const c m_fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); m_height = m_theight + m_fheight; m_maxEntriesPerPage = 0; + int maxLineWidth = 0; + int scrollWidth = 0; + textStartX = 0; m_caption = Caption; @@ -126,6 +129,7 @@ void CHintBoxExt::init(const neutrino_locale_t Caption, const int Width, const c if ((*item)->getType() == Drawable::DTYPE_PAGEBREAK) pagebreak = true; } + maxLineWidth = std::max(maxLineWidth, lineWidth); if (lineWidth > maxWidth) maxWidth = lineWidth; m_height += maxHeight; @@ -168,10 +172,12 @@ void CHintBoxExt::init(const neutrino_locale_t Caption, const int Width, const c m_pages = page + 1; unsigned int additional_width; - if (m_startEntryOfPage.size() > 1) - additional_width = 20 + 15; + if (has_scrollbar()) + scrollWidth = 15; else - additional_width = 20 + 0; + scrollWidth = 0; + additional_width = 30 + scrollWidth; + m_width += additional_width; if (Icon != NULL) { @@ -185,6 +191,7 @@ void CHintBoxExt::init(const neutrino_locale_t Caption, const int Width, const c if (nw > m_width) m_width = nw; + textStartX = (m_width - scrollWidth - maxLineWidth) / 2; m_window = NULL; } @@ -258,7 +265,7 @@ void CHintBoxExt::refresh(bool toround) it != m_lines.begin() + m_startEntryOfPage[m_currentPage+1] && it != m_lines.end(); it++) { - int xPos = 10; + int xPos = textStartX; int maxHeight = 0; for (std::vector::iterator d = it->begin();d!=it->end();d++) { diff --git a/src/gui/widget/hintboxext.h b/src/gui/widget/hintboxext.h index 54cf4e2cd..64dc907c9 100644 --- a/src/gui/widget/hintboxext.h +++ b/src/gui/widget/hintboxext.h @@ -55,6 +55,7 @@ class CHintBoxExt int m_width; int m_height; + int textStartX; int m_fheight; int m_theight; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 31ccf3e98..3e142eb7c 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -66,7 +66,6 @@ #include "gui/filebrowser.h" #include "gui/hdd_menu.h" #include "gui/infoviewer.h" -#include "gui/keybind_setup.h" #include "gui/mediaplayer.h" #include "gui/movieplayer.h" #include "gui/osd_setup.h" @@ -594,8 +593,8 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.cacheTXT = configfile.getInt32( "cacheTXT", 0); g_settings.minimode = configfile.getInt32( "minimode", 0); g_settings.mode_clock = configfile.getInt32( "mode_clock", 0); + g_settings.mode_left_right_key_tv = configfile.getInt32( "mode_left_right_key_tv", SNeutrinoSettings::ZAP); g_settings.zapto_pre_time = configfile.getInt32( "zapto_pre_time", 0); - g_settings.virtual_zap_mode = configfile.getBool("virtual_zap_mode" , false); g_settings.spectrum = configfile.getBool("spectrum" , false); g_settings.channellist_epgtext_align_right = configfile.getBool("channellist_epgtext_align_right" , false); g_settings.channellist_extended = configfile.getBool("channellist_extended" , true); @@ -626,7 +625,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.bigFonts = configfile.getInt32("bigFonts", 0); g_settings.big_windows = configfile.getInt32("big_windows", 0); - g_settings.remote_control_hardware = configfile.getInt32( "remote_control_hardware", CKeybindSetup::REMOTECONTROL_STANDARD); + g_settings.remote_control_hardware = configfile.getInt32( "remote_control_hardware", CRCInput::RC_HW_COOLSTREAM); g_settings.audiochannel_up_down_enable = configfile.getBool("audiochannel_up_down_enable", false); //Software-update @@ -1005,7 +1004,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "cacheTXT", g_settings.cacheTXT ); configfile.setInt32( "minimode", g_settings.minimode ); configfile.setInt32( "mode_clock", g_settings.mode_clock ); - configfile.setBool("virtual_zap_mode", g_settings.virtual_zap_mode); + configfile.setInt32( "mode_left_right_key_tv", g_settings.mode_left_right_key_tv ); configfile.setInt32( "zapto_pre_time", g_settings.zapto_pre_time ); configfile.setBool("spectrum", g_settings.spectrum); configfile.setBool("channellist_epgtext_align_right", g_settings.channellist_epgtext_align_right); @@ -1561,6 +1560,7 @@ void CNeutrinoApp::InitZapper() } firstChannel(); lastChannelMode = g_settings.channel_mode; + SDTreloadChannels = false; channelsInit(); if(firstchannel.mode == 't') { @@ -1964,7 +1964,7 @@ INFO("cCA::GetInstance()->Ready\n"); cCA::GetInstance()->Ready(true); #endif while( true ) { - g_RCInput->getMsg(&msg, &data, 100, ((g_settings.remote_control_hardware == CKeybindSetup::REMOTECONTROL_NEO1) && (g_RemoteControl->subChannels.size() < 1)) ? true : false); // 10 secs.. + g_RCInput->getMsg(&msg, &data, 100, ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME) && (g_RemoteControl->subChannels.size() < 1)) ? true : false); // 10 secs.. if( ( mode == mode_tv ) || ( ( mode == mode_radio ) ) ) { if( (msg == NeutrinoMessages::SHOW_EPG) /* || (msg == CRCInput::RC_info) */ ) { @@ -2029,32 +2029,32 @@ INFO("cCA::GetInstance()->Ready\n"); StopSubtitles(); g_RemoteControl->subChannelUp(); g_InfoViewer->showSubchan(); - } else if(g_settings.remote_control_hardware == CKeybindSetup::REMOTECONTROL_NEO1) { - setVolume(msg, true); - } else if(g_settings.virtual_zap_mode) { - if(channelList->getSize()) { - showInfo(); - } + } else if(g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME) { + setVolume(msg, true); + } else if((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) || (g_settings.mode_left_right_key_tv == SNeutrinoSettings::INFOBAR)) { + if(channelList->getSize()) { + showInfo(); + } } else - quickZap( msg ); + quickZap( msg ); } else if( msg == (neutrino_msg_t) g_settings.key_subchannel_down ) { if(g_RemoteControl->subChannels.size()> 0) { StopSubtitles(); g_RemoteControl->subChannelDown(); g_InfoViewer->showSubchan(); - } else if(g_settings.remote_control_hardware == CKeybindSetup::REMOTECONTROL_NEO1) { - setVolume(msg, true); - } else if(g_settings.virtual_zap_mode) { - if(channelList->getSize()) { - showInfo(); - } + } else if(g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME) { + setVolume(msg, true); + } else if((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) || (g_settings.mode_left_right_key_tv == SNeutrinoSettings::INFOBAR)) { + if(channelList->getSize()) { + showInfo(); + } } else - quickZap( msg ); + quickZap( msg ); } /* in case key_subchannel_up/down redefined */ else if( msg == CRCInput::RC_left || msg == CRCInput::RC_right) { - if(g_settings.remote_control_hardware == CKeybindSetup::REMOTECONTROL_NEO1) { + if(g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME) { setVolume(msg, true); } else if(channelList->getSize()) { showInfo(); @@ -2857,8 +2857,9 @@ _repeat: return messages_return::handled; } else if (msg == NeutrinoMessages::EVT_SERVICES_UPD) { - ShowHintUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_EXTRA_ZAPIT_SDT_CHANGED), - CMessageBox::mbrBack,CMessageBox::mbBack, NEUTRINO_ICON_INFO); + SDTreloadChannels = true; +// ShowHintUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_EXTRA_ZAPIT_SDT_CHANGED), +// CMessageBox::mbrBack,CMessageBox::mbBack, NEUTRINO_ICON_INFO); } if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000)) delete [] (unsigned char*) data; @@ -2881,6 +2882,11 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) } if(do_shutdown) { + if(SDTreloadChannels){ + SDT_ReloadChannels(); + SDTreloadChannels = false; + } + CVFD::getInstance()->setMode(CVFD::MODE_SHUTDOWN); delete CRecordManager::getInstance(); @@ -3161,7 +3167,7 @@ printf("CNeutrinoApp::setVolume dx %d dy %d\n", dx, dy); if (msg <= CRCInput::RC_MaxRC) { int sub_chan_keybind = 0; - if (g_settings.remote_control_hardware == CKeybindSetup::REMOTECONTROL_NEO1 && g_RemoteControl->subChannels.size() < 1) + if (g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME && g_RemoteControl->subChannels.size() < 1) sub_chan_keybind = 1; if ((msg == CRCInput::RC_plus) || (sub_chan_keybind == 1 && (msg == CRCInput::RC_right))) { @@ -3313,7 +3319,10 @@ void CNeutrinoApp::standbyMode( bool bOnOff ) //g_Controld->setScartMode( 0 ); } StopSubtitles(); - + if(SDTreloadChannels && !CRecordManager::getInstance()->RecordingStatus()){ + SDT_ReloadChannels(); + SDTreloadChannels = false; + } frameBuffer->useBackground(false); frameBuffer->paintBackground(); @@ -3932,3 +3941,16 @@ void CNeutrinoApp::SelectSubtitles() } } } +void CNeutrinoApp::SDT_ReloadChannels() +{ + g_Zapit->reinitChannels(); + channelsInit(); + t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ? + if(old_b_id >= 0) { + bouquetList->activateBouquet(old_b_id, false); + old_b_id = -1; + g_RCInput->postMsg(CRCInput::RC_ok, 0); + } + +} diff --git a/src/neutrino.h b/src/neutrino.h index 76da39e1a..79b2100cd 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -130,7 +130,7 @@ private: // bool fromflash; bool init_cec_setting; int lastChannelMode; - + bool SDTreloadChannels; struct timeval standby_pressed_at; CZapitClient::responseGetLastChannel firstchannel; @@ -146,6 +146,7 @@ private: COnekeyPluginChangeExec *OnekeyPluginChanger; CIPChangeNotifier *MyIPChanger; + void SDT_ReloadChannels(); void firstChannel(); void setupNetwork( bool force= false ); void setupNFS(); diff --git a/src/system/locals.h b/src/system/locals.h index c76d30e87..c420f313d 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -610,14 +610,24 @@ typedef enum LOCALE_KEYBINDINGMENU_HEAD, LOCALE_KEYBINDINGMENU_LASTCHANNEL, LOCALE_KEYBINDINGMENU_MISC, + LOCALE_KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV, + LOCALE_KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_INFOBAR, + LOCALE_KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_VOLUME, + LOCALE_KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_VZAP, + LOCALE_KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_ZAP, LOCALE_KEYBINDINGMENU_MODECHANGE, LOCALE_KEYBINDINGMENU_PAGEDOWN, LOCALE_KEYBINDINGMENU_PAGEUP, LOCALE_KEYBINDINGMENU_POWEROFF, LOCALE_KEYBINDINGMENU_QUICKZAP, - LOCALE_KEYBINDINGMENU_REMOTECONTROL, - LOCALE_KEYBINDINGMENU_REMOTECONTROL_NEO1, - LOCALE_KEYBINDINGMENU_REMOTECONTROL_STANDARD, + LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE, + LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_COOLSTREAM, + LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_DBOX, + LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_MSG_PART1, + LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_MSG_PART2, + LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_MSG_PART3, + LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_PHILIPS, + LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE_TRIPLEDRAGON, LOCALE_KEYBINDINGMENU_REPEATBLOCK, LOCALE_KEYBINDINGMENU_REPEATBLOCKGENERIC, LOCALE_KEYBINDINGMENU_SORT, @@ -754,7 +764,6 @@ typedef enum LOCALE_MISCSETTINGS_SHUTDOWN_REAL, LOCALE_MISCSETTINGS_SHUTDOWN_REAL_RCDELAY, LOCALE_MISCSETTINGS_SLEEPTIMER, - LOCALE_MISCSETTINGS_VIRTUAL_ZAP_MODE, LOCALE_MISCSETTINGS_ZAPTO_PRE_TIME, LOCALE_MOTORCONTROL_CALC_POSITIONS, LOCALE_MOTORCONTROL_DISABLE_LIMIT, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index f90f973be..d925dc3ea 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -610,14 +610,24 @@ const char * locale_real_names[] = "keybindingmenu.head", "keybindingmenu.lastchannel", "keybindingmenu.misc", + "keybindingmenu.mode_left_right_key_tv", + "keybindingmenu.mode_left_right_key_tv_infobar", + "keybindingmenu.mode_left_right_key_tv_volume", + "keybindingmenu.mode_left_right_key_tv_vzap", + "keybindingmenu.mode_left_right_key_tv_zap", "keybindingmenu.modechange", "keybindingmenu.pagedown", "keybindingmenu.pageup", "keybindingmenu.poweroff", "keybindingmenu.quickzap", - "keybindingmenu.remotecontrol", - "keybindingmenu.remotecontrol_neo1", - "keybindingmenu.remotecontrol_standard", + "keybindingmenu.remotecontrol_hardware", + "keybindingmenu.remotecontrol_hardware_coolstream", + "keybindingmenu.remotecontrol_hardware_dbox", + "keybindingmenu.remotecontrol_hardware_msg_part1", + "keybindingmenu.remotecontrol_hardware_msg_part2", + "keybindingmenu.remotecontrol_hardware_msg_part3", + "keybindingmenu.remotecontrol_hardware_philips", + "keybindingmenu.remotecontrol_hardware_tripledragon", "keybindingmenu.repeatblock", "keybindingmenu.repeatblockgeneric", "keybindingmenu.sort", @@ -754,7 +764,6 @@ const char * locale_real_names[] = "miscsettings.shutdown_real", "miscsettings.shutdown_real_rcdelay", "miscsettings.sleeptimer", - "miscsettings.virtual_zap_mode", "miscsettings.zapto_pre_time", "motorcontrol.calc_positions", "motorcontrol.disable_limit", diff --git a/src/system/settings.h b/src/system/settings.h index 77fba4a54..947f8cba1 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -379,7 +379,16 @@ struct SNeutrinoSettings int cacheTXT; int minimode; int mode_clock; - int virtual_zap_mode; + + enum MODE_LEFT_RIGHT_KEY_TV_SETTINGS + { + ZAP = 0, + VZAP = 1, + VOLUME = 2, + INFOBAR = 3 + }; + int mode_left_right_key_tv; + int spectrum; int pip_width; int pip_height;