SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
dspengine.h
Go to the documentation of this file.
1 // Copyright (C) 2015 F4EXB //
3 // written by Edouard Griffiths //
4 // //
5 // This program is free software; you can redistribute it and/or modify //
6 // it under the terms of the GNU General Public License as published by //
7 // the Free Software Foundation as version 3 of the License, or //
8 // (at your option) any later version. //
9 // //
10 // This program is distributed in the hope that it will be useful, //
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
13 // GNU General Public License V3 for more details. //
14 // //
15 // You should have received a copy of the GNU General Public License //
16 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
18 
19 #ifndef INCLUDE_DSPENGINE_H
20 #define INCLUDE_DSPENGINE_H
21 
22 #include <QObject>
23 #include <QTimer>
24 #include <vector>
25 
27 #include "audio/audiooutput.h"
28 #include "audio/audioinput.h"
29 #include "export.h"
30 #include "ambe/ambeengine.h"
31 
35 
36 class SDRBASE_API DSPEngine : public QObject {
37  Q_OBJECT
38 public:
39  DSPEngine();
40  ~DSPEngine();
41 
42  static DSPEngine *instance();
43 
45 
46  DSPDeviceSourceEngine *addDeviceSourceEngine();
47  void removeLastDeviceSourceEngine();
48 
49  DSPDeviceSinkEngine *addDeviceSinkEngine();
50  void removeLastDeviceSinkEngine();
51 
52  DSPDeviceMIMOEngine *addDeviceMIMOEngine();
53  void removeLastDeviceMIMOEngine();
54 
55  AudioDeviceManager *getAudioDeviceManager() { return &m_audioDeviceManager; }
56  AMBEEngine *getAMBEEngine() { return &m_ambeEngine; }
57 
58  uint32_t getDeviceSourceEnginesNumber() const { return m_deviceSourceEngines.size(); }
59  DSPDeviceSourceEngine *getDeviceSourceEngineByIndex(uint deviceIndex) { return m_deviceSourceEngines[deviceIndex]; }
60  DSPDeviceSourceEngine *getDeviceSourceEngineByUID(uint uid);
61 
62  uint32_t getDeviceSinkEnginesNumber() const { return m_deviceSinkEngines.size(); }
63  DSPDeviceSinkEngine *getDeviceSinkEngineByIndex(uint deviceIndex) { return m_deviceSinkEngines[deviceIndex]; }
64  DSPDeviceSinkEngine *getDeviceSinkEngineByUID(uint uid);
65 
66  uint32_t getDeviceMIMOEnginesNumber() const { return m_deviceMIMOEngines.size(); }
67  DSPDeviceMIMOEngine *getDeviceMIMOEngineByIndex(uint deviceIndex) { return m_deviceMIMOEngines[deviceIndex]; }
68  DSPDeviceMIMOEngine *getDeviceMIMOEngineByUID(uint uid);
69 
70  // Serial DV methods:
71 
72  bool hasDVSerialSupport();
73  void setDVSerialSupport(bool support);
74  void getDVSerialNames(std::vector<std::string>& deviceNames);
75  void pushMbeFrame(
76  const unsigned char *mbeFrame,
77  int mbeRateIndex,
78  int mbeVolumeIndex,
79  unsigned char channels,
80  bool useHP,
81  int upsampling,
82  AudioFifo *audioFifo);
83 
84  const QTimer& getMasterTimer() const { return m_masterTimer; }
85  void setMIMOSupport(bool mimoSupport) { m_mimoSupport = mimoSupport; }
86  bool getMIMOSupport() const { return m_mimoSupport; }
87 
88 private:
89  std::vector<DSPDeviceSourceEngine*> m_deviceSourceEngines;
91  std::vector<DSPDeviceSinkEngine*> m_deviceSinkEngines;
93  std::vector<DSPDeviceMIMOEngine*> m_deviceMIMOEngines;
98  QTimer m_masterTimer;
102 };
103 
104 #endif // INCLUDE_DSPENGINE_H
uint32_t getDeviceMIMOEnginesNumber() const
Definition: dspengine.h:66
std::vector< DSPDeviceSinkEngine * > m_deviceSinkEngines
Definition: dspengine.h:91
uint m_deviceSinkEnginesUIDSequence
Definition: dspengine.h:92
int m_audioInputDeviceIndex
Definition: dspengine.h:96
DSPDeviceSourceEngine * getDeviceSourceEngineByIndex(uint deviceIndex)
Definition: dspengine.h:59
bool getMIMOSupport() const
Definition: dspengine.h:86
uint m_deviceSourceEnginesUIDSequence
Definition: dspengine.h:90
DSPDeviceMIMOEngine * getDeviceMIMOEngineByIndex(uint deviceIndex)
Definition: dspengine.h:67
unsigned int uint32_t
Definition: rtptypes_win.h:46
uint m_deviceMIMOEnginesUIDSequence
Definition: dspengine.h:94
AMBEEngine * getAMBEEngine()
Definition: dspengine.h:56
AudioDeviceManager m_audioDeviceManager
Definition: dspengine.h:95
uint32_t getDeviceSinkEnginesNumber() const
Definition: dspengine.h:62
std::vector< DSPDeviceMIMOEngine * > m_deviceMIMOEngines
Definition: dspengine.h:93
void setMIMOSupport(bool mimoSupport)
Definition: dspengine.h:85
uint32_t getDeviceSourceEnginesNumber() const
Definition: dspengine.h:58
std::vector< DSPDeviceSourceEngine * > m_deviceSourceEngines
Definition: dspengine.h:89
int m_audioOutputDeviceIndex
Definition: dspengine.h:97
AudioDeviceManager * getAudioDeviceManager()
Definition: dspengine.h:55
unsigned int getDefaultAudioSampleRate() const
Definition: dspengine.h:44
AMBEEngine m_ambeEngine
Definition: dspengine.h:101
bool m_dvSerialSupport
Definition: dspengine.h:99
static const unsigned int m_defaultAudioSampleRate
QTimer m_masterTimer
Definition: dspengine.h:98
#define SDRBASE_API
Definition: export.h:40
DSPDeviceSinkEngine * getDeviceSinkEngineByIndex(uint deviceIndex)
Definition: dspengine.h:63
bool m_mimoSupport
Definition: dspengine.h:100
const QTimer & getMasterTimer() const
Definition: dspengine.h:84