22 #if !defined(FREEMHEG_H)
37 using namespace std::chrono_literals;
57 virtual ~
MHEG() =
default;
58 virtual void SetBooting() = 0;
59 virtual void DrawDisplay(
const QRegion& toDraw) = 0;
62 virtual std::chrono::milliseconds RunAll(
void) = 0;
64 virtual void GenerateUserAction(
int nCode) = 0;
65 virtual void EngineEvent(
int) = 0;
66 virtual void StreamStarted(
MHStream*,
bool bStarted =
true) = 0;
80 #define MHLogAll (MHLogError|MHLogWarning|MHLogNotifications|MHLogScenes|MHLogActions|MHLogLinks|MHLogDetail)
85 MHRgba(
int red,
int green,
int blue,
int alpha):
86 m_red(red), m_green(green), m_blue(blue), m_alpha(alpha) {};
88 int red()
const {
return m_red; }
89 int green()
const {
return m_green; }
90 int blue()
const {
return m_blue; }
91 int alpha()
const {
return m_alpha; }
93 unsigned char m_red{0}, m_green{0}, m_blue{0}, m_alpha{0};
108 virtual bool CheckCarouselObject(
const QString& objectPath) = 0;
114 virtual bool GetCarouselData(
const QString& objectPath, QByteArray &result) = 0;
117 virtual void SetInputRegister(
int nReg) = 0;
120 virtual void RequireRedraw(
const QRegion ®ion) = 0;
128 virtual void DrawRect(
int xPos,
int yPos,
int width,
int height,
MHRgba colour) = 0;
129 virtual void DrawVideo(
const QRect &videoRect,
const QRect &displayRect) = 0;
130 virtual void DrawBackground(
const QRegion ®) = 0;
133 virtual int GetChannelIndex(
const QString &str) = 0;
135 virtual bool GetServiceInfo(
int channelId,
int &netId,
int &origNetId,
136 int &transportId,
int &serviceId) = 0;
138 virtual bool TuneTo(
int channel,
int tuneinfo) = 0;
142 virtual bool CheckStop(
void) = 0;
145 virtual bool BeginStream(
const QString &str,
MHStream* notify =
nullptr) = 0;
147 virtual void EndStream() = 0;
149 virtual bool BeginAudio(
int tag) = 0;
151 virtual void StopAudio() = 0;
153 virtual bool BeginVideo(
int tag) = 0;
155 virtual void StopVideo() = 0;
157 virtual std::chrono::milliseconds GetStreamPos() = 0;
159 virtual std::chrono::milliseconds GetStreamMaxPos() = 0;
161 virtual std::chrono::milliseconds SetStreamPos(std::chrono::milliseconds) = 0;
163 virtual void StreamPlay(
bool play =
true) = 0;
166 virtual const char *GetReceiverId(
void) = 0;
167 virtual const char *GetDSMCCId(
void) = 0;
170 virtual int GetICStatus() = 0;
179 virtual void Draw(
int x,
int y) = 0;
181 virtual void SetSize(
int width,
int height) = 0;
182 virtual void SetLineSize(
int width) = 0;
183 virtual void SetLineColour(
MHRgba colour) = 0;
184 virtual void SetFillColour(
MHRgba colour) = 0;
186 virtual void Clear() = 0;
188 virtual void DrawLine(
int x1,
int y1,
int x2,
int y2) = 0;
189 virtual void DrawBorderedRectangle(
int x,
int y,
int width,
int height) = 0;
190 virtual void DrawOval(
int x,
int y,
int width,
int height) = 0;
191 virtual void DrawArcSector(
int x,
int y,
int width,
int height,
int start,
int arc,
bool isSector) = 0;
201 virtual void Draw(
int x,
int y) = 0;
202 virtual void SetSize(
int width,
int height) = 0;
203 virtual void SetFont(
int size,
bool isBold,
bool isItalic) = 0;
206 virtual QRect GetBounds(
const QString &str,
int &strLen,
int maxSize = -1) = 0;
207 virtual void Clear(
void) = 0;
208 virtual void AddText(
int x,
int y,
const QString &,
MHRgba colour) = 0;
218 virtual void Draw(
int x,
int y, QRect rect,
bool tiled,
bool bUnder) = 0;
220 virtual void CreateFromPNG(
const unsigned char *data,
int length) = 0;
221 virtual void CreateFromMPEG(
const unsigned char *data,
int length) = 0;
222 virtual void CreateFromJPEG(
const unsigned char *data,
int length) = 0;
224 virtual void ScaleImage(
int newWidth,
int newHeight) = 0;
226 virtual QSize GetSize() = 0;
227 virtual bool IsOpaque() = 0;