From ca02407d766dc61fa35599dadf2cd678bb19c168 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 24 Nov 2022 21:08:00 +0100 Subject: [PATCH] display: add class CDisplay This should fix broken build with --enable-lcd (BOXMODEL_OSMIO4KPLUS) FIXME: CLCD::setVolume() needs fix because it contains no code. The concept to overwrite CVFD with CLCD should be thought over, see: display.h: #if BOXMODEL_OSMIO4KPLUS #include #define CVFD CLCD #else #include #endif A plan with base- and subclasses and overwritable members should be more sustainable. It will be coming to a mess, and if not yet, it will be at some point, especially since nothing was documented. --- src/driver/display.h | 16 ++++++++++++++++ src/driver/lcdd.h | 5 +++-- src/driver/vfd.h | 4 ++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/driver/display.h b/src/driver/display.h index 591713d59..efca9ed24 100644 --- a/src/driver/display.h +++ b/src/driver/display.h @@ -13,3 +13,19 @@ #ifdef ENABLE_GRAPHLCD #include #endif + + +#ifndef __DISPLAY_H__ +#define __DISPLAY_H__ + +class CDisplay +{ + public: + CDisplay(){}; + virtual ~CDisplay(){}; + + virtual void showServicename(const std::string, const bool ){}; // UTF-8 + virtual void showServicename(const std::string, int){}; // UTF-8 +}; + +#endif diff --git a/src/driver/lcdd.h b/src/driver/lcdd.h index 7e0ec00e5..6b6cf064a 100644 --- a/src/driver/lcdd.h +++ b/src/driver/lcdd.h @@ -39,7 +39,7 @@ #endif #include #endif // LCD_UPDATE - +#include "display.h" #include #include @@ -132,7 +132,7 @@ typedef enum class CLCDPainter; class LcdFontRenderClass; -class CLCD +class CLCD : public CDisplay { public: @@ -244,6 +244,7 @@ class CLCD /** blocks for duration seconds */ void showRCLock(int duration = 2); void showVolume(const char vol, const bool perform_update = true); + void setVolume(const char /*vol*/){printf("#### FIXME: __function__, at __FILE__ ###\n");}; // FIXME: fake member to fix build with --enable-lcd void showPercentOver(const unsigned char perc, const bool perform_update = true, const MODES m = MODE_TVRADIO); void showMenuText(const int position, const char *text, const int highlight = -1, const bool utf_encoded = false); void showAudioTrack(const std::string &artist, const std::string &title, const std::string &album); diff --git a/src/driver/vfd.h b/src/driver/vfd.h index 4f93ce33c..1d3e6384c 100644 --- a/src/driver/vfd.h +++ b/src/driver/vfd.h @@ -39,13 +39,13 @@ #endif #include "driver/file.h" #endif // VFD_UPDATE - +#include "display.h" #include #include #include -class CVFD +class CVFD : public CDisplay { public: