mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-14 08:53:38 +02:00
neutrino: Add switch osd resolution when supported from hardware
- At the moment supported hardware: CS HD2
Currently known problems:
-------------------------
- Display menus after changing resolution (Reboot required)
- Display headers after changing resolution hd => fullhd (Reboot required)
- Display infobar after changing resolution hd => fullhd (Reboot required)
- Screenshot broken (With new driver and set resolution to 1280x720)
Origin commit data
------------------
Commit: 7b158903f8
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2017-02-13 (Mon, 13 Feb 2017)
Origin message was:
------------------
neutrino: Add switch osd resolution when supported from hardware
- At the moment supported hardware: CS HD2
Currently known problems:
-------------------------
- Display menus after changing resolution (Reboot required)
- Display headers after changing resolution hd => fullhd (Reboot required)
- Display infobar after changing resolution hd => fullhd (Reboot required)
- Screenshot broken (With new driver and set resolution to 1280x720)
This commit is contained in:
@@ -108,6 +108,7 @@ class CFbAccelCSHD1
|
||||
void setBlendLevel(int);
|
||||
void add_gxa_sync_marker(void);
|
||||
void setupGXA(void);
|
||||
void setOsdResolutions();
|
||||
};
|
||||
|
||||
class CFbAccelCSHD2
|
||||
@@ -128,6 +129,8 @@ class CFbAccelCSHD2
|
||||
void setBlendMode(uint8_t);
|
||||
void setBlendLevel(int);
|
||||
int scaleFont(int size);
|
||||
bool fullHdAvailable();
|
||||
void setOsdResolutions();
|
||||
};
|
||||
|
||||
class CFbAccelGLFB
|
||||
|
@@ -325,9 +325,25 @@ void CFbAccelCSHD1::setupGXA()
|
||||
add_gxa_sync_marker();
|
||||
}
|
||||
|
||||
/* wrong name... */
|
||||
void CFbAccelCSHD1::setOsdResolutions()
|
||||
{
|
||||
/* FIXME: Infos available in driver? */
|
||||
osd_resolution_t res;
|
||||
osd_resolutions.clear();
|
||||
res.xRes = 1280;
|
||||
res.yRes = 720;
|
||||
res.bpp = 32;
|
||||
osd_resolutions.push_back(res);
|
||||
}
|
||||
|
||||
int CFbAccelCSHD1::setMode(unsigned int, unsigned int, unsigned int)
|
||||
{
|
||||
if (!available&&!active)
|
||||
return -1;
|
||||
|
||||
if (osd_resolutions.empty())
|
||||
setOsdResolutions();
|
||||
|
||||
fb_fix_screeninfo _fix;
|
||||
|
||||
if (ioctl(fd, FBIOGET_FSCREENINFO, &_fix) < 0) {
|
||||
|
@@ -185,12 +185,32 @@ void CFbAccelCSHD2::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_
|
||||
CFrameBuffer::blitBox2FB(boxBuf, width, height, xoff, yoff);
|
||||
}
|
||||
|
||||
void CFbAccelCSHD2::setOsdResolutions()
|
||||
{
|
||||
/* FIXME: Infos available in driver? */
|
||||
osd_resolution_t res;
|
||||
osd_resolutions.clear();
|
||||
res.xRes = 1280;
|
||||
res.yRes = 720;
|
||||
res.bpp = 32;
|
||||
osd_resolutions.push_back(res);
|
||||
if (fullHdAvailable()) {
|
||||
res.xRes = 1920;
|
||||
res.yRes = 1080;
|
||||
res.bpp = 32;
|
||||
osd_resolutions.push_back(res);
|
||||
}
|
||||
}
|
||||
|
||||
int CFbAccelCSHD2::setMode(unsigned int nxRes, unsigned int nyRes, unsigned int nbpp)
|
||||
{
|
||||
if (!available&&!active)
|
||||
return -1;
|
||||
|
||||
if (available >= 16588800) { /* new fb driver with maxres 1920x1080(*8) */
|
||||
if (osd_resolutions.empty())
|
||||
setOsdResolutions();
|
||||
|
||||
if (fullHdAvailable()) {
|
||||
screeninfo.xres_virtual=screeninfo.xres=nxRes;
|
||||
screeninfo.yres_virtual=screeninfo.yres=nyRes;
|
||||
screeninfo.height=0;
|
||||
@@ -272,3 +292,10 @@ int CFbAccelCSHD2::scaleFont(int size)
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
bool CFbAccelCSHD2::fullHdAvailable()
|
||||
{
|
||||
if (available >= 16588800) /* new fb driver with maxres 1920x1080(*8) */
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@@ -350,8 +350,21 @@ int CFrameBuffer::setMode(unsigned int /*nxRes*/, unsigned int /*nyRes*/, unsign
|
||||
if (ioctl(fd, FBIOBLANK, FB_BLANK_UNBLANK) < 0) {
|
||||
printf("screen unblanking failed\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CFrameBuffer::setOsdResolutions()
|
||||
{
|
||||
/* FIXME: Infos available in driver? */
|
||||
osd_resolution_t res;
|
||||
osd_resolutions.clear();
|
||||
res.xRes = 1280;
|
||||
res.yRes = 720;
|
||||
res.bpp = 32;
|
||||
osd_resolutions.push_back(res);
|
||||
}
|
||||
|
||||
#if 0
|
||||
//never used
|
||||
void CFrameBuffer::setTransparency( int /*tr*/ )
|
||||
|
@@ -39,6 +39,13 @@
|
||||
|
||||
typedef struct fb_var_screeninfo t_fb_var_screeninfo;
|
||||
|
||||
typedef struct osd_resolution_t
|
||||
{
|
||||
uint32_t yRes;
|
||||
uint32_t xRes;
|
||||
uint32_t bpp;
|
||||
} osd_resolution_struct_t;
|
||||
|
||||
typedef struct gradientData_t
|
||||
{
|
||||
fb_pixel_t* gradientBuf;
|
||||
@@ -271,6 +278,9 @@ class CFrameBuffer : public sigc::trackable
|
||||
|
||||
virtual void mark(int x, int y, int dx, int dy);
|
||||
virtual int scaleFont(int size) { return size; };
|
||||
virtual bool fullHdAvailable() { return false; };
|
||||
virtual void setOsdResolutions();
|
||||
std::vector<osd_resolution_t> osd_resolutions;
|
||||
|
||||
enum
|
||||
{
|
||||
|
@@ -389,12 +389,11 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
#define OSD_PRESET_OPTIONS_COUNT 2
|
||||
const CMenuOptionChooser::keyval OSD_PRESET_OPTIONS[OSD_PRESET_OPTIONS_COUNT] =
|
||||
const CMenuOptionChooser::keyval_ext OSD_PRESET_OPTIONS[] =
|
||||
{
|
||||
{ 0, LOCALE_COLORMENU_SD_PRESET },
|
||||
{ 1, LOCALE_COLORMENU_HD_PRESET }
|
||||
{ COsdSetup::PRESET_CRT, NONEXISTANT_LOCALE, "CRT" },
|
||||
{ COsdSetup::PRESET_LCD, NONEXISTANT_LOCALE, "LCD" }
|
||||
};
|
||||
|
||||
#define INFOBAR_CASYSTEM_MODE_OPTION_COUNT 4
|
||||
@@ -641,11 +640,37 @@ int COsdSetup::showOsdSetup()
|
||||
|
||||
osd_menu->addItem(GenericMenuSeparatorLine);
|
||||
|
||||
#ifdef ENABLE_CHANGE_OSD_RESOLUTION
|
||||
// osd resolution
|
||||
size_t resCount = frameBuffer->osd_resolutions.size();
|
||||
struct CMenuOptionChooser::keyval_ext kext[resCount];
|
||||
char valname[resCount][255];
|
||||
if (resCount > 0) {
|
||||
for (size_t i = 0; i < resCount; i++) {
|
||||
kext[i].key = i;
|
||||
kext[i].value = NONEXISTANT_LOCALE;
|
||||
snprintf(valname[i], sizeof(valname[resCount]), "%dx%d", frameBuffer->osd_resolutions[i].xRes, frameBuffer->osd_resolutions[i].yRes);
|
||||
kext[i].valname = valname[i];
|
||||
}
|
||||
}
|
||||
else {
|
||||
kext[0].key = 0;
|
||||
kext[0].value = NONEXISTANT_LOCALE;
|
||||
kext[0].valname = "-";
|
||||
resCount = 1;
|
||||
}
|
||||
CMenuOptionChooser * osd_res = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION, &g_settings.osd_resolution, kext, resCount, (resCount>1), this);
|
||||
osd_res->setHint("", LOCALE_MENU_HINT_OSD_RESOLUTION);
|
||||
osd_menu->addItem(osd_res);
|
||||
#endif
|
||||
|
||||
//monitor
|
||||
CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_PRESET, &g_settings.screen_preset, OSD_PRESET_OPTIONS, OSD_PRESET_OPTIONS_COUNT, true, this);
|
||||
mc->setHint("", LOCALE_MENU_HINT_OSD_PRESET);
|
||||
osd_menu->addItem(mc);
|
||||
|
||||
osd_menu->addItem(GenericMenuSeparatorLine);
|
||||
|
||||
// round corners
|
||||
mc = new CMenuOptionChooser(LOCALE_EXTRA_ROUNDED_CORNERS, &g_settings.rounded_corners, MENU_CORNERSETTINGS_TYPE_OPTIONS, MENU_CORNERSETTINGS_TYPE_OPTION_COUNT, true, this);
|
||||
mc->setHint("", LOCALE_MENU_HINT_ROUNDED_CORNERS);
|
||||
@@ -1354,16 +1379,48 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data)
|
||||
int preset = * (int *) data;
|
||||
printf("preset %d (setting %d)\n", preset, g_settings.screen_preset);
|
||||
|
||||
g_settings.screen_StartX = g_settings.screen_preset ? g_settings.screen_StartX_lcd : g_settings.screen_StartX_crt;
|
||||
g_settings.screen_StartY = g_settings.screen_preset ? g_settings.screen_StartY_lcd : g_settings.screen_StartY_crt;
|
||||
g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_lcd : g_settings.screen_EndX_crt;
|
||||
g_settings.screen_EndY = g_settings.screen_preset ? g_settings.screen_EndY_lcd : g_settings.screen_EndY_crt;
|
||||
CNeutrinoApp::getInstance()->setScreenSettings();
|
||||
osd_menu->hide();
|
||||
if (g_InfoViewer == NULL)
|
||||
g_InfoViewer = new CInfoViewer;
|
||||
g_InfoViewer->changePB();
|
||||
return true;
|
||||
}
|
||||
#ifdef ENABLE_CHANGE_OSD_RESOLUTION
|
||||
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_COLORMENU_OSD_RESOLUTION))
|
||||
{
|
||||
if (frameBuffer->fullHdAvailable()) {
|
||||
if (frameBuffer->osd_resolutions.empty())
|
||||
return true;
|
||||
|
||||
size_t index = (size_t)*(int*)data;
|
||||
size_t resCount = frameBuffer->osd_resolutions.size();
|
||||
if (index >= resCount)
|
||||
index = 0;
|
||||
|
||||
uint32_t resW = frameBuffer->osd_resolutions[index].xRes;
|
||||
uint32_t resH = frameBuffer->osd_resolutions[index].yRes;
|
||||
uint32_t bpp = frameBuffer->osd_resolutions[index].bpp;
|
||||
int switchFB = frameBuffer->setMode(resW, resH, bpp);
|
||||
|
||||
if (switchFB == 0) {
|
||||
//printf("\n>>>>>[%s:%d] New res: %dx%dx%d\n \n", __func__, __LINE__, resW, resH, bpp);
|
||||
osd_menu->hide();
|
||||
frameBuffer->Clear();
|
||||
CNeutrinoApp::getInstance()->setScreenSettings();
|
||||
CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT);
|
||||
CVolumeHelper::getInstance()->refresh();
|
||||
CInfoClock::getInstance()->ClearDisplay();
|
||||
FileTimeOSD->Init();
|
||||
if (CNeutrinoApp::getInstance()->channelList)
|
||||
CNeutrinoApp::getInstance()->channelList->ResetModules();
|
||||
if (g_InfoViewer)
|
||||
g_InfoViewer->ResetModules();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_EXTRA_ROUNDED_CORNERS)) {
|
||||
osd_menu->hide();
|
||||
g_settings.rounded_corners = * (int*) data;
|
||||
|
@@ -96,6 +96,12 @@ class COsdSetup : public CMenuTarget, public CChangeObserver
|
||||
INFOBAR_LOGO_FRAMED,
|
||||
INFOBAR_LOGO_SHADED
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PRESET_CRT,
|
||||
PRESET_LCD
|
||||
};
|
||||
|
||||
COsdSetup(int wizard_mode = SNeutrinoSettings::WIZARD_OFF);
|
||||
~COsdSetup();
|
||||
|
@@ -37,6 +37,7 @@
|
||||
|
||||
#include <gui/color.h>
|
||||
#include <gui/infoviewer.h>
|
||||
#include <gui/osd_setup.h>
|
||||
#include <gui/widget/msgbox.h>
|
||||
#include <gui/widget/icons.h>
|
||||
|
||||
@@ -109,27 +110,61 @@ int CScreenSetup::exec(CMenuTarget* parent, const std::string &)
|
||||
|
||||
switch ( msg )
|
||||
{
|
||||
case CRCInput::RC_ok:
|
||||
case CRCInput::RC_ok: {
|
||||
// abspeichern
|
||||
g_settings.screen_StartX = x_coord[0];
|
||||
g_settings.screen_EndX = x_coord[1];
|
||||
g_settings.screen_StartY = y_coord[0];
|
||||
g_settings.screen_EndY = y_coord[1];
|
||||
if(g_settings.screen_preset) {
|
||||
g_settings.screen_StartX_lcd = g_settings.screen_StartX;
|
||||
g_settings.screen_StartY_lcd = g_settings.screen_StartY;
|
||||
g_settings.screen_EndX_lcd = g_settings.screen_EndX;
|
||||
g_settings.screen_EndY_lcd = g_settings.screen_EndY;
|
||||
} else {
|
||||
g_settings.screen_StartX_crt = g_settings.screen_StartX;
|
||||
g_settings.screen_StartY_crt = g_settings.screen_StartY;
|
||||
g_settings.screen_EndX_crt = g_settings.screen_EndX;
|
||||
g_settings.screen_EndY_crt = g_settings.screen_EndY;
|
||||
switch (g_settings.osd_resolution) {
|
||||
#ifdef ENABLE_CHANGE_OSD_RESOLUTION
|
||||
case 1:
|
||||
{
|
||||
switch (g_settings.screen_preset) {
|
||||
case COsdSetup::PRESET_CRT:
|
||||
g_settings.screen_StartX_crt_1 = g_settings.screen_StartX;
|
||||
g_settings.screen_StartY_crt_1 = g_settings.screen_StartY;
|
||||
g_settings.screen_EndX_crt_1 = g_settings.screen_EndX;
|
||||
g_settings.screen_EndY_crt_1 = g_settings.screen_EndY;
|
||||
break;
|
||||
case COsdSetup::PRESET_LCD:
|
||||
default:
|
||||
g_settings.screen_StartX_lcd_1 = g_settings.screen_StartX;
|
||||
g_settings.screen_StartY_lcd_1 = g_settings.screen_StartY;
|
||||
g_settings.screen_EndX_lcd_1 = g_settings.screen_EndX;
|
||||
g_settings.screen_EndY_lcd_1 = g_settings.screen_EndY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case 0:
|
||||
default:
|
||||
{
|
||||
switch (g_settings.screen_preset) {
|
||||
case COsdSetup::PRESET_CRT:
|
||||
g_settings.screen_StartX_crt_0 = g_settings.screen_StartX;
|
||||
g_settings.screen_StartY_crt_0 = g_settings.screen_StartY;
|
||||
g_settings.screen_EndX_crt_0 = g_settings.screen_EndX;
|
||||
g_settings.screen_EndY_crt_0 = g_settings.screen_EndY;
|
||||
break;
|
||||
case COsdSetup::PRESET_LCD:
|
||||
default:
|
||||
g_settings.screen_StartX_lcd_0 = g_settings.screen_StartX;
|
||||
g_settings.screen_StartY_lcd_0 = g_settings.screen_StartY;
|
||||
g_settings.screen_EndX_lcd_0 = g_settings.screen_EndX;
|
||||
g_settings.screen_EndY_lcd_0 = g_settings.screen_EndY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (g_InfoViewer) /* recalc infobar position */
|
||||
g_InfoViewer->start();
|
||||
loop = false;
|
||||
break;
|
||||
}
|
||||
|
||||
case CRCInput::RC_home:
|
||||
if ( ( ( g_settings.screen_StartX != x_coord[0] ) ||
|
||||
|
166
src/neutrino.cpp
166
src/neutrino.cpp
@@ -225,6 +225,7 @@ CNeutrinoApp::CNeutrinoApp()
|
||||
: configfile('\t')
|
||||
{
|
||||
standby_pressed_at.tv_sec = 0;
|
||||
osd_resolution_tmp = -1;
|
||||
|
||||
frameBuffer = CFrameBuffer::getInstance();
|
||||
frameBuffer->setIconBasePath(ICONSDIR);
|
||||
@@ -305,15 +306,6 @@ static SNeutrinoSettings::usermenu_t usermenu_default[] = {
|
||||
/**************************************************************************************
|
||||
* CNeutrinoApp - loadSetup, load the application-settings *
|
||||
**************************************************************************************/
|
||||
#define DEFAULT_X_START_SD 60
|
||||
#define DEFAULT_Y_START_SD 20
|
||||
#define DEFAULT_X_END_SD 1220
|
||||
#define DEFAULT_Y_END_SD 560
|
||||
|
||||
#define DEFAULT_X_START_HD 40 //5
|
||||
#define DEFAULT_Y_START_HD 25 //5
|
||||
#define DEFAULT_X_END_HD 1235 //1275
|
||||
#define DEFAULT_Y_END_HD 690 //715
|
||||
|
||||
std::string ttx_font_file = "";
|
||||
|
||||
@@ -721,29 +713,31 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
||||
g_settings.channellist_show_numbers = configfile.getInt32("channellist_show_numbers", 1);
|
||||
|
||||
//screen configuration
|
||||
g_settings.screen_StartX_crt = configfile.getInt32( "screen_StartX_crt", DEFAULT_X_START_SD);
|
||||
g_settings.screen_StartY_crt = configfile.getInt32( "screen_StartY_crt", DEFAULT_Y_START_SD );
|
||||
g_settings.screen_EndX_crt = configfile.getInt32( "screen_EndX_crt", DEFAULT_X_END_SD);
|
||||
g_settings.screen_EndY_crt = configfile.getInt32( "screen_EndY_crt", DEFAULT_Y_END_SD);
|
||||
g_settings.screen_StartX_lcd = configfile.getInt32( "screen_StartX_lcd", DEFAULT_X_START_HD);
|
||||
g_settings.screen_StartY_lcd = configfile.getInt32( "screen_StartY_lcd", DEFAULT_Y_START_HD );
|
||||
g_settings.screen_EndX_lcd = configfile.getInt32( "screen_EndX_lcd", DEFAULT_X_END_HD);
|
||||
g_settings.screen_EndY_lcd = configfile.getInt32( "screen_EndY_lcd", DEFAULT_Y_END_HD);
|
||||
g_settings.screen_preset = configfile.getInt32( "screen_preset", 1);
|
||||
|
||||
g_settings.screen_StartX = g_settings.screen_preset ? g_settings.screen_StartX_lcd : g_settings.screen_StartX_crt;
|
||||
g_settings.screen_StartY = g_settings.screen_preset ? g_settings.screen_StartY_lcd : g_settings.screen_StartY_crt;
|
||||
g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_lcd : g_settings.screen_EndX_crt;
|
||||
g_settings.screen_EndY = g_settings.screen_preset ? g_settings.screen_EndY_lcd : g_settings.screen_EndY_crt;
|
||||
|
||||
g_settings.screen_width = frameBuffer->getScreenWidth(true);
|
||||
g_settings.screen_height = frameBuffer->getScreenHeight(true);
|
||||
g_settings.osd_resolution = (osd_resolution_tmp == -1) ? configfile.getInt32("osd_resolution", 0) : osd_resolution_tmp;
|
||||
g_settings.screen_StartX_crt_0 = configfile.getInt32("screen_StartX_crt_0", 80);
|
||||
g_settings.screen_StartY_crt_0 = configfile.getInt32("screen_StartY_crt_0", 45);
|
||||
g_settings.screen_EndX_crt_0 = configfile.getInt32("screen_EndX_crt_0" , 1199);
|
||||
g_settings.screen_EndY_crt_0 = configfile.getInt32("screen_EndY_crt_0" , 674);
|
||||
g_settings.screen_StartX_lcd_0 = configfile.getInt32("screen_StartX_lcd_0", 40);
|
||||
g_settings.screen_StartY_lcd_0 = configfile.getInt32("screen_StartY_lcd_0", 22);
|
||||
g_settings.screen_EndX_lcd_0 = configfile.getInt32("screen_EndX_lcd_0" , 1193);
|
||||
g_settings.screen_EndY_lcd_0 = configfile.getInt32("screen_EndY_lcd_0" , 697);
|
||||
g_settings.screen_StartX_crt_1 = configfile.getInt32("screen_StartX_crt_1", 80);
|
||||
g_settings.screen_StartY_crt_1 = configfile.getInt32("screen_StartY_crt_1", 45);
|
||||
g_settings.screen_EndX_crt_1 = configfile.getInt32("screen_EndX_crt_1" , 1839);
|
||||
g_settings.screen_EndY_crt_1 = configfile.getInt32("screen_EndY_crt_1" , 1034);
|
||||
g_settings.screen_StartX_lcd_1 = configfile.getInt32("screen_StartX_lcd_1", 40);
|
||||
g_settings.screen_StartY_lcd_1 = configfile.getInt32("screen_StartY_lcd_1", 22);
|
||||
g_settings.screen_EndX_lcd_1 = configfile.getInt32("screen_EndX_lcd_1" , 1879);
|
||||
g_settings.screen_EndY_lcd_1 = configfile.getInt32("screen_EndY_lcd_1" , 1057);
|
||||
g_settings.screen_preset = configfile.getInt32("screen_preset", COsdSetup::PRESET_LCD);
|
||||
setScreenSettings();
|
||||
|
||||
// avoid configuration mismatch
|
||||
if (g_settings.screen_EndX > g_settings.screen_width)
|
||||
g_settings.screen_EndX = g_settings.screen_width;
|
||||
if (g_settings.screen_EndY > g_settings.screen_height)
|
||||
g_settings.screen_EndY = g_settings.screen_height;
|
||||
if (g_settings.screen_EndX >= g_settings.screen_width)
|
||||
g_settings.screen_EndX = g_settings.screen_width - 1;
|
||||
if (g_settings.screen_EndY >= g_settings.screen_height)
|
||||
g_settings.screen_EndY = g_settings.screen_height - 1;
|
||||
|
||||
g_settings.bigFonts = configfile.getInt32("bigFonts", 0);
|
||||
g_settings.window_size = configfile.getInt32("window_size", 100);
|
||||
@@ -947,6 +941,56 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
||||
return erg;
|
||||
}
|
||||
|
||||
void CNeutrinoApp::setScreenSettings()
|
||||
{
|
||||
g_settings.screen_width = frameBuffer->getScreenWidth(true);
|
||||
g_settings.screen_height = frameBuffer->getScreenHeight(true);
|
||||
|
||||
switch (g_settings.osd_resolution) {
|
||||
#ifdef ENABLE_CHANGE_OSD_RESOLUTION
|
||||
case 1:
|
||||
{
|
||||
switch (g_settings.screen_preset) {
|
||||
case COsdSetup::PRESET_CRT:
|
||||
g_settings.screen_StartX = g_settings.screen_StartX_crt_1;
|
||||
g_settings.screen_StartY = g_settings.screen_StartY_crt_1;
|
||||
g_settings.screen_EndX = g_settings.screen_EndX_crt_1;
|
||||
g_settings.screen_EndY = g_settings.screen_EndY_crt_1;
|
||||
break;
|
||||
case COsdSetup::PRESET_LCD:
|
||||
default:
|
||||
g_settings.screen_StartX = g_settings.screen_StartX_lcd_1;
|
||||
g_settings.screen_StartY = g_settings.screen_StartY_lcd_1;
|
||||
g_settings.screen_EndX = g_settings.screen_EndX_lcd_1;
|
||||
g_settings.screen_EndY = g_settings.screen_EndY_lcd_1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case 0:
|
||||
default:
|
||||
{
|
||||
switch (g_settings.screen_preset) {
|
||||
case COsdSetup::PRESET_CRT:
|
||||
g_settings.screen_StartX = g_settings.screen_StartX_crt_0;
|
||||
g_settings.screen_StartY = g_settings.screen_StartY_crt_0;
|
||||
g_settings.screen_EndX = g_settings.screen_EndX_crt_0;
|
||||
g_settings.screen_EndY = g_settings.screen_EndY_crt_0;
|
||||
break;
|
||||
case COsdSetup::PRESET_LCD:
|
||||
default:
|
||||
g_settings.screen_StartX = g_settings.screen_StartX_lcd_0;
|
||||
g_settings.screen_StartY = g_settings.screen_StartY_lcd_0;
|
||||
g_settings.screen_EndX = g_settings.screen_EndX_lcd_0;
|
||||
g_settings.screen_EndY = g_settings.screen_EndY_lcd_0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CNeutrinoApp::upgradeSetup(const char * fname)
|
||||
{
|
||||
dprintf(DEBUG_NORMAL, "upgrade/cleanup %s\n", fname);
|
||||
@@ -1310,15 +1354,24 @@ void CNeutrinoApp::saveSetup(const char * fname)
|
||||
configfile.setInt32("channellist_show_numbers", g_settings.channellist_show_numbers);
|
||||
|
||||
//screen configuration
|
||||
configfile.setInt32( "screen_StartX_lcd", g_settings.screen_StartX_lcd );
|
||||
configfile.setInt32( "screen_StartY_lcd", g_settings.screen_StartY_lcd );
|
||||
configfile.setInt32( "screen_EndX_lcd", g_settings.screen_EndX_lcd );
|
||||
configfile.setInt32( "screen_EndY_lcd", g_settings.screen_EndY_lcd );
|
||||
configfile.setInt32( "screen_StartX_crt", g_settings.screen_StartX_crt );
|
||||
configfile.setInt32( "screen_StartY_crt", g_settings.screen_StartY_crt );
|
||||
configfile.setInt32( "screen_EndX_crt", g_settings.screen_EndX_crt );
|
||||
configfile.setInt32( "screen_EndY_crt", g_settings.screen_EndY_crt );
|
||||
configfile.setInt32( "screen_preset", g_settings.screen_preset );
|
||||
configfile.setInt32("osd_resolution" , g_settings.osd_resolution);
|
||||
configfile.setInt32("screen_StartX_lcd_0", g_settings.screen_StartX_lcd_0);
|
||||
configfile.setInt32("screen_StartY_lcd_0", g_settings.screen_StartY_lcd_0);
|
||||
configfile.setInt32("screen_EndX_lcd_0" , g_settings.screen_EndX_lcd_0);
|
||||
configfile.setInt32("screen_EndY_lcd_0" , g_settings.screen_EndY_lcd_0);
|
||||
configfile.setInt32("screen_StartX_crt_0", g_settings.screen_StartX_crt_0);
|
||||
configfile.setInt32("screen_StartY_crt_0", g_settings.screen_StartY_crt_0);
|
||||
configfile.setInt32("screen_EndX_crt_0" , g_settings.screen_EndX_crt_0);
|
||||
configfile.setInt32("screen_EndY_crt_0" , g_settings.screen_EndY_crt_0);
|
||||
configfile.setInt32("screen_StartX_lcd_1", g_settings.screen_StartX_lcd_1);
|
||||
configfile.setInt32("screen_StartY_lcd_1", g_settings.screen_StartY_lcd_1);
|
||||
configfile.setInt32("screen_EndX_lcd_1" , g_settings.screen_EndX_lcd_1);
|
||||
configfile.setInt32("screen_EndY_lcd_1" , g_settings.screen_EndY_lcd_1);
|
||||
configfile.setInt32("screen_StartX_crt_1", g_settings.screen_StartX_crt_1);
|
||||
configfile.setInt32("screen_StartY_crt_1", g_settings.screen_StartY_crt_1);
|
||||
configfile.setInt32("screen_EndX_crt_1" , g_settings.screen_EndX_crt_1);
|
||||
configfile.setInt32("screen_EndY_crt_1" , g_settings.screen_EndY_crt_1);
|
||||
configfile.setInt32("screen_preset" , g_settings.screen_preset);
|
||||
|
||||
//Software-update
|
||||
configfile.setInt32 ("softupdate_mode" , g_settings.softupdate_mode );
|
||||
@@ -1815,10 +1868,37 @@ void CNeutrinoApp::CmdParser(int argc, char **argv)
|
||||
void CNeutrinoApp::SetupFrameBuffer()
|
||||
{
|
||||
frameBuffer->init();
|
||||
/* Parameters only valid for hd2 hardware and new fb drivers,
|
||||
all other hardware ignores these parameters */
|
||||
// if (frameBuffer->setMode(1280, 720, 8 * sizeof(fb_pixel_t)) == -1) {
|
||||
if (frameBuffer->setMode(1920, 1080, 8 * sizeof(fb_pixel_t)) == -1) {
|
||||
int setFbMode = 0;
|
||||
osd_resolution_tmp = -1;
|
||||
#ifdef ENABLE_CHANGE_OSD_RESOLUTION
|
||||
frameBuffer->setOsdResolutions();
|
||||
if (frameBuffer->osd_resolutions.empty()) {
|
||||
dprintf(DEBUG_NORMAL, "Error while setting framebuffer mode\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
uint32_t ort;
|
||||
configfile.loadConfig(NEUTRINO_SETTINGS_FILE);
|
||||
ort = configfile.getInt32("osd_resolution", 0);
|
||||
|
||||
size_t resCount = frameBuffer->osd_resolutions.size();
|
||||
|
||||
if (ort > (resCount - 1))
|
||||
osd_resolution_tmp = ort = 0;
|
||||
|
||||
if (resCount == 1)
|
||||
ort = 0;
|
||||
|
||||
setFbMode = frameBuffer->setMode(frameBuffer->osd_resolutions[ort].xRes,
|
||||
frameBuffer->osd_resolutions[ort].yRes,
|
||||
frameBuffer->osd_resolutions[ort].bpp);
|
||||
|
||||
#else
|
||||
/* all other hardware ignores setMode parameters */
|
||||
setFbMode = frameBuffer->setMode(0, 0, 0);
|
||||
#endif
|
||||
|
||||
if (setFbMode == -1) {
|
||||
dprintf(DEBUG_NORMAL, "Error while setting framebuffer mode\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
@@ -108,6 +108,7 @@ private:
|
||||
bool channelList_allowed;
|
||||
bool channelList_painted;
|
||||
int first_mode_found;
|
||||
int osd_resolution_tmp;
|
||||
|
||||
void SDT_ReloadChannels();
|
||||
void setupNetwork( bool force= false );
|
||||
@@ -162,6 +163,7 @@ public:
|
||||
|
||||
void saveSetup(const char * fname);
|
||||
int loadSetup(const char * fname);
|
||||
void setScreenSettings();
|
||||
void upgradeSetup(const char * fname);
|
||||
void loadKeys(const char * fname = NULL);
|
||||
void saveKeys(const char * fname = NULL);
|
||||
|
@@ -349,10 +349,9 @@ typedef enum
|
||||
LOCALE_COLORMENU_FADE,
|
||||
LOCALE_COLORMENU_FONT,
|
||||
LOCALE_COLORMENU_FONT_TTX,
|
||||
LOCALE_COLORMENU_HD_PRESET,
|
||||
LOCALE_COLORMENU_MENUCOLORS,
|
||||
LOCALE_COLORMENU_OSD_PRESET,
|
||||
LOCALE_COLORMENU_SD_PRESET,
|
||||
LOCALE_COLORMENU_OSD_RESOLUTION,
|
||||
LOCALE_COLORMENU_TEXTCOLOR,
|
||||
LOCALE_COLORMENU_THEMESELECT,
|
||||
LOCALE_COLORMENU_TIMING,
|
||||
@@ -1271,6 +1270,7 @@ typedef enum
|
||||
LOCALE_MENU_HINT_OSD,
|
||||
LOCALE_MENU_HINT_OSD_LANGUAGE,
|
||||
LOCALE_MENU_HINT_OSD_PRESET,
|
||||
LOCALE_MENU_HINT_OSD_RESOLUTION,
|
||||
LOCALE_MENU_HINT_OSD_TIMING,
|
||||
LOCALE_MENU_HINT_OTHER_FONTS,
|
||||
LOCALE_MENU_HINT_PARENTALLOCK_CHANGEPIN,
|
||||
|
@@ -349,10 +349,9 @@ const char * locale_real_names[] =
|
||||
"colormenu.fade",
|
||||
"colormenu.font",
|
||||
"colormenu.font_ttx",
|
||||
"colormenu.hd_preset",
|
||||
"colormenu.menucolors",
|
||||
"colormenu.osd_preset",
|
||||
"colormenu.sd_preset",
|
||||
"colormenu.osd_resolution",
|
||||
"colormenu.textcolor",
|
||||
"colormenu.themeselect",
|
||||
"colormenu.timing",
|
||||
@@ -1271,6 +1270,7 @@ const char * locale_real_names[] =
|
||||
"menu.hint_osd",
|
||||
"menu.hint_osd_language",
|
||||
"menu.hint_osd_preset",
|
||||
"menu.hint_osd_resolution",
|
||||
"menu.hint_osd_timing",
|
||||
"menu.hint_other_fonts",
|
||||
"menu.hint_parentallock_changepin",
|
||||
|
@@ -608,14 +608,23 @@ struct SNeutrinoSettings
|
||||
int screen_StartY;
|
||||
int screen_EndX;
|
||||
int screen_EndY;
|
||||
int screen_StartX_crt;
|
||||
int screen_StartY_crt;
|
||||
int screen_EndX_crt;
|
||||
int screen_EndY_crt;
|
||||
int screen_StartX_lcd;
|
||||
int screen_StartY_lcd;
|
||||
int screen_EndX_lcd;
|
||||
int screen_EndY_lcd;
|
||||
int screen_StartX_crt_0;
|
||||
int screen_StartY_crt_0;
|
||||
int screen_EndX_crt_0;
|
||||
int screen_EndY_crt_0;
|
||||
int screen_StartX_lcd_0;
|
||||
int screen_StartY_lcd_0;
|
||||
int screen_EndX_lcd_0;
|
||||
int screen_EndY_lcd_0;
|
||||
int screen_StartX_crt_1;
|
||||
int screen_StartY_crt_1;
|
||||
int screen_EndX_crt_1;
|
||||
int screen_EndY_crt_1;
|
||||
int screen_StartX_lcd_1;
|
||||
int screen_StartY_lcd_1;
|
||||
int screen_EndX_lcd_1;
|
||||
int screen_EndY_lcd_1;
|
||||
int osd_resolution;
|
||||
int screen_preset;
|
||||
int screen_width;
|
||||
int screen_height;
|
||||
|
Reference in New Issue
Block a user