You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
1.2 KiB

#pragma once
#include <QWidget>
#include <QTimer>
class QToolButton;
class QPushButton;
class QLabel;
class QMenu;
class RadioActivationSettings;
/* Верхняя панель активной рации: общие устройства SoundManager, VAD и удерживаемая PTT.
* Состояние передачи берётся из ядра; включение VAD хранится в конфигурации приложения. */
class RadioPanel : public QWidget {
Q_OBJECT
public:
explicit RadioPanel(QWidget* parent = nullptr);
~RadioPanel() override;
private:
bool eventFilter(QObject* watched, QEvent* event) override;
void setPttLatched(bool latched, const char* reason);
void updateState();
void showActivationSettings();
void updateDevices();
void populateDevices(QToolButton* button, bool capture);
void selectDevice(const QString& id, bool capture);
QToolButton *m_input, *m_output;
QPushButton *m_auto, *m_ptt;
QLabel* m_status;
bool m_pttLatched = false;
QTimer m_autoHold;
bool m_autoLongPressed = false;
QMenu* m_activationMenu = nullptr;
RadioActivationSettings* m_activationSettings = nullptr;
};