2020-09-21 01:13:36 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2020 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 //
|
|
|
|
// (at your option) any later version. //
|
|
|
|
// //
|
|
|
|
// 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/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2020-10-11 11:04:34 +00:00
|
|
|
#ifndef SDRBASE_FEATURE_FEATURESET_H_
|
|
|
|
#define SDRBASE_FEATURE_FEATURESET_H_
|
2020-09-21 01:13:36 +00:00
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
#include <QList>
|
|
|
|
|
2020-10-05 19:32:57 +00:00
|
|
|
#include "export.h"
|
|
|
|
|
2020-09-21 01:13:36 +00:00
|
|
|
class PluginAPI;
|
|
|
|
class Feature;
|
2020-09-24 03:38:05 +00:00
|
|
|
class FeatureSetPreset;
|
2020-09-21 01:13:36 +00:00
|
|
|
class WebAPIAdapterInterface;
|
|
|
|
|
2020-10-11 11:04:34 +00:00
|
|
|
class SDRBASE_API FeatureSet
|
2020-09-21 01:13:36 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
FeatureSet(int tabIndex);
|
|
|
|
~FeatureSet();
|
|
|
|
|
|
|
|
int getNumberOfFeatures() const { return m_featureInstanceRegistrations.size(); }
|
2020-10-16 06:35:06 +00:00
|
|
|
int getIndex() const { return m_featureTabIndex; }
|
2022-03-23 04:53:12 +00:00
|
|
|
Feature *addFeature(int selectedFeatureIndex, PluginAPI *pluginAPI, WebAPIAdapterInterface *apiAdapter);
|
2020-09-21 01:13:36 +00:00
|
|
|
void removeFeatureInstance(Feature* feature);
|
|
|
|
void freeFeatures();
|
|
|
|
void deleteFeature(int featureIndex);
|
|
|
|
const Feature *getFeatureAt(int featureIndex) const;
|
|
|
|
Feature *getFeatureAt(int featureIndex);
|
2020-09-24 03:38:05 +00:00
|
|
|
void loadFeatureSetSettings(const FeatureSetPreset* preset, PluginAPI *pluginAPI, WebAPIAdapterInterface *apiAdapter);
|
|
|
|
void saveFeatureSetSettings(FeatureSetPreset* preset);
|
2020-10-10 22:22:42 +00:00
|
|
|
// slave mode
|
2020-10-16 06:35:06 +00:00
|
|
|
void addFeatureInstance(Feature *feature);
|
2020-10-10 22:22:42 +00:00
|
|
|
void removeFeatureInstanceAt(int index);
|
|
|
|
void clearFeatures();
|
2020-09-21 01:13:36 +00:00
|
|
|
|
|
|
|
private:
|
2020-10-16 06:35:06 +00:00
|
|
|
typedef QList<Feature*> FeatureInstanceRegistrations;
|
2020-09-21 01:13:36 +00:00
|
|
|
|
|
|
|
FeatureInstanceRegistrations m_featureInstanceRegistrations;
|
|
|
|
int m_featureTabIndex;
|
|
|
|
|
|
|
|
void renameFeatureInstances();
|
2020-10-16 06:35:06 +00:00
|
|
|
static bool compareFeatures(Feature *featureA, Feature *featureB);
|
2020-09-21 01:13:36 +00:00
|
|
|
};
|
|
|
|
|
2020-10-11 11:04:34 +00:00
|
|
|
#endif // SDRBASE_FEATURE_FEATURESET_H_
|