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 <driver/lcdd.h>
#define CVFD CLCD
#else
#include <driver/simple_display.h>
#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.
This commit is contained in:
2022-11-24 21:08:00 +01:00
parent 8f2de59f0f
commit ca02407d76
3 changed files with 21 additions and 4 deletions

View File

@@ -13,3 +13,19 @@
#ifdef ENABLE_GRAPHLCD
#include <driver/glcd/glcd.h>
#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

View File

@@ -39,7 +39,7 @@
#endif
#include <driver/file.h>
#endif // LCD_UPDATE
#include "display.h"
#include <configfile.h>
#include <pthread.h>
@@ -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);

View File

@@ -39,13 +39,13 @@
#endif
#include "driver/file.h"
#endif // VFD_UPDATE
#include "display.h"
#include <pthread.h>
#include <string>
#include <cs_frontpanel.h>
class CVFD
class CVFD : public CDisplay
{
public: