From fb6c2e8ad9bc59a6f2f946a1e45c196f7ddb7ec3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 1 Dec 2017 22:08:03 +0100 Subject: [PATCH] lcd4l: detect radiotext (/tmp/lcd/radiotext) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0fb41ee0fdde1240f5d6785e60663de692c0035c Author: vanhofen Date: 2017-12-01 (Fri, 01 Dec 2017) Origin message was: ------------------ - lcd4l: detect radiotext (/tmp/lcd/radiotext) --- src/gui/lcd4l.cpp | 15 +++++++++++++++ src/gui/lcd4l.h | 1 + 2 files changed, 16 insertions(+) diff --git a/src/gui/lcd4l.cpp b/src/gui/lcd4l.cpp index a41e6d980..bf9d35d18 100644 --- a/src/gui/lcd4l.cpp +++ b/src/gui/lcd4l.cpp @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -74,6 +75,7 @@ extern cVideo *videoDecoder; #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" @@ -201,6 +203,7 @@ void CLCD4l::Init() m_Resolution = "n/a"; m_AspectRatio = "n/a"; m_Videotext = -1; + m_Radiotext = -1; m_DolbyDigital = "n/a"; m_Tuner = -1; m_Volume = -1; @@ -381,6 +384,18 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) /* ----------------------------------------------------------------- */ + 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)) diff --git a/src/gui/lcd4l.h b/src/gui/lcd4l.h index 2c2cf6253..b350d31a6 100644 --- a/src/gui/lcd4l.h +++ b/src/gui/lcd4l.h @@ -76,6 +76,7 @@ class CLCD4l std::string m_Resolution; std::string m_AspectRatio; int m_Videotext; + int m_Radiotext; std::string m_DolbyDigital; int m_Tuner; int m_Volume;