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

Compare commits

..

7 Commits

Author SHA1 Message Date
Rolf Ahrenberg
66eca7f8b5 Fixed channel switching.
Cleaned up compilation warnings.
2012-03-12 21:59:34 +02:00
Rolf Ahrenberg
905b7c0870 Updated for a new release version. 2012-03-10 23:07:03 +02:00
Rolf Ahrenberg
597425a271 Updated for vdr-1.7.26. 2012-03-10 23:05:38 +02:00
Rolf Ahrenberg
86210928b8 Updated for vdr-1.7.25. 2012-03-03 15:19:18 +02:00
Rolf Ahrenberg
c98fe8ca87 Added a GIT tag into the version string. 2012-02-26 22:54:18 +02:00
Rolf Ahrenberg
5598f7cc43 Silenced compilation warnings. 2012-02-19 18:54:19 +02:00
Rolf Ahrenberg
62f1f5f776 Updated Makefile. 2012-02-19 17:48:21 +02:00
26 changed files with 73 additions and 55 deletions

View File

@@ -432,3 +432,12 @@ VDR Plugin 'femon' Revision History
- Added initial support for PVRINPUT devices (Thanks to Winfried Köhler).
- Added initial support for IPTV devices.
2012-03-10: Version 1.7.14
- Updated for vdr-1.7.26.
2012-03-12: Version 1.7.15
- Cleaned up compilation warnings.
- Fixed channel switching.

View File

@@ -19,6 +19,7 @@ PLUGIN = femon
### The version number of this plugin (taken from the main source file):
VERSION = $(shell grep 'static const char VERSION\[\] *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
GITTAG = $(shell git describe --always 2>/dev/null)
### The C++ compiler and options:
@@ -28,9 +29,9 @@ LDFLAGS ?= -Wl,--as-needed
### The directory environment:
VDRDIR = ../../..
LIBDIR = ../../lib
TMPDIR = /tmp
VDRDIR ?= ../../..
LIBDIR ?= ../../lib
TMPDIR ?= /tmp
### Make sure that necessary options are included:
@@ -59,6 +60,10 @@ ifdef FEMON_DEBUG
DEFINES += -DDEBUG
endif
ifneq ($(strip $(GITTAG)),)
DEFINES += -DGITVERSION='"-GIT-$(GITTAG)"'
endif
.PHONY: all all-redirect
all-redirect: all

12
femon.c
View File

@@ -14,11 +14,15 @@
#include "femonservice.h"
#include "femontools.h"
#if defined(APIVERSNUM) && APIVERSNUM < 10723
#error "VDR-1.7.23 API version or greater is required!"
#if defined(APIVERSNUM) && APIVERSNUM < 10726
#error "VDR-1.7.26 API version or greater is required!"
#endif
static const char VERSION[] = "1.7.13";
#ifndef GITVERSION
#define GITVERSION ""
#endif
static const char VERSION[] = "1.7.15" GITVERSION;
static const char DESCRIPTION[] = trNOOP("DVB Signal Information Monitor (OSD)");
static const char MAINMENUENTRY[] = trNOOP("Signal Information");
@@ -196,7 +200,7 @@ cString cPluginFemon::SVDRPCommand(const char *Command, const char *Option, int
{
cDvbDevice *dev = dynamic_cast<cDvbDevice*>(cDevice::ActualDevice());
if (*Option && isnumber(Option)) {
cDvbDevice *dev2 = dynamic_cast<cDvbDevice*>(cDevice::GetDevice(strtol(Option, NULL, 10)));
cDvbDevice *dev2 = dynamic_cast<cDvbDevice*>(cDevice::GetDevice(int(strtol(Option, NULL, 10))));
if (dev2)
dev = dev2;
}

View File

@@ -10,7 +10,7 @@
#define IS_HEAAC_AUDIO(buf) (((buf)[0] == 0xFF) && (((buf)[1] & 0xF6) == 0xF0))
unsigned int cFemonAAC::s_Samplerates[16] =
int cFemonAAC::s_Samplerates[16] =
{
96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, -1, -1, -1, -1
};

View File

@@ -14,7 +14,7 @@ class cFemonAAC {
private:
cFemonAudioIf *m_AudioHandler;
static unsigned int s_Samplerates[16];
static int s_Samplerates[16];
public:
cFemonAAC(cFemonAudioIf *audiohandler);

View File

@@ -9,17 +9,17 @@
#include "femontools.h"
#include "femonac3.h"
unsigned int cFemonAC3::s_Bitrates[32] =
int cFemonAC3::s_Bitrates[32] =
{
32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
unsigned int cFemonAC3::s_Frequencies[4] =
int cFemonAC3::s_Frequencies[4] =
{
480, 441, 320, 0
};
unsigned int cFemonAC3::s_Frames[3][32] =
int cFemonAC3::s_Frames[3][32] =
{
{64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 640, 768, 896, 1024, 1152, 1280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{69, 87, 104, 121, 139, 174, 208, 243, 278, 348, 417, 487, 557, 696, 835, 975, 1114, 1253, 1393, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},

View File

@@ -14,9 +14,9 @@ class cFemonAC3 {
private:
cFemonAC3If *m_AudioHandler;
static unsigned int s_Bitrates[32];
static unsigned int s_Frequencies[4];
static unsigned int s_Frames[3][32];
static int s_Bitrates[32];
static int s_Frequencies[4];
static int s_Frames[3][32];
public:
cFemonAC3(cFemonAC3If *audiohandler);

View File

@@ -64,15 +64,15 @@ enum eFemonThemes
struct cFemonTheme
{
int bpp;
int clrBackground;
int clrTitleBackground;
int clrTitleText;
int clrActiveText;
int clrInactiveText;
int clrRed;
int clrYellow;
int clrGreen;
unsigned int bpp;
unsigned int clrBackground;
unsigned int clrTitleBackground;
unsigned int clrTitleText;
unsigned int clrActiveText;
unsigned int clrInactiveText;
unsigned int clrRed;
unsigned int clrYellow;
unsigned int clrGreen;
};
extern const cFemonTheme femonTheme[eFemonThemeMaxNumber];

View File

@@ -8,14 +8,14 @@
#include "femontools.h"
#include "femonlatm.h"
unsigned int cFemonLATM::s_Bitrates[3][16] =
int cFemonLATM::s_Bitrates[3][16] =
{
{0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, -1}, // MPEG-2 Layer I
{0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, -1}, // MPEG-2 Layer II/III
{0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, -1} // MPEG-2 Layer II/III
};
unsigned int cFemonLATM::s_Samplerates[4] =
int cFemonLATM::s_Samplerates[4] =
{
22050, 24000, 16000, -1
};

View File

@@ -14,8 +14,8 @@ class cFemonLATM {
private:
cFemonAudioIf *m_AudioHandler;
static unsigned int s_Bitrates[3][16];
static unsigned int s_Samplerates[4];
static int s_Bitrates[3][16];
static int s_Samplerates[4];
public:
cFemonLATM(cFemonAudioIf *audiohandler);

View File

@@ -10,7 +10,7 @@
#define IS_EXTENSION_START(buf) (((buf)[0] == 0x00) && ((buf)[1] == 0x00) && ((buf)[2] == 0x01) && ((buf)[3] == 0xB5))
unsigned int cFemonMPEG::s_Bitrates[2][3][16] =
int cFemonMPEG::s_Bitrates[2][3][16] =
{
{
{0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, -1}, // MPEG-2 Layer I
@@ -24,7 +24,7 @@ unsigned int cFemonMPEG::s_Bitrates[2][3][16] =
}
};
unsigned int cFemonMPEG::s_Samplerates[2][4] =
int cFemonMPEG::s_Samplerates[2][4] =
{
{22050, 24000, 16000, -1}, // MPEG-2
{44100, 48000, 32000, -1} // MPEG-1

View File

@@ -16,9 +16,9 @@ private:
cFemonVideoIf *m_VideoHandler;
cFemonAudioIf *m_AudioHandler;
static unsigned int s_Bitrates[2][3][16];
static unsigned int s_Samplerates[2][4];
static eAudioCodec s_Formats[2][4];
static int s_Bitrates[2][3][16];
static int s_Samplerates[2][4];
static eAudioCodec s_Formats[2][4];
public:
cFemonMPEG(cFemonVideoIf *videohandler, cFemonAudioIf *audiohandler);

View File

@@ -200,7 +200,7 @@ cFemonOsd::cFemonOsd()
memset(&m_FrontendInfo, 0, sizeof(m_FrontendInfo));
m_SvdrpConnection.handle = -1;
femonSymbols.Refresh();
m_Font = cFont::CreateFont(Setup.FontSml, min(max(Setup.FontSmlSize, MINFONTSIZE), MAXFONTSIZE));
m_Font = cFont::CreateFont(Setup.FontSml, constrain(Setup.FontSmlSize, MINFONTSIZE, MAXFONTSIZE));
if (!m_Font || !m_Font->Height()) {
m_Font = new cFemonDummyFont;
error("cFemonOsd::cFemonOsd() cannot create required font.");
@@ -558,7 +558,7 @@ void cFemonOsd::Action(void)
m_StrengthValid = (m_Strength >= 0);
m_FrontendStatus = (fe_status_t)(m_StrengthValid ? (FE_HAS_LOCK | FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC) : 0);
m_FrontendStatusValid = m_StrengthValid;
m_Signal = m_Strength * 0xFFFF / 100;
m_Signal = uint16_t(m_Strength * 0xFFFF / 100);
m_SignalValid = m_StrengthValid;
m_SNR = 0;
m_SNRValid = false;
@@ -574,9 +574,9 @@ void cFemonOsd::Action(void)
m_StrengthValid = (m_Strength >= 0);
m_FrontendStatus = (fe_status_t)(m_StrengthValid ? (FE_HAS_LOCK | FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC) : 0);
m_FrontendStatusValid = m_StrengthValid;
m_Signal = m_Strength * 0xFFFF / 100;
m_Signal = uint16_t(m_Strength * 0xFFFF / 100);
m_SignalValid = m_StrengthValid;
m_SNR = m_Quality * 0xFFFF / 100;
m_SNR = uint16_t(m_Quality * 0xFFFF / 100);
m_SNRValid = m_QualityValid;
m_BER = 0;
m_BERValid = false;
@@ -725,13 +725,13 @@ void cFemonOsd::Show(void)
}
}
void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber)
void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber, bool liveView)
{
debug("%s(%d,%d)\n", __PRETTY_FUNCTION__, device->DeviceNumber(), channelNumber);
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
if (!device->IsPrimaryDevice() || !channelNumber || !channel || channel->Number() != channelNumber)
if (!liveView || !channelNumber || !channel || channel->Number() != channelNumber)
return;
m_DeviceSource = DEVICESOURCE_DVBAPI;
@@ -816,13 +816,13 @@ bool cFemonOsd::DeviceSwitch(int direction)
}
if (cDevice::GetDevice(device)->ProvidesChannel(channel, 0)) {
debug("%s(%d) device(%d)\n", __PRETTY_FUNCTION__, direction, device);
cStatus::MsgChannelSwitch(cDevice::PrimaryDevice(), 0);
cStatus::MsgChannelSwitch(cDevice::PrimaryDevice(), 0, true);
cControl::Shutdown();
cDevice::GetDevice(device)->SwitchChannel(channel, true);
if (cDevice::GetDevice(device) == cDevice::PrimaryDevice())
cDevice::GetDevice(device)->ForceTransferMode();
cControl::Launch(new cTransferControl(cDevice::GetDevice(device), channel));
cStatus::MsgChannelSwitch(cDevice::PrimaryDevice(), channel->Number());
cStatus::MsgChannelSwitch(cDevice::PrimaryDevice(), channel->Number(), true);
return (true);
}
}

View File

@@ -79,7 +79,7 @@ protected:
cFemonOsd(const cFemonOsd&);
cFemonOsd& operator= (const cFemonOsd&);
virtual void Action(void);
virtual void ChannelSwitch(const cDevice * device, int channelNumber);
virtual void ChannelSwitch(const cDevice *device, int channelNumber, bool liveView);
virtual void SetAudioTrack(int Index, const char * const *Tracks);
public:

View File

@@ -77,8 +77,8 @@ public:
~cFemonSymbolCache();
void Refresh();
cBitmap& Get(eSymbols symbolP);
int GetSpacing() { return yFactorM * DEFAULT_SPACING; }
int GetRounding() { return yFactorM * DEFAULT_ROUNDING; }
int GetSpacing() { return int(yFactorM * DEFAULT_SPACING); }
int GetRounding() { return int(yFactorM * DEFAULT_ROUNDING); }
};
extern cFemonSymbolCache femonSymbols;

View File

@@ -7,7 +7,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 1.7.13\n"
"Project-Id-Version: vdr-femon 1.7.15\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2010-10-10 10:10+0300\n"
"PO-Revision-Date: 2010-10-10 10:10+0300\n"

View File

@@ -5,7 +5,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 1.7.13\n"
"Project-Id-Version: vdr-femon 1.7.15\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2010-10-10 10:10+0300\n"
"PO-Revision-Date: 2010-10-10 10:10+0300\n"

View File

@@ -5,7 +5,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 1.7.13\n"
"Project-Id-Version: vdr-femon 1.7.15\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2010-10-10 10:10+0300\n"
"PO-Revision-Date: 2010-10-10 10:10+0300\n"

View File

@@ -5,7 +5,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 1.7.13\n"
"Project-Id-Version: vdr-femon 1.7.15\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2010-10-10 10:10+0300\n"
"PO-Revision-Date: 2010-10-10 10:10+0300\n"

View File

@@ -5,7 +5,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 1.7.13\n"
"Project-Id-Version: vdr-femon 1.7.15\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2010-10-10 10:10+0300\n"
"PO-Revision-Date: 2010-10-10 10:10+0300\n"

View File

@@ -5,7 +5,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 1.7.13\n"
"Project-Id-Version: vdr-femon 1.7.15\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2010-10-10 10:10+0200\n"
"PO-Revision-Date: 2010-10-10 10:10+0200\n"

View File

@@ -6,7 +6,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 1.7.13\n"
"Project-Id-Version: vdr-femon 1.7.15\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2010-10-10 10:10+0300\n"
"PO-Revision-Date: 2010-10-10 10:10+0300\n"

View File

@@ -5,7 +5,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 1.7.13\n"
"Project-Id-Version: vdr-femon 1.7.15\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2010-10-10 10:10+0300\n"
"PO-Revision-Date: 2010-10-10 10:10+0300\n"

View File

@@ -5,7 +5,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 1.7.13\n"
"Project-Id-Version: vdr-femon 1.7.15\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2010-10-10 10:10+0300\n"
"PO-Revision-Date: 2010-10-10 10:10+0300\n"

View File

@@ -5,7 +5,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 1.7.13\n"
"Project-Id-Version: vdr-femon 1.7.15\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2010-10-10 10:10+0300\n"
"PO-Revision-Date: 2010-10-10 10:10+0300\n"

View File

@@ -5,7 +5,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: vdr-femon 1.7.13\n"
"Project-Id-Version: vdr-femon 1.7.15\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2010-10-10 10:10+0300\n"
"PO-Revision-Date: 2010-10-10 10:10+0300\n"