diff --git a/plugins/channeltx/filesource/filesource.cpp b/plugins/channeltx/filesource/filesource.cpp index 0b77e8ee7..64f466d16 100644 --- a/plugins/channeltx/filesource/filesource.cpp +++ b/plugins/channeltx/filesource/filesource.cpp @@ -323,6 +323,9 @@ void FileSource::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("gainDB")) { settings.m_gainDB = response.getFileSourceSettings()->getGainDb(); } + if (channelSettingsKeys.contains("streamIndex")) { + settings.m_streamIndex = response.getFileSourceSettings()->getStreamIndex(); + } if (channelSettingsKeys.contains("useReverseAPI")) { settings.m_useReverseAPI = response.getFileSourceSettings()->getUseReverseApi() != 0; } @@ -442,6 +445,9 @@ void FileSource::webapiReverseSendSettings(QList& channelSettingsKeys, if (channelSettingsKeys.contains("title") || force) { swgFileSourceSettings->setTitle(new QString(settings.m_title)); } + if (channelSettingsKeys.contains("streamIndex") || force) { + swgFileSourceSettings->setStreamIndex(settings.m_streamIndex); + } QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings") .arg(settings.m_reverseAPIAddress) @@ -497,4 +503,9 @@ void FileSource::propagateMessageQueueToGUI() double FileSource::getMagSq() const { return m_basebandSource->getMagSq(); +} + +uint32_t FileSource::getNumberOfDeviceStreams() const +{ + return m_deviceAPI->getNbSinkStreams(); } \ No newline at end of file diff --git a/plugins/channeltx/filesource/filesource.h b/plugins/channeltx/filesource/filesource.h index 2e6edc469..7d435c088 100644 --- a/plugins/channeltx/filesource/filesource.h +++ b/plugins/channeltx/filesource/filesource.h @@ -243,6 +243,7 @@ public: double getMagSq() const; void getMagSqLevels(double& avg, double& peak, int& nbSamples) const; void propagateMessageQueueToGUI(); + uint32_t getNumberOfDeviceStreams() const; static const QString m_channelIdURI; static const QString m_channelId; diff --git a/plugins/channeltx/filesource/filesourcegui.cpp b/plugins/channeltx/filesource/filesourcegui.cpp index f13b01d6f..52ceb1def 100644 --- a/plugins/channeltx/filesource/filesourcegui.cpp +++ b/plugins/channeltx/filesource/filesourcegui.cpp @@ -23,6 +23,7 @@ #include "device/deviceuiset.h" #include "dsp/hbfilterchainconverter.h" #include "gui/basicchannelsettingsdialog.h" +#include "gui/devicestreamselectiondialog.h" #include "util/db.h" #include "mainwindow.h" @@ -300,6 +301,7 @@ void FileSourceGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); + displayStreamIndex(); blockApplySettings(true); ui->gain->setValue(m_settings.m_gainDB); @@ -320,6 +322,15 @@ void FileSourceGUI::displayRateAndShift() m_channelMarker.setBandwidth(channelSampleRate); } +void FileSourceGUI::displayStreamIndex() +{ + if (m_deviceUISet->m_deviceMIMOEngine) { + setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); + } else { + setStreamIndicator("S"); // single channel indicator + } +} + void FileSourceGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); @@ -376,6 +387,20 @@ void FileSourceGUI::onMenuDialogCalled(const QPoint &p) applySettings(); } + else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) + { + DeviceStreamSelectionDialog dialog(this); + dialog.setNumberOfStreams(m_fileSource->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + dialog.move(p); + dialog.exec(); + + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + displayStreamIndex(); + applySettings(); + } resetContextMenuType(); } diff --git a/plugins/channeltx/filesource/filesourcegui.h b/plugins/channeltx/filesource/filesourcegui.h index 27a2c723a..e696d0456 100644 --- a/plugins/channeltx/filesource/filesourcegui.h +++ b/plugins/channeltx/filesource/filesourcegui.h @@ -92,6 +92,7 @@ private: void updateWithStreamTime(); void displaySettings(); void displayRateAndShift(); + void displayStreamIndex(); void leaveEvent(QEvent*); void enterEvent(QEvent*); diff --git a/plugins/channeltx/filesource/filesourceplugin.cpp b/plugins/channeltx/filesource/filesourceplugin.cpp index cd6b94013..12210376f 100644 --- a/plugins/channeltx/filesource/filesourceplugin.cpp +++ b/plugins/channeltx/filesource/filesourceplugin.cpp @@ -27,7 +27,7 @@ const PluginDescriptor FileSourcePlugin::m_pluginDescriptor = { QString("File channel source"), - QString("4.12.0"), + QString("4.12.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channeltx/filesource/filesourcesettings.cpp b/plugins/channeltx/filesource/filesourcesettings.cpp index 4647a51dc..3c563f4b1 100644 --- a/plugins/channeltx/filesource/filesourcesettings.cpp +++ b/plugins/channeltx/filesource/filesourcesettings.cpp @@ -38,6 +38,7 @@ void FileSourceSettings::resetToDefaults() m_rgbColor = QColor(140, 4, 4).rgb(); m_title = "File source"; m_channelMarker = nullptr; + m_streamIndex = 0; m_useReverseAPI = false; m_reverseAPIAddress = "127.0.0.1"; m_reverseAPIPort = 8888; @@ -60,6 +61,7 @@ QByteArray FileSourceSettings::serialize() const s.writeU32(10, m_reverseAPIPort); s.writeU32(11, m_reverseAPIDeviceIndex); s.writeU32(12, m_reverseAPIChannelIndex); + s.writeS32(13, m_streamIndex); return s.final(); } @@ -87,11 +89,11 @@ bool FileSourceSettings::deserialize(const QByteArray& data) d.readU32(4, &m_filterChainHash, 0); d.readS32(5, &itmp, 20); m_gainDB = itmp < -10 ? -10 : itmp > 50 ? 50 : itmp; - d.readU32(5, &m_rgbColor, QColor(140, 4, 4).rgb()); - d.readString(6, &m_title, "File source"); - d.readBool(7, &m_useReverseAPI, false); - d.readString(8, &m_reverseAPIAddress, "127.0.0.1"); - d.readU32(9, &tmp, 0); + d.readU32(6, &m_rgbColor, QColor(140, 4, 4).rgb()); + d.readString(7, &m_title, "File source"); + d.readBool(8, &m_useReverseAPI, false); + d.readString(9, &m_reverseAPIAddress, "127.0.0.1"); + d.readU32(10, &tmp, 0); if ((tmp > 1023) && (tmp < 65535)) { m_reverseAPIPort = tmp; @@ -99,10 +101,11 @@ bool FileSourceSettings::deserialize(const QByteArray& data) m_reverseAPIPort = 8888; } - d.readU32(10, &tmp, 0); - m_reverseAPIDeviceIndex = tmp > 99 ? 99 : tmp; d.readU32(11, &tmp, 0); + m_reverseAPIDeviceIndex = tmp > 99 ? 99 : tmp; + d.readU32(12, &tmp, 0); m_reverseAPIChannelIndex = tmp > 99 ? 99 : tmp; + d.readS32(13, &m_streamIndex, 0); return true; } diff --git a/plugins/channeltx/filesource/filesourcesettings.h b/plugins/channeltx/filesource/filesourcesettings.h index 9b202ee01..d604e906a 100644 --- a/plugins/channeltx/filesource/filesourcesettings.h +++ b/plugins/channeltx/filesource/filesourcesettings.h @@ -32,6 +32,7 @@ struct FileSourceSettings int m_gainDB; quint32 m_rgbColor; QString m_title; + int m_streamIndex; bool m_useReverseAPI; QString m_reverseAPIAddress; uint16_t m_reverseAPIPort; diff --git a/plugins/channeltx/localsource/localsource.cpp b/plugins/channeltx/localsource/localsource.cpp index 7f6802d2e..2e2f342da 100644 --- a/plugins/channeltx/localsource/localsource.cpp +++ b/plugins/channeltx/localsource/localsource.cpp @@ -391,6 +391,9 @@ void LocalSource::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("reverseAPIChannelIndex")) { settings.m_reverseAPIChannelIndex = response.getLocalSourceSettings()->getReverseApiChannelIndex(); } + if (channelSettingsKeys.contains("streamIndex")) { + settings.m_streamIndex = response.getLocalSourceSettings()->getStreamIndex(); + } } void LocalSource::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const LocalSourceSettings& settings) @@ -446,6 +449,9 @@ void LocalSource::webapiReverseSendSettings(QList& channelSettingsKeys, if (channelSettingsKeys.contains("filterChainHash") || force) { swgLocalSourceSettings->setFilterChainHash(settings.m_filterChainHash); } + if (channelSettingsKeys.contains("streamIndex") || force) { + swgLocalSourceSettings->setRgbColor(settings.m_streamIndex); + } QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings") .arg(settings.m_reverseAPIAddress) @@ -487,3 +493,8 @@ void LocalSource::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } + +uint32_t LocalSource::getNumberOfDeviceStreams() const +{ + return m_deviceAPI->getNbSinkStreams(); +} \ No newline at end of file diff --git a/plugins/channeltx/localsource/localsource.h b/plugins/channeltx/localsource/localsource.h index ecaeb3dba..1960234c7 100644 --- a/plugins/channeltx/localsource/localsource.h +++ b/plugins/channeltx/localsource/localsource.h @@ -127,6 +127,7 @@ public: SWGSDRangel::SWGChannelSettings& response); void getLocalDevices(std::vector& indexes); + uint32_t getNumberOfDeviceStreams() const; static const QString m_channelIdURI; static const QString m_channelId; diff --git a/plugins/channeltx/localsource/localsourcegui.cpp b/plugins/channeltx/localsource/localsourcegui.cpp index 2995c788b..32770e9fc 100644 --- a/plugins/channeltx/localsource/localsourcegui.cpp +++ b/plugins/channeltx/localsource/localsourcegui.cpp @@ -19,6 +19,7 @@ #include "device/deviceuiset.h" #include "gui/basicchannelsettingsdialog.h" +#include "gui/devicestreamselectiondialog.h" #include "dsp/hbfilterchainconverter.h" #include "mainwindow.h" @@ -179,6 +180,7 @@ void LocalSourceGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); + displayStreamIndex(); blockApplySettings(true); ui->interpolationFactor->setCurrentIndex(m_settings.m_log2Interp); @@ -197,6 +199,15 @@ void LocalSourceGUI::displayRateAndShift() m_channelMarker.setBandwidth(channelSampleRate); } +void LocalSourceGUI::displayStreamIndex() +{ + if (m_deviceUISet->m_deviceMIMOEngine) { + setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); + } else { + setStreamIndicator("S"); // single channel indicator + } +} + void LocalSourceGUI::updateLocalDevices() { std::vector localDevicesIndexes; @@ -265,6 +276,20 @@ void LocalSourceGUI::onMenuDialogCalled(const QPoint &p) applySettings(); } + else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) + { + DeviceStreamSelectionDialog dialog(this); + dialog.setNumberOfStreams(m_localSource->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + dialog.move(p); + dialog.exec(); + + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + displayStreamIndex(); + applySettings(); + } resetContextMenuType(); } diff --git a/plugins/channeltx/localsource/localsourcegui.h b/plugins/channeltx/localsource/localsourcegui.h index 804d342f7..f9ebbbe7b 100644 --- a/plugins/channeltx/localsource/localsourcegui.h +++ b/plugins/channeltx/localsource/localsourcegui.h @@ -80,6 +80,7 @@ private: void applySettings(bool force = false); void displaySettings(); void displayRateAndShift(); + void displayStreamIndex(); void updateLocalDevices(); void leaveEvent(QEvent*); diff --git a/plugins/channeltx/localsource/localsourceplugin.cpp b/plugins/channeltx/localsource/localsourceplugin.cpp index 5e2b579f0..c3bb92713 100644 --- a/plugins/channeltx/localsource/localsourceplugin.cpp +++ b/plugins/channeltx/localsource/localsourceplugin.cpp @@ -29,7 +29,7 @@ const PluginDescriptor LocalSourcePlugin::m_pluginDescriptor = { QString("Local channel source"), - QString("4.12.0"), + QString("4.12.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channeltx/localsource/localsourcesettings.cpp b/plugins/channeltx/localsource/localsourcesettings.cpp index e08419e0f..676851eaf 100644 --- a/plugins/channeltx/localsource/localsourcesettings.cpp +++ b/plugins/channeltx/localsource/localsourcesettings.cpp @@ -37,6 +37,7 @@ void LocalSourceSettings::resetToDefaults() m_filterChainHash = 0; m_channelMarker = nullptr; m_play = false; + m_streamIndex = 0; m_useReverseAPI = false; m_reverseAPIAddress = "127.0.0.1"; m_reverseAPIPort = 8888; @@ -57,6 +58,7 @@ QByteArray LocalSourceSettings::serialize() const s.writeU32(11, m_reverseAPIChannelIndex); s.writeU32(12, m_log2Interp); s.writeU32(13, m_filterChainHash); + s.writeS32(14, m_streamIndex); return s.final(); } @@ -96,6 +98,7 @@ bool LocalSourceSettings::deserialize(const QByteArray& data) d.readU32(12, &tmp, 0); m_log2Interp = tmp > 6 ? 6 : tmp; d.readU32(13, &m_filterChainHash, 0); + d.readS32(14, &m_streamIndex, 0); return true; } diff --git a/plugins/channeltx/localsource/localsourcesettings.h b/plugins/channeltx/localsource/localsourcesettings.h index f9ab4c45a..c7431c992 100644 --- a/plugins/channeltx/localsource/localsourcesettings.h +++ b/plugins/channeltx/localsource/localsourcesettings.h @@ -31,6 +31,7 @@ struct LocalSourceSettings uint32_t m_log2Interp; uint32_t m_filterChainHash; bool m_play; + int m_streamIndex; bool m_useReverseAPI; QString m_reverseAPIAddress; uint16_t m_reverseAPIPort; diff --git a/plugins/channeltx/modam/ammod.cpp b/plugins/channeltx/modam/ammod.cpp index 689019fc9..53f18beff 100644 --- a/plugins/channeltx/modam/ammod.cpp +++ b/plugins/channeltx/modam/ammod.cpp @@ -466,6 +466,9 @@ void AMMod::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("modFactor")) { settings.m_modFactor = response.getAmModSettings()->getModFactor(); } + if (channelSettingsKeys.contains("streamIndex")) { + settings.m_streamIndex = response.getAmModSettings()->getStreamIndex(); + } if (channelSettingsKeys.contains("useReverseAPI")) { settings.m_useReverseAPI = response.getAmModSettings()->getUseReverseApi() != 0; } @@ -588,6 +591,9 @@ void AMMod::webapiReverseSendSettings(QList& channelSettingsKeys, const if (channelSettingsKeys.contains("modFactor") || force) { swgAMModSettings->setModFactor(settings.m_modFactor); } + if (channelSettingsKeys.contains("streamIndex") || force) { + swgAMModSettings->setStreamIndex(settings.m_streamIndex); + } if (force) { diff --git a/plugins/channeltx/modam/ammodplugin.cpp b/plugins/channeltx/modam/ammodplugin.cpp index 94326f4ef..e7676c0aa 100644 --- a/plugins/channeltx/modam/ammodplugin.cpp +++ b/plugins/channeltx/modam/ammodplugin.cpp @@ -27,7 +27,7 @@ const PluginDescriptor AMModPlugin::m_pluginDescriptor = { QString("AM Modulator"), - QString("4.12.0"), + QString("4.12.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channeltx/modatv/atvmod.cpp b/plugins/channeltx/modatv/atvmod.cpp index 846079aca..25b9a848b 100644 --- a/plugins/channeltx/modatv/atvmod.cpp +++ b/plugins/channeltx/modatv/atvmod.cpp @@ -470,6 +470,9 @@ void ATVMod::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("title")) { settings.m_title = *response.getAtvModSettings()->getTitle(); } + if (channelSettingsKeys.contains("streamIndex")) { + settings.m_streamIndex = response.getAtvModSettings()->getStreamIndex(); + } if (channelSettingsKeys.contains("useReverseAPI")) { settings.m_useReverseAPI = response.getAtvModSettings()->getUseReverseApi() != 0; } @@ -639,6 +642,9 @@ void ATVMod::webapiReverseSendSettings(QList& channelSettingsKeys, cons if (channelSettingsKeys.contains("title") || force) { swgATVModSettings->setTitle(new QString(settings.m_title)); } + if (channelSettingsKeys.contains("streamIndex") || force) { + swgATVModSettings->setStreamIndex(settings.m_streamIndex); + } QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings") .arg(settings.m_reverseAPIAddress) diff --git a/plugins/channeltx/modatv/atvmodgui.cpp b/plugins/channeltx/modatv/atvmodgui.cpp index 87a911fe0..87daf07ba 100644 --- a/plugins/channeltx/modatv/atvmodgui.cpp +++ b/plugins/channeltx/modatv/atvmodgui.cpp @@ -30,6 +30,7 @@ #include "dsp/dspengine.h" #include "util/db.h" #include "gui/basicchannelsettingsdialog.h" +#include "gui/devicestreamselectiondialog.h" #include "mainwindow.h" #include "ui_atvmodgui.h" @@ -715,6 +716,20 @@ void ATVModGUI::onMenuDialogCalled(const QPoint &p) applySettings(); } + else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) + { + DeviceStreamSelectionDialog dialog(this); + dialog.setNumberOfStreams(m_atvMod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + dialog.move(p); + dialog.exec(); + + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + displayStreamIndex(); + applySettings(); + } resetContextMenuType(); } @@ -748,6 +763,7 @@ void ATVModGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); + displayStreamIndex(); blockApplySettings(true); @@ -796,6 +812,15 @@ void ATVModGUI::displaySettings() blockApplySettings(false); } +void ATVModGUI::displayStreamIndex() +{ + if (m_deviceUISet->m_deviceMIMOEngine) { + setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); + } else { + setStreamIndicator("S"); // single channel indicator + } +} + void ATVModGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channeltx/modatv/atvmodgui.h b/plugins/channeltx/modatv/atvmodgui.h index e47460796..da8f291b2 100644 --- a/plugins/channeltx/modatv/atvmodgui.h +++ b/plugins/channeltx/modatv/atvmodgui.h @@ -85,6 +85,7 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); + void displayStreamIndex(); void updateWithStreamData(); void updateWithStreamTime(); void setRFFiltersSlidersRange(int sampleRate); diff --git a/plugins/channeltx/modatv/atvmodplugin.cpp b/plugins/channeltx/modatv/atvmodplugin.cpp index 0f77b0fca..7ff70cf09 100644 --- a/plugins/channeltx/modatv/atvmodplugin.cpp +++ b/plugins/channeltx/modatv/atvmodplugin.cpp @@ -27,7 +27,7 @@ const PluginDescriptor ATVModPlugin::m_pluginDescriptor = { QString("ATV Modulator"), - QString("4.12.0"), + QString("4.12.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channeltx/modatv/atvmodsettings.cpp b/plugins/channeltx/modatv/atvmodsettings.cpp index 3df412973..f690254ff 100644 --- a/plugins/channeltx/modatv/atvmodsettings.cpp +++ b/plugins/channeltx/modatv/atvmodsettings.cpp @@ -51,6 +51,7 @@ void ATVModSettings::resetToDefaults() m_overlayText = "ATV"; m_rgbColor = QColor(255, 255, 255).rgb(); m_title = "ATV Modulator"; + m_streamIndex = 0; m_useReverseAPI = false; m_reverseAPIAddress = "127.0.0.1"; m_reverseAPIPort = 8888; @@ -89,6 +90,7 @@ QByteArray ATVModSettings::serialize() const s.writeU32(21, m_reverseAPIChannelIndex); s.writeString(22, m_imageFileName); s.writeString(23, m_videoFileName); + s.writeS32(24, m_streamIndex); return s.final(); } @@ -154,6 +156,7 @@ bool ATVModSettings::deserialize(const QByteArray& data) m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp; d.readString(22, &m_imageFileName); d.readString(23, &m_videoFileName); + d.readS32(24, &m_streamIndex, 0); return true; } diff --git a/plugins/channeltx/modatv/atvmodsettings.h b/plugins/channeltx/modatv/atvmodsettings.h index 29cd0b1bb..d7dc2ab08 100644 --- a/plugins/channeltx/modatv/atvmodsettings.h +++ b/plugins/channeltx/modatv/atvmodsettings.h @@ -82,6 +82,7 @@ struct ATVModSettings QString m_title; QString m_imageFileName; QString m_videoFileName; + int m_streamIndex; bool m_useReverseAPI; QString m_reverseAPIAddress; uint16_t m_reverseAPIPort; diff --git a/plugins/channeltx/modfreedv/freedvmod.cpp b/plugins/channeltx/modfreedv/freedvmod.cpp index 28018617a..d95a51f9a 100644 --- a/plugins/channeltx/modfreedv/freedvmod.cpp +++ b/plugins/channeltx/modfreedv/freedvmod.cpp @@ -428,6 +428,9 @@ void FreeDVMod::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("audioDeviceName")) { settings.m_audioDeviceName = *response.getFreeDvModSettings()->getAudioDeviceName(); } + if (channelSettingsKeys.contains("streamIndex")) { + settings.m_streamIndex = response.getFreeDvModSettings()->getStreamIndex(); + } if (channelSettingsKeys.contains("useReverseAPI")) { settings.m_useReverseAPI = response.getFreeDvModSettings()->getUseReverseApi() != 0; } @@ -554,6 +557,9 @@ void FreeDVMod::webapiReverseSendSettings(QList& channelSettingsKeys, c if (channelSettingsKeys.contains("audioDeviceName") || force) { swgFreeDVModSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName)); } + if (channelSettingsKeys.contains("streamIndex") || force) { + swgFreeDVModSettings->setStreamIndex(settings.m_streamIndex); + } if (force) { @@ -675,3 +681,8 @@ void FreeDVMod::setLevelMeter(QObject *levelMeter) { connect(m_basebandSource, SIGNAL(levelChanged(qreal, qreal, int)), levelMeter, SLOT(levelChanged(qreal, qreal, int))); } + +uint32_t FreeDVMod::getNumberOfDeviceStreams() const +{ + return m_deviceAPI->getNbSinkStreams(); +} \ No newline at end of file diff --git a/plugins/channeltx/modfreedv/freedvmod.h b/plugins/channeltx/modfreedv/freedvmod.h index 5df6108f4..8065bb2f0 100644 --- a/plugins/channeltx/modfreedv/freedvmod.h +++ b/plugins/channeltx/modfreedv/freedvmod.h @@ -262,6 +262,7 @@ public: CWKeyer *getCWKeyer(); void setLevelMeter(QObject *levelMeter); void setSpectrumSampleSink(BasebandSampleSink* sampleSink); + uint32_t getNumberOfDeviceStreams() const; static const QString m_channelIdURI; static const QString m_channelId; diff --git a/plugins/channeltx/modfreedv/freedvmodgui.cpp b/plugins/channeltx/modfreedv/freedvmodgui.cpp index d1d36c104..5ac50b3da 100644 --- a/plugins/channeltx/modfreedv/freedvmodgui.cpp +++ b/plugins/channeltx/modfreedv/freedvmodgui.cpp @@ -34,6 +34,7 @@ #include "gui/crightclickenabler.h" #include "gui/audioselectdialog.h" #include "gui/basicchannelsettingsdialog.h" +#include "gui/devicestreamselectiondialog.h" #include "mainwindow.h" #include "ui_freedvmodgui.h" @@ -331,6 +332,20 @@ void FreeDVModGUI::onMenuDialogCalled(const QPoint &p) applySettings(); } + else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) + { + DeviceStreamSelectionDialog dialog(this); + dialog.setNumberOfStreams(m_freeDVMod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + dialog.move(p); + dialog.exec(); + + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + displayStreamIndex(); + applySettings(); + } resetContextMenuType(); } @@ -467,6 +482,7 @@ void FreeDVModGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); + displayStreamIndex(); blockApplySettings(true); @@ -510,6 +526,15 @@ void FreeDVModGUI::displaySettings() blockApplySettings(false); } +void FreeDVModGUI::displayStreamIndex() +{ + if (m_deviceUISet->m_deviceMIMOEngine) { + setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); + } else { + setStreamIndicator("S"); // single channel indicator + } +} + void FreeDVModGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channeltx/modfreedv/freedvmodgui.h b/plugins/channeltx/modfreedv/freedvmodgui.h index 7b978b978..63842c2a6 100644 --- a/plugins/channeltx/modfreedv/freedvmodgui.h +++ b/plugins/channeltx/modfreedv/freedvmodgui.h @@ -88,6 +88,7 @@ private: void applyBandwidths(int spanLog2, bool force = false); void displayBandwidths(int spanLog2); void displaySettings(); + void displayStreamIndex(); void updateWithStreamData(); void updateWithStreamTime(); void channelMarkerUpdate(); diff --git a/plugins/channeltx/modfreedv/freedvmodplugin.cpp b/plugins/channeltx/modfreedv/freedvmodplugin.cpp index 38acf5490..10e5bf748 100644 --- a/plugins/channeltx/modfreedv/freedvmodplugin.cpp +++ b/plugins/channeltx/modfreedv/freedvmodplugin.cpp @@ -27,7 +27,7 @@ const PluginDescriptor FreeDVModPlugin::m_pluginDescriptor = { QString("FreeDV Modulator"), - QString("4.12.0"), + QString("4.12.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channeltx/modfreedv/freedvmodsettings.cpp b/plugins/channeltx/modfreedv/freedvmodsettings.cpp index 9de739176..b5dbc91ce 100644 --- a/plugins/channeltx/modfreedv/freedvmodsettings.cpp +++ b/plugins/channeltx/modfreedv/freedvmodsettings.cpp @@ -44,6 +44,7 @@ void FreeDVModSettings::resetToDefaults() m_audioDeviceName = AudioDeviceManager::m_defaultDeviceName; m_freeDVMode = FreeDVMode::FreeDVMode2400A; m_gaugeInputElseModem = false; + m_streamIndex = 0; m_useReverseAPI = false; m_reverseAPIAddress = "127.0.0.1"; m_reverseAPIPort = 8888; @@ -86,6 +87,7 @@ QByteArray FreeDVModSettings::serialize() const s.writeU32(24, m_reverseAPIPort); s.writeU32(25, m_reverseAPIDeviceIndex); s.writeU32(26, m_reverseAPIChannelIndex); + s.writeS32(27, m_streamIndex); return s.final(); } @@ -166,6 +168,7 @@ bool FreeDVModSettings::deserialize(const QByteArray& data) m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp; d.readU32(26, &utmp, 0); m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp; + d.readS32(27, &m_streamIndex, 0); return true; } diff --git a/plugins/channeltx/modfreedv/freedvmodsettings.h b/plugins/channeltx/modfreedv/freedvmodsettings.h index fcb3f2c60..0bed11b8d 100644 --- a/plugins/channeltx/modfreedv/freedvmodsettings.h +++ b/plugins/channeltx/modfreedv/freedvmodsettings.h @@ -59,6 +59,7 @@ struct FreeDVModSettings QString m_audioDeviceName; FreeDVMode m_freeDVMode; bool m_gaugeInputElseModem; //!< Volume gauge shows speech input level else modem level + int m_streamIndex; bool m_useReverseAPI; QString m_reverseAPIAddress; diff --git a/plugins/channeltx/modnfm/nfmmod.cpp b/plugins/channeltx/modnfm/nfmmod.cpp index ebe22247a..14dabebf6 100644 --- a/plugins/channeltx/modnfm/nfmmod.cpp +++ b/plugins/channeltx/modnfm/nfmmod.cpp @@ -508,6 +508,9 @@ void NFMMod::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("volumeFactor")) { settings.m_volumeFactor = response.getNfmModSettings()->getVolumeFactor(); } + if (channelSettingsKeys.contains("streamIndex")) { + settings.m_streamIndex = response.getNfmModSettings()->getStreamIndex(); + } if (channelSettingsKeys.contains("useReverseAPI")) { settings.m_useReverseAPI = response.getNfmModSettings()->getUseReverseApi() != 0; } @@ -642,6 +645,9 @@ void NFMMod::webapiReverseSendSettings(QList& channelSettingsKeys, cons if (channelSettingsKeys.contains("ctcssIndex") || force) { swgNFMModSettings->setCtcssIndex(settings.m_ctcssIndex); } + if (channelSettingsKeys.contains("streamIndex") || force) { + swgNFMModSettings->setStreamIndex(settings.m_streamIndex); + } if (force) { @@ -738,3 +744,8 @@ void NFMMod::setLevelMeter(QObject *levelMeter) { connect(m_basebandSource, SIGNAL(levelChanged(qreal, qreal, int)), levelMeter, SLOT(levelChanged(qreal, qreal, int))); } + +uint32_t NFMMod::getNumberOfDeviceStreams() const +{ + return m_deviceAPI->getNbSinkStreams(); +} \ No newline at end of file diff --git a/plugins/channeltx/modnfm/nfmmod.h b/plugins/channeltx/modnfm/nfmmod.h index 13f8da675..0123907be 100644 --- a/plugins/channeltx/modnfm/nfmmod.h +++ b/plugins/channeltx/modnfm/nfmmod.h @@ -254,6 +254,7 @@ public: double getMagSq() const; CWKeyer *getCWKeyer(); void setLevelMeter(QObject *levelMeter); + uint32_t getNumberOfDeviceStreams() const; static const QString m_channelIdURI; static const QString m_channelId; diff --git a/plugins/channeltx/modnfm/nfmmodgui.cpp b/plugins/channeltx/modnfm/nfmmodgui.cpp index b36345ae0..7b689a217 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.cpp +++ b/plugins/channeltx/modnfm/nfmmodgui.cpp @@ -30,6 +30,7 @@ #include "gui/crightclickenabler.h" #include "gui/audioselectdialog.h" #include "gui/basicchannelsettingsdialog.h" +#include "gui/devicestreamselectiondialog.h" #include "mainwindow.h" #include "ui_nfmmodgui.h" @@ -335,6 +336,20 @@ void NFMModGUI::onMenuDialogCalled(const QPoint &p) applySettings(); } + else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) + { + DeviceStreamSelectionDialog dialog(this); + dialog.setNumberOfStreams(m_nfmMod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + dialog.move(p); + dialog.exec(); + + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + displayStreamIndex(); + applySettings(); + } resetContextMenuType(); } @@ -456,6 +471,7 @@ void NFMModGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); + displayStreamIndex(); blockApplySettings(true); @@ -498,6 +514,14 @@ void NFMModGUI::displaySettings() blockApplySettings(false); } +void NFMModGUI::displayStreamIndex() +{ + if (m_deviceUISet->m_deviceMIMOEngine) { + setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); + } else { + setStreamIndicator("S"); // single channel indicator + } +} void NFMModGUI::leaveEvent(QEvent*) { diff --git a/plugins/channeltx/modnfm/nfmmodgui.h b/plugins/channeltx/modnfm/nfmmodgui.h index 699eb66ec..65948033e 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.h +++ b/plugins/channeltx/modnfm/nfmmodgui.h @@ -82,6 +82,7 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); + void displayStreamIndex(); void updateWithStreamData(); void updateWithStreamTime(); diff --git a/plugins/channeltx/modnfm/nfmmodplugin.cpp b/plugins/channeltx/modnfm/nfmmodplugin.cpp index 77539e87c..3f618f85e 100644 --- a/plugins/channeltx/modnfm/nfmmodplugin.cpp +++ b/plugins/channeltx/modnfm/nfmmodplugin.cpp @@ -27,7 +27,7 @@ const PluginDescriptor NFMModPlugin::m_pluginDescriptor = { QString("NFM Modulator"), - QString("4.12.0"), + QString("4.12.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channeltx/modnfm/nfmmodsettings.cpp b/plugins/channeltx/modnfm/nfmmodsettings.cpp index 8b1f0b7d5..43717d990 100644 --- a/plugins/channeltx/modnfm/nfmmodsettings.cpp +++ b/plugins/channeltx/modnfm/nfmmodsettings.cpp @@ -63,6 +63,7 @@ void NFMModSettings::resetToDefaults() m_feedbackAudioDeviceName = AudioDeviceManager::m_defaultDeviceName; m_feedbackVolumeFactor = 0.5f; m_feedbackAudioEnable = false; + m_streamIndex = 0; m_useReverseAPI = false; m_reverseAPIAddress = "127.0.0.1"; m_reverseAPIPort = 8888; @@ -105,6 +106,7 @@ QByteArray NFMModSettings::serialize() const s.writeString(20, m_feedbackAudioDeviceName); s.writeReal(21, m_feedbackVolumeFactor); s.writeBool(22, m_feedbackAudioEnable); + s.writeS32(23, m_streamIndex); return s.final(); } @@ -177,6 +179,7 @@ bool NFMModSettings::deserialize(const QByteArray& data) d.readString(20, &m_feedbackAudioDeviceName, AudioDeviceManager::m_defaultDeviceName); d.readReal(21, &m_feedbackVolumeFactor, 1.0); d.readBool(22, &m_feedbackAudioEnable, false); + d.readS32(23, &m_streamIndex, 0); return true; } diff --git a/plugins/channeltx/modnfm/nfmmodsettings.h b/plugins/channeltx/modnfm/nfmmodsettings.h index 0e1b6f327..2080339bd 100644 --- a/plugins/channeltx/modnfm/nfmmodsettings.h +++ b/plugins/channeltx/modnfm/nfmmodsettings.h @@ -57,6 +57,7 @@ struct NFMModSettings QString m_feedbackAudioDeviceName; //!< This is the audio device you send the audio samples to for audio feedback float m_feedbackVolumeFactor; bool m_feedbackAudioEnable; + int m_streamIndex; bool m_useReverseAPI; QString m_reverseAPIAddress; uint16_t m_reverseAPIPort; diff --git a/plugins/channeltx/modssb/ssbmod.cpp b/plugins/channeltx/modssb/ssbmod.cpp index 43b1ac245..d66f21e04 100644 --- a/plugins/channeltx/modssb/ssbmod.cpp +++ b/plugins/channeltx/modssb/ssbmod.cpp @@ -475,6 +475,9 @@ void SSBMod::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("audioDeviceName")) { settings.m_audioDeviceName = *response.getSsbModSettings()->getAudioDeviceName(); } + if (channelSettingsKeys.contains("streamIndex")) { + settings.m_streamIndex = response.getSsbModSettings()->getStreamIndex(); + } if (channelSettingsKeys.contains("useReverseAPI")) { settings.m_useReverseAPI = response.getSsbModSettings()->getUseReverseApi() != 0; } @@ -621,6 +624,9 @@ void SSBMod::webapiReverseSendSettings(QList& channelSettingsKeys, cons if (channelSettingsKeys.contains("audioDeviceName") || force) { swgSSBModSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName)); } + if (channelSettingsKeys.contains("streamIndex") || force) { + swgSSBModSettings->setStreamIndex(settings.m_streamIndex); + } if (force) { @@ -726,4 +732,9 @@ unsigned int SSBMod::getAudioSampleRate() const void SSBMod::setSpectrumSink(BasebandSampleSink *sampleSink) { m_basebandSource->setSpectrumSink(sampleSink); +} + +uint32_t SSBMod::getNumberOfDeviceStreams() const +{ + return m_deviceAPI->getNbSinkStreams(); } \ No newline at end of file diff --git a/plugins/channeltx/modssb/ssbmod.h b/plugins/channeltx/modssb/ssbmod.h index 2a31cfde8..d4ec6346b 100644 --- a/plugins/channeltx/modssb/ssbmod.h +++ b/plugins/channeltx/modssb/ssbmod.h @@ -257,6 +257,7 @@ public: void setLevelMeter(QObject *levelMeter); unsigned int getAudioSampleRate() const; void setSpectrumSink(BasebandSampleSink *sampleSink); + uint32_t getNumberOfDeviceStreams() const; static const QString m_channelIdURI; static const QString m_channelId; diff --git a/plugins/channeltx/modssb/ssbmodgui.cpp b/plugins/channeltx/modssb/ssbmodgui.cpp index aff4d602d..94c81d201 100644 --- a/plugins/channeltx/modssb/ssbmodgui.cpp +++ b/plugins/channeltx/modssb/ssbmodgui.cpp @@ -35,6 +35,7 @@ #include "gui/crightclickenabler.h" #include "gui/audioselectdialog.h" #include "gui/basicchannelsettingsdialog.h" +#include "gui/devicestreamselectiondialog.h" #include "mainwindow.h" SSBModGUI* SSBModGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx) @@ -381,6 +382,20 @@ void SSBModGUI::onMenuDialogCalled(const QPoint &p) applySettings(); } + else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) + { + DeviceStreamSelectionDialog dialog(this); + dialog.setNumberOfStreams(m_ssbMod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + dialog.move(p); + dialog.exec(); + + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + displayStreamIndex(); + applySettings(); + } resetContextMenuType(); } @@ -636,6 +651,7 @@ void SSBModGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); + displayStreamIndex(); blockApplySettings(true); @@ -703,6 +719,15 @@ void SSBModGUI::displaySettings() blockApplySettings(false); } +void SSBModGUI::displayStreamIndex() +{ + if (m_deviceUISet->m_deviceMIMOEngine) { + setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); + } else { + setStreamIndicator("S"); // single channel indicator + } +} + void SSBModGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channeltx/modssb/ssbmodgui.h b/plugins/channeltx/modssb/ssbmodgui.h index c8e0ae140..aeb2d36d5 100644 --- a/plugins/channeltx/modssb/ssbmodgui.h +++ b/plugins/channeltx/modssb/ssbmodgui.h @@ -90,6 +90,7 @@ private: void applySettings(bool force = false); void applyBandwidths(int spanLog2, bool force = false); void displaySettings(); + void displayStreamIndex(); void updateWithStreamData(); void updateWithStreamTime(); void channelMarkerUpdate(); diff --git a/plugins/channeltx/modssb/ssbmodplugin.cpp b/plugins/channeltx/modssb/ssbmodplugin.cpp index 23e0b7452..51c46f45e 100644 --- a/plugins/channeltx/modssb/ssbmodplugin.cpp +++ b/plugins/channeltx/modssb/ssbmodplugin.cpp @@ -27,7 +27,7 @@ const PluginDescriptor SSBModPlugin::m_pluginDescriptor = { QString("SSB Modulator"), - QString("4.12.0"), + QString("4.12.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channeltx/modssb/ssbmodsettings.cpp b/plugins/channeltx/modssb/ssbmodsettings.cpp index 034a63750..2da2c2020 100644 --- a/plugins/channeltx/modssb/ssbmodsettings.cpp +++ b/plugins/channeltx/modssb/ssbmodsettings.cpp @@ -66,6 +66,7 @@ void SSBModSettings::resetToDefaults() m_feedbackAudioDeviceName = AudioDeviceManager::m_defaultDeviceName; m_feedbackVolumeFactor = 0.5f; m_feedbackAudioEnable = false; + m_streamIndex = 0; m_useReverseAPI = false; m_reverseAPIAddress = "127.0.0.1"; m_reverseAPIPort = 8888; @@ -115,6 +116,7 @@ QByteArray SSBModSettings::serialize() const s.writeString(27, m_feedbackAudioDeviceName); s.writeReal(28, m_feedbackVolumeFactor); s.writeBool(29, m_feedbackAudioEnable); + s.writeS32(30, m_streamIndex); return s.final(); } @@ -201,6 +203,7 @@ bool SSBModSettings::deserialize(const QByteArray& data) d.readString(27, &m_feedbackAudioDeviceName, AudioDeviceManager::m_defaultDeviceName); d.readReal(28, &m_feedbackVolumeFactor, 1.0); d.readBool(29, &m_feedbackAudioEnable, false); + d.readS32(30, &m_streamIndex, 0); return true; } diff --git a/plugins/channeltx/modssb/ssbmodsettings.h b/plugins/channeltx/modssb/ssbmodsettings.h index 4ba5c2850..088cbbd2a 100644 --- a/plugins/channeltx/modssb/ssbmodsettings.h +++ b/plugins/channeltx/modssb/ssbmodsettings.h @@ -61,6 +61,7 @@ struct SSBModSettings QString m_feedbackAudioDeviceName; //!< This is the audio device you send the audio samples to for audio feedback float m_feedbackVolumeFactor; bool m_feedbackAudioEnable; + int m_streamIndex; bool m_useReverseAPI; QString m_reverseAPIAddress; diff --git a/plugins/channeltx/modwfm/wfmmod.cpp b/plugins/channeltx/modwfm/wfmmod.cpp index 8f2bc8248..cf2e3cea6 100644 --- a/plugins/channeltx/modwfm/wfmmod.cpp +++ b/plugins/channeltx/modwfm/wfmmod.cpp @@ -427,6 +427,9 @@ void WFMMod::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("fmDeviation")) { settings.m_fmDeviation = response.getWfmModSettings()->getFmDeviation(); } + if (channelSettingsKeys.contains("streamIndex")) { + settings.m_streamIndex = response.getWfmModSettings()->getStreamIndex(); + } if (channelSettingsKeys.contains("useReverseAPI")) { settings.m_useReverseAPI = response.getWfmModSettings()->getUseReverseApi() != 0; } @@ -550,6 +553,9 @@ void WFMMod::webapiReverseSendSettings(QList& channelSettingsKeys, cons if (channelSettingsKeys.contains("fmDeviation")) { swgWFMModSettings->setFmDeviation(settings.m_fmDeviation); } + if (channelSettingsKeys.contains("streamIndex")) { + swgWFMModSettings->setStreamIndex(settings.m_streamIndex); + } if (channelSettingsKeys.contains("audioDeviceName") || force) { swgWFMModSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName)); } @@ -649,3 +655,8 @@ void WFMMod::setLevelMeter(QObject *levelMeter) { connect(m_basebandSource, SIGNAL(levelChanged(qreal, qreal, int)), levelMeter, SLOT(levelChanged(qreal, qreal, int))); } + +uint32_t WFMMod::getNumberOfDeviceStreams() const +{ + return m_deviceAPI->getNbSinkStreams(); +} \ No newline at end of file diff --git a/plugins/channeltx/modwfm/wfmmod.h b/plugins/channeltx/modwfm/wfmmod.h index be662a0c7..bf1f8ce4e 100644 --- a/plugins/channeltx/modwfm/wfmmod.h +++ b/plugins/channeltx/modwfm/wfmmod.h @@ -254,6 +254,7 @@ public: double getMagSq() const; CWKeyer *getCWKeyer(); void setLevelMeter(QObject *levelMeter); + uint32_t getNumberOfDeviceStreams() const; static const QString m_channelIdURI; static const QString m_channelId; diff --git a/plugins/channeltx/modwfm/wfmmodgui.cpp b/plugins/channeltx/modwfm/wfmmodgui.cpp index 1b3d33a54..eb68baf6b 100644 --- a/plugins/channeltx/modwfm/wfmmodgui.cpp +++ b/plugins/channeltx/modwfm/wfmmodgui.cpp @@ -30,6 +30,7 @@ #include "gui/crightclickenabler.h" #include "gui/audioselectdialog.h" #include "gui/basicchannelsettingsdialog.h" +#include "gui/devicestreamselectiondialog.h" #include "mainwindow.h" #include "ui_wfmmodgui.h" @@ -310,6 +311,20 @@ void WFMModGUI::onMenuDialogCalled(const QPoint &p) applySettings(); } + else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) + { + DeviceStreamSelectionDialog dialog(this); + dialog.setNumberOfStreams(m_wfmMod->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + dialog.move(p); + dialog.exec(); + + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + displayStreamIndex(); + applySettings(); + } resetContextMenuType(); } @@ -428,6 +443,7 @@ void WFMModGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); + displayStreamIndex(); blockApplySettings(true); @@ -463,6 +479,15 @@ void WFMModGUI::displaySettings() blockApplySettings(false); } +void WFMModGUI::displayStreamIndex() +{ + if (m_deviceUISet->m_deviceMIMOEngine) { + setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); + } else { + setStreamIndicator("S"); // single channel indicator + } +} + void WFMModGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); diff --git a/plugins/channeltx/modwfm/wfmmodgui.h b/plugins/channeltx/modwfm/wfmmodgui.h index cd3e3c363..b5aa2dc64 100644 --- a/plugins/channeltx/modwfm/wfmmodgui.h +++ b/plugins/channeltx/modwfm/wfmmodgui.h @@ -81,6 +81,7 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); + void displayStreamIndex(); void updateWithStreamData(); void updateWithStreamTime(); diff --git a/plugins/channeltx/modwfm/wfmmodplugin.cpp b/plugins/channeltx/modwfm/wfmmodplugin.cpp index 3deb38f36..c5ad1b1ca 100644 --- a/plugins/channeltx/modwfm/wfmmodplugin.cpp +++ b/plugins/channeltx/modwfm/wfmmodplugin.cpp @@ -27,7 +27,7 @@ const PluginDescriptor WFMModPlugin::m_pluginDescriptor = { QString("WFM Modulator"), - QString("4.12.0"), + QString("4.12.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channeltx/modwfm/wfmmodsettings.cpp b/plugins/channeltx/modwfm/wfmmodsettings.cpp index 7ddc36909..0b5afca0b 100644 --- a/plugins/channeltx/modwfm/wfmmodsettings.cpp +++ b/plugins/channeltx/modwfm/wfmmodsettings.cpp @@ -50,6 +50,7 @@ void WFMModSettings::resetToDefaults() m_title = "WFM Modulator"; m_modAFInput = WFMModInputNone; m_audioDeviceName = AudioDeviceManager::m_defaultDeviceName; + m_streamIndex = 0; m_useReverseAPI = false; m_reverseAPIAddress = "127.0.0.1"; m_reverseAPIPort = 8888; @@ -87,6 +88,7 @@ QByteArray WFMModSettings::serialize() const s.writeU32(15, m_reverseAPIPort); s.writeU32(16, m_reverseAPIDeviceIndex); s.writeU32(17, m_reverseAPIChannelIndex); + s.writeS32(18, m_streamIndex); return s.final(); } @@ -152,6 +154,7 @@ bool WFMModSettings::deserialize(const QByteArray& data) m_reverseAPIDeviceIndex = utmp > 99 ? 99 : utmp; d.readU32(17, &utmp, 0); m_reverseAPIChannelIndex = utmp > 99 ? 99 : utmp; + d.readS32(18, &m_streamIndex, 0); return true; } diff --git a/plugins/channeltx/modwfm/wfmmodsettings.h b/plugins/channeltx/modwfm/wfmmodsettings.h index 1e7507db3..6e4c3c3c9 100644 --- a/plugins/channeltx/modwfm/wfmmodsettings.h +++ b/plugins/channeltx/modwfm/wfmmodsettings.h @@ -50,6 +50,7 @@ struct WFMModSettings QString m_title; WFMModInputAF m_modAFInput; QString m_audioDeviceName; //!< This is the audio device you get the audio samples from + int m_streamIndex; bool m_useReverseAPI; QString m_reverseAPIAddress; uint16_t m_reverseAPIPort; diff --git a/plugins/channeltx/remotesource/remotesource.cpp b/plugins/channeltx/remotesource/remotesource.cpp index f537eb9d2..55ef98193 100644 --- a/plugins/channeltx/remotesource/remotesource.cpp +++ b/plugins/channeltx/remotesource/remotesource.cpp @@ -252,6 +252,9 @@ void RemoteSource::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("title")) { settings.m_title = *response.getRemoteSourceSettings()->getTitle(); } + if (channelSettingsKeys.contains("streamIndex")) { + settings.m_streamIndex = response.getRemoteSourceSettings()->getStreamIndex(); + } if (channelSettingsKeys.contains("useReverseAPI")) { settings.m_useReverseAPI = response.getRemoteSourceSettings()->getUseReverseApi() != 0; } @@ -355,6 +358,9 @@ void RemoteSource::webapiReverseSendSettings(QList& channelSettingsKeys if (channelSettingsKeys.contains("title") || force) { swgRemoteSourceSettings->setTitle(new QString(settings.m_title)); } + if (channelSettingsKeys.contains("streamIndex") || force) { + swgRemoteSourceSettings->setStreamIndex(settings.m_streamIndex); + } QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings") .arg(settings.m_reverseAPIAddress) @@ -396,3 +402,8 @@ void RemoteSource::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } + +uint32_t RemoteSource::getNumberOfDeviceStreams() const +{ + return m_deviceAPI->getNbSinkStreams(); +} \ No newline at end of file diff --git a/plugins/channeltx/remotesource/remotesource.h b/plugins/channeltx/remotesource/remotesource.h index 40764bf43..adc902d52 100644 --- a/plugins/channeltx/remotesource/remotesource.h +++ b/plugins/channeltx/remotesource/remotesource.h @@ -204,6 +204,8 @@ public: const QStringList& channelSettingsKeys, SWGSDRangel::SWGChannelSettings& response); + uint32_t getNumberOfDeviceStreams() const; + static const QString m_channelIdURI; static const QString m_channelId; diff --git a/plugins/channeltx/remotesource/remotesourcegui.cpp b/plugins/channeltx/remotesource/remotesourcegui.cpp index 3ad9a1b96..008643e62 100644 --- a/plugins/channeltx/remotesource/remotesourcegui.cpp +++ b/plugins/channeltx/remotesource/remotesourcegui.cpp @@ -20,6 +20,7 @@ #include "device/deviceapi.h" #include "device/deviceuiset.h" #include "gui/basicchannelsettingsdialog.h" +#include "gui/devicestreamselectiondialog.h" #include "mainwindow.h" #include "remotesource.h" @@ -241,6 +242,7 @@ void RemoteSourceGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); setWindowTitle(m_channelMarker.getTitle()); + displayStreamIndex(); blockApplySettings(true); ui->dataAddress->setText(m_settings.m_dataAddress); @@ -248,6 +250,15 @@ void RemoteSourceGUI::displaySettings() blockApplySettings(false); } +void RemoteSourceGUI::displayStreamIndex() +{ + if (m_deviceUISet->m_deviceMIMOEngine) { + setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); + } else { + setStreamIndicator("S"); // single channel indicator + } +} + void RemoteSourceGUI::leaveEvent(QEvent*) { m_channelMarker.setHighlighted(false); @@ -304,6 +315,20 @@ void RemoteSourceGUI::onMenuDialogCalled(const QPoint &p) applySettings(); } + else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) + { + DeviceStreamSelectionDialog dialog(this); + dialog.setNumberOfStreams(m_remoteSrc->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + dialog.move(p); + dialog.exec(); + + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + displayStreamIndex(); + applySettings(); + } resetContextMenuType(); } diff --git a/plugins/channeltx/remotesource/remotesourcegui.h b/plugins/channeltx/remotesource/remotesourcegui.h index 67386326a..664d785a4 100644 --- a/plugins/channeltx/remotesource/remotesourcegui.h +++ b/plugins/channeltx/remotesource/remotesourcegui.h @@ -85,6 +85,7 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); + void displayStreamIndex(); void leaveEvent(QEvent*); void enterEvent(QEvent*); diff --git a/plugins/channeltx/remotesource/remotesourceplugin.cpp b/plugins/channeltx/remotesource/remotesourceplugin.cpp index 35abfc675..00d0a1326 100644 --- a/plugins/channeltx/remotesource/remotesourceplugin.cpp +++ b/plugins/channeltx/remotesource/remotesourceplugin.cpp @@ -27,7 +27,7 @@ const PluginDescriptor RemoteSourcePlugin::m_pluginDescriptor = { QString("Remote channel source"), - QString("4.12.0"), + QString("4.12.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channeltx/remotesource/remotesourcesettings.cpp b/plugins/channeltx/remotesource/remotesourcesettings.cpp index b7affa386..1d2c152e8 100644 --- a/plugins/channeltx/remotesource/remotesourcesettings.cpp +++ b/plugins/channeltx/remotesource/remotesourcesettings.cpp @@ -35,6 +35,7 @@ void RemoteSourceSettings::resetToDefaults() m_rgbColor = QColor(140, 4, 4).rgb(); m_title = "Remote source"; m_channelMarker = nullptr; + m_streamIndex = 0; m_useReverseAPI = false; m_reverseAPIAddress = "127.0.0.1"; m_reverseAPIPort = 8888; @@ -54,6 +55,7 @@ QByteArray RemoteSourceSettings::serialize() const s.writeU32(7, m_reverseAPIPort); s.writeU32(8, m_reverseAPIDeviceIndex); s.writeU32(9, m_reverseAPIChannelIndex); + s.writeS32(10, m_streamIndex); return s.final(); } @@ -98,6 +100,8 @@ bool RemoteSourceSettings::deserialize(const QByteArray& data) m_reverseAPIDeviceIndex = tmp > 99 ? 99 : tmp; d.readU32(9, &tmp, 0); m_reverseAPIChannelIndex = tmp > 99 ? 99 : tmp; + d.readS32(10, &m_streamIndex, 0); + return true; } else diff --git a/plugins/channeltx/remotesource/remotesourcesettings.h b/plugins/channeltx/remotesource/remotesourcesettings.h index e5ec152d3..bf9ea602a 100644 --- a/plugins/channeltx/remotesource/remotesourcesettings.h +++ b/plugins/channeltx/remotesource/remotesourcesettings.h @@ -29,6 +29,7 @@ struct RemoteSourceSettings uint16_t m_dataPort; //!< Listening data port quint32 m_rgbColor; QString m_title; + int m_streamIndex; bool m_useReverseAPI; QString m_reverseAPIAddress; uint16_t m_reverseAPIPort; diff --git a/plugins/channeltx/udpsource/udpsource.cpp b/plugins/channeltx/udpsource/udpsource.cpp index bd3c4e1f5..6ec062c23 100644 --- a/plugins/channeltx/udpsource/udpsource.cpp +++ b/plugins/channeltx/udpsource/udpsource.cpp @@ -363,6 +363,9 @@ void UDPSource::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("title")) { settings.m_title = *response.getUdpSourceSettings()->getTitle(); } + if (channelSettingsKeys.contains("streamIndex")) { + settings.m_streamIndex = response.getUdpSourceSettings()->getStreamIndex(); + } if (channelSettingsKeys.contains("useReverseAPI")) { settings.m_useReverseAPI = response.getUdpSourceSettings()->getUseReverseApi() != 0; } @@ -515,6 +518,9 @@ void UDPSource::webapiReverseSendSettings(QList& channelSettingsKeys, c if (channelSettingsKeys.contains("title") || force) { swgUDPSourceSettings->setTitle(new QString(settings.m_title)); } + if (channelSettingsKeys.contains("streamIndex") || force) { + swgUDPSourceSettings->setStreamIndex(settings.m_streamIndex); + } QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings") .arg(settings.m_reverseAPIAddress) @@ -579,4 +585,9 @@ int32_t UDPSource::getBufferGauge() const bool UDPSource::getSquelchOpen() const { return m_basebandSource->getSquelchOpen(); +} + +uint32_t UDPSource::getNumberOfDeviceStreams() const +{ + return m_deviceAPI->getNbSinkStreams(); } \ No newline at end of file diff --git a/plugins/channeltx/udpsource/udpsource.h b/plugins/channeltx/udpsource/udpsource.h index 1baeaa4f9..5e755d8f4 100644 --- a/plugins/channeltx/udpsource/udpsource.h +++ b/plugins/channeltx/udpsource/udpsource.h @@ -149,6 +149,7 @@ public: void setSpectrum(bool enabled); void resetReadIndex(); void setLevelMeter(QObject *levelMeter); + uint32_t getNumberOfDeviceStreams() const; static const QString m_channelIdURI; static const QString m_channelId; diff --git a/plugins/channeltx/udpsource/udpsourcegui.cpp b/plugins/channeltx/udpsource/udpsourcegui.cpp index 724a9e525..dd28b6951 100644 --- a/plugins/channeltx/udpsource/udpsourcegui.cpp +++ b/plugins/channeltx/udpsource/udpsourcegui.cpp @@ -23,6 +23,7 @@ #include "util/simpleserializer.h" #include "util/db.h" #include "gui/basicchannelsettingsdialog.h" +#include "gui/devicestreamselectiondialog.h" #include "plugin/pluginapi.h" #include "mainwindow.h" @@ -218,6 +219,7 @@ void UDPSourceGUI::displaySettings() setTitleColor(m_settings.m_rgbColor); this->setWindowTitle(m_channelMarker.getTitle()); + displayStreamIndex(); blockApplySettings(true); @@ -260,6 +262,15 @@ void UDPSourceGUI::displaySettings() blockApplySettings(false); } +void UDPSourceGUI::displayStreamIndex() +{ + if (m_deviceUISet->m_deviceMIMOEngine) { + setStreamIndicator(tr("%1").arg(m_settings.m_streamIndex)); + } else { + setStreamIndicator("S"); // single channel indicator + } +} + void UDPSourceGUI::channelMarkerChangedByCursor() { ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency()); @@ -497,6 +508,20 @@ void UDPSourceGUI::onMenuDialogCalled(const QPoint &p) applySettings(); } + else if ((m_contextMenuType == ContextMenuStreamSettings) && (m_deviceUISet->m_deviceMIMOEngine)) + { + DeviceStreamSelectionDialog dialog(this); + dialog.setNumberOfStreams(m_udpSource->getNumberOfDeviceStreams()); + dialog.setStreamIndex(m_settings.m_streamIndex); + dialog.move(p); + dialog.exec(); + + m_settings.m_streamIndex = dialog.getSelectedStreamIndex(); + m_channelMarker.clearStreamIndexes(); + m_channelMarker.addStreamIndex(m_settings.m_streamIndex); + displayStreamIndex(); + applySettings(); + } resetContextMenuType(); } diff --git a/plugins/channeltx/udpsource/udpsourcegui.h b/plugins/channeltx/udpsource/udpsourcegui.h index aae1a457e..b521c6125 100644 --- a/plugins/channeltx/udpsource/udpsourcegui.h +++ b/plugins/channeltx/udpsource/udpsourcegui.h @@ -81,6 +81,7 @@ private: void blockApplySettings(bool block); void applySettings(bool force = false); void displaySettings(); + void displayStreamIndex(); void setSampleFormat(int index); void setSampleFormatIndex(const UDPSourceSettings::SampleFormat& sampleFormat); diff --git a/plugins/channeltx/udpsource/udpsourceplugin.cpp b/plugins/channeltx/udpsource/udpsourceplugin.cpp index 6af51170a..bd438c4fc 100644 --- a/plugins/channeltx/udpsource/udpsourceplugin.cpp +++ b/plugins/channeltx/udpsource/udpsourceplugin.cpp @@ -30,7 +30,7 @@ const PluginDescriptor UDPSourcePlugin::m_pluginDescriptor = { QString("UDP Channel Source"), - QString("4.12.0"), + QString("4.12.1"), QString("(c) Edouard Griffiths, F4EXB"), QString("https://github.com/f4exb/sdrangel"), true, diff --git a/plugins/channeltx/udpsource/udpsourcesettings.cpp b/plugins/channeltx/udpsource/udpsourcesettings.cpp index c1d47c974..52c3d5642 100644 --- a/plugins/channeltx/udpsource/udpsourcesettings.cpp +++ b/plugins/channeltx/udpsource/udpsourcesettings.cpp @@ -51,6 +51,7 @@ void UDPSourceSettings::resetToDefaults() m_udpPort = 9998; m_rgbColor = QColor(225, 25, 99).rgb(); m_title = "UDP Sample Source"; + m_streamIndex = 0; m_useReverseAPI = false; m_reverseAPIAddress = "127.0.0.1"; m_reverseAPIPort = 8888; @@ -90,6 +91,7 @@ QByteArray UDPSourceSettings::serialize() const s.writeU32(23, m_reverseAPIPort); s.writeU32(24, m_reverseAPIDeviceIndex); s.writeU32(25, m_reverseAPIChannelIndex); + s.writeS32(26, m_streamIndex); return s.final(); } @@ -181,6 +183,7 @@ bool UDPSourceSettings::deserialize(const QByteArray& data) m_reverseAPIDeviceIndex = u32tmp > 99 ? 99 : u32tmp; d.readU32(25, &u32tmp, 0); m_reverseAPIChannelIndex = u32tmp > 99 ? 99 : u32tmp; + d.readS32(26, &m_streamIndex, 0); return true; } diff --git a/plugins/channeltx/udpsource/udpsourcesettings.h b/plugins/channeltx/udpsource/udpsourcesettings.h index d4d7cb161..91ee64b32 100644 --- a/plugins/channeltx/udpsource/udpsourcesettings.h +++ b/plugins/channeltx/udpsource/udpsourcesettings.h @@ -58,6 +58,7 @@ struct UDPSourceSettings uint16_t m_udpPort; QString m_title; + int m_streamIndex; bool m_useReverseAPI; QString m_reverseAPIAddress;