diff --git a/configure.ac b/configure.ac index 472ceda53..1dbdd36c9 100644 --- a/configure.ac +++ b/configure.ac @@ -150,6 +150,14 @@ if test "$BOXTYPE" = "coolstream" || AC_DEFINE(SCREENSHOT, 1, [Define to 1 if the platform supports screenshots]) fi +AC_ARG_ENABLE(lcd4linux, + AS_HELP_STRING([--enable-lcd4linux], [enable Lcd4Linux support]), + ,[enable_lcd4linux=no]) +AM_CONDITIONAL(ENABLE_LCD4LINUX, test "$enable_lcd4linux" = "yes") +if test "$enable_lcd4linux" = "yes"; then + AC_DEFINE(ENABLE_LCD4LINUX, 1, [include Lcd4Linux support]) +fi + AC_ARG_ENABLE(keyboard-no-rc, AS_HELP_STRING([--enable-keyboard-no-rc], [enable keyboard control, disable rc control @<:@default=no@:>@]), AC_DEFINE(KEYBOARD_INSTEAD_OF_REMOTE_CONTROL, 1, [enable keyboard control, disable rc control])) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index c05da3c57..89bc71733 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -923,6 +923,23 @@ keychoosermenu.setnone Keine Taste languagesetup.head Sprache und Zeitzonen languagesetup.osd Menüsprache languagesetup.select Sprache +lcd4l_brightness Helligkeit +lcd4l_brightness_standby Helligkeit im Standby-Modus +lcd4l_clock_a Analog-Uhr im Standby-Modus +lcd4l_convert Konvertiere Umlaute +lcd4l_display_type Display-Typ +lcd4l_logodir Senderlogo-Verzeichnis +lcd4l_skin Display-Style +lcd4l_skin_0 Standard +lcd4l_skin_1 Benutzer 1 +lcd4l_skin_2 Benutzer 2 +lcd4l_skin_3 Benutzer 3 +lcd4l_skin_4 Benutzer 4 +lcd4l_skin_radio Radio-Style aktivieren +lcd4l_support LCD4Linux-Unterstützung +lcd4l_support_auto automatisch +lcd4l_support_off aus +lcd4l_support_on ein lcd_info_line Zeige in Infozeile lcd_info_line_channel Kanalname lcd_info_line_clock Uhrzeit @@ -1226,6 +1243,15 @@ menu.hint_language Menü-Sprache, Zeitzone, bevorzugte Tonspuren, Untertitel-Spr menu.hint_last_radio Wählen Sie den Start-Sender im Radio-Modus menu.hint_last_tv Wählen Sie den Start-Sender im TV-Modus menu.hint_last_use Speichert den aktuellen Kanal beim Herunterfahren der Box +menu.hint_lcd4l_brightness Regelt die Helligkeit des externen Displays im Normalbetrieb +menu.hint_lcd4l_brightness_standby Regelt die Helligkeit des externen Displays im Standby-Modus +menu.hint_lcd4l_clock_a Zeigt im Standby-Betrieb eine Analog-Uhr anstatt einer Digital-Uhr +menu.hint_lcd4l_convert Konvertiert Umlaute für die eingebaute LCD4Linux-Schriftart +menu.hint_lcd4l_display_type Wählen Sie den Typ den externen Displays +menu.hint_lcd4l_logodir Verzeichnis für Senderlogos\nBei ungültigem Eintrag Fallback auf Standard-Logoverzeichnis +menu.hint_lcd4l_skin Auswahl der verfügbaren Darstellungsarten +menu.hint_lcd4l_skin_radio Wechselt die Darstellungsart, wenn der Radio-Modus aktiviert wird +menu.hint_lcd4l_support LCD4Linux aktivieren/deaktivieren\nUnterstützte Displays: Pearl DPF, Samsung DPF, VU+SOLO4K, PNG menu.hint_leds_blink Die Power-LEDs blinken, wenn sich der Receiver im Deep-Standby befindet und ein Timer aktiv ist menu.hint_leds_deepstandby Definiert den Status der Power-LEDs im Deep-Standby menu.hint_leds_record Definiert, ob die Power-LEDs blinken sollen, wenn eine Aufnahme aktiv ist diff --git a/data/locale/english.locale b/data/locale/english.locale index 5b3edb94f..d4ba35ed7 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -922,6 +922,23 @@ keychoosermenu.setnone No key languagesetup.head Language and timezone languagesetup.osd OSD language languagesetup.select OSD language +lcd4l_brightness Brightness +lcd4l_brightness_standby Brightness in standby +lcd4l_clock_a Analog clock in Standby-Mode +lcd4l_convert Convert umlauts +lcd4l_display_type Display Type +lcd4l_logodir Channellogo-Directory +lcd4l_skin Display-Style +lcd4l_skin_0 Standard +lcd4l_skin_1 User 1 +lcd4l_skin_2 User 2 +lcd4l_skin_3 User 3 +lcd4l_skin_4 User 4 +lcd4l_skin_radio Activate Radio-Style +lcd4l_support LCD4Linux-Support +lcd4l_support_auto automatic +lcd4l_support_off off +lcd4l_support_on on lcd_info_line Show in infoline lcd_info_line_channel Channelname lcd_info_line_clock Clock @@ -1224,6 +1241,15 @@ menu.hint_language OSD language, timezone\nPrefered audio and subtitles language menu.hint_last_radio Start box on selected channel\nif last mode is Radio menu.hint_last_tv Start box on selected channel\nif last mode is TV menu.hint_last_use Start box on last used channel +menu.hint_lcd4l_brightness Adjusts the brightness of external display in normal mode +menu.hint_lcd4l_brightness_standby Adjusts the brightness of external display in standby mode +menu.hint_lcd4l_clock_a Shows an analog clock instead of a digital clock on display at standby +menu.hint_lcd4l_convert Convert umlauts for the built-in LCD4Linux font +menu.hint_lcd4l_display_type Choose type of external display +menu.hint_lcd4l_logodir Logo directory.\nFallback to default on invalid entry. +menu.hint_lcd4l_skin Switch between modes +menu.hint_lcd4l_skin_radio Switch the mode, when Radio-Mode is activated +menu.hint_lcd4l_support Activate/deactivate LCD4Linux\nSupported displays: Pearl DPF, Samsung DPF, VU+SOLO4K, PNG menu.hint_leds_blink Blinking LEDs in deep-standby menu.hint_leds_deepstandby LEDs state in deep-standby mode menu.hint_leds_record LEDs state when box recording diff --git a/data/y-web/Makefile.am b/data/y-web/Makefile.am index ba7efd16c..151af476f 100644 --- a/data/y-web/Makefile.am +++ b/data/y-web/Makefile.am @@ -9,6 +9,7 @@ install_DATA = channels.js \ index.html \ prototype.js \ robots.txt \ + lcd4linux.html \ Y_About.yhtm \ Y_Baselib.js \ Y_blank.htm \ diff --git a/data/y-web/lcd4linux.html b/data/y-web/lcd4linux.html new file mode 100644 index 000000000..6dbb1d9a2 --- /dev/null +++ b/data/y-web/lcd4linux.html @@ -0,0 +1,14 @@ + + + + + + + + + LCD4LINUX + + + + + diff --git a/src/driver/Makefile.am b/src/driver/Makefile.am index ac05d73fd..fdb167ef8 100644 --- a/src/driver/Makefile.am +++ b/src/driver/Makefile.am @@ -47,6 +47,11 @@ libneutrino_driver_a_SOURCES = \ streamts.cpp \ volume.cpp +if ENABLE_LCD4LINUX +libneutrino_driver_a_SOURCES += \ + lcd4l.cpp +endif + if BOXTYPE_COOL libneutrino_driver_a_SOURCES += \ fb_accel_cs_hdx.cpp diff --git a/src/driver/lcd4l.cpp b/src/driver/lcd4l.cpp new file mode 100644 index 000000000..12c7f8f76 --- /dev/null +++ b/src/driver/lcd4l.cpp @@ -0,0 +1,1135 @@ +/* + lcd4l - Neutrino-GUI + + Copyright (C) 2012 'defans' + Homepage: http://www.bluepeercrew.us/ + + Copyright (C) 2012-2016 'vanhofen' + Homepage: http://www.neutrino-images.de/ + + Modded (C) 2016 'TangoCash' + + License: GPL + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "lcd4l.h" + +extern CRemoteControl *g_RemoteControl; +extern cVideo *videoDecoder; + +#define LCD_DATADIR "/tmp/lcd/" + +#define LCD_ICONSDIR DATADIR "/lcd/icons/" +#define ICONSEXT ".png" + +#define LOGO_DUMMY LCD_ICONSDIR "blank.png" + +#define BRIGHTNESS LCD_DATADIR "brightness" +#define BRIGHTNESS_STANDBY LCD_DATADIR "brightness_standby" +#define RESOLUTION LCD_DATADIR "resolution" +#define ASPECTRATIO LCD_DATADIR "aspectratio" +#define VIDEOTEXT LCD_DATADIR "videotext" +#define RADIOTEXT LCD_DATADIR "radiotext" +#define DOLBYDIGITAL LCD_DATADIR "dolbydigital" +#define TUNER LCD_DATADIR "tuner" +#define VOLUME LCD_DATADIR "volume" +#define MODE_REC LCD_DATADIR "mode_rec" +#define MODE_REC_ICON LCD_DATADIR "mode_rec_icon" +#define MODE_TSHIFT LCD_DATADIR "mode_tshift" +#define MODE_TIMER LCD_DATADIR "mode_timer" +#define MODE_ECM LCD_DATADIR "mode_ecm" + +#define SERVICE LCD_DATADIR "service" +#define CHANNELNR LCD_DATADIR "channelnr" +#define LOGO LCD_DATADIR "logo" +#define MODE_LOGO LCD_DATADIR "mode_logo" +#define LAYOUT LCD_DATADIR "layout" + +#define EVENT LCD_DATADIR "event" +#define INFO1 LCD_DATADIR "info1" +#define INFO2 LCD_DATADIR "info2" +#define PROGRESS LCD_DATADIR "progress" +#define DURATION LCD_DATADIR "duration" +#define START LCD_DATADIR "start" +#define END LCD_DATADIR "end" + +#define LCD_FONT LCD_DATADIR "font" +#define FGCOLOR LCD_DATADIR "fgcolor" +#define BGCOLOR LCD_DATADIR "bgcolor" + +#define FCOLOR1 LCD_DATADIR "fcolor1" +#define FCOLOR2 LCD_DATADIR "fcolor2" +#define PBCOLOR LCD_DATADIR "pbcolor" + +#define FLAG_LCD4LINUX "/tmp/.lcd4linux" +#define PIDFILE "/tmp/lcd4linux.pid" +#define PNGFILE "/tmp/lcd4linux.png" + +static void lcd4linux(bool run) +{ + const char *buf = "lcd4linux"; + const char *conf = "/etc/lcd4linux.conf"; + + chmod(conf,0x600); + chown(conf,0,0); + + if (run == true) + { + if (g_settings.lcd4l_dpf_type == 3) + { + if (my_system(3, buf, "-o", PNGFILE) != 0) + printf("[CLCD4l] %s: executing '%s -o %s' failed\n", __FUNCTION__, buf, PNGFILE); + } else { + if (my_system(1, buf) != 0) + printf("[CLCD4l] %s: executing '%s' failed\n", __FUNCTION__, buf); + } + sleep(2); + } + else + { + if (my_system(3, "killall", "-9", buf) != 0) + printf("[CLCD4l] %s: terminating '%s' failed\n", __FUNCTION__, buf); + } +} + +/* ----------------------------------------------------------------- */ + +CLCD4l::CLCD4l() +{ + thrLCD4l = 0; +} + +CLCD4l::~CLCD4l() +{ + if (thrLCD4l) + pthread_cancel(thrLCD4l); + thrLCD4l = 0; +} + +/* ----------------------------------------------------------------- */ + +void CLCD4l::InitLCD4l() +{ + if (thrLCD4l) + { + printf("[CLCD4l] %s: initializing\n", __FUNCTION__); + Init(); + } +} + +void CLCD4l::StartLCD4l() +{ + if (!thrLCD4l && (g_settings.lcd4l_support == 1 || g_settings.lcd4l_support == 2)) + { + printf("[CLCD4l] %s: starting thread\n", __FUNCTION__); + pthread_create(&thrLCD4l, NULL, LCD4lProc, (void*) this); + pthread_detach(thrLCD4l); + lcd4linux(true); + } +} + +void CLCD4l::StopLCD4l() +{ + if (thrLCD4l) + { + printf("[CLCD4l] %s: stopping thread\n", __FUNCTION__); + pthread_cancel(thrLCD4l); + thrLCD4l = 0; + lcd4linux(false); + } +} + +void CLCD4l::SwitchLCD4l() +{ + if (thrLCD4l) + StopLCD4l(); + else + StartLCD4l(); +} + +int CLCD4l::CreateFile(const char *file, std::string content, bool convert) +{ + // returns 0 = ok; 1 = can't create file; -1 = thread not found + + int ret = 0; + + if (thrLCD4l) + { + if (WriteFile(file, content, convert) == false) + ret = 1; + } + else + ret = -1; + + return ret; +} + +int CLCD4l::RemoveFile(const char *file) +{ + // returns 0 = ok; 1 = can't remove file; + + int ret = 0; + + if (access(file, F_OK) == 0) + { + if (unlink(file) != 0) + ret = 1; + } + + return ret; +} + +/* ----------------------------------------------------------------- */ + +void CLCD4l::Init() +{ + m_ParseID = 0; + + m_Brightness = -1; + m_Brightness_standby = -1; + m_Resolution = "n/a"; + m_AspectRatio = "n/a"; + m_Videotext = -1; + m_Radiotext = -1; + m_DolbyDigital = "n/a"; + m_Tuner = -1; + m_Volume = -1; + m_ModeRec = -1; + m_ModeTshift = -1; + m_ModeTimer = -1; + m_ModeEcm = -1; + + m_Service = "n/a"; + m_ChannelNr = -1; + m_Logo = "n/a"; + m_ModeLogo = -1; + + m_Layout = "n/a"; + + m_Event = "n/a"; + m_Info1 = "n/a"; + m_Info2 = "n/a"; + m_Progress = -1; + for (int i = 0; i < (int)sizeof(m_Duration); i++) + m_Duration[i] = ' '; + m_Start = "00:00"; + m_End = "00:00"; + + if (!access(LCD_DATADIR, F_OK) == 0) + mkdir(LCD_DATADIR, 0755); +} + +void* CLCD4l::LCD4lProc(void* arg) +{ + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0); + pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0); + + CLCD4l *PLCD4l = static_cast(arg); + + PLCD4l->Init(); + + sleep(5); //please wait ! + + static bool FirstRun = true; + uint64_t p_ParseID = 0; + bool NewParseID = false; + + //printf("[CLCD4l] %s: starting loop\n", __FUNCTION__); + while(1) + { + if ( (!access(PIDFILE, F_OK) == 0) && (!FirstRun) ) + { + if (g_settings.lcd4l_support == 1) // automatic + { + //printf("[CLCD4l] %s: waiting for lcd4linux\n", __FUNCTION__); + sleep(10); + continue; + } + } + + for (int i = 0; i < 10; i++) + { + usleep(5 * 100 * 1000); // 0.5 sec + NewParseID = PLCD4l->CompareParseID(p_ParseID); + if (NewParseID || p_ParseID == NeutrinoModes::mode_audio) + break; + } + + //printf("[CLCD4l] %s: m_ParseID: %llx (NewParseID: %d)\n", __FUNCTION__, p_ParseID, NewParseID ? 1 : 0); + PLCD4l->ParseInfo(p_ParseID, NewParseID, FirstRun); + + if (FirstRun) + { + PLCD4l->WriteFile(FLAG_LCD4LINUX); + FirstRun = false; + } + if (g_settings.lcd4l_support == 0) + { + lcd4linux(false); + } + if (g_settings.lcd4l_support == 1 || g_settings.lcd4l_support == 2) + { + lcd4linux(true); + } + } + return 0; +} + +void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) +{ + SNeutrinoTheme &t = g_settings.theme; + + std::string font = g_settings.font_file; + + if (m_font.compare(font)) + { + WriteFile(LCD_FONT, font); + m_font = font; + } + + /* ----------------------------------------------------------------- */ + + std::string fgcolor = hexStr(t.infobar_Text_red) + + hexStr(t.infobar_Text_green) + + hexStr(t.infobar_Text_blue) + + hexStrA2A(t.infobar_Text_alpha); + + if (m_fgcolor.compare(fgcolor)) + { + WriteFile(FGCOLOR, fgcolor); + m_fgcolor = fgcolor; + } + + /* ----------------------------------------------------------------- */ + + std::string bgcolor = hexStr(t.infobar_red) + + hexStr(t.infobar_green) + + hexStr(t.infobar_blue) + + hexStrA2A(t.infobar_alpha); + + if (m_bgcolor.compare(bgcolor)) + { + WriteFile(BGCOLOR, bgcolor); + m_bgcolor = bgcolor; + } + + /* ----------------------------------------------------------------- */ + + std::string fcolor1 = hexStr(t.infobar_Text_red) + + hexStr(t.infobar_Text_green) + + hexStr(t.infobar_Text_blue) + + hexStr(t.infobar_Text_alpha); + + if (m_fcolor1.compare(fcolor1)) + { + WriteFile(FCOLOR1, fcolor1); + m_fcolor1 = fcolor1; + } + + /* ----------------------------------------------------------------- */ + + std::string fcolor2 = hexStr(t.colored_events_red) + + hexStr(t.colored_events_green) + + hexStr(t.colored_events_blue) + + hexStr(t.colored_events_alpha); + + if (!t.colored_events_infobar) + fcolor2 = fcolor1; + + if (m_fcolor2.compare(fcolor2)) + { + WriteFile(FCOLOR2, fcolor2); + m_fcolor2 = fcolor2; + } + + /* ----------------------------------------------------------------- */ + + std::string pbcolor = hexStr(t.menu_Content_Selected_red) + + hexStr(t.menu_Content_Selected_green) + + hexStr(t.menu_Content_Selected_blue) + + hexStrA2A(t.menu_Content_Selected_alpha); + + if (m_pbcolor.compare(pbcolor)) + { + WriteFile(PBCOLOR, pbcolor); + m_pbcolor = pbcolor; + } + + /* ----------------------------------------------------------------- */ + + int Brightness = g_settings.lcd4l_brightness; + if (m_Brightness != Brightness) + { + WriteFile(BRIGHTNESS, to_string(Brightness)); + m_Brightness = Brightness; + lcd4linux(false); + lcd4linux(true); + } + + int Brightness_standby = g_settings.lcd4l_brightness_standby; + if (m_Brightness_standby != Brightness_standby) + { + WriteFile(BRIGHTNESS_STANDBY, to_string(Brightness_standby)); + m_Brightness_standby = Brightness_standby; + lcd4linux(false); + lcd4linux(true); + } + + /* ----------------------------------------------------------------- */ + + int x_res, y_res, framerate; + videoDecoder->getPictureInfo(x_res, y_res, framerate); + + if (y_res == 1088) + y_res = 1080; + + std::string Resolution = to_string(x_res) + "x" + to_string(y_res); + //Resolution += "\n" + to_string(framerate); //TODO + + if (m_Resolution.compare(Resolution)) + { + WriteFile(RESOLUTION, Resolution); + m_Resolution = Resolution; + } + + /* ----------------------------------------------------------------- */ + + std::string AspectRatio; + switch (videoDecoder->getAspectRatio()) + { + case 0: + AspectRatio = "n/a"; + break; + case 1: + AspectRatio = "4:3"; + break; + case 2: + AspectRatio = "14:9"; + break; + case 3: + AspectRatio = "16:9"; + break; + case 4: + AspectRatio = "20:9"; + break; + default: + AspectRatio = "n/k"; + break; + } + + if (m_AspectRatio.compare(AspectRatio)) + { + WriteFile(ASPECTRATIO, AspectRatio); + m_AspectRatio = AspectRatio; + } + + /* ----------------------------------------------------------------- */ + + int Videotext = g_RemoteControl->current_PIDs.PIDs.vtxtpid; + + if (m_Videotext != Videotext) + { + WriteFile(VIDEOTEXT, Videotext ? "yes" : "no"); + m_Videotext = Videotext; + } + + /* ----------------------------------------------------------------- */ + + int Radiotext = 0; + if (m_Mode == NeutrinoModes::mode_radio && g_settings.radiotext_enable && g_Radiotext) + Radiotext = g_Radiotext->haveRadiotext(); + + if (m_Radiotext != Radiotext) + { + WriteFile(RADIOTEXT, Radiotext ? "yes" : "no"); + m_Radiotext = Radiotext; + } + + /* ----------------------------------------------------------------- */ + + std::string DolbyDigital; + if ((g_RemoteControl->current_PIDs.PIDs.selected_apid < g_RemoteControl->current_PIDs.APIDs.size()) && + (g_RemoteControl->current_PIDs.APIDs[g_RemoteControl->current_PIDs.PIDs.selected_apid].is_ac3)) + DolbyDigital = "yes"; + else + DolbyDigital = g_RemoteControl->has_ac3 ? "available" : "no"; + + if (m_DolbyDigital.compare(DolbyDigital)) + { + WriteFile(DOLBYDIGITAL, DolbyDigital); + m_DolbyDigital = DolbyDigital; + } + + /* ----------------------------------------------------------------- */ + + int Tuner = 1 + CFEManager::getInstance()->getLiveFE()->getNumber(); + + if (m_Tuner != Tuner) + { + WriteFile(TUNER, to_string(Tuner)); + m_Tuner = Tuner; + } + + /* ----------------------------------------------------------------- */ + + int Volume = g_settings.current_volume; + + if (m_Volume != Volume) + { + WriteFile(VOLUME, to_string(Volume)); + m_Volume = Volume; + } + + /* ----------------------------------------------------------------- */ + + int ModeRec = 0; + int ModeTshift = 0; + + int RecordMode = CRecordManager::getInstance()->GetRecordMode(); + switch (RecordMode) + { + case CRecordManager::RECMODE_REC_TSHIFT: + ModeRec = 1; + ModeTshift = 1; + break; + case CRecordManager::RECMODE_REC: + ModeRec = 1; + break; + case CRecordManager::RECMODE_TSHIFT: + ModeTshift = 1; + break; + default: + break; + } + + if (m_ModeRec != ModeRec) + { + WriteFile(MODE_REC, ModeRec ? "on" : "off"); + std::string rec_icon =""; + if (ModeRec) + rec_icon = ICONSDIR "/" NEUTRINO_ICON_REC ICONSEXT; + else + rec_icon = ICONSDIR "/" NEUTRINO_ICON_REC_GRAY ICONSEXT; + WriteFile(MODE_REC_ICON, rec_icon); + m_ModeRec = ModeRec; + } + + if (m_ModeTshift != ModeTshift) + { + WriteFile(MODE_TSHIFT, ModeTshift ? "on" : "off"); + m_ModeTshift = ModeTshift; + } + + /* ----------------------------------------------------------------- */ + + int ModeTimer = 0; + + CTimerd::TimerList timerList; + CTimerdClient TimerdClient; + + timerList.clear(); + TimerdClient.getTimerList(timerList); + + CTimerd::TimerList::iterator timer = timerList.begin(); + + for (; timer != timerList.end(); timer++) + { + if (timer->alarmTime > time(NULL) && (timer->eventType == CTimerd::TIMER_ZAPTO || timer->eventType == CTimerd::TIMER_RECORD)) + { + // Nur "true", wenn irgendein timer in der zukunft liegt + // und dieser vom typ TIMER_ZAPTO oder TIMER_RECORD ist + ModeTimer = 1; + break; + } + } + + if (m_ModeTimer != ModeTimer) + { + WriteFile(MODE_TIMER, ModeTimer ? "on" : "off"); + m_ModeTimer = ModeTimer; + } + + /* ----------------------------------------------------------------- */ + + int ModeEcm = 0; + + if (access("/tmp/ecm.info", F_OK) == 0) + { + struct stat buf; + stat("/tmp/ecm.info", &buf); + if (buf.st_size > 0) + ModeEcm = 1; + } + + if (m_ModeEcm != ModeEcm) + { + WriteFile(MODE_ECM, ModeEcm ? "on" : "off"); + m_ModeEcm = ModeEcm; + } + + /* ----------------------------------------------------------------- */ + + if (newID || parseID == NeutrinoModes::mode_audio || parseID == NeutrinoModes::mode_ts) + { + std::string Service = ""; + int ChannelNr = 0; + std::string Logo = LOGO_DUMMY; + int ModeLogo = 0; + + int ModeStandby = 0; + + if (m_ModeChannel) + { + if (m_ModeChannel > 1) + Service = g_RemoteControl->subChannels[g_RemoteControl->selected_subchannel].subservice_name; + else + Service = g_RemoteControl->getCurrentChannelName(); + + GetLogoName(parseID, Service, Logo); + + ChannelNr = CNeutrinoApp::getInstance()->channelList->getActiveChannelNumber(); + } + else if (parseID == NeutrinoModes::mode_audio) + { + const CAudioMetaData meta = CAudioPlayer::getInstance()->getMetaData(); + if ( (!meta.sc_station.empty()) && (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP)) + Service = meta.sc_station; + else + { + Service = g_Locale->getText(LOCALE_AUDIOPLAYER_NAME); + + switch (CAudioPlayer::getInstance()->getState()) + { + case CBaseDec::REV: + Logo = ICONSDIR "/" NEUTRINO_ICON_REW ICONSEXT; + break; + case CBaseDec::FF: + Logo = ICONSDIR "/" NEUTRINO_ICON_FF ICONSEXT; + break; + case CBaseDec::PAUSE: + Logo = ICONSDIR "/" NEUTRINO_ICON_PAUSE ICONSEXT; + break; + case CBaseDec::PLAY: + Logo = ICONSDIR "/" NEUTRINO_ICON_PLAY ICONSEXT; + break; + default: + ; + } + } + } + else if (parseID == NeutrinoModes::mode_pic) + { + Service = g_Locale->getText(LOCALE_PICTUREVIEWER_HEAD); + } + else if (parseID == NeutrinoModes::mode_ts) + { + if (ModeTshift) + Service = g_Locale->getText(LOCALE_RECORDINGMENU_TIMESHIFT); + else if (CMoviePlayerGui::getInstance().p_movie_info) + { + if (!CMoviePlayerGui::getInstance().p_movie_info->channelName.empty()) + Service = CMoviePlayerGui::getInstance().p_movie_info->channelName; + } + + if (Service.empty()) + Service = g_Locale->getText(LOCALE_MOVIEPLAYER_HEAD); + + switch (CMoviePlayerGui::getInstance().getState()) + { + case 6: /* rewind */ + Logo = ICONSDIR "/" NEUTRINO_ICON_REW ICONSEXT; + break; + case 5: /* fast forward */ + Logo = ICONSDIR "/" NEUTRINO_ICON_FF ICONSEXT; + break; + case 4: /* pause */ + Logo = ICONSDIR "/" NEUTRINO_ICON_PAUSE ICONSEXT; + break; + case 3: /* play */ + if (ModeTshift && CMoviePlayerGui::getInstance().p_movie_info) /* show channel-logo */ + { + if (!GetLogoName(CMoviePlayerGui::getInstance().p_movie_info->channelId, + CMoviePlayerGui::getInstance().p_movie_info->channelName, + Logo)) + Logo = ICONSDIR "/" NEUTRINO_ICON_PLAY ICONSEXT; + } + else /* show play-icon */ + Logo = ICONSDIR "/" NEUTRINO_ICON_PLAY ICONSEXT; + break; + default: /* show movieplayer-icon */ + Logo = ICONSDIR "/" NEUTRINO_ICON_MOVIEPLAYER ICONSEXT; + } + } + else if (parseID == NeutrinoModes::mode_upnp) + { + Service = g_Locale->getText(LOCALE_UPNPBROWSER_HEAD); + } + else if (parseID == NeutrinoModes::mode_standby) + { + Service = "STANDBY"; + ModeStandby = 1; + } + + /* --- */ + + if (m_Service.compare(Service)) + { + WriteFile(SERVICE, Service, true); + m_Service = Service; + } + + if (m_ChannelNr != ChannelNr) + { + WriteFile(CHANNELNR, to_string(ChannelNr)); + m_ChannelNr = ChannelNr; + } + + if (m_Logo.compare(Logo)) + { + WriteFile(LOGO, Logo); + m_Logo = Logo; + } + + if (Logo != LOGO_DUMMY) + ModeLogo = 1; + + if (m_ModeLogo != ModeLogo) + { + WriteFile(MODE_LOGO, to_string(ModeLogo)); + m_ModeLogo = ModeLogo; + } + + /* --- */ + + std::string Layout; + + std::string DPF_Type; + switch (g_settings.lcd4l_dpf_type) { + case 3: + DPF_Type = "PNG_"; + break; +#if defined BOXMODEL_VUSOLO4K + case 2: + DPF_Type = "VUSolo4K_"; + break; +#endif + case 1: + DPF_Type = "Samsung_"; + break; + case 0: + default: + DPF_Type = "Pearl_"; + break; + } + + switch (g_settings.lcd4l_skin) + { + case 4: + Layout = DPF_Type + "user04"; + break; + case 3: + Layout = DPF_Type + "user03"; + break; + case 2: + Layout = DPF_Type + "user02"; + break; + case 1: + Layout = DPF_Type + "user01"; + break; + default: + Layout = DPF_Type + "standard"; + } + + if (ModeStandby) + { + Layout += "_standby"; + } + else if ((g_settings.lcd4l_skin_radio) && (m_Mode == NeutrinoModes::mode_radio || m_Mode == NeutrinoModes::mode_webradio)) + { + Layout += "_radio"; + } + + if (m_Layout.compare(Layout)) + { + WriteFile(LAYOUT, Layout); + m_Layout = Layout; + if (!firstRun) + { + lcd4linux(false); + lcd4linux(true); + } + } + } + + /* ----------------------------------------------------------------- */ + + std::string Event = ""; + std::string Info1 = ""; + std::string Info2 = ""; + int Progress = 0; + char Duration[sizeof(m_Duration)] = {0}; + char Start[6] = {0}; + char End[6] = {0}; + + if (m_ModeChannel) + { + t_channel_id channel_id = parseID & 0xFFFFFFFFFFFFULL; + + CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel(); + if (channel) + channel_id = channel->getEpgID(); + + CSectionsdClient::CurrentNextInfo CurrentNext; + CEitManager::getInstance()->getCurrentNextServiceKey(channel_id, CurrentNext); + + if (CSectionsdClient::epgflags::has_current) + { + if (!CurrentNext.current_name.empty()) + Event = CurrentNext.current_name; + + CShortEPGData shortEpgData; + if (CEitManager::getInstance()->getEPGidShort(CurrentNext.current_uniqueKey, &shortEpgData)) + { + Info1 = shortEpgData.info1; + Info2 = shortEpgData.info2; + } + + if ((CurrentNext.current_zeit.dauer > 0) && (CurrentNext.current_zeit.dauer < 86400)) + { + Progress = 100 * (time(NULL) - CurrentNext.current_zeit.startzeit) / CurrentNext.current_zeit.dauer; + + int total = CurrentNext.current_zeit.dauer / 60; + int done = (abs(time(NULL) - CurrentNext.current_zeit.startzeit) + 30) / 60; + int todo = total - done; + if ((time(NULL) < CurrentNext.current_zeit.startzeit) && todo >= 0) + { + done = 0; + todo = CurrentNext.current_zeit.dauer / 60; + } + snprintf(Duration, sizeof(Duration), "%d/%d", done, total); + } + + tm_struct = localtime(&CurrentNext.current_zeit.startzeit); + snprintf(Start, sizeof(Start), "%02d:%02d", tm_struct->tm_hour, tm_struct->tm_min); + } + + if (CSectionsdClient::epgflags::has_next) + { + Event += "\n"+ CurrentNext.next_name; + tm_struct = localtime(&CurrentNext.next_zeit.startzeit); + snprintf(End, sizeof(End), "%02d:%02d", tm_struct->tm_hour, tm_struct->tm_min); + } + } + else if (parseID == NeutrinoModes::mode_audio) + { + if (CAudioPlayer::getInstance()->getState() == CBaseDec::STOP) + { + Event = g_Locale->getText(LOCALE_AUDIOPLAYER_STOP); + //snprintf(Duration, sizeof(Duration), "-:--"); + } + else + { + const CAudioMetaData meta = CAudioPlayer::getInstance()->getMetaData(); + if ( !meta.artist.empty() ) + Event += meta.artist; + if ( !meta.artist.empty() && !meta.title.empty() ) + Event += " - "; + if ( !meta.title.empty() ) + Event += meta.title; + + if (!meta.album.empty()) + Info1 = meta.album; + + if (!meta.genre.empty()) + Info2 = meta.genre; + + time_t total = meta.total_time; + time_t done = CAudioPlayer::getInstance()->getTimePlayed(); + + if ( (total > 0) && (done > 0) ) + { + Progress = 100 * done / total; + snprintf(Duration, sizeof(Duration), "%ld:%02ld/%ld:%02ld", done / 60, done % 60, total / 60, total % 60); + } + } + + time_t sTime = time(NULL); + tm_struct = localtime(&sTime); + + snprintf(Start, sizeof(Start), "%02d:%02d", tm_struct->tm_hour, tm_struct->tm_min); + } + else if (parseID == NeutrinoModes::mode_ts) + { + if (CMoviePlayerGui::getInstance().p_movie_info) + { + if (!CMoviePlayerGui::getInstance().p_movie_info->epgTitle.empty()) + Event = CMoviePlayerGui::getInstance().p_movie_info->epgTitle; + + if (!CMoviePlayerGui::getInstance().p_movie_info->epgInfo1.empty()) + Info1 = CMoviePlayerGui::getInstance().p_movie_info->epgInfo1; + + if (!CMoviePlayerGui::getInstance().p_movie_info->epgInfo2.empty()) + Info2 = CMoviePlayerGui::getInstance().p_movie_info->epgInfo2; + } + else if (!CMoviePlayerGui::getInstance().GetFile().empty()) + Event = CMoviePlayerGui::getInstance().GetFile(); + + if (Event.empty()) + Event = "MOVIE"; + + if (!ModeTshift) + { + int total = CMoviePlayerGui::getInstance().GetDuration(); + int done = CMoviePlayerGui::getInstance().GetPosition(); + snprintf(Duration, sizeof(Duration), "%d/%d", done / (60 * 1000), total / (60 * 1000)); + Progress = CMoviePlayerGui::getInstance().file_prozent; + } + + time_t sTime = time(NULL); + sTime -= (CMoviePlayerGui::getInstance().GetPosition()/1000); + tm_struct = localtime(&sTime); + + snprintf(Start, sizeof(Start), "%02d:%02d", tm_struct->tm_hour, tm_struct->tm_min); + + time_t eTime = time(NULL); + eTime +=(CMoviePlayerGui::getInstance().GetDuration()/1000) - (CMoviePlayerGui::getInstance().GetPosition()/1000); + tm_struct = localtime(&eTime); + + snprintf(End, sizeof(End), "%02d:%02d", tm_struct->tm_hour, tm_struct->tm_min); + } + + /* ----------------------------------------------------------------- */ + + Event += "\n"; // make sure we have at least two lines in event-file + + if (m_Event.compare(Event)) + { + WriteFile(EVENT, Event, g_settings.lcd4l_convert); + m_Event = Event; + } + + if (m_Info1.compare(Info1)) + { + WriteFile(INFO1, Info1, g_settings.lcd4l_convert); + m_Info1 = Info1; + } + + if (m_Info2.compare(Info2)) + { + WriteFile(INFO2, Info2, g_settings.lcd4l_convert); + m_Info2 = Info2; + } + + if (m_Start.compare(Start)) + { + WriteFile(START, (std::string)Start); + m_Start = (std::string)Start; + } + + if (m_End.compare(End)) + { + WriteFile(END, (std::string)End); + m_End = (std::string)End; + } + + if (Progress > 100) + Progress = 100; + + if (m_Progress != Progress) + { + WriteFile(PROGRESS, to_string(Progress)); + m_Progress = Progress; + } + + if (strcmp(m_Duration, Duration)) + { + WriteFile(DURATION, (std::string)Duration); + strcpy(m_Duration, Duration); + } +} + +/* ----------------------------------------------------------------- */ + +bool CLCD4l::WriteFile(const char *file, std::string content, bool convert) +{ + bool ret = true; + + if (convert) // align to internal lcd4linux font + { + strReplace(content, "ä", "\xe4\0"); + strReplace(content, "ö", "\xf6\0"); + strReplace(content, "ü", "\xfc\0"); + strReplace(content, "Ä", "\xc4\0"); + strReplace(content, "Ö", "\xd6\0"); + strReplace(content, "Ü", "\xdc\0"); + if (g_settings.lcd4l_dpf_type == 0) strReplace(content, "ß", "\xe2\0"); + strReplace(content, "é", "e"); + } + + if (FILE *f = fopen(file, "w")) + { + //printf("[CLCD4l] %s: %s -> %s\n", __FUNCTION__, content.c_str(), file); + fprintf(f, "%s\n", content.c_str()); + fclose(f); + } + else + { + ret = false; + printf("[CLCD4l] %s: %s failed!\n", __FUNCTION__, file); + } + + return ret; +} + +uint64_t CLCD4l::GetParseID() +{ + uint64_t ID = CNeutrinoApp::getInstance()->getMode(); + m_Mode = (int) ID; + m_ModeChannel = 0; + + if (ID == NeutrinoModes::mode_tv || ID == NeutrinoModes::mode_webtv || ID == NeutrinoModes::mode_radio || ID == NeutrinoModes::mode_webradio) + { + if (!(g_RemoteControl->subChannels.empty()) && (g_RemoteControl->selected_subchannel > 0)) + m_ModeChannel = 2; + else + m_ModeChannel = 1; + + if (m_ModeChannel > 1) + ID = g_RemoteControl->subChannels[g_RemoteControl->selected_subchannel].getChannelID(); + else + ID = CZapit::getInstance()->GetCurrentChannelID(); + } + //printf("[CLCD4l] %s: %llx\n", __FUNCTION__, ID); + return ID; +} + +bool CLCD4l::CompareParseID(uint64_t &i_ParseID) +{ + bool ret = false; + + i_ParseID = GetParseID(); + if (m_ParseID != i_ParseID) + { + //printf("[CLCD4l] %s: i_%llx <-> m_%llx\n", __FUNCTION__, i_ParseID, m_ParseID); + ret = true; + m_ParseID = i_ParseID; + } + return ret; +} + +void CLCD4l::strReplace(std::string &orig, const std::string &fstr, const std::string &rstr) +{ + size_t pos = 0; + while ((pos = orig.find(fstr, pos)) != std::string::npos) + { + orig.replace(pos, fstr.length(), rstr); + pos += rstr.length(); + } +} + +std::string CLCD4l::hexStr(unsigned char data) +{ + char hexstr[3]; + snprintf(hexstr, sizeof hexstr, "%02x", (int)data * 255 / 100); + return std::string(hexstr); +} + +std::string CLCD4l::hexStrA2A(unsigned char data) +{ + char hexstr[3]; + int a = 100 - data; + int ret = a * 0xFF / 100; + + if(data == 0) + ret = 0xFF; + else if(data >= 100) + ret = 0x00; + + snprintf(hexstr, sizeof hexstr, "%02x", ret); + return std::string(hexstr); +} + +bool CLCD4l::GetLogoName(uint64_t channel_id, std::string channel_name, std::string &logo) +{ + int h, i, j; + char str_channel_id[16]; + char *upper_name, *lower_name, *p; + + upper_name = strdup(channel_name.c_str()); + for (p = upper_name; *p != '\0'; p++) + *p = (char) toupper(*p); + + lower_name = strdup(channel_name.c_str()); + for (p = lower_name; *p != '\0'; p++) + *p = (char) tolower(*p); + + sprintf(str_channel_id, "%llx", channel_id & 0xFFFFFFFFFFFFULL); + // the directorys to search in + std::string strLogoDir[4] = { g_settings.lcd4l_logodir, LOGODIR_VAR, LOGODIR, g_settings.logo_hdd_dir }; + // first the channelname, then the upper channelname, then the lower channelname, then the channel-id + std::string strLogoName[4] = { channel_name, (std::string)upper_name, (std::string)lower_name, (std::string)str_channel_id }; + // first png, then jpg, then gif + std::string strLogoExt[3] = { ".png", ".jpg", ".gif" }; + + //printf("[CLCD4l] %s: ID: %s, Name: %s (u: %s, l: %s)\n", __FUNCTION__, str_channel_id, channel_name.c_str(), upper_name, lower_name); + + for (h = 0; h < 4; h++) + { + for (i = 0; i < 4; i++) + { + for (j = 0; j < 3; j++) + { + std::string tmp(strLogoDir[h] + "/" + strLogoName[i] + strLogoExt[j]); + if (access(tmp.c_str(), R_OK) != -1) + { + logo = tmp; + return true; + } + } + } + } + + return false; +} diff --git a/src/driver/lcd4l.h b/src/driver/lcd4l.h new file mode 100644 index 000000000..0d2f0a08b --- /dev/null +++ b/src/driver/lcd4l.h @@ -0,0 +1,111 @@ +/* + lcd4l - Neutrino-GUI + + Copyright (C) 2012 'defans' + Homepage: http://www.bluepeercrew.us/ + + Copyright (C) 2012-2016 'vanhofen' + Homepage: http://www.neutrino-images.de/ + + Modded (C) 2016 'TangoCash' + + License: GPL + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef __lcd4l__ +#define __lcd4l__ + +#include + +class CLCD4l +{ + public: + CLCD4l(); + ~CLCD4l(); + + // Functions + void InitLCD4l(); + void StartLCD4l(); + void StopLCD4l(); + void SwitchLCD4l(); + + int CreateFile(const char *file, std::string content = "", bool convert = false); + int RemoveFile(const char *file); + + private: + pthread_t thrLCD4l; + static void* LCD4lProc(void *arg); + + struct tm *tm_struct; + + // Functions + void Init(); + void ParseInfo(uint64_t parseID, bool newID, bool firstRun = false); + + uint64_t GetParseID(); + bool CompareParseID(uint64_t &i_ParseID); + bool GetLogoName(uint64_t channel_id, std::string channel_name, std::string & logo); + + std::string hexStr(unsigned char data); + std::string hexStrA2A(unsigned char data); + void strReplace(std::string &orig, const std::string &fstr, const std::string &rstr); + bool WriteFile(const char *file, std::string content = "", bool convert = false); + + // Variables + uint64_t m_ParseID; + int m_Mode; + int m_ModeChannel; + + int m_Brightness; + int m_Brightness_standby; + std::string m_Resolution; + std::string m_AspectRatio; + int m_Videotext; + int m_Radiotext; + std::string m_DolbyDigital; + int m_Tuner; + int m_Volume; + int m_ModeRec; + int m_ModeTshift; + int m_ModeTimer; + int m_ModeEcm; + + std::string m_Service; + int m_ChannelNr; + std::string m_Logo; + int m_ModeLogo; + + std::string m_Layout; + + std::string m_Event; + std::string m_Info1; + std::string m_Info2; + int m_Progress; + char m_Duration[15]; + std::string m_Start; + std::string m_End; + + std::string m_font; + std::string m_fgcolor; + std::string m_bgcolor; + std::string m_fcolor1; + std::string m_fcolor2; + std::string m_pbcolor; +}; + +#endif diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 2a8272437..5b8ae8af1 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -112,6 +112,11 @@ libneutrino_gui_a_SOURCES = \ xmltv_setup.cpp \ zapit_setup.cpp +if ENABLE_LCD4LINUX +libneutrino_gui_a_SOURCES += \ + lcd4l_setup.cpp +endif + if BOXTYPE_COOL libneutrino_gui_a_SOURCES += \ streaminfo1.cpp diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 9c05057a3..326f8c82c 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -56,6 +56,11 @@ #include #include +#ifdef ENABLE_LCD4LINUX +#include "driver/lcd4l.h" +extern CLCD4l *LCD4l; +#endif + extern CBouquetManager *g_bouquetManager; CBouquetList::CBouquetList(const char * const Name) @@ -589,6 +594,10 @@ int CBouquetList::show(bool bShowChannelList) } hide(); +#ifdef ENABLE_LCD4LINUX + LCD4l->RemoveFile("/tmp/lcd/menu"); +#endif + fader.StopFade(); CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); @@ -646,6 +655,10 @@ void CBouquetList::paintItem(int pos) { if(npos < (int) Bouquets.size()) CVFD::getInstance()->showMenuText(0, lname, -1, true); +#ifdef ENABLE_LCD4LINUX + if(g_settings.lcd4l_support) + LCD4l->CreateFile("/tmp/lcd/menu", lname, g_settings.lcd4l_convert); +#endif } else { diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 7581fef95..f933509b6 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -86,6 +86,11 @@ #include +#ifdef ENABLE_LCD4LINUX +#include "driver/lcd4l.h" +extern CLCD4l *LCD4l; +#endif + extern CBouquetList * bouquetList; /* neutrino.cpp */ extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ extern CBouquetList * AllFavBouquetList; @@ -929,6 +934,10 @@ int CChannelList::show() if (edit_state) editMode(false); +#ifdef ENABLE_LCD4LINUX + LCD4l->RemoveFile("/tmp/lcd/menu"); +#endif + if(!dont_hide){ if (new_zap_mode && (g_settings.channellist_new_zap_mode != new_zap_mode)) g_settings.channellist_new_zap_mode = new_zap_mode; @@ -2184,6 +2193,11 @@ void CChannelList::updateVfd() CVFD::getInstance()->showMenuText(0, nameAndDescription, -1, true); // UTF-8 } else CVFD::getInstance()->showMenuText(0, chan->getName().c_str(), -1, true); // UTF-8 + +#ifdef ENABLE_LCD4LINUX + if (g_settings.lcd4l_support) + LCD4l->CreateFile("/tmp/lcd/menu", chan->getName().c_str(), g_settings.lcd4l_convert); +#endif } void CChannelList::paint() diff --git a/src/gui/lcd4l_setup.cpp b/src/gui/lcd4l_setup.cpp new file mode 100644 index 000000000..c5824f0d4 --- /dev/null +++ b/src/gui/lcd4l_setup.cpp @@ -0,0 +1,216 @@ +/* + lcd4l setup + + Copyright (C) 2012 'defans' + Homepage: http://www.bluepeercrew.us/ + + Copyright (C) 2012-2016 'vanhofen' + Homepage: http://www.neutrino-images.de/ + + Modded (C) 2016 'TangoCash' + + License: GPL + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include + +#include + +// lcd4l-support +#include "driver/lcd4l.h" +extern CLCD4l *LCD4l; + +const CMenuOptionChooser::keyval LCD4L_SUPPORT_OPTIONS[] = +{ + { 0, LOCALE_LCD4L_SUPPORT_OFF }, + { 1, LOCALE_LCD4L_SUPPORT_AUTO }, + { 2, LOCALE_LCD4L_SUPPORT_ON } +}; +#define LCD4L_SUPPORT_OPTION_COUNT (sizeof(LCD4L_SUPPORT_OPTIONS)/sizeof(CMenuOptionChooser::keyval)) + +const CMenuOptionChooser::keyval_ext LCD4L_DPF_TYPE_OPTIONS[] = +{ + { 0, NONEXISTANT_LOCALE, "Pearl"}, + { 1, NONEXISTANT_LOCALE, "Samsung"}, +#if defined BOXMODEL_VUSOLO4K + { 2, NONEXISTANT_LOCALE, "VUSolo4K"}, +#endif + { 3, NONEXISTANT_LOCALE, "PNG"} +}; +#define LCD4L_DPF_TYPE_OPTION_COUNT (sizeof(LCD4L_DPF_TYPE_OPTIONS)/sizeof(CMenuOptionChooser::keyval_ext)) + +const CMenuOptionChooser::keyval LCD4L_SKIN_OPTIONS[] = +{ + { 0, LOCALE_LCD4L_SKIN_0 }, + { 1, LOCALE_LCD4L_SKIN_1 }, + { 2, LOCALE_LCD4L_SKIN_2 }, + { 3, LOCALE_LCD4L_SKIN_3 }, + { 4, LOCALE_LCD4L_SKIN_4 } +}; +#define LCD4L_SKIN_OPTION_COUNT (sizeof(LCD4L_SKIN_OPTIONS)/sizeof(CMenuOptionChooser::keyval)) + +CLCD4lSetup::CLCD4lSetup() +{ + width = 40; +} + +CLCD4lSetup::~CLCD4lSetup() +{ +} + +int CLCD4lSetup::exec(CMenuTarget* parent, const std::string &actionkey) +{ + printf("CLCD4lSetup::exec: actionkey %s\n", actionkey.c_str()); + int res = menu_return::RETURN_REPAINT; + + if (parent) + parent->hide(); + + if (actionkey == "lcd4l_logodir") { + const char *action_str = "lcd4l_logodir"; + chooserDir(g_settings.lcd4l_logodir, false, action_str); + return menu_return::RETURN_REPAINT; + } + + res = show(); + + return res; +} + +bool CLCD4lSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*/) +{ +#if 0 + int value = 0; + + if (data) + value = (*(int *)data); +#endif + + if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCD4L_SUPPORT)) + { + LCD4l->StopLCD4l(); + if (g_settings.lcd4l_support) + LCD4l->StartLCD4l(); + } + + return false; +} + +int CLCD4lSetup::show() +{ + int shortcut = 1; + + int temp_lcd4l_dpf_type = g_settings.lcd4l_dpf_type; + int temp_lcd4l_skin = g_settings.lcd4l_skin; + + // lcd4l setup + CMenuWidget* lcd4lSetup = new CMenuWidget(LOCALE_LCD4L_SUPPORT, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_LCD4L_SETUP); + lcd4lSetup->addIntroItems(); + + mc = new CMenuOptionChooser(LOCALE_LCD4L_SUPPORT, &g_settings.lcd4l_support, LCD4L_SUPPORT_OPTIONS, LCD4L_SUPPORT_OPTION_COUNT, true, this, CRCInput::RC_red); + mc->setHint("", LOCALE_MENU_HINT_LCD4L_SUPPORT); + lcd4lSetup->addItem(mc); + lcd4lSetup->addItem(GenericMenuSeparatorLine); + + mf = new CMenuForwarder(LOCALE_LCD4L_LOGODIR, true, g_settings.lcd4l_logodir, this, "lcd4l_logodir", CRCInput::convertDigitToKey(shortcut++)); + mf->setHint("", LOCALE_MENU_HINT_LCD4L_LOGODIR); + lcd4lSetup->addItem(mf); + + mc = new CMenuOptionChooser(LOCALE_LCD4L_DISPLAY_TYPE, &temp_lcd4l_dpf_type, LCD4L_DPF_TYPE_OPTIONS, LCD4L_DPF_TYPE_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++)); + mc->setHint("", LOCALE_MENU_HINT_LCD4L_DISPLAY_TYPE); + lcd4lSetup->addItem(mc); + + mc = new CMenuOptionChooser(LOCALE_LCD4L_SKIN, &temp_lcd4l_skin, LCD4L_SKIN_OPTIONS, LCD4L_SKIN_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++)); + mc->setHint("", LOCALE_MENU_HINT_LCD4L_SKIN); + lcd4lSetup->addItem(mc); + + mc = new CMenuOptionChooser(LOCALE_LCD4L_SKIN_RADIO, &g_settings.lcd4l_skin_radio, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++)); + mc->setHint("", LOCALE_MENU_HINT_LCD4L_SKIN_RADIO); + lcd4lSetup->addItem(mc); + + int max_brightness = 7; +#if defined BOXMODEL_VUSOLO4K + max_brightness = 10; +#endif + + nc = new CMenuOptionNumberChooser(LOCALE_LCD4L_BRIGHTNESS, (int *)&g_settings.lcd4l_brightness, true, 1, max_brightness, this); + nc->setHint("", LOCALE_MENU_HINT_LCD4L_BRIGHTNESS); + lcd4lSetup->addItem(nc); + + nc = new CMenuOptionNumberChooser(LOCALE_LCD4L_BRIGHTNESS_STANDBY, (int *)&g_settings.lcd4l_brightness_standby, true, 1, max_brightness, this); + nc->setHint("", LOCALE_MENU_HINT_LCD4L_BRIGHTNESS_STANDBY); + lcd4lSetup->addItem(nc); + + const char *flag_lcd4l_clock_a = FLAGDIR "/.lcd-clock_a"; + int fake_lcd4l_clock_a = file_exists(flag_lcd4l_clock_a); + CTouchFileNotifier * lcd_clock_a = new CTouchFileNotifier(flag_lcd4l_clock_a); + mc = new CMenuOptionChooser(LOCALE_LCD4L_CLOCK_A, &fake_lcd4l_clock_a, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, ((file_exists(DATADIR "/lcd/icons/clock/analog")) || (file_exists("/var/tuxbox/lcd/icons/clock/analog"))), lcd_clock_a, CRCInput::convertDigitToKey(shortcut++)); + mc->setHint("", LOCALE_MENU_HINT_LCD4L_CLOCK_A); + lcd4lSetup->addItem(mc); + + lcd4lSetup->addItem(GenericMenuSeparator); + + mc = new CMenuOptionChooser(LOCALE_LCD4L_CONVERT, &g_settings.lcd4l_convert, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++)); + mc->setHint("", LOCALE_MENU_HINT_LCD4L_CONVERT); + lcd4lSetup->addItem(mc); + + int res = lcd4lSetup->exec(NULL, ""); + + lcd4lSetup->hide(); + if (lcd_clock_a) + delete lcd_clock_a; + if (lcd4lSetup) + delete lcd4lSetup; + + // the things to do on exit + + if (g_settings.lcd4l_dpf_type != temp_lcd4l_dpf_type) + { + g_settings.lcd4l_dpf_type = temp_lcd4l_dpf_type; + LCD4l->InitLCD4l(); + } + + if (g_settings.lcd4l_skin != temp_lcd4l_skin) + { + g_settings.lcd4l_skin = temp_lcd4l_skin; + LCD4l->InitLCD4l(); + } + + return res; +} diff --git a/src/gui/lcd4l_setup.h b/src/gui/lcd4l_setup.h new file mode 100644 index 000000000..fb6c94ef5 --- /dev/null +++ b/src/gui/lcd4l_setup.h @@ -0,0 +1,53 @@ +/* + lcd4l setup + + Copyright (C) 2012 'defans' + Homepage: http://www.bluepeercrew.us/ + + Copyright (C) 2012-2016 'vanhofen' + Homepage: http://www.neutrino-images.de/ + + Modded (C) 2016 'TangoCash' + + License: GPL + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + + +#ifndef __lcd4l_setup__ +#define __lcd4l_setup__ + +#include + +class CLCD4lSetup : public CMenuTarget, CChangeObserver +{ + private: + CMenuOptionNumberChooser *nc; + CMenuOptionChooser *mc; + CMenuForwarder * mf; + + int width; + int show(); + + public: + CLCD4lSetup(); + ~CLCD4lSetup(); + int exec(CMenuTarget* parent, const std::string &actionkey); + virtual bool changeNotify(const neutrino_locale_t OptionName, void * /*data*/); +}; + +#endif diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index b735d1b54..ac19eb1fa 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -37,6 +37,9 @@ #include #include #include +#ifdef ENABLE_LCD4LINUX +#include +#endif #include #include #include @@ -300,8 +303,15 @@ int CMiscMenue::showMiscSettingsMenu() mf->setHint("", LOCALE_MENU_HINT_MISC_ZAPIT); misc_menue.addItem(mf); +#ifdef ENABLE_LCD4LINUX + // LCD4Linux Setup + CLCD4lSetup lcd4lSetup; + mf = new CMenuForwarder(LOCALE_LCD4L_SUPPORT, ((access("/usr/bin/lcd4linux", F_OK) == 0) || (access("/var/bin/lcd4linux", F_OK) == 0)), NULL, &lcd4lSetup, NULL, CRCInput::RC_4); + misc_menue.addItem(mf); +#endif + // onlineservices - mf = new CMenuForwarder(LOCALE_MISCSETTINGS_ONLINESERVICES, true, NULL, this, "onlineservices", CRCInput::RC_4); + mf = new CMenuForwarder(LOCALE_MISCSETTINGS_ONLINESERVICES, true, NULL, this, "onlineservices", CRCInput::RC_5); mf->setHint("", LOCALE_MENU_HINT_MISC_ONLINESERVICES); misc_menue.addItem(mf); @@ -309,7 +319,7 @@ int CMiscMenue::showMiscSettingsMenu() //CPU CMenuWidget misc_menue_cpu("CPU", NEUTRINO_ICON_SETTINGS, width); showMiscSettingsMenuCPUFreq(&misc_menue_cpu); - misc_menue.addItem( new CMenuForwarder("CPU", true, NULL, &misc_menue_cpu, NULL, CRCInput::RC_5)); + misc_menue.addItem( new CMenuForwarder("CPU", true, NULL, &misc_menue_cpu, NULL, CRCInput::RC_6)); #endif /*CPU_FREQ*/ int res = misc_menue.exec(NULL, ""); diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index f5c2aa07f..fee073410 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -47,6 +47,11 @@ #include +#ifdef ENABLE_LCD4LINUX +#include "driver/lcd4l.h" +extern CLCD4l *LCD4l; +#endif + /* the following generic menu items are integrated into multiple menus at the same time */ CMenuSeparator CGenericMenuSeparator(0, NONEXISTANT_LOCALE, true); CMenuSeparator CGenericMenuSeparatorLine(CMenuSeparator::LINE, NONEXISTANT_LOCALE, true); @@ -88,6 +93,10 @@ CMenuItem::CMenuItem(bool Active, neutrino_msg_t DirectKey, const char * const I height = 0; actObserv = NULL; parent_widget = NULL; + +#ifdef ENABLE_LCD4LINUX + lcd4l_text = ""; +#endif } void CMenuItem::init(const int X, const int Y, const int DX, const int OFFX) @@ -234,9 +243,23 @@ void CMenuItem::paintItemCaption(const bool select_mode, const char * right_text char str[len]; snprintf(str, len, "%s %s", left_text, right_text); CVFD::getInstance()->showMenuText(0, str, -1, true); +#ifdef ENABLE_LCD4LINUX + if(g_settings.lcd4l_support) + lcd4l_text = str; +#endif } else + { CVFD::getInstance()->showMenuText(0, left_text, -1, true); +#ifdef ENABLE_LCD4LINUX + if (g_settings.lcd4l_support) + lcd4l_text = left_text; +#endif + } +#ifdef ENABLE_LCD4LINUX + if (g_settings.lcd4l_support) + LCD4l->CreateFile("/tmp/lcd/menu", lcd4l_text, g_settings.lcd4l_convert); +#endif } //left text @@ -985,6 +1008,10 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) case (CRCInput::RC_right): case (CRCInput::RC_ok): if (hasItem() && selected > -1 && (int)items.size() > selected) { +#ifdef ENABLE_LCD4LINUX + LCD4l->RemoveFile("/tmp/lcd/menu"); +#endif + //exec this item... CMenuItem* item = items[selected]; if (msg == CRCInput::RC_left && g_settings.menu_left_exit && @@ -997,6 +1024,12 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) item->msg = msg; fader.StopFade(); int rv = item->exec( this ); + +#ifdef ENABLE_LCD4LINUX + if (g_settings.lcd4l_support) + LCD4l->CreateFile("/tmp/lcd/menu", item->lcd4l_text, g_settings.lcd4l_convert); +#endif + switch ( rv ) { case menu_return::RETURN_EXIT_ALL: retval = menu_return::RETURN_EXIT_ALL; @@ -1081,6 +1114,10 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) if(oldLcdMode != CVFD::getInstance()->getMode()) CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); +#ifdef ENABLE_LCD4LINUX + LCD4l->RemoveFile("/tmp/lcd/menu"); +#endif + for (unsigned int count = 0; count < items.size(); count++) { if(items[count] == GenericMenuNext) diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index e21292597..64bfee4f6 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -208,6 +208,9 @@ class CMenuItem : public CComponentsSignals void setParentWidget(CMenuWidget* parent){parent_widget = parent;} void setInfoIconRight(const char * const IconName_Info_right); const char* getInfoIconRight(){return iconName_Info_right;} +#ifdef ENABLE_LCD4LINUX + std::string lcd4l_text; +#endif }; class CMenuSeparator : public CMenuItem diff --git a/src/neutrino.cpp b/src/neutrino.cpp index b094f1668..5ea89d54d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -124,6 +124,11 @@ #include #include +#ifdef ENABLE_LCD4LINUX +#include "driver/lcd4l.h" +CLCD4l *LCD4l; +#endif + #include #include @@ -182,6 +187,9 @@ extern cAudio * audioDecoder; cPowerManager *powerManager; cCpuFreqManager * cpuFreq; +#ifdef ENABLE_LCD4LINUX +void stop_lcd4l_support(void); +#endif void stop_daemons(bool stopall = true, bool for_flash = false); void stop_video(void); @@ -353,6 +361,16 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.theme_name = configfile.getString("theme_name", !access(NEUTRINO_SETTINGS_FILE, F_OK) ? MIGRATE_THEME_NAME : ""); CThemes::getInstance()->getTheme(configfile); +#ifdef ENABLE_LCD4LINUX + g_settings.lcd4l_support = configfile.getInt32("lcd4l_support" , 0); + g_settings.lcd4l_logodir = configfile.getString("lcd4l_logodir", LOGODIR); + g_settings.lcd4l_dpf_type = configfile.getInt32("lcd4l_dpf_type", 0); + g_settings.lcd4l_skin = configfile.getInt32("lcd4l_skin" , 0); + g_settings.lcd4l_skin_radio = configfile.getInt32("lcd4l_skin_radio" , 0); + g_settings.lcd4l_brightness = configfile.getInt32("lcd4l_brightness", 7); + g_settings.lcd4l_brightness_standby = configfile.getInt32("lcd4l_brightness_standby", 3); + g_settings.lcd4l_convert = configfile.getInt32("lcd4l_convert", 1); +#endif // internet radio g_settings.inetradio_autostart = configfile.getInt32("inetradio_autostart" , 0); @@ -1205,6 +1223,16 @@ void CNeutrinoApp::saveSetup(const char * fname) CThemes::getInstance()->setTheme(configfile); configfile.setString( "theme_name", g_settings.theme_name ); +#ifdef ENABLE_LCD4LINUX + configfile.setInt32("lcd4l_support" , g_settings.lcd4l_support); + configfile.setString("lcd4l_logodir" , g_settings.lcd4l_logodir); + configfile.setInt32("lcd4l_dpf_type" , g_settings.lcd4l_dpf_type); + configfile.setInt32("lcd4l_skin" , g_settings.lcd4l_skin); + configfile.setInt32("lcd4l_skin_radio" , g_settings.lcd4l_skin_radio); + configfile.setInt32("lcd4l_brightness", g_settings.lcd4l_brightness); + configfile.setInt32("lcd4l_brightness_standby", g_settings.lcd4l_brightness_standby); + configfile.setInt32("lcd4l_convert" , g_settings.lcd4l_convert); +#endif //internet radio configfile.setInt32("inetradio_autostart" , g_settings.inetradio_autostart); @@ -2606,6 +2634,12 @@ TIMER_START(); CVFD::getInstance()->showVolume(g_settings.current_volume); CVFD::getInstance()->setMuted(current_muted); +#ifdef ENABLE_LCD4LINUX + LCD4l = new CLCD4l(); + if (g_settings.lcd4l_support) + LCD4l->StartLCD4l(); +#endif + if (show_startwizard) { hintBox->hide(); CStartUpWizard startwizard; @@ -3980,6 +4014,10 @@ void CNeutrinoApp::ExitRun(int exit_code) printf("[neutrino] %s(int %d)\n", __func__, exit_code); printf("[neutrino] hw_caps->can_shutdown: %d\n", g_info.hw_caps->can_shutdown); +#ifdef ENABLE_LCD4LINUX + stop_lcd4l_support(); +#endif + if (SDTreloadChannels) SDT_ReloadChannels(); @@ -4599,6 +4637,10 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) CHint * hint = new CHint(LOCALE_SERVICEMENU_RESTART_HINT); hint->paint(); +#ifdef ENABLE_LCD4LINUX + stop_lcd4l_support(); +#endif + saveSetup(NEUTRINO_SETTINGS_FILE); /* this is an ugly mess :-( */ @@ -4669,6 +4711,20 @@ void CNeutrinoApp::stopDaemonsForFlash() /************************************************************************************** * Main programm - no function here * **************************************************************************************/ + +#ifdef ENABLE_LCD4LINUX +void stop_lcd4l_support() +{ + if (LCD4l) { + if (g_settings.lcd4l_support) { + LCD4l->StopLCD4l(); + } + delete LCD4l; + } + LCD4l = NULL; +} +#endif + void stop_daemons(bool stopall, bool for_flash) { CMoviePlayerGui::getInstance().stopPlayBack(); @@ -4763,6 +4819,9 @@ void sighandler (int signum) switch (signum) { case SIGTERM: case SIGINT: +#ifdef ENABLE_LCD4LINUX + stop_lcd4l_support(); +#endif delete cHddStat::getInstance(); delete CRecordManager::getInstance(); //CNeutrinoApp::getInstance()->saveSetup(NEUTRINO_SETTINGS_FILE); diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index 21e1e8141..8b07e0857 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -48,6 +48,9 @@ #include "gui/imageinfo.h" #include "gui/info_menue.h" #include "gui/keybind_setup.h" +#ifdef ENABLE_LCD4LINUX +#include "gui/lcd4l_setup.h" +#endif #include "gui/mediaplayer.h" #include "gui/mediaplayer_setup.h" #include "gui/miscsettings_menu.h" diff --git a/src/neutrino_menue.h b/src/neutrino_menue.h index b69b0c122..2519d84a2 100644 --- a/src/neutrino_menue.h +++ b/src/neutrino_menue.h @@ -90,6 +90,10 @@ enum MN_WIDGET_ID MN_WIDGET_ID_VFDSETUP_LCD_SLIDERS, MN_WIDGET_ID_VFDSETUP_LED_SETUP, MN_WIDGET_ID_VFDSETUP_BACKLIGHT, + +#ifdef ENABLE_LCD4LINUX + MN_WIDGET_ID_LCD4L_SETUP, +#endif //keybind setup MN_WIDGET_ID_KEYSETUP, diff --git a/src/system/locals.h b/src/system/locals.h index 6d5d98002..dfe827662 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -950,6 +950,23 @@ typedef enum LOCALE_LANGUAGESETUP_HEAD, LOCALE_LANGUAGESETUP_OSD, LOCALE_LANGUAGESETUP_SELECT, + LOCALE_LCD4L_BRIGHTNESS, + LOCALE_LCD4L_BRIGHTNESS_STANDBY, + LOCALE_LCD4L_CLOCK_A, + LOCALE_LCD4L_CONVERT, + LOCALE_LCD4L_DISPLAY_TYPE, + LOCALE_LCD4L_LOGODIR, + LOCALE_LCD4L_SKIN, + LOCALE_LCD4L_SKIN_0, + LOCALE_LCD4L_SKIN_1, + LOCALE_LCD4L_SKIN_2, + LOCALE_LCD4L_SKIN_3, + LOCALE_LCD4L_SKIN_4, + LOCALE_LCD4L_SKIN_RADIO, + LOCALE_LCD4L_SUPPORT, + LOCALE_LCD4L_SUPPORT_AUTO, + LOCALE_LCD4L_SUPPORT_OFF, + LOCALE_LCD4L_SUPPORT_ON, LOCALE_LCD_INFO_LINE, LOCALE_LCD_INFO_LINE_CHANNEL, LOCALE_LCD_INFO_LINE_CLOCK, @@ -1253,6 +1270,15 @@ typedef enum LOCALE_MENU_HINT_LAST_RADIO, LOCALE_MENU_HINT_LAST_TV, LOCALE_MENU_HINT_LAST_USE, + LOCALE_MENU_HINT_LCD4L_BRIGHTNESS, + LOCALE_MENU_HINT_LCD4L_BRIGHTNESS_STANDBY, + LOCALE_MENU_HINT_LCD4L_CLOCK_A, + LOCALE_MENU_HINT_LCD4L_CONVERT, + LOCALE_MENU_HINT_LCD4L_DISPLAY_TYPE, + LOCALE_MENU_HINT_LCD4L_LOGODIR, + LOCALE_MENU_HINT_LCD4L_SKIN, + LOCALE_MENU_HINT_LCD4L_SKIN_RADIO, + LOCALE_MENU_HINT_LCD4L_SUPPORT, LOCALE_MENU_HINT_LEDS_BLINK, LOCALE_MENU_HINT_LEDS_DEEPSTANDBY, LOCALE_MENU_HINT_LEDS_RECORD, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index a16b26192..49ccf129b 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -950,6 +950,23 @@ const char * locale_real_names[] = "languagesetup.head", "languagesetup.osd", "languagesetup.select", + "lcd4l_brightness", + "lcd4l_brightness_standby", + "lcd4l_clock_a", + "lcd4l_convert", + "lcd4l_display_type", + "lcd4l_logodir", + "lcd4l_skin", + "lcd4l_skin_0", + "lcd4l_skin_1", + "lcd4l_skin_2", + "lcd4l_skin_3", + "lcd4l_skin_4", + "lcd4l_skin_radio", + "lcd4l_support", + "lcd4l_support_auto", + "lcd4l_support_off", + "lcd4l_support_on", "lcd_info_line", "lcd_info_line_channel", "lcd_info_line_clock", @@ -1253,6 +1270,15 @@ const char * locale_real_names[] = "menu.hint_last_radio", "menu.hint_last_tv", "menu.hint_last_use", + "menu.hint_lcd4l_brightness", + "menu.hint_lcd4l_brightness_standby", + "menu.hint_lcd4l_clock_a", + "menu.hint_lcd4l_convert", + "menu.hint_lcd4l_display_type", + "menu.hint_lcd4l_logodir", + "menu.hint_lcd4l_skin", + "menu.hint_lcd4l_skin_radio", + "menu.hint_lcd4l_support", "menu.hint_leds_blink", "menu.hint_leds_deepstandby", "menu.hint_leds_record", diff --git a/src/system/settings.h b/src/system/settings.h index 55103eb14..0b37906cc 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -762,6 +762,18 @@ struct SNeutrinoSettings int infoClockSeconds; int infoClockBackground; +#ifdef ENABLE_LCD4LINUX + // lcd4linux + int lcd4l_support; + std::string lcd4l_logodir; + int lcd4l_brightness; + int lcd4l_brightness_standby; + int lcd4l_dpf_type; + int lcd4l_skin; + int lcd4l_skin_radio; + int lcd4l_convert; +#endif + // lcdd enum LCD_SETTINGS { LCD_BRIGHTNESS = 0,