From eb0b4eb36c799d3c01a53aa7144fc1189507a100 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 4 Mar 2017 19:49:48 +0100 Subject: [PATCH 1/6] unbreak msgbox the "if (msg)" was basically always true, killing all keys that were not handled in this clause (e.g. it was not possible to switch the box from standby if a plugin with output was running during standby) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e1b50ee304ec11ea30593f21c8efae71bc36ff04 Author: Stefan Seyfried Date: 2017-03-04 (Sat, 04 Mar 2017) ------------------ This commit was generated by Migit --- src/gui/widget/msgbox.cpp | 82 +++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 42 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index bc364fd9f..a2c845662 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -275,53 +275,51 @@ int CMsgBox::exec() { scroll_down(); } - else if (msg){ - //***navi buttons for button selection*** - if(msg==CRCInput::RC_right || msg==CRCInput::RC_left) - { - if(msg==CRCInput::RC_right){ - ccw_footer->setSelectedButton(selected+1); - mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); - } - if(msg==CRCInput::RC_left){ - ccw_footer->setSelectedButton(selected-1); - mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); - } - selected = ccw_footer->getSelectedButton(); + //***navi buttons for button selection*** + else if(msg == CRCInput::RC_right || msg == CRCInput::RC_left) + { + if (msg == CRCInput::RC_right) { + ccw_footer->setSelectedButton(selected+1); + mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); + } + if (msg == CRCInput::RC_left) { + ccw_footer->setSelectedButton(selected-1); + mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); + } + selected = ccw_footer->getSelectedButton(); - //***refresh buttons only if we have more than one button, this avoids unnecessary repaints with possible flicker effects*** - if (ccw_footer->getButtonChainObject()->size()>1) - refreshFoot(); + //***refresh buttons only if we have more than one button, this avoids unnecessary repaints with possible flicker effects*** + if (ccw_footer->getButtonChainObject()->size()>1) + refreshFoot(); - //***refresh timeout on any pressed navi key! This resets current timeout end to initial value*** - if (timeout > 0){ - timeout_pb->setValues(0, timeout); - timeoutEnd = CRCInput::calcTimeoutEnd(timeout); - } + //***refresh timeout on any pressed navi key! This resets current timeout end to initial value*** + if (timeout > 0) { + timeout_pb->setValues(0, timeout); + timeoutEnd = CRCInput::calcTimeoutEnd(timeout); + } + dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button); + } + + //***action buttons without preselection*** + for (size_t i = 0; i< ccw_footer->getButtonChainObject()->size(); i++){ + CComponentsButton* btn_action = static_cast(ccw_footer->getButtonChainObject()->getCCItem(i)); + if (msg == btn_action->getButtonDirectKey() || msg == btn_action->getButtonDirectKeyA()){ + result = (msg_result_t)btn_action->getButtonResult(); dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button); - } - - //***action buttons without preselection*** - for (size_t i = 0; i< ccw_footer->getButtonChainObject()->size(); i++){ - CComponentsButton* btn_action = static_cast(ccw_footer->getButtonChainObject()->getCCItem(i)); - if (msg == btn_action->getButtonDirectKey() || msg == btn_action->getButtonDirectKeyA()){ - result = (msg_result_t)btn_action->getButtonResult(); - dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button); - loop = false; - } - } - //***action button ok with preselected button*** - if ((msg == CRCInput::RC_ok) && (ccw_footer->getSelectedButtonObject()->getButtonAlias() == mb_show_button)){ - result = (msg_result_t)ccw_footer->getSelectedButtonObject()->getButtonResult(); loop = false; } - else if (msg == NeutrinoMessages::RECORD_START || msg == NeutrinoMessages::RECORD_STOP) { - CNeutrinoApp::getInstance()->handleMsg(msg, data); - } - //***ignore*** - else if (CNeutrinoApp::getInstance()->listModeKey(msg)){ - // do nothing //TODO: if passed rc messages are ignored rc messaages: has no effect here too!! - } + } + //***action button ok with preselected button*** + if ((msg == CRCInput::RC_ok) && (ccw_footer->getSelectedButtonObject()->getButtonAlias() == mb_show_button)){ + result = (msg_result_t)ccw_footer->getSelectedButtonObject()->getButtonResult(); + loop = false; + } + else if (msg == NeutrinoMessages::RECORD_START || msg == NeutrinoMessages::RECORD_STOP) { + CNeutrinoApp::getInstance()->handleMsg(msg, data); + } + //***ignore*** + else if (CNeutrinoApp::getInstance()->listModeKey(msg)){ + // do nothing //TODO: if passed rc messages are ignored rc messaages: has no effect here too!! } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { From 383fe398b32010ea82007e9cb9295aac48753a0f Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 4 Mar 2017 19:55:59 +0100 Subject: [PATCH 2/6] msgbox: remove duplicated code Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/71361684d83b22017eae6991a5b71b0399f5fc94 Author: Stefan Seyfried Date: 2017-03-04 (Sat, 04 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/msgbox.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index a2c845662..81892f5e0 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -278,14 +278,11 @@ int CMsgBox::exec() //***navi buttons for button selection*** else if(msg == CRCInput::RC_right || msg == CRCInput::RC_left) { - if (msg == CRCInput::RC_right) { + if (msg == CRCInput::RC_right) ccw_footer->setSelectedButton(selected+1); - mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); - } - if (msg == CRCInput::RC_left) { + else ccw_footer->setSelectedButton(selected-1); - mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); - } + mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); selected = ccw_footer->getSelectedButton(); //***refresh buttons only if we have more than one button, this avoids unnecessary repaints with possible flicker effects*** From 2aa2f4ba652b4036562f2a307914c88e39a5fb0c Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 4 Mar 2017 19:56:41 +0100 Subject: [PATCH 3/6] msgbox: remove explicit handling of record events these are handled in the last else clause anyway Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3bcdbb39ff29fe7a45f3fcc71425a42574a7608f Author: Stefan Seyfried Date: 2017-03-04 (Sat, 04 Mar 2017) ------------------ This commit was generated by Migit --- src/gui/widget/msgbox.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 81892f5e0..837f46eb2 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -311,9 +311,6 @@ int CMsgBox::exec() result = (msg_result_t)ccw_footer->getSelectedButtonObject()->getButtonResult(); loop = false; } - else if (msg == NeutrinoMessages::RECORD_START || msg == NeutrinoMessages::RECORD_STOP) { - CNeutrinoApp::getInstance()->handleMsg(msg, data); - } //***ignore*** else if (CNeutrinoApp::getInstance()->listModeKey(msg)){ // do nothing //TODO: if passed rc messages are ignored rc messaages: has no effect here too!! From b2c32ac24bc34c007feda477284e346e1038e6cd Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 4 Mar 2017 20:28:21 +0100 Subject: [PATCH 4/6] hw_caps: add caps for 14:9 AR and broken tuner driver Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3a7a20281851be6589d6a67877440cd66ac60571 Author: Stefan Seyfried Date: 2017-03-04 (Sat, 04 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- lib/libcoolstream/hardware_caps.cpp | 6 ++++++ lib/libcoolstream/hardware_caps.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/lib/libcoolstream/hardware_caps.cpp b/lib/libcoolstream/hardware_caps.cpp index 879efffc3..216a6dcae 100644 --- a/lib/libcoolstream/hardware_caps.cpp +++ b/lib/libcoolstream/hardware_caps.cpp @@ -29,6 +29,9 @@ hw_caps_t *get_hwcaps(void) { caps.display_xres = 12; caps.display_yres = 0; caps.can_set_display_brightness = 1; + caps.can_ar_14_9 = 1; + caps.can_ps_14_9 = 1; + caps.force_tuner_2G = 0; strcpy(caps.boxvendor, "Coolstream"); /* list of boxnames from neutrinoyparser.cpp */ strcpy(caps.boxarch, "Nevis"); @@ -36,9 +39,11 @@ hw_caps_t *get_hwcaps(void) { case 6: case 7: // Black Stallion Edition strcpy(caps.boxname, "HD1"); + caps.force_tuner_2G = 1; break; case 8: strcpy(caps.boxname, "Neo"); + caps.force_tuner_2G = 1; break; case 9: strcpy(caps.boxname, "Tank"); @@ -46,6 +51,7 @@ hw_caps_t *get_hwcaps(void) { break; case 10: strcpy(caps.boxname, "Zee"); + caps.force_tuner_2G = 1; break; case 11: strcpy(caps.boxname, "Trinity"); diff --git a/lib/libcoolstream/hardware_caps.h b/lib/libcoolstream/hardware_caps.h index 69865e954..aaea1334e 100644 --- a/lib/libcoolstream/hardware_caps.h +++ b/lib/libcoolstream/hardware_caps.h @@ -27,6 +27,9 @@ typedef struct hw_caps int has_YUV_cinch; int can_shutdown; int can_cec; + int can_ar_14_9; /* video drivers have 14:9 aspect ratio mode */ + int can_ps_14_9; /* video drivers have 14:9 panscan mode */ + int force_tuner_2G; /* force DVB-S2 even though driver may not advertise it */ display_type_t display_type; int display_xres; /* x resolution or chars per line */ int display_yres; From de0eb6e89d749f44a0b64df5ae610d16ea8eb0fe Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 4 Mar 2017 20:30:28 +0100 Subject: [PATCH 5/6] frontend: use hw_caps instead of BOXMODEL define Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2c0496be8282970548d25defc7ff7a113a54b087 Author: Stefan Seyfried Date: 2017-03-04 (Sat, 04 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/frontend.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index 117997e8c..58fd2d5ab 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -40,6 +40,8 @@ #include #include +#include + extern transponder_list_t transponders; extern int zapit_debug; @@ -327,9 +329,7 @@ void CFrontend::getFEInfo(void) switch (info.type) { case FE_QPSK: deliverySystemMask |= DVB_S; -#ifndef BOXMODEL_CS_HD1 - if (info.caps & FE_CAN_2G_MODULATION) -#endif + if (info.caps & FE_CAN_2G_MODULATION || get_hwcaps()->force_tuner_2G) deliverySystemMask |= DVB_S2; break; case FE_OFDM: From 113edb58c628f01a999a433cb4c745e531f18d64 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 4 Mar 2017 20:36:56 +0100 Subject: [PATCH 6/6] videosettings: select VIDEOMENU_43MODE_OPTIONS at runtime instead of hard coded hardware dependence, select panscan and display AR options at run time via hw_caps. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c2f7e1b1c00bde189c154ea5f334e5e198bcf581 Author: Stefan Seyfried Date: 2017-03-04 (Sat, 04 Mar 2017) ------------------ This commit was generated by Migit --- src/gui/videosettings.cpp | 44 +++++++++++++++++++++++---------------- src/gui/videosettings.h | 2 ++ 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 74e5286f4..06c27be48 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -85,11 +85,12 @@ CVideoSettings::CVideoSettings(int wizard_mode) prev_video_mode = g_settings.video_Mode; setupVideoSystem(false); + Init43ModeOptions(); } CVideoSettings::~CVideoSettings() { - + videomenu_43mode_options.clear(); } int CVideoSettings::exec(CMenuTarget* parent, const std::string &/*actionKey*/) @@ -110,9 +111,7 @@ int CVideoSettings::exec(CMenuTarget* parent, const std::string &/*actionKey*/) const CMenuOptionChooser::keyval VIDEOMENU_43MODE_OPTIONS[] = { { DISPLAY_AR_MODE_PANSCAN, LOCALE_VIDEOMENU_PANSCAN }, -#ifndef BOXMODEL_CS_HD2 { DISPLAY_AR_MODE_PANSCAN2, LOCALE_VIDEOMENU_PANSCAN2 }, -#endif { DISPLAY_AR_MODE_LETTERBOX, LOCALE_VIDEOMENU_LETTERBOX }, { DISPLAY_AR_MODE_NONE, LOCALE_VIDEOMENU_FULLSCREEN } //{ 2, LOCALE_VIDEOMENU_AUTO } // whatever is this auto mode, it seems its totally broken @@ -290,18 +289,12 @@ CMenuOptionChooser::keyval_ext VIDEOMENU_VIDEOMODE_OPTIONS[VIDEOMENU_VIDEOMODE_O }; #endif -#if HAVE_TRIPLEDRAGON -#define VIDEOMENU_VIDEOFORMAT_OPTION_COUNT 2 -#else #define VIDEOMENU_VIDEOFORMAT_OPTION_COUNT 3//2 -#endif const CMenuOptionChooser::keyval VIDEOMENU_VIDEOFORMAT_OPTIONS[VIDEOMENU_VIDEOFORMAT_OPTION_COUNT] = { { DISPLAY_AR_4_3, LOCALE_VIDEOMENU_VIDEOFORMAT_43 }, { DISPLAY_AR_16_9, LOCALE_VIDEOMENU_VIDEOFORMAT_169 }, -#if !HAVE_TRIPLEDRAGON { DISPLAY_AR_14_9, LOCALE_VIDEOMENU_VIDEOFORMAT_149 } -#endif }; #define VIDEOMENU_DBDR_OPTION_COUNT 3 @@ -361,11 +354,11 @@ int CVideoSettings::showVideoSetup() #endif //4:3 mode - CMenuOptionChooser * vs_43mode_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_43MODE, &g_settings.video_43mode, VIDEOMENU_43MODE_OPTIONS, VIDEOMENU_43MODE_OPTION_COUNT, true, this); + CMenuOptionChooser * vs_43mode_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_43MODE, &g_settings.video_43mode, videomenu_43mode_options, true, this); vs_43mode_ch->setHint("", LOCALE_MENU_HINT_VIDEO_43MODE); //display format - CMenuOptionChooser * vs_dispformat_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_VIDEOFORMAT, &g_settings.video_Format, VIDEOMENU_VIDEOFORMAT_OPTIONS, VIDEOMENU_VIDEOFORMAT_OPTION_COUNT, true, this); + CMenuOptionChooser * vs_dispformat_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_VIDEOFORMAT, &g_settings.video_Format, VIDEOMENU_VIDEOFORMAT_OPTIONS, g_info.hw_caps->can_ar_14_9 ? VIDEOMENU_VIDEOFORMAT_OPTION_COUNT : VIDEOMENU_VIDEOFORMAT_OPTION_COUNT -1, true, this); /* works only if 14:9 is last! */ vs_dispformat_ch->setHint("", LOCALE_MENU_HINT_VIDEO_FORMAT); //video system @@ -623,20 +616,20 @@ void CVideoSettings::next43Mode(void) { printf("[neutrino VideoSettings] %s setting 43Mode...\n", __FUNCTION__); neutrino_locale_t text; - int curmode = 0; + unsigned int curmode = 0; - for (int i = 0; i < (int) VIDEOMENU_43MODE_OPTION_COUNT; i++) { - if (VIDEOMENU_43MODE_OPTIONS[i].key == g_settings.video_43mode) { + for (unsigned int i = 0; i < videomenu_43mode_options.size(); i++) { + if (videomenu_43mode_options[i].key == g_settings.video_43mode) { curmode = i; break; } } curmode++; - if (curmode >= (int) VIDEOMENU_43MODE_OPTION_COUNT) + if (curmode >= videomenu_43mode_options.size()) curmode = 0; - text = VIDEOMENU_43MODE_OPTIONS[curmode].value; - g_settings.video_43mode = VIDEOMENU_43MODE_OPTIONS[curmode].key; + text = videomenu_43mode_options[curmode].value; + g_settings.video_43mode = videomenu_43mode_options[curmode].key; videoDecoder->setAspectRatio(-1, g_settings.video_43mode); #ifdef ENABLE_PIP pipDecoder->setAspectRatio(-1, g_settings.video_43mode); @@ -659,7 +652,8 @@ void CVideoSettings::SwitchFormat() curmode++; if (curmode >= VIDEOMENU_VIDEOFORMAT_OPTION_COUNT) curmode = 0; - + if (VIDEOMENU_VIDEOFORMAT_OPTIONS[curmode].key == DISPLAY_AR_14_9 && g_info.hw_caps->can_ar_14_9 == 0) + curmode = 0; text = VIDEOMENU_VIDEOFORMAT_OPTIONS[curmode].value; g_settings.video_Format = VIDEOMENU_VIDEOFORMAT_OPTIONS[curmode].key; @@ -730,3 +724,17 @@ void CVideoSettings::nextMode(void) CVFD::getInstance()->showServicename(g_RemoteControl->getCurrentChannelName(), g_RemoteControl->getCurrentChannelNumber()); //ShowHint(LOCALE_VIDEOMENU_VIDEOMODE, text, 450, 2); } + +void CVideoSettings::Init43ModeOptions() +{ + videomenu_43mode_options.clear(); + for (unsigned int i = 0; i < VIDEOMENU_43MODE_OPTION_COUNT; i++) + { + if (VIDEOMENU_43MODE_OPTIONS[i].key == DISPLAY_AR_MODE_PANSCAN2 && + g_info.hw_caps->can_ps_14_9 == 0) + continue; + CMenuOptionChooser::keyval_ext o; + o = VIDEOMENU_43MODE_OPTIONS[i]; + videomenu_43mode_options.push_back(o); + } +} diff --git a/src/gui/videosettings.h b/src/gui/videosettings.h index 9c0e7e628..3556f0d34 100644 --- a/src/gui/videosettings.h +++ b/src/gui/videosettings.h @@ -47,6 +47,8 @@ class CVideoSettings : public CMenuWidget, CChangeObserver int width, selected; int showVideoSetup(); + std::vector videomenu_43mode_options; + void Init43ModeOptions(); public: CVideoSettings(int wizard_mode = SNeutrinoSettings::WIZARD_OFF);