mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 15:58:31 +00:00
removed code for displaying bitrates in displaychannel again
This commit is contained in:
@@ -17,7 +17,6 @@ cDisplayChannelView::cDisplayChannelView(cTemplateView *tmplView) : cView(tmplVi
|
||||
lastTracDesc = "";
|
||||
lastTrackLang = "";
|
||||
InitDevices();
|
||||
InitFemonReceiver();
|
||||
DeleteOsdOnExit();
|
||||
SetFadeTime(tmplView->GetNumericParameter(ptFadeTime));
|
||||
}
|
||||
@@ -424,33 +423,6 @@ void cDisplayChannelView::ClearDevices(void) {
|
||||
ClearViewElement(veDevices);
|
||||
}
|
||||
|
||||
void cDisplayChannelView::DrawBitrates(void) {
|
||||
if (!ViewElementImplemented(veBitRate)) {
|
||||
return;
|
||||
}
|
||||
double bitrateVideo;
|
||||
double bitrateAudio;
|
||||
double bitrateDolby;
|
||||
|
||||
bool changed = GetBitrates(bitrateVideo, bitrateAudio, bitrateDolby);
|
||||
if (!changed) {
|
||||
return;
|
||||
}
|
||||
map < string, string > stringTokens;
|
||||
map < string, int > intTokens;
|
||||
stringTokens.insert(pair<string,string>("bitratevideo", *cString::sprintf("%.2f", bitrateVideo)));
|
||||
intTokens.insert(pair<string,int>("bitrateaudio", bitrateAudio));
|
||||
intTokens.insert(pair<string,int>("bitratedolby", bitrateDolby));
|
||||
intTokens.insert(pair<string,int>("isdolby", (bitrateDolby > 0) ? true : false));
|
||||
|
||||
ClearBitrates();
|
||||
DrawViewElement(veBitRate, &stringTokens, &intTokens);
|
||||
}
|
||||
|
||||
void cDisplayChannelView::ClearBitrates(void) {
|
||||
ClearViewElement(veBitRate);
|
||||
}
|
||||
|
||||
void cDisplayChannelView::DrawChannelGroups(const cChannel *Channel, cString ChannelName) {
|
||||
if (!ViewElementImplemented(veChannelGroup)) {
|
||||
return;
|
||||
|
@@ -47,8 +47,6 @@ public:
|
||||
void ClearSignalBackground(void);
|
||||
void DrawDevices(bool initial);
|
||||
void ClearDevices(void);
|
||||
void DrawBitrates(void);
|
||||
void ClearBitrates(void);
|
||||
void DrawChannelGroups(const cChannel *Channel, cString ChannelName);
|
||||
void ClearChannelGroups(void);
|
||||
void DisplayMessage(eMessageType Type, const char *Text);
|
||||
|
@@ -4,8 +4,6 @@
|
||||
|
||||
cViewHelpers::cViewHelpers(void) {
|
||||
devicesInit = false;
|
||||
femonReceiver = NULL;
|
||||
bitrateVideoLast = bitrateAudioLast = bitrateDolbyLast = 0.0;
|
||||
}
|
||||
|
||||
cViewHelpers::~cViewHelpers() {
|
||||
@@ -14,10 +12,6 @@ cViewHelpers::~cViewHelpers() {
|
||||
delete[] lastSignalQuality;
|
||||
delete[] recDevices;
|
||||
}
|
||||
if (femonReceiver) {
|
||||
femonReceiver->Deactivate();
|
||||
delete femonReceiver;
|
||||
}
|
||||
}
|
||||
|
||||
void cViewHelpers::InitDevices(void) {
|
||||
@@ -138,69 +132,3 @@ bool cViewHelpers::SetDevices(bool initial, map<string,int> *intTokens, vector<m
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void cViewHelpers::InitFemonReceiver(void) {
|
||||
const cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
|
||||
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
|
||||
if (channel) {
|
||||
femonReceiver = new cFemonReceiver(channel,
|
||||
IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0,
|
||||
IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0);
|
||||
cDevice::ActualDevice()->AttachReceiver(femonReceiver);
|
||||
}
|
||||
}
|
||||
|
||||
void cViewHelpers::ChannelSwitch(const cDevice * device, int channelNumber, bool liveView) {
|
||||
if (!femonReceiver)
|
||||
return;
|
||||
bitrateVideoLast = bitrateAudioLast = bitrateDolbyLast = 0.0;
|
||||
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
|
||||
const cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
|
||||
|
||||
if (!liveView || !channelNumber || !channel || channel->Number() != channelNumber)
|
||||
return;
|
||||
|
||||
if (femonReceiver) {
|
||||
femonReceiver->Deactivate();
|
||||
delete femonReceiver;
|
||||
femonReceiver = NULL;
|
||||
}
|
||||
if (channel) {
|
||||
femonReceiver = new cFemonReceiver(channel,
|
||||
IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0,
|
||||
IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0);
|
||||
cDevice::ActualDevice()->AttachReceiver(femonReceiver);
|
||||
}
|
||||
}
|
||||
|
||||
void cViewHelpers::SetAudioTrack(int Index, const char * const *Tracks) {
|
||||
if (!femonReceiver)
|
||||
return;
|
||||
bitrateVideoLast = bitrateAudioLast = bitrateDolbyLast = 0.0;
|
||||
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
|
||||
if (femonReceiver) {
|
||||
femonReceiver->Deactivate();
|
||||
delete femonReceiver;
|
||||
femonReceiver = NULL;
|
||||
}
|
||||
const cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
|
||||
if (channel) {
|
||||
femonReceiver = new cFemonReceiver(channel,
|
||||
IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0,
|
||||
IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0);
|
||||
cDevice::ActualDevice()->AttachReceiver(femonReceiver);
|
||||
}
|
||||
}
|
||||
|
||||
bool cViewHelpers::GetBitrates(double &bitrateVideo, double &bitrateAudio, double &bitrateDolby) {
|
||||
bitrateVideo = (int)(femonReceiver->VideoBitrate() / 1024 / 1024 * 100 + 0.5) / 100.0;
|
||||
bitrateAudio = (int)(femonReceiver->AudioBitrate() / 1024 * 100 + 0.5) / 100.0;
|
||||
bitrateDolby = (int)(femonReceiver->AC3Bitrate() / 1024 * 100 + 0.5) / 100.0;
|
||||
if (bitrateVideo != bitrateVideoLast || bitrateAudio != bitrateAudioLast || bitrateDolby != bitrateDolbyLast) {
|
||||
bitrateVideoLast = bitrateVideo;
|
||||
bitrateAudioLast = bitrateAudio;
|
||||
bitrateDolbyLast = bitrateDolby;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@@ -1,26 +1,15 @@
|
||||
#ifndef __VIEWHELPERS_H
|
||||
#define __VIEWHELPERS_H
|
||||
|
||||
#include <vdr/status.h>
|
||||
#include "../libcore/femonreceiver.h"
|
||||
|
||||
class cViewHelpers : public cStatus {
|
||||
class cViewHelpers {
|
||||
private:
|
||||
bool devicesInit;
|
||||
int* lastSignalStrength;
|
||||
int* lastSignalQuality;
|
||||
bool* recDevices;
|
||||
cFemonReceiver *femonReceiver;
|
||||
double bitrateVideoLast;
|
||||
double bitrateAudioLast;
|
||||
double bitrateDolbyLast;
|
||||
protected:
|
||||
virtual void ChannelSwitch(const cDevice *device, int channelNumber, bool liveView);
|
||||
virtual void SetAudioTrack(int Index, const char * const *Tracks);
|
||||
void InitDevices(void);
|
||||
bool SetDevices(bool initial, map<string,int> *intTokens, vector<map<string,string> > *devices);
|
||||
void InitFemonReceiver(void);
|
||||
bool GetBitrates(double &bitrateVideo, double &bitrateAudio, double &bitrateDolby);
|
||||
public:
|
||||
cViewHelpers(void);
|
||||
virtual ~cViewHelpers(void);
|
||||
|
Reference in New Issue
Block a user