mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-06-24 13:05:21 -04:00
ATV Demod: use a UI agnostic interface for the ATV screen
This commit is contained in:
parent
f2fe5753b1
commit
db57a4b1e1
@ -13,6 +13,7 @@ set(atv_HEADERS
|
||||
atvdemodgui.h
|
||||
atvdemodplugin.h
|
||||
atvscreen.h
|
||||
atvscreeninterface.h
|
||||
glshaderarray.h
|
||||
)
|
||||
|
||||
|
@ -101,7 +101,7 @@ ATVDemod::~ATVDemod()
|
||||
delete m_channelizer;
|
||||
}
|
||||
|
||||
void ATVDemod::setATVScreen(ATVScreen *objScreen)
|
||||
void ATVDemod::setATVScreen(ATVScreenInterface *objScreen)
|
||||
{
|
||||
m_registeredATVScreen = objScreen;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include "dsp/phasediscri.h"
|
||||
#include "audio/audiofifo.h"
|
||||
#include "util/message.h"
|
||||
#include "atvscreen.h"
|
||||
#include "atvscreeninterface.h"
|
||||
|
||||
class DeviceSourceAPI;
|
||||
class ThreadedBasebandSampleSink;
|
||||
@ -221,7 +221,7 @@ public:
|
||||
virtual void stop();
|
||||
virtual bool handleMessage(const Message& cmd);
|
||||
|
||||
void setATVScreen(ATVScreen *objScreen);
|
||||
void setATVScreen(ATVScreenInterface *objScreen);
|
||||
int getSampleRate();
|
||||
int getEffectiveSampleRate();
|
||||
double getMagSq() const { return m_objMagSqAverage.average(); } //!< Beware this is scaled to 2^30
|
||||
@ -396,7 +396,7 @@ private:
|
||||
SampleVector m_scopeSampleBuffer;
|
||||
|
||||
//*************** ATV PARAMETERS ***************
|
||||
ATVScreen * m_registeredATVScreen;
|
||||
ATVScreenInterface * m_registeredATVScreen;
|
||||
|
||||
//int m_intNumberSamplePerLine;
|
||||
int m_intNumberSamplePerTop;
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <QDebug>
|
||||
|
||||
ATVScreen::ATVScreen(QWidget* parent) :
|
||||
QGLWidget(parent), m_objMutex(QMutex::NonRecursive)
|
||||
QGLWidget(parent), ATVScreenInterface(), m_objMutex(QMutex::NonRecursive)
|
||||
{
|
||||
setAttribute(Qt::WA_OpaquePaintEvent);
|
||||
connect(&m_objTimer, SIGNAL(timeout()), this, SLOT(tick()));
|
||||
@ -37,7 +37,7 @@ ATVScreen::ATVScreen(QWidget* parent) :
|
||||
m_chrLastData = NULL;
|
||||
m_blnConfigChanged = false;
|
||||
m_blnDataChanged = false;
|
||||
m_blnRenderImmediate = false;
|
||||
//m_blnRenderImmediate = false;
|
||||
m_blnGLContextInitialized = false;
|
||||
|
||||
//Par défaut
|
||||
|
@ -33,28 +33,29 @@
|
||||
#include "util/export.h"
|
||||
#include "util/bitfieldindex.h"
|
||||
|
||||
#include "atvscreeninterface.h"
|
||||
|
||||
class QPainter;
|
||||
|
||||
|
||||
|
||||
class SDRANGEL_API ATVScreen: public QGLWidget
|
||||
class SDRANGEL_API ATVScreen: public QGLWidget, public ATVScreenInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
ATVScreen(QWidget* parent = NULL);
|
||||
~ATVScreen();
|
||||
virtual ~ATVScreen();
|
||||
|
||||
void resizeATVScreen(int intCols, int intRows);
|
||||
void renderImage(unsigned char * objData);
|
||||
virtual void resizeATVScreen(int intCols, int intRows);
|
||||
virtual void renderImage(unsigned char * objData);
|
||||
QRgb* getRowBuffer(int intRow);
|
||||
void resetImage();
|
||||
|
||||
bool selectRow(int intLine);
|
||||
bool setDataColor(int intCol,int intRed, int intGreen, int intBlue);
|
||||
void setRenderImmediate(bool blnRenderImmediate) { m_blnRenderImmediate = blnRenderImmediate; }
|
||||
virtual bool selectRow(int intLine);
|
||||
virtual bool setDataColor(int intCol,int intRed, int intGreen, int intBlue);
|
||||
//void setRenderImmediate(bool blnRenderImmediate) { m_blnRenderImmediate = blnRenderImmediate; }
|
||||
|
||||
void connectTimer(const QTimer& timer);
|
||||
|
||||
@ -76,7 +77,7 @@ private:
|
||||
QTimer m_objTimer;
|
||||
QMutex m_objMutex;
|
||||
bool m_blnDataChanged;
|
||||
bool m_blnRenderImmediate;
|
||||
//bool m_blnRenderImmediate;
|
||||
bool m_blnConfigChanged;
|
||||
|
||||
GLShaderArray m_objGLShaderArray;
|
||||
|
46
plugins/channelrx/demodatv/atvscreeninterface.h
Normal file
46
plugins/channelrx/demodatv/atvscreeninterface.h
Normal file
@ -0,0 +1,46 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (C) 2017 F4HKW //
|
||||
// for F4EXB / SDRAngel //
|
||||
// //
|
||||
// OpenGL interface modernization. //
|
||||
// See: http://doc.qt.io/qt-5/qopenglshaderprogram.html //
|
||||
// //
|
||||
// This program is free software; you can redistribute it and/or modify //
|
||||
// it under the terms of the GNU General Public License as published by //
|
||||
// the Free Software Foundation as version 3 of the License, or //
|
||||
// //
|
||||
// This program is distributed in the hope that it will be useful, //
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||
// GNU General Public License V3 for more details. //
|
||||
// //
|
||||
// You should have received a copy of the GNU General Public License //
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef PLUGINS_CHANNELRX_DEMODATV_ATVSCREENINTERFACE_H_
|
||||
#define PLUGINS_CHANNELRX_DEMODATV_ATVSCREENINTERFACE_H_
|
||||
|
||||
class ATVScreenInterface
|
||||
{
|
||||
public:
|
||||
ATVScreenInterface() :
|
||||
m_blnRenderImmediate(false)
|
||||
{}
|
||||
|
||||
virtual ~ATVScreenInterface() {}
|
||||
|
||||
virtual void resizeATVScreen(int intCols __attribute__((unused)), int intRows __attribute__((unused))) {}
|
||||
virtual void renderImage(unsigned char * objData __attribute__((unused))) {}
|
||||
virtual bool selectRow(int intLine __attribute__((unused))) { return false; }
|
||||
virtual bool setDataColor(int intCol __attribute__((unused)), int intRed __attribute__((unused)), int intGreen __attribute__((unused)), int intBlue __attribute__((unused))) { return false; }
|
||||
void setRenderImmediate(bool blnRenderImmediate) { m_blnRenderImmediate = blnRenderImmediate; }
|
||||
|
||||
protected:
|
||||
bool m_blnRenderImmediate;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /* PLUGINS_CHANNELRX_DEMODATV_ATVSCREENINTERFACE_H_ */
|
@ -31,14 +31,15 @@ CONFIG(macx):INCLUDEPATH += "../../../../../boost_1_64_0"
|
||||
SOURCES += atvdemod.cpp\
|
||||
atvdemodgui.cpp\
|
||||
atvdemodplugin.cpp\
|
||||
atvscreen.cpp\
|
||||
glshaderarray.cpp
|
||||
atvscreen.cpp\
|
||||
glshaderarray.cpp
|
||||
|
||||
HEADERS += atvdemod.h\
|
||||
atvdemodgui.h\
|
||||
atvdemodplugin.h\
|
||||
atvscreen.h\
|
||||
glshaderarray.h
|
||||
atvscreen.h\
|
||||
atvscreeninterface.h\
|
||||
glshaderarray.h
|
||||
|
||||
FORMS += atvdemodgui.ui
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user