diff --git a/plugins/channelrx/demodatv/CMakeLists.txt b/plugins/channelrx/demodatv/CMakeLists.txt index 7c783ecc1..7cc6a5237 100644 --- a/plugins/channelrx/demodatv/CMakeLists.txt +++ b/plugins/channelrx/demodatv/CMakeLists.txt @@ -13,6 +13,7 @@ set(atv_HEADERS atvdemodgui.h atvdemodplugin.h atvscreen.h + atvscreeninterface.h glshaderarray.h ) diff --git a/plugins/channelrx/demodatv/atvdemod.cpp b/plugins/channelrx/demodatv/atvdemod.cpp index ff84988a9..f9209bf1a 100644 --- a/plugins/channelrx/demodatv/atvdemod.cpp +++ b/plugins/channelrx/demodatv/atvdemod.cpp @@ -101,7 +101,7 @@ ATVDemod::~ATVDemod() delete m_channelizer; } -void ATVDemod::setATVScreen(ATVScreen *objScreen) +void ATVDemod::setATVScreen(ATVScreenInterface *objScreen) { m_registeredATVScreen = objScreen; } diff --git a/plugins/channelrx/demodatv/atvdemod.h b/plugins/channelrx/demodatv/atvdemod.h index c2e1d286a..7013d3e23 100644 --- a/plugins/channelrx/demodatv/atvdemod.h +++ b/plugins/channelrx/demodatv/atvdemod.h @@ -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; diff --git a/plugins/channelrx/demodatv/atvscreen.cpp b/plugins/channelrx/demodatv/atvscreen.cpp index 809398e48..95bcc0029 100644 --- a/plugins/channelrx/demodatv/atvscreen.cpp +++ b/plugins/channelrx/demodatv/atvscreen.cpp @@ -28,7 +28,7 @@ #include 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 diff --git a/plugins/channelrx/demodatv/atvscreen.h b/plugins/channelrx/demodatv/atvscreen.h index 1e1aebd04..71ff751b3 100644 --- a/plugins/channelrx/demodatv/atvscreen.h +++ b/plugins/channelrx/demodatv/atvscreen.h @@ -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; diff --git a/plugins/channelrx/demodatv/atvscreeninterface.h b/plugins/channelrx/demodatv/atvscreeninterface.h new file mode 100644 index 000000000..3a16c59aa --- /dev/null +++ b/plugins/channelrx/demodatv/atvscreeninterface.h @@ -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 . // +/////////////////////////////////////////////////////////////////////////////////// + +#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_ */ diff --git a/plugins/channelrx/demodatv/demodatv.pro b/plugins/channelrx/demodatv/demodatv.pro index a6d46d75e..5fc8131bf 100644 --- a/plugins/channelrx/demodatv/demodatv.pro +++ b/plugins/channelrx/demodatv/demodatv.pro @@ -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