diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 725e58fbb..564023935 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -336,7 +336,6 @@ extra.add_to_bouquet dem Bouquet zufügen extra.audio_run_player Audiotaste startet Player extra.auto_delete Automatisch löschen extra.auto_timeshift Autom. Aufnahme, Sek. (0 = deakt.) -extra.bigwindows Große Fenster extra.cache_txt Teletext zwischenspeichern extra.chadded Der aktuelle Kanal wird dem selektierten Bouquet hinzugefügt...\n extra.chalreadyinbq Der aktuelle Kanal ist bereits im selektierten Bouquet...\n @@ -772,7 +771,6 @@ menu.hint_back Zurück zum vorherigen Menü.\nDie Taste 'Menü' schließt alle M menu.hint_backlight Konfigurieren Sie die Hintergrundbeleuchtung der Buttons menu.hint_backup Sichern von Konfigurationen und Kanallisten menu.hint_bedit Bearbeiten ihrer Favoriten und der Bouquets -menu.hint_bigwindows Kanalliste, EPG-Infos, Audioplayer und einige andere Fenster werden bildschirmfüllend angezeigt menu.hint_cache_txt Startet das Zwischenspeichern des Teletextes nach einem Kanalwechsel menu.hint_cec_mode CEC-Modus menu.hint_cec_standby CEC-Standby @@ -1147,6 +1145,7 @@ menu.hint_volume Wählen Sie die Anzeigeoptionen für die Lautstärke menu.hint_volume_digits Zifferndarstellung der Lautstärkeanzeige ein- oder ausschalten menu.hint_volume_pos Wählen Sie die Position der Lautstärkeanzeige aus menu.hint_volume_size Wählen Sie die Höhe der Lautstärkeanzeige +menu.hint_window_size Kanalliste, EPG-Infos und einige andere Fenster werden mit diesem Faktor skaliert menu.hint_ytplay Wiedergabe von ausgewählten Youtube Feeds menu.hint_zap_cycle Wählen Sie, ob nur innerhalb des aktiven Bouquets umgeschaltet werden kann menu.next Weiter (Menü zum Beenden) @@ -1960,6 +1959,7 @@ videomenu.videoformat_149 14:9 videomenu.videoformat_169 16:9 videomenu.videoformat_43 4:3 videomenu.videomode Videosystem +window_size Fenstergröße in % wizard.initial_settings Grundeinstellungen gefunden wizard.install_settings Kanalliste für Astra 19.2°E installieren? wizard.setup Erste Installation diff --git a/data/locale/english.locale b/data/locale/english.locale index 45f1a519d..0591a8f94 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -336,7 +336,6 @@ extra.add_to_bouquet Add to bouquet extra.audio_run_player Audio key start player extra.auto_delete Auto-delete extra.auto_timeshift Auto-record, sec (0 = disable) -extra.bigwindows Big Windows extra.cache_txt Cache teletext extra.chadded The current channel has been added to selected bouquet....\n extra.chalreadyinbq The current channel is already in selected bouquet....\n @@ -772,7 +771,6 @@ menu.hint_back Return to previous menu\nPress menu key to close all menus menu.hint_backlight Configure buttons backlight menu.hint_backup Backup configs and channels to selected dir menu.hint_bedit Edit favorites and bouquets -menu.hint_bigwindows Channellist, EPG-infos, audioplayer and some other windows are displayed full screen menu.hint_cache_txt Start teletext caching after channel switch menu.hint_cec_mode CEC mode menu.hint_cec_standby CEC standby @@ -1147,6 +1145,7 @@ menu.hint_volume Configure Volume GUI options menu.hint_volume_digits Numeric display of the volumebar on/off menu.hint_volume_pos Select volume indicator position menu.hint_volume_size Select volume indicator height +menu.hint_window_size Channellist, EPG-infos and some other windows are scaled by this factor menu.hint_ytplay Play selected youtube feeds menu.hint_zap_cycle When swithing channels, stay in current bouquet menu.next Next (press Menu to quit) @@ -1960,6 +1959,7 @@ videomenu.videoformat_149 14:9 videomenu.videoformat_169 16:9 videomenu.videoformat_43 4:3 videomenu.videomode Digital video mode +window_size Window size in % wizard.initial_settings Initial settings found wizard.install_settings Do you want to install channels for Astra 19.2°E? wizard.setup First installation diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 55e581b9b..24927fd98 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -457,24 +457,16 @@ unsigned int CFrameBuffer::getScreenHeight(bool real) return g_settings.screen_EndY - g_settings.screen_StartY; } -unsigned int CFrameBuffer::getScreenPercentRel(bool force_small) -{ - int percent = 100; - if (force_small || !g_settings.big_windows) - percent = NON_BIG_WINDOWS; - return percent; -} - unsigned int CFrameBuffer::getScreenWidthRel(bool force_small) { - int percent = getScreenPercentRel(force_small); + int percent = force_small ? WINDOW_SIZE_MIN : g_settings.window_size; // always reduce a possible detailline return (g_settings.screen_EndX - g_settings.screen_StartX - 2*ConnectLineBox_Width) * percent / 100; } unsigned int CFrameBuffer::getScreenHeightRel(bool force_small) { - int percent = getScreenPercentRel(force_small); + int percent = force_small ? WINDOW_SIZE_MIN : g_settings.window_size; return (g_settings.screen_EndY - g_settings.screen_StartY) * percent / 100; } diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index 3b6b0cd77..527157b9b 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -54,7 +54,8 @@ typedef struct fb_var_screeninfo t_fb_var_screeninfo; #define FADE_STEP 5 #define FADE_RESET 0xFFFF -#define NON_BIG_WINDOWS 85 // % +#define WINDOW_SIZE_MAX 100 // % +#define WINDOW_SIZE_MIN 80 // % #define ConnectLineBox_Width 16 // px /** Ausfuehrung als Singleton */ @@ -157,7 +158,6 @@ class CFrameBuffer unsigned int getStride() const; // size of a single line in the framebuffer (in bytes) unsigned int getScreenWidth(bool real = false); unsigned int getScreenHeight(bool real = false); - unsigned int getScreenPercentRel(bool force_small); unsigned int getScreenWidthRel(bool force_small = false); unsigned int getScreenHeightRel(bool force_small = false); unsigned int getScreenX(); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 6deb82a34..361b3e159 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -49,6 +49,7 @@ #include #include +#include #include #include #include @@ -67,12 +68,15 @@ extern std::string ttx_font_file; COsdSetup::COsdSetup(bool wizard_mode) { + frameBuffer = CFrameBuffer::getInstance(); colorSetupNotifier = new CColorSetupNotifier(); fontsizenotifier = new CFontSizeNotifier; osd_menu = NULL; submenu_menus = NULL; mfFontFile = NULL; mfTtxFontFile = NULL; + mfWindowSize = NULL; + win_demo = NULL; is_wizard = wizard_mode; @@ -85,6 +89,7 @@ COsdSetup::~COsdSetup() { delete colorSetupNotifier; delete fontsizenotifier; + delete win_demo; } //font settings @@ -184,6 +189,10 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) if(parent != NULL) parent->hide(); + int res = menu_return::RETURN_REPAINT; + neutrino_msg_t msg; + neutrino_msg_data_t data; + if(actionKey == "select_font") { CFileBrowser fileBrowser; @@ -198,7 +207,7 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) osdFontFile = "(" + getBaseName(fileBrowser.getSelectedFile()->Name) + ")"; mfFontFile->setOption(osdFontFile.c_str()); } - return menu_return::RETURN_REPAINT; + return res; } else if(actionKey == "ttx_font") { @@ -215,7 +224,7 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) osdTtxFontFile = "(" + getBaseName(fileBrowser.getSelectedFile()->Name) + ")"; mfTtxFontFile->setOption(osdTtxFontFile.c_str()); } - return menu_return::RETURN_REPAINT; + return res; } else if (actionKey == "font_scaling") { int xre = g_settings.screen_xres; @@ -236,7 +245,7 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) fontscale.addItem(m_x); fontscale.addItem(m_y); - int res = fontscale.exec(NULL, ""); + res = fontscale.exec(NULL, ""); xre = atoi(val_x); yre = atoi(val_y); //fallback for min/max bugs ;) @@ -258,22 +267,91 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) //return menu_return::RETURN_REPAINT; return res; } + else if(actionKey=="window_size") { + if (win_demo == NULL) { + win_demo = new CComponentsShapeSquare(0, 0, 0, 0); + win_demo->setFrameThickness(8); + win_demo->setShadowOnOff(CC_SHADOW_OFF); + win_demo->setColorBody(COL_BACKGROUND); + win_demo->setColorFrame(COL_RED); + win_demo->doPaintBg(true); + } + else { + if (win_demo->isPainted()) + win_demo->kill(); + } + + win_demo->setWidth(frameBuffer->getScreenWidthRel()); + win_demo->setHeight(frameBuffer->getScreenHeightRel()); + win_demo->setXPos(getScreenStartX(win_demo->getWidth())); + win_demo->setYPos(getScreenStartY(win_demo->getHeight())); + + win_demo->paint(CC_SAVE_SCREEN_NO); + + int old_window_size = g_settings.window_size; + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); + + bool loop=true; + while (loop) { + g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd, true); + + if ( msg <= CRCInput::RC_MaxRC ) + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); + + if ( msg == CRCInput::RC_ok ) { + loop = false; + memset(window_size_value, 0, sizeof(window_size_value)); + snprintf(window_size_value, sizeof(window_size_value)-1, "%d", g_settings.window_size); + mfWindowSize->setOption(window_size_value); + break; + } else if ((msg == CRCInput::RC_home) || (msg == CRCInput::RC_timeout)) { + g_settings.window_size = old_window_size; + loop = false; + } else if ((msg == CRCInput::RC_up) || (msg == CRCInput::RC_down)) { + if ((msg == CRCInput::RC_up) && (g_settings.window_size < WINDOW_SIZE_MAX)) { + g_settings.window_size += 1; + } + if ((msg == CRCInput::RC_down) && (g_settings.window_size > WINDOW_SIZE_MIN)) { + g_settings.window_size -= 1; + } + + if (win_demo->isPainted()) + win_demo->kill(); + + win_demo->setWidth(frameBuffer->getScreenWidthRel()); + win_demo->setHeight(frameBuffer->getScreenHeightRel()); + win_demo->setXPos(getScreenStartX(win_demo->getWidth())); + win_demo->setYPos(getScreenStartY(win_demo->getHeight())); + + win_demo->paint(CC_SAVE_SCREEN_NO); + + } else if (msg > CRCInput::RC_MaxRC) { + if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { + loop = false; + res = menu_return::RETURN_EXIT_ALL; + } + } + } + win_demo->kill(); + + return res; + } else if(actionKey=="osd.def") { for (int i = 0; i < SNeutrinoSettings::TIMING_SETTING_COUNT; i++) g_settings.timing[i] = timing_setting[i].default_timing; CNeutrinoApp::getInstance()->SetupTiming(); - return menu_return::RETURN_REPAINT; + return res; } else if(actionKey=="logo_dir") { const char *action_str = "logo"; chooserDir(g_settings.logo_hdd_dir, false, action_str); - return menu_return::RETURN_REPAINT; + return res; } else if(actionKey=="screenshot_dir") { const char *action_str = "screenshot"; chooserDir(g_settings.screenshot_dir, true, action_str); - return menu_return::RETURN_REPAINT; + return res; } else if(strncmp(actionKey.c_str(), "fontsize.d", 10) == 0) { for (int i = 0; i < 6; i++) { @@ -286,10 +364,10 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) } } fontsizenotifier->changeNotify(NONEXISTANT_LOCALE, NULL); - return menu_return::RETURN_REPAINT; + return res; } - int res = showOsdSetup(); + res = showOsdSetup(); //return menu_return::RETURN_REPAINT; return res; @@ -504,10 +582,12 @@ int COsdSetup::showOsdSetup() mc->setHint("", LOCALE_MENU_HINT_FADE); osd_menu->addItem(mc); - // big windows - mc = new CMenuOptionChooser(LOCALE_EXTRA_BIGWINDOWS, &g_settings.big_windows, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); - mc->setHint("", LOCALE_MENU_HINT_BIGWINDOWS); - osd_menu->addItem(mc); + // window size + memset(window_size_value, 0, sizeof(window_size_value)); + snprintf(window_size_value, sizeof(window_size_value)-1, "%d", g_settings.window_size); + mfWindowSize = new CMenuForwarder(LOCALE_WINDOW_SIZE, true, window_size_value, this, "window_size", CRCInput::convertDigitToKey(shortcut++)); + mfWindowSize->setHint("", LOCALE_MENU_HINT_WINDOW_SIZE); + osd_menu->addItem(mfWindowSize); osd_menu->addItem(GenericMenuSeparatorLine); diff --git a/src/gui/osd_setup.h b/src/gui/osd_setup.h index b1ebb733e..d392d4cd7 100644 --- a/src/gui/osd_setup.h +++ b/src/gui/osd_setup.h @@ -31,6 +31,7 @@ #ifndef __osd_setup__ #define __osd_setup__ +#include #include #include @@ -43,12 +44,15 @@ class COsdSetup : public CMenuTarget, public CChangeObserver { private: + CFrameBuffer *frameBuffer; CColorSetupNotifier *colorSetupNotifier; CFontSizeNotifier *fontsizenotifier; CMenuWidget *osd_menu; CMenuWidget *submenu_menus; - CMenuForwarder *mfFontFile, *mfTtxFontFile; + CMenuForwarder *mfFontFile, *mfTtxFontFile, *mfWindowSize; + char window_size_value[6]; std::string osdFontFile, osdTtxFontFile; + CComponentsShapeSquare *win_demo; int width; bool is_wizard; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 9da507760..e2eb3d05c 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -649,7 +649,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.screen_height = configfile.getInt32("screen_height", 0); g_settings.bigFonts = configfile.getInt32("bigFonts", 0); - g_settings.big_windows = configfile.getInt32("big_windows", 1); + g_settings.window_size = configfile.getInt32("window_size", 100); 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); @@ -1176,7 +1176,7 @@ void CNeutrinoApp::saveSetup(const char * fname) } configfile.setInt32("bigFonts", g_settings.bigFonts); - configfile.setInt32("big_windows", g_settings.big_windows); + configfile.setInt32("window_size", g_settings.window_size); #ifdef BOXMODEL_APOLLO configfile.setInt32("brightness", g_settings.brightness ); configfile.setInt32("contrast", g_settings.contrast ); diff --git a/src/system/locals.h b/src/system/locals.h index 743fadee5..79009dcf3 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -363,7 +363,6 @@ typedef enum LOCALE_EXTRA_AUDIO_RUN_PLAYER, LOCALE_EXTRA_AUTO_DELETE, LOCALE_EXTRA_AUTO_TIMESHIFT, - LOCALE_EXTRA_BIGWINDOWS, LOCALE_EXTRA_CACHE_TXT, LOCALE_EXTRA_CHADDED, LOCALE_EXTRA_CHALREADYINBQ, @@ -799,7 +798,6 @@ typedef enum LOCALE_MENU_HINT_BACKLIGHT, LOCALE_MENU_HINT_BACKUP, LOCALE_MENU_HINT_BEDIT, - LOCALE_MENU_HINT_BIGWINDOWS, LOCALE_MENU_HINT_CACHE_TXT, LOCALE_MENU_HINT_CEC_MODE, LOCALE_MENU_HINT_CEC_STANDBY, @@ -1174,6 +1172,7 @@ typedef enum LOCALE_MENU_HINT_VOLUME_DIGITS, LOCALE_MENU_HINT_VOLUME_POS, LOCALE_MENU_HINT_VOLUME_SIZE, + LOCALE_MENU_HINT_WINDOW_SIZE, LOCALE_MENU_HINT_YTPLAY, LOCALE_MENU_HINT_ZAP_CYCLE, LOCALE_MENU_NEXT, @@ -1987,6 +1986,7 @@ typedef enum LOCALE_VIDEOMENU_VIDEOFORMAT_169, LOCALE_VIDEOMENU_VIDEOFORMAT_43, LOCALE_VIDEOMENU_VIDEOMODE, + LOCALE_WINDOW_SIZE, LOCALE_WIZARD_INITIAL_SETTINGS, LOCALE_WIZARD_INSTALL_SETTINGS, LOCALE_WIZARD_SETUP, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 305b8ed6b..c3b8664cb 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -363,7 +363,6 @@ const char * locale_real_names[] = "extra.audio_run_player", "extra.auto_delete", "extra.auto_timeshift", - "extra.bigwindows", "extra.cache_txt", "extra.chadded", "extra.chalreadyinbq", @@ -799,7 +798,6 @@ const char * locale_real_names[] = "menu.hint_backlight", "menu.hint_backup", "menu.hint_bedit", - "menu.hint_bigwindows", "menu.hint_cache_txt", "menu.hint_cec_mode", "menu.hint_cec_standby", @@ -1174,6 +1172,7 @@ const char * locale_real_names[] = "menu.hint_volume_digits", "menu.hint_volume_pos", "menu.hint_volume_size", + "menu.hint_window_size", "menu.hint_ytplay", "menu.hint_zap_cycle", "menu.next", @@ -1987,6 +1986,7 @@ const char * locale_real_names[] = "videomenu.videoformat_169", "videomenu.videoformat_43", "videomenu.videomode", + "window_size", "wizard.initial_settings", "wizard.install_settings", "wizard.setup", diff --git a/src/system/settings.h b/src/system/settings.h index cdd216df2..006202c84 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -438,7 +438,7 @@ struct SNeutrinoSettings int pip_x; int pip_y; int bigFonts; - int big_windows; + int window_size; int eventlist_additional; int channellist_additional; int channellist_epgtext_align_right;