2017-12-17 17:15:42 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2017 Edouard Griffiths, F4EXB //
|
|
|
|
// //
|
|
|
|
// 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 //
|
2019-04-11 08:44:23 -04:00
|
|
|
// (at your option) any later version. //
|
2017-12-17 17:15:42 -05:00
|
|
|
// //
|
|
|
|
// 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 SDRSRV_DEVICE_DEVICESET_H_
|
|
|
|
#define SDRSRV_DEVICE_DEVICESET_H_
|
|
|
|
|
|
|
|
#include <QTimer>
|
|
|
|
|
2019-05-08 16:11:53 -04:00
|
|
|
class DeviceAPI;
|
2019-05-16 12:39:13 -04:00
|
|
|
class DSPDeviceSourceEngine;
|
2017-12-17 17:15:42 -05:00
|
|
|
class DSPDeviceSinkEngine;
|
2019-05-16 12:39:13 -04:00
|
|
|
class DSPDeviceMIMOEngine;
|
2017-12-17 17:15:42 -05:00
|
|
|
class PluginAPI;
|
2019-05-09 11:27:12 -04:00
|
|
|
class ChannelAPI;
|
2017-12-17 17:15:42 -05:00
|
|
|
class Preset;
|
|
|
|
|
2018-02-27 13:26:52 -05:00
|
|
|
class DeviceSet
|
2017-12-17 17:15:42 -05:00
|
|
|
{
|
2018-02-27 13:26:52 -05:00
|
|
|
public:
|
2019-05-08 16:11:53 -04:00
|
|
|
DeviceAPI *m_deviceAPI;
|
2019-05-16 12:39:13 -04:00
|
|
|
DSPDeviceSourceEngine *m_deviceSourceEngine;
|
2017-12-17 17:15:42 -05:00
|
|
|
DSPDeviceSinkEngine *m_deviceSinkEngine;
|
2019-05-16 12:39:13 -04:00
|
|
|
DSPDeviceMIMOEngine *m_deviceMIMOEngine;
|
2017-12-17 17:15:42 -05:00
|
|
|
|
|
|
|
DeviceSet(int tabIndex);
|
|
|
|
~DeviceSet();
|
|
|
|
|
2017-12-23 16:33:30 -05:00
|
|
|
int getNumberOfRxChannels() const { return m_rxChannelInstanceRegistrations.size(); }
|
|
|
|
int getNumberOfTxChannels() const { return m_txChannelInstanceRegistrations.size(); }
|
2017-12-22 23:56:40 -05:00
|
|
|
void addRxChannel(int selectedChannelIndex, PluginAPI *pluginAPI);
|
|
|
|
void addTxChannel(int selectedChannelIndex, PluginAPI *pluginAPI);
|
2017-12-23 16:33:30 -05:00
|
|
|
void deleteRxChannel(int channelIndex);
|
|
|
|
void deleteTxChannel(int channelIndex);
|
2019-05-09 11:27:12 -04:00
|
|
|
void registerRxChannelInstance(const QString& channelName, ChannelAPI* channelAPI);
|
|
|
|
void registerTxChannelInstance(const QString& channelName, ChannelAPI* channelAPI);
|
|
|
|
void removeRxChannelInstance(ChannelAPI* channelAPI);
|
|
|
|
void removeTxChannelInstance(ChannelAPI* channelAPI);
|
2017-12-17 17:15:42 -05:00
|
|
|
void freeRxChannels();
|
|
|
|
void freeTxChannels();
|
|
|
|
void loadRxChannelSettings(const Preset* preset, PluginAPI *pluginAPI);
|
|
|
|
void saveRxChannelSettings(Preset* preset);
|
|
|
|
void loadTxChannelSettings(const Preset* preset, PluginAPI *pluginAPI);
|
|
|
|
void saveTxChannelSettings(Preset* preset);
|
|
|
|
|
|
|
|
private:
|
|
|
|
struct ChannelInstanceRegistration
|
|
|
|
{
|
|
|
|
QString m_channelName;
|
2019-05-09 11:27:12 -04:00
|
|
|
ChannelAPI *m_channelSinkAPI;
|
|
|
|
ChannelAPI *m_channelSourceAPI;
|
2017-12-17 17:15:42 -05:00
|
|
|
|
|
|
|
ChannelInstanceRegistration() :
|
|
|
|
m_channelName(),
|
2019-05-09 11:27:12 -04:00
|
|
|
m_channelSinkAPI(nullptr),
|
|
|
|
m_channelSourceAPI(nullptr)
|
2017-12-17 17:15:42 -05:00
|
|
|
{ }
|
|
|
|
|
2019-05-09 11:27:12 -04:00
|
|
|
ChannelInstanceRegistration(const QString& channelName, ChannelAPI* channelAPI);
|
2017-12-17 17:15:42 -05:00
|
|
|
|
|
|
|
bool operator<(const ChannelInstanceRegistration& other) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef QList<ChannelInstanceRegistration> ChannelInstanceRegistrations;
|
|
|
|
|
|
|
|
ChannelInstanceRegistrations m_rxChannelInstanceRegistrations;
|
|
|
|
ChannelInstanceRegistrations m_txChannelInstanceRegistrations;
|
|
|
|
int m_deviceTabIndex;
|
|
|
|
|
|
|
|
void renameRxChannelInstances();
|
|
|
|
void renameTxChannelInstances();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* SDRSRV_DEVICE_DEVICESET_H_ */
|