1
0
mirror of https://github.com/rofafor/vdr-plugin-femon.git synced 2023-10-10 13:36:53 +02:00
vdr-plugin-femon/osd.c

1118 lines
52 KiB
C
Raw Normal View History

2004-02-15 03:20:00 +01:00
/*
2015-03-07 21:32:58 +01:00
* osd.c: Frontend Status Monitor plugin for the Video Disk Recorder
2004-02-15 03:20:00 +01:00
*
* See the README file for copyright information and how to reach the author.
*
*/
2009-09-16 11:05:15 +02:00
#ifndef __STDC_FORMAT_MACROS
2011-06-15 16:50:03 +02:00
#define __STDC_FORMAT_MACROS
2009-09-16 11:05:15 +02:00
#endif
#include <ctype.h>
2009-07-08 22:14:19 +02:00
#include <math.h>
2015-03-07 21:09:18 +01:00
2015-03-07 21:32:58 +01:00
#include "config.h"
#include "iptvservice.h"
2015-03-07 21:09:18 +01:00
#include "log.h"
2015-03-07 21:32:58 +01:00
#include "receiver.h"
#include "symbol.h"
#include "tools.h"
#include "osd.h"
2004-02-15 03:20:00 +01:00
#define CHANNELINPUT_TIMEOUT 1000
#define SVDRPPLUGIN "svdrpservice"
2015-03-07 17:22:02 +01:00
#define OSDWIDTH osdWidthM // in pixels
#define OSDHEIGHT osdHeightM // in pixels
#define OSDROWHEIGHT fontM->Height() // in pixels
2014-03-16 16:04:28 +01:00
#define OSDINFOHEIGHT (OSDROWHEIGHT * 14) // in pixels (14 rows)
2017-05-04 21:47:49 +02:00
#define OSDSTATUSHEIGHT (OSDROWHEIGHT * 5) // in pixels (5 rows)
#define OSDSYMBOL(id) femonSymbols.Get(id)
#define OSDSPACING femonSymbols.GetSpacing()
#define OSDROUNDING femonSymbols.GetRounding()
2015-03-07 20:37:46 +01:00
#define IS_OSDROUNDING (FemonConfig.GetSkin() == eFemonSkinElchi)
#define IS_OSDRESOLUTION(r1, r2) (abs(r1 - r2) < 20)
2015-03-07 20:37:46 +01:00
#define OSDINFOWIN_Y(offset) (FemonConfig.GetPosition() ? (OSDHEIGHT - OSDINFOHEIGHT + offset) : offset)
2009-07-08 22:14:19 +02:00
#define OSDINFOWIN_X(col) ((col == 4) ? int(round(OSDWIDTH * 0.76)) : \
(col == 3) ? int(round(OSDWIDTH * 0.51)) : \
(col == 2) ? int(round(OSDWIDTH * 0.26)) : \
int(round(OSDWIDTH * 0.025)))
2015-03-07 20:37:46 +01:00
#define OSDSTATUSWIN_Y(offset) (FemonConfig.GetPosition() ? offset : (OSDHEIGHT - OSDSTATUSHEIGHT + offset))
2017-05-04 21:47:49 +02:00
#define OSDSTATUSWIN_X(col) ((col == 6) ? int(round(OSDWIDTH * 0.84)) : \
(col == 5) ? int(round(OSDWIDTH * 0.66)) : \
(col == 4) ? int(round(OSDWIDTH * 0.50)) : \
(col == 3) ? int(round(OSDWIDTH * 0.35)) : \
(col == 2) ? int(round(OSDWIDTH * 0.19)) : \
2009-07-08 22:14:19 +02:00
int(round(OSDWIDTH * 0.025)))
#define OSDSTATUSWIN_XSYMBOL(c,w) (c * ((OSDWIDTH - (5 * w)) / 6) + ((c - 1) * w))
#define OSDBARWIDTH(x) (OSDWIDTH * x / 100)
2004-02-15 03:20:00 +01:00
#define OSDDRAWSTATUSBM(spacing) \
if (bm) { \
x -= bm->Width() + spacing; \
y = (OSDROWHEIGHT - bm->Height()) / 2; \
if (y < 0) y = 0; \
2015-03-07 20:37:46 +01:00
osdM->DrawBitmap(x, OSDSTATUSWIN_Y(offset) + y, *bm, FemonTheme[FemonConfig.GetTheme()].clrTitleText, FemonTheme[FemonConfig.GetTheme()].clrTitleBackground); \
}
#define OSDDRAWSTATUSFRONTEND(column, bitmap, status) \
2015-03-07 20:37:46 +01:00
osdM->DrawBitmap(OSDSTATUSWIN_XSYMBOL(column, x), OSDSTATUSWIN_Y(offset) + y, bitmap, (frontendStatusM & status) ? FemonTheme[FemonConfig.GetTheme()].clrActiveText : FemonTheme[FemonConfig.GetTheme()].clrRed, FemonTheme[FemonConfig.GetTheme()].clrBackground)
2017-05-04 21:47:49 +02:00
#define OSDDRAWSTATUSVALUES(label1, label2, label3, label4, label5, label6) \
2015-03-07 20:37:46 +01:00
osdM->DrawText(OSDSTATUSWIN_X(1), OSDSTATUSWIN_Y(offset), label1, FemonTheme[FemonConfig.GetTheme()].clrInactiveText, FemonTheme[FemonConfig.GetTheme()].clrBackground, fontM); \
osdM->DrawText(OSDSTATUSWIN_X(2), OSDSTATUSWIN_Y(offset), label2, FemonTheme[FemonConfig.GetTheme()].clrInactiveText, FemonTheme[FemonConfig.GetTheme()].clrBackground, fontM); \
osdM->DrawText(OSDSTATUSWIN_X(3), OSDSTATUSWIN_Y(offset), label3, FemonTheme[FemonConfig.GetTheme()].clrInactiveText, FemonTheme[FemonConfig.GetTheme()].clrBackground, fontM); \
osdM->DrawText(OSDSTATUSWIN_X(4), OSDSTATUSWIN_Y(offset), label4, FemonTheme[FemonConfig.GetTheme()].clrInactiveText, FemonTheme[FemonConfig.GetTheme()].clrBackground, fontM); \
osdM->DrawText(OSDSTATUSWIN_X(5), OSDSTATUSWIN_Y(offset), label5, FemonTheme[FemonConfig.GetTheme()].clrInactiveText, FemonTheme[FemonConfig.GetTheme()].clrBackground, fontM); \
2017-05-04 21:47:49 +02:00
osdM->DrawText(OSDSTATUSWIN_X(6), OSDSTATUSWIN_Y(offset), label6, FemonTheme[FemonConfig.GetTheme()].clrInactiveText, FemonTheme[FemonConfig.GetTheme()].clrBackground, fontM)
#define OSDDRAWSTATUSBAR(value) \
if (value > 0) { \
int barvalue = OSDBARWIDTH(value); \
2015-03-07 20:37:46 +01:00
osdM->DrawRectangle(0, OSDSTATUSWIN_Y(offset) + 3, min(OSDBARWIDTH(FemonConfig.GetRedLimit()), barvalue), OSDSTATUSWIN_Y(offset) + OSDROWHEIGHT - 3, FemonTheme[FemonConfig.GetTheme()].clrRed); \
if (barvalue > OSDBARWIDTH(FemonConfig.GetRedLimit())) \
osdM->DrawRectangle(OSDBARWIDTH(FemonConfig.GetRedLimit()), OSDSTATUSWIN_Y(offset) + 3, min((OSDWIDTH * FemonConfig.GetGreenLimit() / 100), barvalue), OSDSTATUSWIN_Y(offset) + OSDROWHEIGHT - 3, FemonTheme[FemonConfig.GetTheme()].clrYellow); \
if (barvalue > OSDBARWIDTH(FemonConfig.GetGreenLimit())) \
osdM->DrawRectangle(OSDBARWIDTH(FemonConfig.GetGreenLimit()), OSDSTATUSWIN_Y(offset) + 3, barvalue, OSDSTATUSWIN_Y(offset) + OSDROWHEIGHT - 3, FemonTheme[FemonConfig.GetTheme()].clrGreen); \
}
#define OSDDRAWSTATUSTITLEBAR(title) \
2015-03-07 20:37:46 +01:00
osdM->DrawRectangle(0, OSDSTATUSWIN_Y(offset), OSDWIDTH, OSDSTATUSWIN_Y(offset) + OSDROWHEIGHT - 1, FemonTheme[FemonConfig.GetTheme()].clrTitleBackground); \
osdM->DrawText(OSDSTATUSWIN_X(1), OSDSTATUSWIN_Y(offset), title, FemonTheme[FemonConfig.GetTheme()].clrTitleText, FemonTheme[FemonConfig.GetTheme()].clrTitleBackground, fontM); \
2008-11-22 22:12:39 +01:00
if (IS_OSDROUNDING) { \
2015-03-07 17:22:02 +01:00
osdM->DrawEllipse(0, OSDSTATUSWIN_Y(0), OSDROUNDING, OSDSTATUSWIN_Y(OSDROUNDING), clrTransparent, -2); \
osdM->DrawEllipse(OSDWIDTH - OSDROUNDING, OSDSTATUSWIN_Y(0), OSDWIDTH, OSDSTATUSWIN_Y(OSDROUNDING), clrTransparent, -1); \
2008-11-23 03:45:20 +01:00
} \
2015-03-07 20:37:46 +01:00
osdM->DrawRectangle(0, OSDSTATUSWIN_Y(offset) + OSDROWHEIGHT, OSDWIDTH, OSDSTATUSWIN_Y(offset) + OSDSTATUSHEIGHT - 1, FemonTheme[FemonConfig.GetTheme()].clrBackground)
#define OSDDRAWSTATUSBOTTOMBAR() \
2008-11-22 22:12:39 +01:00
if (IS_OSDROUNDING) { \
2015-03-07 17:22:02 +01:00
osdM->DrawEllipse(0, OSDSTATUSWIN_Y(OSDSTATUSHEIGHT) - OSDROUNDING, OSDROUNDING, OSDSTATUSWIN_Y(OSDSTATUSHEIGHT), clrTransparent, -3); \
osdM->DrawEllipse(OSDWIDTH - OSDROUNDING, OSDSTATUSWIN_Y(OSDSTATUSHEIGHT) - OSDROUNDING, OSDWIDTH, OSDSTATUSWIN_Y(OSDSTATUSHEIGHT), clrTransparent, -4); \
}
2008-11-23 03:45:20 +01:00
#define OSDCLEARSTATUS() \
2015-03-07 17:22:02 +01:00
osdM->DrawRectangle(0, OSDSTATUSWIN_Y(0), OSDWIDTH, OSDSTATUSWIN_Y(OSDSTATUSHEIGHT) - 1, clrTransparent)
2008-11-23 03:45:20 +01:00
#define OSDDRAWINFOLEFT(label, value) \
2015-03-07 20:37:46 +01:00
osdM->DrawText(OSDINFOWIN_X(1), OSDINFOWIN_Y(offset), label, FemonTheme[FemonConfig.GetTheme()].clrInactiveText, FemonTheme[FemonConfig.GetTheme()].clrBackground, fontM); \
osdM->DrawText(OSDINFOWIN_X(2), OSDINFOWIN_Y(offset), value, FemonTheme[FemonConfig.GetTheme()].clrActiveText, FemonTheme[FemonConfig.GetTheme()].clrBackground, fontM)
#define OSDDRAWINFORIGHT(label, value) \
2015-03-07 20:37:46 +01:00
osdM->DrawText(OSDINFOWIN_X(3), OSDINFOWIN_Y(offset), label, FemonTheme[FemonConfig.GetTheme()].clrInactiveText, FemonTheme[FemonConfig.GetTheme()].clrBackground, fontM); \
osdM->DrawText(OSDINFOWIN_X(4), OSDINFOWIN_Y(offset), value, FemonTheme[FemonConfig.GetTheme()].clrActiveText, FemonTheme[FemonConfig.GetTheme()].clrBackground, fontM)
#define OSDDRAWINFOACTIVE(label, value) \
2015-03-07 20:37:46 +01:00
osdM->DrawText(OSDINFOWIN_X(1), OSDINFOWIN_Y(offset), label, FemonTheme[FemonConfig.GetTheme()].clrActiveText, FemonTheme[FemonConfig.GetTheme()].clrBackground, fontM); \
osdM->DrawText(OSDINFOWIN_X(3), OSDINFOWIN_Y(offset), value, FemonTheme[FemonConfig.GetTheme()].clrActiveText, FemonTheme[FemonConfig.GetTheme()].clrBackground, fontM)
#define OSDDRAWINFOINACTIVE(label, value) \
2015-03-07 20:37:46 +01:00
osdM->DrawText(OSDINFOWIN_X(1), OSDINFOWIN_Y(offset), label, FemonTheme[FemonConfig.GetTheme()].clrInactiveText, FemonTheme[FemonConfig.GetTheme()].clrBackground, fontM); \
osdM->DrawText(OSDINFOWIN_X(3), OSDINFOWIN_Y(offset), value, FemonTheme[FemonConfig.GetTheme()].clrActiveText, FemonTheme[FemonConfig.GetTheme()].clrBackground, fontM)
#define OSDDRAWINFOLINE(label) \
2015-03-07 20:37:46 +01:00
osdM->DrawText(OSDINFOWIN_X(1), OSDINFOWIN_Y(offset), label, FemonTheme[FemonConfig.GetTheme()].clrActiveText, FemonTheme[FemonConfig.GetTheme()].clrBackground, fontM)
#define OSDDRAWINFOTITLEBAR(title) \
2015-03-07 20:37:46 +01:00
osdM->DrawRectangle(0, OSDINFOWIN_Y(offset), OSDWIDTH, OSDINFOWIN_Y(offset) + OSDROWHEIGHT - 1, FemonTheme[FemonConfig.GetTheme()].clrTitleBackground); \
osdM->DrawText(OSDINFOWIN_X(1), OSDINFOWIN_Y(offset), title, FemonTheme[FemonConfig.GetTheme()].clrTitleText, FemonTheme[FemonConfig.GetTheme()].clrTitleBackground, fontM); \
2008-11-22 22:12:39 +01:00
if (IS_OSDROUNDING) { \
2015-03-07 17:22:02 +01:00
osdM->DrawEllipse(0, OSDINFOWIN_Y(0), OSDROUNDING, OSDINFOWIN_Y(OSDROUNDING), clrTransparent, -2); \
osdM->DrawEllipse(OSDWIDTH - OSDROUNDING, OSDINFOWIN_Y(0), OSDWIDTH, OSDINFOWIN_Y(OSDROUNDING), clrTransparent, -1); \
2008-11-23 03:45:20 +01:00
} \
2015-03-07 20:37:46 +01:00
osdM->DrawRectangle(0, OSDINFOWIN_Y(offset) + OSDROWHEIGHT, OSDWIDTH, OSDINFOWIN_Y(offset) + OSDINFOHEIGHT - 1, FemonTheme[FemonConfig.GetTheme()].clrBackground)
#define OSDDRAWINFOBOTTOMBAR() \
2008-11-22 22:12:39 +01:00
if (IS_OSDROUNDING) { \
2015-03-07 17:22:02 +01:00
osdM->DrawEllipse(0, OSDINFOWIN_Y(OSDINFOHEIGHT) - OSDROUNDING, OSDROUNDING, OSDINFOWIN_Y(OSDINFOHEIGHT), clrTransparent, -3); \
osdM->DrawEllipse((OSDWIDTH - OSDROUNDING), OSDINFOWIN_Y(OSDINFOHEIGHT) - OSDROUNDING, OSDWIDTH, OSDINFOWIN_Y(OSDINFOHEIGHT), clrTransparent, -4); \
}
#define OSDCLEARINFO() \
2015-03-07 17:22:02 +01:00
osdM->DrawRectangle(0, OSDINFOWIN_Y(0), OSDWIDTH, OSDINFOWIN_Y(OSDINFOHEIGHT) - 1, clrTransparent)
#ifndef MINFONTSIZE
#define MINFONTSIZE 10
#endif
#ifndef MAXFONTSIZE
#define MAXFONTSIZE 64
#endif
2009-06-18 11:16:11 +02:00
class cFemonDummyFont : public cFont {
public:
2017-01-05 14:39:52 +01:00
virtual int Width(void) const { return 10; }
2015-03-07 17:22:02 +01:00
virtual int Width(uint cP) const { return 10; }
virtual int Width(const char *sP) const { return 50; }
2009-06-18 11:16:11 +02:00
virtual int Height(void) const { return 20; }
2015-03-07 17:22:02 +01:00
virtual void DrawText(cBitmap *bitmapP, int xP, int yP, const char *sP, tColor colorFgP, tColor colorBgP, int widthP) const {}
virtual void DrawText(cPixmap *pixmapP, int xP, int yP, const char *sP, tColor colorFgP, tColor colorBgP, int widthP) const {}
2009-06-18 11:16:11 +02:00
};
2015-03-07 17:22:02 +01:00
cFemonOsd *cFemonOsd::pInstanceS = NULL;
2015-03-07 17:22:02 +01:00
cFemonOsd *cFemonOsd::Instance(bool createP)
{
2015-03-07 21:09:18 +01:00
debug1("%s (%d)", __PRETTY_FUNCTION__, createP);
2015-03-07 17:22:02 +01:00
if ((pInstanceS == NULL) && createP)
{
2015-03-07 17:22:02 +01:00
pInstanceS = new cFemonOsd();
}
2015-03-07 17:22:02 +01:00
return (pInstanceS);
}
cFemonOsd::cFemonOsd()
: cOsdObject(true), cThread("femon osd"),
2015-03-07 17:22:02 +01:00
osdM(NULL),
receiverM(NULL),
svdrpFrontendM(-1),
svdrpVideoBitRateM(-1),
svdrpAudioBitRateM(-1),
svdrpPluginM(NULL),
numberM(0),
oldNumberM(0),
qualityM(0),
qualityValidM(false),
strengthM(0),
strengthValidM(false),
2017-05-04 21:47:49 +02:00
cnrM(0),
cnrValidM(false),
2015-03-07 17:22:02 +01:00
signalM(0),
signalValidM(false),
berM(0),
berValidM(false),
2017-05-04 21:47:49 +02:00
perM(0),
perValidM(false),
2015-03-07 17:22:02 +01:00
frontendNameM(""),
2017-05-04 21:47:49 +02:00
frontendTypeM(""),
frontendStatusM(DTV_STAT_HAS_NONE),
2015-03-07 17:22:02 +01:00
frontendStatusValidM(false),
deviceSourceM(DEVICESOURCE_DVBAPI),
2015-03-07 20:37:46 +01:00
displayModeM(FemonConfig.GetDisplayMode()),
osdWidthM(cOsd::OsdWidth() * (100 - FemonConfig.GetDownscale()) / 100),
osdHeightM(cOsd::OsdHeight() * (100 - FemonConfig.GetDownscale()) / 100),
osdLeftM(cOsd::OsdLeft() + (cOsd::OsdWidth() * FemonConfig.GetDownscale() / 200)),
osdTopM(cOsd::OsdTop() + (cOsd::OsdHeight() * FemonConfig.GetDownscale() / 200)),
2015-03-07 17:22:02 +01:00
inputTimeM(0),
sleepM(),
mutexM()
2004-02-15 03:20:00 +01:00
{
2009-07-08 22:14:19 +02:00
int tmp;
2015-03-07 21:09:18 +01:00
debug1("%s", __PRETTY_FUNCTION__);
2015-03-07 17:22:02 +01:00
svdrpConnectionM.handle = -1;
femonSymbols.Refresh();
2015-03-07 17:22:02 +01:00
fontM = cFont::CreateFont(Setup.FontSml, constrain(Setup.FontSmlSize, MINFONTSIZE, MAXFONTSIZE));
if (!fontM || !fontM->Height()) {
fontM = new cFemonDummyFont;
2015-03-07 21:09:18 +01:00
error("%s Cannot create required font", __PRETTY_FUNCTION__);
}
tmp = 5 * OSDSYMBOL(SYMBOL_LOCK).Width() + 6 * OSDSPACING;
2009-07-08 22:14:19 +02:00
if (OSDWIDTH < tmp) {
2015-03-07 21:09:18 +01:00
error("%s OSD width (%d) smaller than required (%d).", __PRETTY_FUNCTION__, OSDWIDTH, tmp);
2009-07-08 22:14:19 +02:00
OSDWIDTH = tmp;
}
tmp = OSDINFOHEIGHT + OSDROWHEIGHT + OSDSTATUSHEIGHT;
if (OSDHEIGHT < tmp) {
2015-03-07 21:09:18 +01:00
error("%s OSD height (%d) smaller than required (%d).", __PRETTY_FUNCTION__, OSDHEIGHT, tmp);
2009-07-08 22:14:19 +02:00
OSDHEIGHT = tmp;
}
2004-02-15 03:20:00 +01:00
}
2004-02-15 03:20:00 +01:00
cFemonOsd::~cFemonOsd(void)
{
2015-03-07 21:09:18 +01:00
debug1("%s", __PRETTY_FUNCTION__);
2015-03-07 17:22:02 +01:00
sleepM.Signal();
if (Running())
Cancel(3);
2015-03-07 17:22:02 +01:00
if (svdrpConnectionM.handle >= 0) {
svdrpPluginM = cPluginManager::GetPlugin(SVDRPPLUGIN);
if (svdrpPluginM)
svdrpPluginM->Service("SvdrpConnection-v1.0", &svdrpConnectionM);
}
2015-03-07 17:22:02 +01:00
if (receiverM) {
receiverM->Deactivate();
DELETENULL(receiverM);
2008-11-23 21:26:48 +01:00
}
2015-03-07 17:22:02 +01:00
if (osdM)
DELETENULL(osdM);
if (fontM)
DELETENULL(fontM);
pInstanceS = NULL;
2004-02-15 03:20:00 +01:00
}
void cFemonOsd::DrawStatusWindow(void)
2004-02-15 03:20:00 +01:00
{
2015-03-07 17:22:02 +01:00
cMutexLock lock(&mutexM);
2015-09-19 16:01:01 +02:00
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByNumber(cDevice::CurrentChannel());
2004-02-15 03:20:00 +01:00
2015-03-07 17:22:02 +01:00
if (osdM && channel) {
2011-06-15 16:50:03 +02:00
cBitmap *bm = NULL;
int offset = 0;
int x = OSDWIDTH - OSDROUNDING;
int y = 0;
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
2015-03-07 17:22:02 +01:00
OSDDRAWSTATUSTITLEBAR(*cString::sprintf("%d%s %s", numberM ? numberM : channel->Number(), numberM ? "-" : "", channel->ShortName(true)));
if (svdrpFrontendM >= 0) {
bm = &OSDSYMBOL(SYMBOL_SVDRP);
OSDDRAWSTATUSBM(OSDSPACING);
}
switch (cDevice::ActualDevice()->CardIndex()) {
case 1: bm = &OSDSYMBOL(SYMBOL_ONE); break;
case 2: bm = &OSDSYMBOL(SYMBOL_TWO); break;
case 3: bm = &OSDSYMBOL(SYMBOL_THREE); break;
case 4: bm = &OSDSYMBOL(SYMBOL_FOUR); break;
case 5: bm = &OSDSYMBOL(SYMBOL_FIVE); break;
case 6: bm = &OSDSYMBOL(SYMBOL_SIX); break;
case 7: bm = &OSDSYMBOL(SYMBOL_SEVEN); break;
case 8: bm = &OSDSYMBOL(SYMBOL_EIGHT); break;
default: bm = &OSDSYMBOL(SYMBOL_ZERO); break;
}
OSDDRAWSTATUSBM(OSDSPACING);
bm = &OSDSYMBOL(SYMBOL_DEVICE);
OSDDRAWSTATUSBM(0);
if (IS_AUDIO_TRACK(track)) {
switch (int(track - ttAudioFirst)) {
case 1: bm = &OSDSYMBOL(SYMBOL_ONE); break;
case 2: bm = &OSDSYMBOL(SYMBOL_TWO); break;
case 3: bm = &OSDSYMBOL(SYMBOL_THREE); break;
case 4: bm = &OSDSYMBOL(SYMBOL_FOUR); break;
case 5: bm = &OSDSYMBOL(SYMBOL_FIVE); break;
case 6: bm = &OSDSYMBOL(SYMBOL_SIX); break;
case 7: bm = &OSDSYMBOL(SYMBOL_SEVEN); break;
case 8: bm = &OSDSYMBOL(SYMBOL_EIGHT); break;
default: bm = &OSDSYMBOL(SYMBOL_ZERO); break;
}
OSDDRAWSTATUSBM(OSDSPACING);
switch (cDevice::PrimaryDevice()->GetAudioChannel()) {
case 1: bm = &OSDSYMBOL(SYMBOL_MONO_LEFT); break;
case 2: bm = &OSDSYMBOL(SYMBOL_MONO_RIGHT); break;
default: bm = &OSDSYMBOL(SYMBOL_STEREO); break;
}
OSDDRAWSTATUSBM(0);
}
2015-03-07 17:22:02 +01:00
else if (receiverM && receiverM->AC3Valid() && IS_DOLBY_TRACK(track)) {
if (receiverM->AC3_5_1()) bm = &OSDSYMBOL(SYMBOL_DD51);
else if (receiverM->AC3_2_0()) bm = &OSDSYMBOL(SYMBOL_DD20);
else bm = &OSDSYMBOL(SYMBOL_DD);
OSDDRAWSTATUSBM(OSDSPACING);
}
2015-03-07 17:22:02 +01:00
if (receiverM) {
2017-02-24 19:49:44 +01:00
if (IS_OSDRESOLUTION(receiverM->VideoVerticalSize(), 2160)) {
switch (receiverM->VideoScan()) {
case VIDEO_SCAN_INTERLACED: bm = &OSDSYMBOL(SYMBOL_FORMAT_2160i); break;
case VIDEO_SCAN_PROGRESSIVE: bm = &OSDSYMBOL(SYMBOL_FORMAT_2160p); break;
default: bm = &OSDSYMBOL(SYMBOL_FORMAT_2160); break;
}
}
else if (IS_OSDRESOLUTION(receiverM->VideoVerticalSize(), 1080)) {
2015-03-07 17:22:02 +01:00
switch (receiverM->VideoScan()) {
2011-11-27 01:09:27 +01:00
case VIDEO_SCAN_INTERLACED: bm = &OSDSYMBOL(SYMBOL_FORMAT_1080i); break;
case VIDEO_SCAN_PROGRESSIVE: bm = &OSDSYMBOL(SYMBOL_FORMAT_1080p); break;
default: bm = &OSDSYMBOL(SYMBOL_FORMAT_1080); break;
}
}
2015-03-07 17:22:02 +01:00
else if (IS_OSDRESOLUTION(receiverM->VideoVerticalSize(), 720)) {
switch (receiverM->VideoScan()) {
2011-11-27 01:09:27 +01:00
case VIDEO_SCAN_INTERLACED: bm = &OSDSYMBOL(SYMBOL_FORMAT_720i); break;
case VIDEO_SCAN_PROGRESSIVE: bm = &OSDSYMBOL(SYMBOL_FORMAT_720p); break;
default: bm = &OSDSYMBOL(SYMBOL_FORMAT_720); break;
}
}
2015-03-07 17:22:02 +01:00
else if (IS_OSDRESOLUTION(receiverM->VideoVerticalSize(), 576)) {
switch (receiverM->VideoScan()) {
2011-11-27 01:09:27 +01:00
case VIDEO_SCAN_INTERLACED: bm = &OSDSYMBOL(SYMBOL_FORMAT_576i); break;
case VIDEO_SCAN_PROGRESSIVE: bm = &OSDSYMBOL(SYMBOL_FORMAT_576p); break;
default: bm = &OSDSYMBOL(SYMBOL_FORMAT_576); break;
}
}
2015-03-07 17:22:02 +01:00
else if (IS_OSDRESOLUTION(receiverM->VideoVerticalSize(), 480)) {
switch (receiverM->VideoScan()) {
2011-11-27 01:09:27 +01:00
case VIDEO_SCAN_INTERLACED: bm = &OSDSYMBOL(SYMBOL_FORMAT_480i); break;
case VIDEO_SCAN_PROGRESSIVE: bm = &OSDSYMBOL(SYMBOL_FORMAT_480p); break;
default: bm = &OSDSYMBOL(SYMBOL_FORMAT_480); break;
}
}
else
bm = NULL;
OSDDRAWSTATUSBM(OSDSPACING);
2015-03-07 17:22:02 +01:00
switch (receiverM->VideoCodec()) {
case VIDEO_CODEC_MPEG2: bm = &OSDSYMBOL(SYMBOL_MPEG2); break;
case VIDEO_CODEC_H264: bm = &OSDSYMBOL(SYMBOL_H264); break;
2017-01-05 16:55:53 +01:00
case VIDEO_CODEC_H265: bm = &OSDSYMBOL(SYMBOL_H265); break;
default: bm = NULL; break;
}
OSDDRAWSTATUSBM(OSDSPACING);
2015-03-07 17:22:02 +01:00
switch (receiverM->VideoFormat()) {
case VIDEO_FORMAT_PAL: bm = &OSDSYMBOL(SYMBOL_PAL); break;
case VIDEO_FORMAT_NTSC: bm = &OSDSYMBOL(SYMBOL_NTSC); break;
default: bm = NULL; break;
}
OSDDRAWSTATUSBM(OSDSPACING);
2015-03-07 17:22:02 +01:00
switch (receiverM->VideoAspectRatio()) {
case VIDEO_ASPECT_RATIO_1_1: bm = &OSDSYMBOL(SYMBOL_AR_1_1); break;
case VIDEO_ASPECT_RATIO_4_3: bm = &OSDSYMBOL(SYMBOL_AR_4_3); break;
case VIDEO_ASPECT_RATIO_16_9: bm = &OSDSYMBOL(SYMBOL_AR_16_9); break;
case VIDEO_ASPECT_RATIO_2_21_1: bm = &OSDSYMBOL(SYMBOL_AR_2_21_1); break;
default: bm = NULL; break;
}
OSDDRAWSTATUSBM(OSDSPACING);
}
2008-11-09 13:35:12 +01:00
if (channel->Ca() > 0xFF) {
bm = &OSDSYMBOL(SYMBOL_ENCRYPTED);
2008-11-09 13:35:12 +01:00
OSDDRAWSTATUSBM(OSDSPACING);
}
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
if (strengthValidM)
OSDDRAWSTATUSBAR(strengthM);
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
if (qualityValidM)
OSDDRAWSTATUSBAR(qualityM);
offset += OSDROWHEIGHT;
2017-05-04 21:47:49 +02:00
OSDDRAWSTATUSVALUES(signalValidM ? *cString::sprintf("STR: %.2f dBm", signalM) : "STR: ---",
cnrValidM ? *cString::sprintf("CNR: %.2f dB", cnrM) : "CNR: ---",
berValidM ? *cString::sprintf("BER: %.0f", berM) : "BER: ---",
perValidM ? *cString::sprintf("PER: %.0f", perM) : "PER: ---",
*cString::sprintf("%s: %s", tr("Video"), *getBitrateMbits(receiverM ? receiverM->VideoBitrate() : (svdrpFrontendM >= 0 ? svdrpVideoBitRateM : -1.0))),
*cString::sprintf("%s: %s", (receiverM && receiverM->AC3Valid() && IS_DOLBY_TRACK(track)) ? tr("AC-3") : tr("Audio"), *getBitrateKbits(receiverM ? ((receiverM->AC3Valid() && IS_DOLBY_TRACK(track)) ? receiverM->AC3Bitrate() : receiverM->AudioBitrate()) : (svdrpFrontendM >= 0 ? svdrpAudioBitRateM : -1.0)))
);
offset += OSDROWHEIGHT;
x = OSDSYMBOL(SYMBOL_LOCK).Width();
y = (OSDROWHEIGHT - OSDSYMBOL(SYMBOL_LOCK).Height()) / 2;
2015-03-07 17:22:02 +01:00
if (frontendStatusValidM) {
2017-05-04 21:47:49 +02:00
OSDDRAWSTATUSFRONTEND(1, OSDSYMBOL(SYMBOL_LOCK), DTV_STAT_HAS_LOCK);
OSDDRAWSTATUSFRONTEND(2, OSDSYMBOL(SYMBOL_SIGNAL), DTV_STAT_HAS_SIGNAL);
OSDDRAWSTATUSFRONTEND(3, OSDSYMBOL(SYMBOL_CARRIER), DTV_STAT_HAS_CARRIER);
OSDDRAWSTATUSFRONTEND(4, OSDSYMBOL(SYMBOL_VITERBI), DTV_STAT_HAS_VITERBI);
OSDDRAWSTATUSFRONTEND(5, OSDSYMBOL(SYMBOL_SYNC), DTV_STAT_HAS_SYNC);
}
OSDDRAWSTATUSBOTTOMBAR();
2015-03-07 17:22:02 +01:00
osdM->Flush();
}
}
void cFemonOsd::DrawInfoWindow(void)
{
2015-03-07 17:22:02 +01:00
cMutexLock lock(&mutexM);
2015-09-19 16:01:01 +02:00
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByNumber(cDevice::CurrentChannel());
2015-03-07 17:22:02 +01:00
if (osdM && channel) {
2011-06-15 16:50:03 +02:00
int offset = 0;
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
2015-03-07 17:22:02 +01:00
switch (displayModeM) {
case eFemonModeTransponder:
OSDDRAWINFOTITLEBAR(tr("Transponder Information"));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("Vpid"), *cString::sprintf("%d", channel->Vpid()));
OSDDRAWINFORIGHT(trVDR("Ppid"), *cString::sprintf("%d", channel->Ppid()));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( tr("Apid"), *getApids(channel));
OSDDRAWINFORIGHT( tr("Dpid"), *getDpids(channel));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( tr("Spid"), *getSpids(channel));
OSDDRAWINFORIGHT(trVDR("Tpid"), *cString::sprintf("%d", channel->Tpid()));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("Sid"), *cString::sprintf("%d", channel->Sid()));
OSDDRAWINFORIGHT( tr("Nid"), *cString::sprintf("%d", channel->Nid()));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( tr("Tid"), *cString::sprintf("%d", channel->Tid()));
OSDDRAWINFORIGHT( tr("Rid"), *cString::sprintf("%d", channel->Rid()));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("CA"), *getCAids(channel));
offset += OSDROWHEIGHT;
switch (channel->Source() & cSource::st_Mask) {
case cSource::stSat: {
cDvbTransponderParameters dtp(channel->Parameters());
2015-03-07 17:22:02 +01:00
OSDDRAWINFOLINE(*cString::sprintf("%s #%d - %s", *getSatelliteSystem(dtp.System()), (svdrpFrontendM >= 0) ? svdrpFrontendM : cDevice::ActualDevice()->CardIndex(), *frontendNameM));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("Frequency"), *getFrequencyMHz(channel->Frequency()));
OSDDRAWINFORIGHT(trVDR("Source"), *cSource::ToString(channel->Source()));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("Srate"), *cString::sprintf("%d", channel->Srate()));
2010-02-28 20:42:06 +01:00
OSDDRAWINFORIGHT(trVDR("Polarization"), *cString::sprintf("%c", toupper(dtp.Polarization())));
offset += OSDROWHEIGHT;
2010-02-28 20:42:06 +01:00
OSDDRAWINFOLEFT( trVDR("Inversion"), *getInversion(dtp.Inversion()));
OSDDRAWINFORIGHT(trVDR("CoderateH"), *getCoderate(dtp.CoderateH()));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("System"), *getSatelliteSystem(dtp.System()));
if (dtp.System()) {
OSDDRAWINFORIGHT(trVDR("RollOff"), *getRollOff(dtp.RollOff()));
2014-03-16 16:04:28 +01:00
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("Pilot"), *getPilot(dtp.Pilot()));
}
}
break;
case cSource::stCable: {
cDvbTransponderParameters dtp(channel->Parameters());
2015-03-07 17:22:02 +01:00
OSDDRAWINFOLINE(*cString::sprintf("DVB-C #%d - %s", (svdrpFrontendM >= 0) ? svdrpFrontendM : cDevice::ActualDevice()->CardIndex(), *frontendNameM));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("Frequency"), *getFrequencyMHz(channel->Frequency()));
OSDDRAWINFORIGHT(trVDR("Source"), *cSource::ToString(channel->Source()));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("Srate"), *cString::sprintf("%d", channel->Srate()));
2010-02-28 20:42:06 +01:00
OSDDRAWINFORIGHT(trVDR("Modulation"), *getModulation(dtp.Modulation()));
offset += OSDROWHEIGHT;
2010-02-28 20:42:06 +01:00
OSDDRAWINFOLEFT( trVDR("Inversion"), *getInversion(dtp.Inversion()));
OSDDRAWINFORIGHT(trVDR("CoderateH"), *getCoderate(dtp.CoderateH()));
}
break;
case cSource::stTerr: {
cDvbTransponderParameters dtp(channel->Parameters());
2015-03-07 17:22:02 +01:00
OSDDRAWINFOLINE(*cString::sprintf("%s #%d - %s", *getTerrestrialSystem(dtp.System()), (svdrpFrontendM >= 0) ? svdrpFrontendM : cDevice::ActualDevice()->CardIndex(), *frontendNameM));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("Frequency"), *getFrequencyMHz(channel->Frequency()));
2010-02-28 20:42:06 +01:00
OSDDRAWINFORIGHT(trVDR("Transmission"), *getTransmission(dtp.Transmission()));
offset += OSDROWHEIGHT;
2010-02-28 20:42:06 +01:00
OSDDRAWINFOLEFT( trVDR("Bandwidth"), *getBandwidth(dtp.Bandwidth()));
OSDDRAWINFORIGHT(trVDR("Modulation"), *getModulation(dtp.Modulation()));
offset += OSDROWHEIGHT;
2010-02-28 20:42:06 +01:00
OSDDRAWINFOLEFT( trVDR("Inversion"), *getInversion(dtp.Inversion()));
OSDDRAWINFORIGHT(tr ("Coderate"), *cString::sprintf("%s (H) %s (L)", *getCoderate(dtp.CoderateH()), *getCoderate(dtp.CoderateL())));
offset += OSDROWHEIGHT;
2010-02-28 20:42:06 +01:00
OSDDRAWINFOLEFT( trVDR("Hierarchy"), *getHierarchy(dtp.Hierarchy()));
OSDDRAWINFORIGHT(trVDR("Guard"), *getGuard(dtp.Guard()));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("System"), *getTerrestrialSystem(dtp.System()));
if (dtp.System()) {
OSDDRAWINFORIGHT(trVDR("StreamId"), *cString::sprintf("%d", dtp.StreamId()));
2014-03-16 16:04:28 +01:00
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("T2SystemId"),*cString::sprintf("%d", dtp.T2SystemId()));
OSDDRAWINFORIGHT(trVDR("SISO/MISO"), *cString::sprintf("%d", dtp.SisoMiso()));
}
}
break;
case stIptv: {
2015-03-07 17:22:02 +01:00
OSDDRAWINFOLINE(*cString::sprintf("IPTV #%d - %s", (svdrpFrontendM >= 0) ? svdrpFrontendM : cDevice::ActualDevice()->CardIndex(), *frontendNameM));
2012-03-31 12:22:11 +02:00
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
if (svdrpFrontendM < 0) {
cPlugin *p;
IptvService_v1_0 data;
data.cardIndex = cDevice::ActualDevice()->CardIndex();
p = cPluginManager::CallFirstService("IptvService-v1.0", &data);
if (p) {
OSDDRAWINFOLEFT(tr("Protocol"), *data.protocol);
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT(tr("Bitrate"), *data.bitrate);
}
}
2012-03-31 12:22:11 +02:00
}
break;
default:
break;
}
OSDDRAWINFOBOTTOMBAR();
break;
case eFemonModeStream:
OSDDRAWINFOTITLEBAR(tr("Stream Information"));
offset += OSDROWHEIGHT;
OSDDRAWINFOACTIVE( tr("Video Stream"), *getVideoStream(channel->Vpid()));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Codec"), *getVideoCodec(receiverM ? receiverM->VideoCodec() : VIDEO_CODEC_INVALID));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Bitrate"), *getVideoBitrate(receiverM ? receiverM->VideoBitrate() : 0, receiverM ? receiverM->VideoStreamBitrate() : 0));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Aspect Ratio"), *getAspectRatio(receiverM ? receiverM->VideoAspectRatio() : VIDEO_ASPECT_RATIO_INVALID));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Frame Rate"), *getFrameRate(receiverM ? receiverM->VideoFrameRate() : 0));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Video Format"), *getVideoFormat(receiverM ? receiverM->VideoFormat() : VIDEO_CODEC_INVALID));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Resolution"), *getResolution(receiverM ? receiverM->VideoHorizontalSize() : 0, receiverM ? receiverM->VideoVerticalSize() : 0, receiverM ? receiverM->VideoScan() : VIDEO_SCAN_INVALID));
offset += OSDROWHEIGHT;
OSDDRAWINFOACTIVE( tr("Audio Stream"), *getAudioStream(track, channel));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Codec"), *getAudioCodec(receiverM ? receiverM->AudioCodec() : AUDIO_CODEC_INVALID));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Channel Mode"), *getAudioChannelMode(receiverM ? receiverM->AudioChannelMode() : AUDIO_CHANNEL_MODE_INVALID));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Bitrate"), *getAudioBitrate(receiverM ? receiverM->AudioBitrate() : 0, receiverM ? receiverM->AudioStreamBitrate() : 0));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Sampling Frequency"), *getAudioSamplingFreq(receiverM ? receiverM->AudioSamplingFreq() : AUDIO_SAMPLING_FREQUENCY_INVALID));
OSDDRAWINFOBOTTOMBAR();
break;
case eFemonModeAC3:
OSDDRAWINFOTITLEBAR(tr("Stream Information"));
2015-03-07 17:22:02 +01:00
if (receiverM && receiverM->AC3Valid() && IS_DOLBY_TRACK(track)) {
offset += OSDROWHEIGHT;
2008-11-22 22:12:39 +01:00
OSDDRAWINFOACTIVE( tr("AC-3 Stream"), *getAC3Stream(track, channel));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Bitrate"), *getAudioBitrate(receiverM->AC3Bitrate(), receiverM->AC3StreamBitrate()));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Sampling Frequency"), *getAudioSamplingFreq(receiverM->AC3SamplingFreq()));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Bit Stream Mode"), *getAC3BitStreamMode(receiverM->AC3BitStreamMode(), receiverM->AC3AudioCodingMode()));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Audio Coding Mode"), *getAC3AudioCodingMode(receiverM->AC3AudioCodingMode(), receiverM->AC3BitStreamMode()));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Center Mix Level"), *getAC3CenterMixLevel(receiverM->AC3CenterMixLevel()));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Surround Mix Level"), *getAC3SurroundMixLevel(receiverM->AC3SurroundMixLevel()));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Dolby Surround Mode"), *getAC3DolbySurroundMode(receiverM->AC3DolbySurroundMode()));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Low Frequency Effects"), *cString::sprintf("%s", receiverM->AC3Lfe() ? trVDR("on") : trVDR("off")));
offset += OSDROWHEIGHT;
2015-03-07 17:22:02 +01:00
OSDDRAWINFOINACTIVE(tr("Dialogue Normalization"), *getAC3DialogLevel(receiverM->AC3DialogLevel()));
}
OSDDRAWINFOBOTTOMBAR();
break;
default:
OSDCLEARINFO();
break;
}
2015-03-07 17:22:02 +01:00
osdM->Flush();
}
}
void cFemonOsd::Action(void)
{
2015-03-07 21:09:18 +01:00
debug1("%s", __PRETTY_FUNCTION__);
cTimeMs t;
SvdrpCommand_v1_0 cmd;
cmd.command = cString::sprintf("PLUG %s INFO\r\n", PLUGIN_NAME_I18N);
2005-08-15 03:20:00 +02:00
while (Running()) {
t.Set(0);
2015-03-07 17:22:02 +01:00
svdrpFrontendM = -1;
svdrpVideoBitRateM = -1.0;
svdrpAudioBitRateM = -1.0;
switch (deviceSourceM) {
case DEVICESOURCE_PVRINPUT:
2015-03-07 17:22:02 +01:00
qualityM = cDevice::ActualDevice()->SignalStrength();
qualityValidM = (qualityM >= 0);
strengthM = cDevice::ActualDevice()->SignalStrength();
strengthValidM = (strengthM >= 0);
frontendNameM = cDevice::ActualDevice()->DeviceName();
2017-05-04 21:47:49 +02:00
frontendStatusM = strengthValidM ? (DTV_STAT_HAS_SIGNAL | DTV_STAT_HAS_CARRIER | DTV_STAT_HAS_VITERBI | DTV_STAT_HAS_SYNC | DTV_STAT_HAS_LOCK) : DTV_STAT_HAS_NONE;
2015-03-07 17:22:02 +01:00
frontendStatusValidM = strengthValidM;
2017-05-04 21:47:49 +02:00
signalM = strengthM;
2015-03-07 17:22:02 +01:00
signalValidM = strengthValidM;
2017-05-04 21:47:49 +02:00
cnrM = 0;
cnrValidM = false;
2015-03-07 17:22:02 +01:00
berM = 0;
berValidM = false;
2017-05-04 21:47:49 +02:00
perM = 0;
perValidM = false;
break;
case DEVICESOURCE_IPTV:
2015-03-07 17:22:02 +01:00
qualityM = cDevice::ActualDevice()->SignalQuality();
qualityValidM = (qualityM >= 0);
strengthM = cDevice::ActualDevice()->SignalStrength();
strengthValidM = (strengthM >= 0);
frontendNameM = cDevice::ActualDevice()->DeviceName();
2017-05-04 21:47:49 +02:00
frontendStatusM = strengthValidM ? (DTV_STAT_HAS_SIGNAL | DTV_STAT_HAS_CARRIER | DTV_STAT_HAS_VITERBI | DTV_STAT_HAS_SYNC | DTV_STAT_HAS_LOCK) : DTV_STAT_HAS_NONE;
2015-03-07 17:22:02 +01:00
frontendStatusValidM = strengthValidM;
2017-05-04 21:47:49 +02:00
signalM = strengthM;
2015-03-07 17:22:02 +01:00
signalValidM = strengthValidM;
2017-05-04 21:47:49 +02:00
cnrM = qualityM;
cnrValidM = qualityValidM;
2015-03-07 17:22:02 +01:00
berM = 0;
berValidM = false;
2017-05-04 21:47:49 +02:00
perM = 0;
perValidM = false;
break;
default:
case DEVICESOURCE_DVBAPI:
2017-05-04 21:47:49 +02:00
if (svdrpConnectionM.handle >= 0) {
2015-03-07 17:22:02 +01:00
cmd.handle = svdrpConnectionM.handle;
svdrpPluginM->Service("SvdrpCommand-v1.0", &cmd);
if (cmd.responseCode == 900) {
2015-03-07 17:22:02 +01:00
strengthValidM = false;
qualityValidM = false;
frontendStatusValidM = false;
signalValidM = false;
2017-05-04 21:47:49 +02:00
cnrValidM = false;
2015-03-07 17:22:02 +01:00
berValidM = false;
2017-05-04 21:47:49 +02:00
perValidM = false;
for (cLine *line = cmd.reply.First(); line; line = cmd.reply.Next(line)) {
const char *s = line->Text();
if (!strncasecmp(s, "CARD:", 5))
2015-03-07 17:22:02 +01:00
svdrpFrontendM = (int)strtol(s + 5, NULL, 10);
else if (!strncasecmp(s, "STRG:", 5)) {
2015-03-07 17:22:02 +01:00
strengthM = (int)strtol(s + 5, NULL, 10);
strengthValidM = (strengthM >= 0);
}
else if (!strncasecmp(s, "QUAL:", 5)) {
2015-03-07 17:22:02 +01:00
qualityM = (int)strtol(s + 5, NULL, 10);
qualityValidM = (qualityM >= 0);
}
2017-05-04 21:47:49 +02:00
else if (!strncasecmp(s, "TYPE:", 5)) {
frontendTypeM = s + 5;
}
else if (!strncasecmp(s, "NAME:", 5)) {
2015-03-07 17:22:02 +01:00
frontendNameM = s + 5;
}
else if (!strncasecmp(s, "STAT:", 5)) {
2017-05-04 21:47:49 +02:00
frontendStatusM = strtol(s + 5, NULL, 16);
2015-03-07 17:22:02 +01:00
frontendStatusValidM = true;
}
else if (!strncasecmp(s, "SGNL:", 5)) {
2017-05-04 21:47:49 +02:00
signalM = atod(s + 5);
2015-03-07 17:22:02 +01:00
signalValidM = true;
}
2017-05-04 21:47:49 +02:00
else if (!strncasecmp(s, "CNRA:", 5)) {
cnrM = atod(s + 5);
cnrValidM = true;
}
else if (!strncasecmp(s, "BERA:", 5)) {
2017-05-04 21:47:49 +02:00
berM = atod(s + 5);
2015-03-07 17:22:02 +01:00
berValidM = true;
}
2017-05-04 21:47:49 +02:00
else if (!strncasecmp(s, "PERA:", 5)) {
perM = atod(s + 5);
perValidM = true;
}
else if (!strncasecmp(s, "VIBR:", 5))
2017-05-04 21:47:49 +02:00
svdrpVideoBitRateM = atod(s + 5);
else if (!strncasecmp(s, "AUBR:", 5))
2017-05-04 21:47:49 +02:00
svdrpAudioBitRateM = atod(s + 5);
}
}
2008-12-16 11:51:59 +01:00
}
2017-05-04 21:47:49 +02:00
else {
int valid;
qualityM = cDevice::ActualDevice()->SignalQuality();
qualityValidM = (qualityM >= 0);
strengthM = cDevice::ActualDevice()->SignalStrength();
strengthValidM = (strengthM >= 0);
frontendNameM = cDevice::ActualDevice()->DeviceName();
if (cDevice::ActualDevice()->SignalStats(valid, &signalM, &cnrM, NULL, &berM, &perM, &frontendStatusM)) {
frontendStatusValidM = valid & DTV_STAT_VALID_STATUS;
signalValidM = valid & DTV_STAT_VALID_STRENGTH;
cnrValidM = valid & DTV_STAT_VALID_CNR;
berValidM = valid & DTV_STAT_VALID_BERPOST;
perValidM = valid & DTV_STAT_VALID_PER;
}
else {
frontendStatusValidM = false;
signalValidM = false;
cnrValidM = false;
berValidM = false;
perValidM = false;
}
}
break;
}
DrawInfoWindow();
DrawStatusWindow();
2015-03-07 20:37:46 +01:00
sleepM.Wait(max((int)(100 * FemonConfig.GetUpdateInterval() - t.Elapsed()), 3));
2004-02-15 03:20:00 +01:00
}
}
void cFemonOsd::Show(void)
{
2015-03-07 21:09:18 +01:00
debug1("%s", __PRETTY_FUNCTION__);
2005-01-23 03:20:00 +01:00
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
2015-09-19 16:01:01 +02:00
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByNumber(cDevice::CurrentChannel());
AttachFrontend();
osdM = cOsdProvider::NewOsd(osdLeftM, osdTopM);
if (osdM) {
tArea Areas1[] = { { 0, 0, OSDWIDTH - 1, OSDHEIGHT - 1, 8 } };
if (Setup.AntiAlias && osdM->CanHandleAreas(Areas1, sizeof(Areas1) / sizeof(tArea)) == oeOk) {
osdM->SetAreas(Areas1, sizeof(Areas1) / sizeof(tArea));
}
else {
tArea Areas2[] = { { 0, OSDSTATUSWIN_Y(0), OSDWIDTH - 1, OSDSTATUSWIN_Y(0) + OSDSTATUSHEIGHT - 1, FemonTheme[FemonConfig.GetTheme()].bpp },
{ 0, OSDINFOWIN_Y(0), OSDWIDTH - 1, OSDINFOWIN_Y(0) + OSDROWHEIGHT - 1, FemonTheme[FemonConfig.GetTheme()].bpp },
{ 0, OSDINFOWIN_Y(OSDROWHEIGHT), OSDWIDTH - 1, OSDINFOWIN_Y(0) + OSDINFOHEIGHT - 1, 2 } };
osdM->SetAreas(Areas2, sizeof(Areas2) / sizeof(tArea));
}
OSDCLEARSTATUS();
OSDCLEARINFO();
osdM->Flush();
if (receiverM) {
receiverM->Deactivate();
DELETENULL(receiverM);
}
if (FemonConfig.GetAnalyzeStream() && channel) {
receiverM = new cFemonReceiver(channel, IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0, IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0);
cDevice::ActualDevice()->AttachReceiver(receiverM);
}
Start();
}
}
bool cFemonOsd::AttachFrontend(void)
{
debug1("%s", __PRETTY_FUNCTION__);
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByNumber(cDevice::CurrentChannel());
2015-03-07 17:22:02 +01:00
deviceSourceM = DEVICESOURCE_DVBAPI;
if (channel) {
2014-03-15 11:35:49 +01:00
if (channel->IsSourceType('I'))
2015-03-07 17:22:02 +01:00
deviceSourceM = DEVICESOURCE_IPTV;
else if (channel->IsSourceType('V'))
2015-03-07 17:22:02 +01:00
deviceSourceM = DEVICESOURCE_PVRINPUT;
2004-02-15 03:20:00 +01:00
}
2015-03-07 17:22:02 +01:00
if (deviceSourceM == DEVICESOURCE_DVBAPI) {
2015-02-07 16:07:02 +01:00
if (!strstr(*cDevice::ActualDevice()->DeviceType(), SATIP_DEVICE)) {
2017-05-04 21:47:49 +02:00
if (FemonConfig.GetUseSvdrp()) {
2015-02-07 16:07:02 +01:00
if (!SvdrpConnect() || !SvdrpTune())
return false;
2015-02-07 16:07:02 +01:00
}
}
}
return true;
2004-02-15 03:20:00 +01:00
}
2015-03-07 17:22:02 +01:00
void cFemonOsd::ChannelSwitch(const cDevice * deviceP, int channelNumberP, bool liveViewP)
2004-02-15 03:20:00 +01:00
{
2015-03-07 21:09:18 +01:00
debug1("%s (%d, %d, %d)", __PRETTY_FUNCTION__, deviceP->DeviceNumber(), channelNumberP, liveViewP);
2005-01-23 03:20:00 +01:00
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
2015-09-19 16:01:01 +02:00
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByNumber(cDevice::CurrentChannel());
2015-03-07 17:22:02 +01:00
if (!deviceP || !liveViewP)
return;
2015-03-07 17:22:02 +01:00
if (!channelNumberP) {
if (receiverM) {
receiverM->Deactivate();
DELETENULL(receiverM);
}
return;
}
if (channel && FemonConfig.GetAnalyzeStream() && AttachFrontend()) {
if (receiverM) {
receiverM->Deactivate();
DELETENULL(receiverM);
}
receiverM = new cFemonReceiver(channel, IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0, IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0);
cDevice::ActualDevice()->AttachReceiver(receiverM);
2004-02-15 03:20:00 +01:00
}
}
2015-03-07 17:22:02 +01:00
void cFemonOsd::SetAudioTrack(int indexP, const char * const *tracksP)
{
2015-03-07 21:09:18 +01:00
debug1("%s (%d, )", __PRETTY_FUNCTION__, indexP);
2005-01-23 03:20:00 +01:00
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
2015-03-07 17:22:02 +01:00
if (receiverM) {
receiverM->Deactivate();
DELETENULL(receiverM);
2008-11-23 21:26:48 +01:00
}
2015-03-07 20:37:46 +01:00
if (FemonConfig.GetAnalyzeStream()) {
2015-09-19 16:01:01 +02:00
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByNumber(cDevice::CurrentChannel());
if (channel) {
2015-03-07 17:22:02 +01:00
receiverM = new cFemonReceiver(channel, IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0, IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0);
cDevice::ActualDevice()->AttachReceiver(receiverM);
}
}
2004-02-15 03:20:00 +01:00
}
2015-03-07 17:22:02 +01:00
bool cFemonOsd::DeviceSwitch(int directionP)
{
2015-03-07 21:09:18 +01:00
debug1("%s (%d)", __PRETTY_FUNCTION__, directionP);
int device = cDevice::ActualDevice()->DeviceNumber();
2015-03-07 17:22:02 +01:00
int direction = sgn(directionP);
if (device >= 0) {
2015-09-19 16:01:01 +02:00
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByNumber(cDevice::CurrentChannel());
if (channel) {
for (int i = 0; i < cDevice::NumDevices() - 1; i++) {
2014-01-12 00:02:03 +01:00
if (direction >= 0) {
if (++device >= cDevice::NumDevices())
device = 0;
}
else {
if (--device < 0)
device = cDevice::NumDevices() - 1;
}
2014-01-12 21:24:50 +01:00
// Collect the current priorities of all CAM slots that can decrypt the channel:
int NumCamSlots = CamSlots.Count();
int SlotPriority[NumCamSlots];
int NumUsableSlots = 0;
bool NeedsDetachAllReceivers = false;
bool InternalCamNeeded = false;
bool ValidDevice = false;
cCamSlot *s = NULL;
cDevice *d = cDevice::GetDevice(device);
if (channel->Ca() >= CA_ENCRYPTED_MIN) {
for (cCamSlot *CamSlot = CamSlots.First(); CamSlot; CamSlot = CamSlots.Next(CamSlot)) {
SlotPriority[CamSlot->Index()] = MAXPRIORITY + 1; // assumes it can't be used
if (CamSlot->ModuleStatus() == msReady) {
if (CamSlot->ProvidesCa(channel->Caids())) {
if (!ChannelCamRelations.CamChecked(channel->GetChannelID(), CamSlot->SlotNumber())) {
SlotPriority[CamSlot->Index()] = CamSlot->Priority();
NumUsableSlots++;
}
}
}
}
if (!NumUsableSlots)
InternalCamNeeded = true; // no CAM is able to decrypt this channel
}
for (int j = 0; j < NumCamSlots || !NumUsableSlots; ++j) {
if (NumUsableSlots && SlotPriority[j] > MAXPRIORITY)
continue; // there is no CAM available in this slot
bool HasInternalCam = d->HasInternalCam();
if (InternalCamNeeded && !HasInternalCam)
continue; // no CAM is able to decrypt this channel and the device uses vdr handled CAMs
if (NumUsableSlots && !HasInternalCam && !CamSlots.Get(j)->Assign(d, true))
continue; // CAM slot can't be used with this device
if (d->ProvidesChannel(channel, 0, &NeedsDetachAllReceivers)) { // this device is basically able to do the job
2015-03-07 21:09:18 +01:00
debug1("%s (%d) device=%d", __PRETTY_FUNCTION__, direction, device);
2014-01-12 21:24:50 +01:00
if (NumUsableSlots && !HasInternalCam && d->CamSlot() && d->CamSlot() != CamSlots.Get(j))
NeedsDetachAllReceivers = true; // using a different CAM slot requires detaching receivers
if (NumUsableSlots && !HasInternalCam)
s = CamSlots.Get(j);
ValidDevice = true;
break;
}
if (!NumUsableSlots)
break; // no CAM necessary, so just one loop over the devices
}
// Do the actual switch if valid device found
if (d && ValidDevice) {
2014-01-12 00:02:03 +01:00
cControl::Shutdown();
2014-01-12 21:24:50 +01:00
if (NeedsDetachAllReceivers)
d->DetachAllReceivers();
if (s) {
if (s->Device() != d) {
if (s->Device())
s->Device()->DetachAllReceivers();
if (d->CamSlot())
d->CamSlot()->Assign(NULL);
s->Assign(d);
}
}
else if (d->CamSlot() && !d->CamSlot()->IsDecrypting())
d->CamSlot()->Assign(NULL);
2015-02-08 14:34:01 +01:00
d->SwitchChannel(channel, false);
2014-01-12 21:24:50 +01:00
cControl::Launch(new cTransferControl(d, channel));
AttachFrontend();
return true;
2014-01-12 00:02:03 +01:00
}
}
}
}
return false;
}
bool cFemonOsd::SvdrpConnect(void)
{
2015-03-07 17:22:02 +01:00
if (svdrpConnectionM.handle < 0) {
svdrpPluginM = cPluginManager::GetPlugin(SVDRPPLUGIN);
if (svdrpPluginM) {
2015-03-07 20:37:46 +01:00
svdrpConnectionM.serverIp = FemonConfig.GetSvdrpIp();
svdrpConnectionM.serverPort = (unsigned short)FemonConfig.GetSvdrpPort();
2015-03-07 17:22:02 +01:00
svdrpConnectionM.shared = true;
svdrpPluginM->Service("SvdrpConnection-v1.0", &svdrpConnectionM);
if (svdrpConnectionM.handle >= 0) {
SvdrpCommand_v1_0 cmd;
2015-03-07 17:22:02 +01:00
cmd.handle = svdrpConnectionM.handle;
cmd.command = cString::sprintf("PLUG %s\r\n", PLUGIN_NAME_I18N);
2015-03-07 17:22:02 +01:00
svdrpPluginM->Service("SvdrpCommand-v1.0", &cmd);
if (cmd.responseCode != 214) {
2015-03-07 17:22:02 +01:00
svdrpPluginM->Service("SvdrpConnection-v1.0", &svdrpConnectionM); // close connection
2015-03-07 21:09:18 +01:00
error("%s Cannot find plugin '%s' on server %s", __PRETTY_FUNCTION__, PLUGIN_NAME_I18N, *svdrpConnectionM.serverIp);
}
}
else
2015-03-07 21:09:18 +01:00
error("%s Cannot connect to SVDRP server", __PRETTY_FUNCTION__);
}
else
2015-03-07 21:09:18 +01:00
error("%s Cannot find plugin '%s'", __PRETTY_FUNCTION__, SVDRPPLUGIN);
}
2015-03-07 17:22:02 +01:00
return svdrpConnectionM.handle >= 0;
}
bool cFemonOsd::SvdrpTune(void)
{
2015-03-07 17:22:02 +01:00
if (svdrpPluginM && svdrpConnectionM.handle >= 0) {
2015-09-19 16:01:01 +02:00
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByNumber(cDevice::CurrentChannel());
if (channel) {
SvdrpCommand_v1_0 cmd;
2015-03-07 17:22:02 +01:00
cmd.handle = svdrpConnectionM.handle;
cmd.command = cString::sprintf("CHAN %s\r\n", *channel->GetChannelID().ToString());
2015-03-07 17:22:02 +01:00
svdrpPluginM->Service("SvdrpCommand-v1.0", &cmd);
if (cmd.responseCode == 250)
return true;
2015-03-07 21:09:18 +01:00
error("%s Cannot tune server channel", __PRETTY_FUNCTION__);
}
else
2015-03-07 21:09:18 +01:00
error("%s Invalid channel", __PRETTY_FUNCTION__);
}
else
2015-03-07 21:09:18 +01:00
error("%s Unexpected connection state", __PRETTY_FUNCTION__);
return false;
}
double cFemonOsd::GetVideoBitrate(void)
{
2015-03-07 21:09:18 +01:00
debug1("%s", __PRETTY_FUNCTION__);
double value = 0.0;
2015-03-07 17:22:02 +01:00
if (receiverM)
value = receiverM->VideoBitrate();
return (value);
}
double cFemonOsd::GetAudioBitrate(void)
{
2015-03-07 21:09:18 +01:00
debug1("%s", __PRETTY_FUNCTION__);
double value = 0.0;
2015-03-07 17:22:02 +01:00
if (receiverM)
value = receiverM->AudioBitrate();
return (value);
}
double cFemonOsd::GetDolbyBitrate(void)
{
2015-03-07 21:09:18 +01:00
debug1("%s", __PRETTY_FUNCTION__);
double value = 0.0;
2015-03-07 17:22:02 +01:00
if (receiverM)
value = receiverM->AC3Bitrate();
return (value);
}
2015-03-07 17:22:02 +01:00
eOSState cFemonOsd::ProcessKey(eKeys keyP)
2009-08-28 19:54:34 +02:00
{
2015-03-07 17:22:02 +01:00
eOSState state = cOsdObject::ProcessKey(keyP);
2004-02-15 03:20:00 +01:00
if (state == osUnknown) {
2015-03-07 17:22:02 +01:00
switch (int(keyP)) {
2004-02-15 03:20:00 +01:00
case k0:
2015-03-07 17:22:02 +01:00
if ((numberM == 0) && (oldNumberM != 0)) {
numberM = oldNumberM;
oldNumberM = cDevice::CurrentChannel();
2015-09-19 16:01:01 +02:00
LOCK_CHANNELS_READ;
Channels->SwitchTo(numberM);
2015-03-07 17:22:02 +01:00
numberM = 0;
2004-02-15 03:20:00 +01:00
return osContinue;
}
case k1 ... k9:
2015-03-07 17:22:02 +01:00
if (numberM >= 0) {
numberM = numberM * 10 + keyP - k0;
if (numberM > 0) {
DrawStatusWindow();
2015-09-19 16:01:01 +02:00
LOCK_CHANNELS_READ;
const cChannel *ch = Channels->GetByNumber(numberM);
2015-03-07 17:22:02 +01:00
inputTimeM.Set(0);
2004-02-15 03:20:00 +01:00
// Lets see if there can be any useful further input:
2015-03-07 17:22:02 +01:00
int n = ch ? numberM * 10 : 0;
2015-09-19 16:01:01 +02:00
while (ch && (ch = Channels->Next(ch)) != NULL) {
2004-02-15 03:20:00 +01:00
if (!ch->GroupSep()) {
if (n <= ch->Number() && ch->Number() <= n + 9) {
n = 0;
break;
}
if (ch->Number() > n)
n *= 10;
}
}
if (n > 0) {
// This channel is the only one that fits the input, so let's take it right away:
2015-03-07 17:22:02 +01:00
oldNumberM = cDevice::CurrentChannel();
2015-09-19 16:01:01 +02:00
Channels->SwitchTo(numberM);
2015-03-07 17:22:02 +01:00
numberM = 0;
2004-02-15 03:20:00 +01:00
}
}
}
break;
case kBack:
return osEnd;
case kGreen:
{
eTrackType types[ttMaxTrackTypes];
eTrackType CurrentAudioTrack = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
int numTracks = 0;
int oldTrack = 0;
int track = 0;
for (int i = ttAudioFirst; i <= ttDolbyLast; i++) {
const tTrackId *TrackId = cDevice::PrimaryDevice()->GetTrack(eTrackType(i));
if (TrackId && TrackId->id) {
types[numTracks] = eTrackType(i);
if (i == CurrentAudioTrack)
track = numTracks;
numTracks++;
}
}
oldTrack = track;
if (++track >= numTracks)
track = 0;
if (track != oldTrack) {
cDevice::PrimaryDevice()->SetCurrentAudioTrack(types[track]);
Setup.CurrentDolby = IS_DOLBY_TRACK(types[track]);
}
}
break;
case kYellow:
if (IS_AUDIO_TRACK(cDevice::PrimaryDevice()->GetCurrentAudioTrack())) {
int audioChannel = cDevice::PrimaryDevice()->GetAudioChannel();
int oldAudioChannel = audioChannel;
if (++audioChannel > 2)
audioChannel = 0;
if (audioChannel != oldAudioChannel) {
cDevice::PrimaryDevice()->SetAudioChannel(audioChannel);
}
}
break;
case kRight:
DeviceSwitch(1);
break;
case kLeft:
DeviceSwitch(-1);
break;
case kUp|k_Repeat:
2004-02-15 03:20:00 +01:00
case kUp:
case kDown|k_Repeat:
2004-02-15 03:20:00 +01:00
case kDown:
2015-03-07 17:22:02 +01:00
oldNumberM = cDevice::CurrentChannel();
cDevice::SwitchChannel(NORMALKEY(keyP) == kUp ? 1 : -1);
numberM = 0;
2004-02-15 03:20:00 +01:00
break;
case kNone:
2015-03-07 17:22:02 +01:00
if (numberM && (inputTimeM.Elapsed() > CHANNELINPUT_TIMEOUT)) {
2015-09-19 16:01:01 +02:00
LOCK_CHANNELS_READ;
if (Channels->GetByNumber(numberM)) {
2015-03-07 17:22:02 +01:00
oldNumberM = cDevice::CurrentChannel();
2015-09-19 16:01:01 +02:00
Channels->SwitchTo(numberM);
2015-03-07 17:22:02 +01:00
numberM = 0;
2004-02-15 03:20:00 +01:00
}
else {
2015-03-07 17:22:02 +01:00
inputTimeM.Set(0);
numberM = 0;
2004-02-15 03:20:00 +01:00
}
}
break;
case kOk:
{
// toggle between display modes
2015-09-19 16:01:01 +02:00
LOCK_CHANNELS_READ;
const cChannel *channel = Channels->GetByNumber(cDevice::CurrentChannel());
2015-03-07 17:22:02 +01:00
if (++displayModeM == eFemonModeAC3 && channel && !channel->Dpid(0)) displayModeM++;
if (displayModeM >= eFemonModeMaxNumber) displayModeM = 0;
DrawInfoWindow();
}
2004-02-15 03:20:00 +01:00
break;
default:
break;
}
state = osContinue;
}
2004-02-15 03:20:00 +01:00
return state;
}