From 7d746755c1fbe3e6d4b6b82d7a353f7f04fa4860 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 24 Oct 2017 16:54:01 +0200 Subject: [PATCH] Removed main window reference from device source API --- sdrgui/device/devicesourceapi.cpp | 7 +++---- sdrgui/device/devicesourceapi.h | 4 +--- sdrgui/mainwindow.cpp | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/sdrgui/device/devicesourceapi.cpp b/sdrgui/device/devicesourceapi.cpp index f037e025f..6af3f9ac7 100644 --- a/sdrgui/device/devicesourceapi.cpp +++ b/sdrgui/device/devicesourceapi.cpp @@ -22,12 +22,11 @@ #include "plugin/plugininterface.h" #include "gui/glspectrum.h" #include "gui/channelwindow.h" -#include "mainwindow.h" #include "settings/preset.h" +#include "dsp/dspengine.h" // TODO: extract GUI dependencies in a separate object -DeviceSourceAPI::DeviceSourceAPI(MainWindow *mainWindow, - int deviceTabIndex, +DeviceSourceAPI::DeviceSourceAPI(int deviceTabIndex, DSPDeviceSourceEngine *deviceSourceEngine, GLSpectrum *glSpectrum, ChannelWindow *channelWindow) : @@ -40,7 +39,7 @@ DeviceSourceAPI::DeviceSourceAPI(MainWindow *mainWindow, m_sampleSourcePluginInstanceUI(0), m_buddySharedPtr(0), m_isBuddyLeader(false), - m_masterTimer(mainWindow->getMasterTimer()) // TODO: get master timer directly not from main window + m_masterTimer(DSPEngine::instance()->getMasterTimer()) // TODO: get master timer directly not from main window { } diff --git a/sdrgui/device/devicesourceapi.h b/sdrgui/device/devicesourceapi.h index f064de5ea..f303822d6 100644 --- a/sdrgui/device/devicesourceapi.h +++ b/sdrgui/device/devicesourceapi.h @@ -25,7 +25,6 @@ #include "util/export.h" -class MainWindow; class GLSpectrum; class ChannelWindow; class BasebandSampleSink; @@ -131,8 +130,7 @@ protected: typedef QList ChannelInstanceRegistrations; - DeviceSourceAPI(MainWindow *mainWindow, - int deviceTabIndex, + DeviceSourceAPI(int deviceTabIndex, DSPDeviceSourceEngine *deviceSourceEngine, GLSpectrum *glSpectrum, ChannelWindow *channelWindow); diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index 957485e30..1625064db 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -203,7 +203,7 @@ void MainWindow::addSourceDevice() char tabNameCStr[16]; sprintf(tabNameCStr, "R%d", deviceTabIndex); - DeviceSourceAPI *deviceSourceAPI = new DeviceSourceAPI(this, deviceTabIndex, dspDeviceSourceEngine, m_deviceUIs.back()->m_spectrum, m_deviceUIs.back()->m_channelWindow); + DeviceSourceAPI *deviceSourceAPI = new DeviceSourceAPI(deviceTabIndex, dspDeviceSourceEngine, m_deviceUIs.back()->m_spectrum, m_deviceUIs.back()->m_channelWindow); m_deviceUIs.back()->m_deviceSourceAPI = deviceSourceAPI; m_deviceUIs.back()->m_samplingDeviceControl->setDeviceAPI(deviceSourceAPI);