mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 17:31:20 +02:00
make driver selectable for graphlcd
Conflicts: data/locale/deutsch.locale data/locale/english.locale src/driver/nglcd.h src/gui/glcdsetup.cpp src/gui/glcdsetup.h src/neutrino.cpp src/system/locals.h src/system/locals_intern.h src/system/settings.h Signed-off-by: Thilo Graf <dbt@novatux.de> compile fixed
This commit is contained in:
@@ -562,7 +562,11 @@ void nGLCD::Run(void)
|
||||
break;
|
||||
|
||||
int warmUp = 10;
|
||||
lcd = GLCD::CreateDriver(GLCD::Config.driverConfigs[0].id, &GLCD::Config.driverConfigs[0]);
|
||||
|
||||
if ((g_settings.glcd_selected_config < 0) || (g_settings.glcd_selected_config > GetConfigSize() - 1))
|
||||
g_settings.glcd_selected_config = 0;
|
||||
|
||||
lcd = GLCD::CreateDriver(GLCD::Config.driverConfigs[g_settings.glcd_selected_config].id, &GLCD::Config.driverConfigs[g_settings.glcd_selected_config]);
|
||||
if (!lcd) {
|
||||
#ifdef GLCD_DEBUG
|
||||
fprintf(stderr, "CreateDriver failed.\n");
|
||||
@@ -959,3 +963,14 @@ int nGLCD::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t /* data */)
|
||||
return messages_return::unhandled;
|
||||
}
|
||||
|
||||
int nGLCD::GetConfigSize()
|
||||
{
|
||||
return (int) GLCD::Config.driverConfigs.size();
|
||||
}
|
||||
|
||||
std::string nGLCD::GetConfigName(int driver)
|
||||
{
|
||||
if ((driver < 0) || (driver > GetConfigSize() - 1))
|
||||
driver = 0;
|
||||
return GLCD::Config.driverConfigs[driver].name;
|
||||
}
|
||||
|
@@ -130,6 +130,8 @@ class nGLCD
|
||||
static void Exit();
|
||||
static void Blit();
|
||||
static void SetBrightness(unsigned int b);
|
||||
int GetConfigSize();
|
||||
std::string GetConfigName(int);
|
||||
void UpdateBrightness();
|
||||
int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data);
|
||||
};
|
||||
|
Reference in New Issue
Block a user