Skip to content

Commit

Permalink
nglcd: new option for scroll text on/off added
Browse files Browse the repository at this point in the history
  • Loading branch information
BPanther committed Aug 13, 2023
1 parent 0869afb commit a1aa348
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 11 deletions.
3 changes: 2 additions & 1 deletion data/locale/deutsch.locale
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,8 @@ glcd.head GraphLCD
glcd.mirror_osd OSD-Menü auf GraphLCD anzeigen
glcd.mirror_video Videobild auf GraphLCD anzeigen
glcd.restart Neu erkennen
glcd.scroll_speed Scroll-Geschwindigkeit
glcd.scroll Laufschrift
glcd.scroll_speed Geschwindigkeit der Laufschrift
glcd.select.bar Fortschrittsbalken-Farbe
glcd.select.bg Hintergrund-Farbe
glcd.select.fg Vordergrund-Farbe
Expand Down
1 change: 1 addition & 0 deletions data/locale/english.locale
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,7 @@ glcd.head GraphLCD
glcd.mirror_osd Show OSD menu on GraphLCD
glcd.mirror_video Show running video on GraphLCD
glcd.restart Rescan
glcd.scroll Scrolling
glcd.scroll_speed Scrolling Speed
glcd.select.bar Progress bar color
glcd.select.bg Background color
Expand Down
60 changes: 50 additions & 10 deletions src/driver/nglcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,16 @@ void nGLCD::Run(void)
{
Channel = g_Locale->getText(LOCALE_GLCD_VOLUME);
ChannelWidth = font_channel.Width(Channel);
doScrollChannel = ChannelWidth > bitmap->Width() - 4;
scrollChannelForward = true;
if (g_settings.glcd_scroll)
{
doScrollChannel = ChannelWidth > bitmap->Width() - 4;
scrollChannelForward = true;
}
else
{
doScrollChannel = false;
scrollChannelForward = false;
}
scrollChannelSkip = 0;
if (doScrollChannel)
{
Expand All @@ -808,8 +816,16 @@ void nGLCD::Run(void)
{
Epg = stagingEpg;
EpgWidth = font_epg.Width(Epg);
doScrollEpg = EpgWidth > bitmap->Width() - 4;
scrollEpgForward = true;
if (g_settings.glcd_scroll)
{
doScrollEpg = EpgWidth > bitmap->Width() - 4;
scrollEpgForward = true;
}
else
{
doScrollEpg = false;
scrollEpgForward = false;
}
scrollEpgSkip = 0;
if (doScrollEpg)
{
Expand All @@ -823,8 +839,16 @@ void nGLCD::Run(void)
{
Channel = stagingChannel;
ChannelWidth = font_channel.Width(Channel);
doScrollChannel = ChannelWidth > bitmap->Width() - 4;
scrollChannelForward = true;
if (g_settings.glcd_scroll)
{
doScrollChannel = ChannelWidth > bitmap->Width() - 4;
scrollChannelForward = true;
}
else
{
doScrollChannel = false;
scrollChannelForward = false;
}
scrollChannelSkip = 0;
if (doScrollChannel)
{
Expand Down Expand Up @@ -854,8 +878,16 @@ void nGLCD::Run(void)
EpgWidth = 0;
Scale = 0;
doScrollEpg = false;
doScrollChannel = ChannelWidth > bitmap->Width() - 4;
scrollChannelForward = true;
if (g_settings.glcd_scroll)
{
doScrollChannel = ChannelWidth > bitmap->Width() - 4;
scrollChannelForward = true;
}
else
{
doScrollChannel = false;
scrollChannelForward = false;
}
scrollChannelSkip = 0;
if (doScrollChannel)
{
Expand All @@ -876,8 +908,16 @@ void nGLCD::Run(void)
{
Epg = info_CurrentNext.current_name;
EpgWidth = font_epg.Width(Epg);
doScrollEpg = EpgWidth > bitmap->Width() - 4;
scrollEpgForward = true;
if (g_settings.glcd_scroll)
{
doScrollEpg = EpgWidth > bitmap->Width() - 4;
scrollEpgForward = true;
}
else
{
doScrollEpg = false;
scrollEpgForward = false;
}
scrollEpgSkip = 0;
if (doScrollEpg)
{
Expand Down
4 changes: 4 additions & 0 deletions src/gui/glcdsetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ bool GLCD_Menu::changeNotify (const neutrino_locale_t OptionName, void *Data)
case LOCALE_GLCD_SIZE_TIME:
case LOCALE_GLCD_SIZE_TIME_STANDBY:
case LOCALE_GLCD_TIME_IN_STANDBY:
case LOCALE_GLCD_SCROLL:
case LOCALE_GLCD_SCROLL_SPEED:
break;
default:
Expand Down Expand Up @@ -268,6 +269,9 @@ void GLCD_Menu::GLCD_Menu_Settings()
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_BRIGHTNESS_STANDBY,
&g_settings.glcd_brightness_standby, true, 0, 100, this));
m.addItem(GenericMenuSeparatorLine);
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_SCROLL, &g_settings.glcd_scroll,
OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this,
CRCInput::convertDigitToKey(shortcut++)));
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SCROLL_SPEED,
&g_settings.glcd_scroll_speed, true, 1, 63, this));
m.addItem(GenericMenuSeparatorLine);
Expand Down
2 changes: 2 additions & 0 deletions src/neutrino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ if (g_info.hw_caps->can_shutdown)
g_settings.glcd_brightness = configfile.getInt32("glcd_brightness", 75);
g_settings.glcd_brightness_standby = configfile.getInt32("glcd_brightness_standby", 45);
#endif
g_settings.glcd_scroll = configfile.getInt32("glcd_scroll", 1);
#if BOXMODEL_VUUNO4KSE || BOXMODEL_VUDUO2 || BOXMODEL_VUULTIMO
g_settings.glcd_scroll_speed = configfile.getInt32("glcd_scroll_speed", 1);
#elif BOXMODEL_VUSOLO4K || BOXMODEL_VUDUO4K || BOXMODEL_VUDUO4KSE || BOXMODEL_VUULTIMO4K
Expand Down Expand Up @@ -1479,6 +1480,7 @@ void CNeutrinoApp::saveSetup(const char * fname)
configfile.setString("glcd_font", g_settings.glcd_font);
configfile.setInt32("glcd_brightness", g_settings.glcd_brightness);
configfile.setInt32("glcd_brightness_standby", g_settings.glcd_brightness_standby);
configfile.setInt32("glcd_scroll", g_settings.glcd_scroll);
configfile.setInt32("glcd_scroll_speed", g_settings.glcd_scroll_speed);
configfile.setInt32("glcd_selected_config", g_settings.glcd_selected_config);
#endif
Expand Down
1 change: 1 addition & 0 deletions src/system/locals.h
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ typedef enum
LOCALE_GLCD_MIRROR_OSD,
LOCALE_GLCD_MIRROR_VIDEO,
LOCALE_GLCD_RESTART,
LOCALE_GLCD_SCROLL,
LOCALE_GLCD_SCROLL_SPEED,
LOCALE_GLCD_SELECT_BAR,
LOCALE_GLCD_SELECT_BG,
Expand Down
1 change: 1 addition & 0 deletions src/system/locals_intern.h
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ const char *locale_real_names[] =
"glcd.mirror_osd",
"glcd.mirror_video",
"glcd.restart",
"glcd.scroll",
"glcd.scroll_speed",
"glcd.select.bar",
"glcd.select.bg",
Expand Down
1 change: 1 addition & 0 deletions src/system/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,7 @@ struct SNeutrinoSettings
int glcd_show_logo;
int glcd_brightness;
int glcd_brightness_standby;
int glcd_scroll;
int glcd_scroll_speed;
int glcd_selected_config;
#endif
Expand Down

0 comments on commit a1aa348

Please sign in to comment.