From 1786a6a5e032cdd7d94a2b1e30c0393dc7d50f1c Mon Sep 17 00:00:00 2001 From: "Gonzalo J. Carracedo Carballal" Date: Sun, 18 Aug 2024 19:11:08 +0200 Subject: [PATCH] Implement quick audio actions --- Default/Audio/AudioWidget.cpp | 68 ++++ Default/Audio/AudioWidget.h | 9 + icons/Icons.qrc | 6 + icons/am.svg | 694 +++++++++++++++++++++++++++++++ icons/fm.svg | 600 +++++++++++++++++++++++++++ icons/lsb.svg | 734 +++++++++++++++++++++++++++++++++ icons/nodemod.svg | 600 +++++++++++++++++++++++++++ icons/raw.svg | 680 +++++++++++++++++++++++++++++++ icons/usb.svg | 740 ++++++++++++++++++++++++++++++++++ 9 files changed, 4131 insertions(+) create mode 100644 icons/am.svg create mode 100644 icons/fm.svg create mode 100644 icons/lsb.svg create mode 100644 icons/nodemod.svg create mode 100644 icons/raw.svg create mode 100644 icons/usb.svg diff --git a/Default/Audio/AudioWidget.cpp b/Default/Audio/AudioWidget.cpp index 9346918..7638851 100644 --- a/Default/Audio/AudioWidget.cpp +++ b/Default/Audio/AudioWidget.cpp @@ -138,6 +138,31 @@ AudioWidget::AudioWidget( connectAll(); setProperty("collapsed", m_panelConfig->collapsed); + + auto action = new QAction; + + action->setIcon(QIcon(":/icons/nodemod.svg")); + registerAction(action, SLOT(onNoDemod())); + + action = new QAction; + action->setIcon(QIcon(":/icons/am.svg")); + registerAction(action, SLOT(onAM())); + + action = new QAction; + action->setIcon(QIcon(":/icons/fm.svg")); + registerAction(action, SLOT(onFM())); + + action = new QAction; + action->setIcon(QIcon(":/icons/lsb.svg")); + registerAction(action, SLOT(onAM())); + + action = new QAction; + action->setIcon(QIcon(":/icons/usb.svg")); + registerAction(action, SLOT(onUSB())); + + action = new QAction; + action->setIcon(QIcon(":/icons/raw.svg")); + registerAction(action, SLOT(onRaw())); } AudioWidget::~AudioWidget() @@ -878,6 +903,9 @@ AudioWidget::setState(int state, Suscan::Analyzer *analyzer) if (analyzer == nullptr) m_processor->setAnalyzer(analyzer); + for (auto &p : UIComponent::actions()) + p->setEnabled(m_analyzer != nullptr); + applySpectrumState(); } @@ -1233,5 +1261,45 @@ AudioWidget::onLockToFreqChanged() setLockToFreq(getLockToFreq()); } +void +AudioWidget::onNoDemod() +{ + setEnabled(false); +} + +void +AudioWidget::onAM() +{ + setEnabled(true); + setDemod(AudioDemod::AM); +} + +void +AudioWidget::onFM() +{ + setEnabled(true); + setDemod(AudioDemod::FM); +} + +void +AudioWidget::onUSB() +{ + setEnabled(true); + setDemod(AudioDemod::USB); +} + +void +AudioWidget::onLSB() +{ + setEnabled(true); + setDemod(AudioDemod::LSB); +} + +void +AudioWidget::onRaw() +{ + setEnabled(true); + setDemod(AudioDemod::RAW); +} ////////////////// TODO: implement onJumpToBookmark //////////////////////////// diff --git a/Default/Audio/AudioWidget.h b/Default/Audio/AudioWidget.h index 3fa733d..3d4e883 100644 --- a/Default/Audio/AudioWidget.h +++ b/Default/Audio/AudioWidget.h @@ -191,6 +191,15 @@ namespace SigDigger { // Analyzer slots void onSourceInfoMessage(Suscan::SourceInfoMessage const &); + + // Quick actions + void onNoDemod(); + void onAM(); + void onFM(); + void onUSB(); + void onLSB(); + void onRaw(); + }; } diff --git a/icons/Icons.qrc b/icons/Icons.qrc index 44d44cb..12c82e3 100644 --- a/icons/Icons.qrc +++ b/icons/Icons.qrc @@ -55,6 +55,12 @@ fsk-inspector.svg psk-inspector.svg rms-inspector.svg + am.svg + fm.svg + nodemod.svg + raw.svg + usb.svg + lsb.svg diff --git a/icons/am.svg b/icons/am.svg new file mode 100644 index 0000000..a98a681 --- /dev/null +++ b/icons/am.svg @@ -0,0 +1,694 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + Shadow opacity : 30, 15, 10, (8) + + Bevel opacity : 20 / 10 + Bevel opacity : 75 / 15 + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icons/fm.svg b/icons/fm.svg new file mode 100644 index 0000000..1481339 --- /dev/null +++ b/icons/fm.svg @@ -0,0 +1,600 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + Shadow opacity : 30, 15, 10, (8) + + Bevel opacity : 20 / 10 + Bevel opacity : 75 / 15 + + + + + + + + + + + + + + + + + diff --git a/icons/lsb.svg b/icons/lsb.svg new file mode 100644 index 0000000..9d63fd3 --- /dev/null +++ b/icons/lsb.svg @@ -0,0 +1,734 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + Shadow opacity : 30, 15, 10, (8) + + Bevel opacity : 20 / 10 + Bevel opacity : 75 / 15 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icons/nodemod.svg b/icons/nodemod.svg new file mode 100644 index 0000000..7ae0cbb --- /dev/null +++ b/icons/nodemod.svg @@ -0,0 +1,600 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + Shadow opacity : 30, 15, 10, (8) + + Bevel opacity : 20 / 10 + Bevel opacity : 75 / 15 + + + + + + + diff --git a/icons/raw.svg b/icons/raw.svg new file mode 100644 index 0000000..43701db --- /dev/null +++ b/icons/raw.svg @@ -0,0 +1,680 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + Shadow opacity : 30, 15, 10, (8) + + Bevel opacity : 20 / 10 + Bevel opacity : 75 / 15 + + + + + + + + RAW + RAW + RAW + RAW + RAW + + diff --git a/icons/usb.svg b/icons/usb.svg new file mode 100644 index 0000000..02e0f34 --- /dev/null +++ b/icons/usb.svg @@ -0,0 +1,740 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + Shadow opacity : 30, 15, 10, (8) + + Bevel opacity : 20 / 10 + Bevel opacity : 75 / 15 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +