VR-Engage  2.2
Loading...
Searching...
No Matches
radioWidget.h
Go to the documentation of this file.
1/*******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4*******************************************************************************/
5
6//! \file radioWidget.h
7//! \ingroup vrfMakRadioQt
8//! \brief Individual radio control widget for VREngage
9//!
10//! This file defines the DtRadioWidget class, which provides a user interface
11//! for controlling individual radio channels in the VREngage environment. It includes
12//! controls for power, channel selection, volume, and push-to-talk functionality.
13
14#pragma once
15
16#include <vrvUtil/signalslib.h>
17
18#include "radioWidget.hpp"
19
20#include <QtWidgets/QWidget>
21
22#include <string>
23#include <vector>
24
25namespace makRadio
26{
27class DtRadio;
28}
29
30namespace makVrv
31{
33class DtRadioEventProcessor;
34
35//! \brief Individual radio control widget for VREngage
36//!
37//! This widget provides a user interface for controlling a single radio channel
38//! in the VREngage environment. It includes controls for power, channel selection,
39//! volume adjustment, push-to-talk functionality, and jamming capabilities.
40class DtRadioWidget : public QWidget
41{
42 Q_OBJECT
43
44public:
45 //! \brief Constructor
46 //! \param radio Pointer to the radio object this widget controls
47 //! \param parent Pointer to the parent radio stack widget
48 //!
49 //! Creates a new radio widget to control the specified radio object
50 //! within the specified parent stack widget.
51 DtRadioWidget(makRadio::DtRadio* radio, DtRadioStackWidget* parent);
52
53 //! \brief Virtual destructor
54 //!
55 //! Cleans up resources used by the radio widget.
56 virtual ~DtRadioWidget();
57
58 //! \brief Updates the GUI to reflect the current radio state
59 //!
60 //! Synchronizes all controls in this widget to match the current
61 //! state of the underlying radio object. This includes power state,
62 //! channel, volume, and mute settings.
63 virtual void updateGuiFromRadio();
64
65 //! \brief Gets the radio object controlled by this widget
66 //! \return Pointer to the radio object
67 //!
68 //! Returns a pointer to the radio object this widget controls.
69 virtual makRadio::DtRadio* radio();
70
71public slots:
72 //! \brief Slot called when the power state changes
73 //! \param state The new power state (true = on, false = off)
74 //!
75 //! Updates the radio's power state when the power button is toggled.
76 virtual void powerChanged(bool state);
77
78 //! \brief Slot called when the channel selection changes
79 //! \param channel The new channel index
80 //!
81 //! Changes the radio's active channel when a new channel is selected.
82 virtual void channelChanged(int channel);
83
84 //! \brief Slot called when the talk button is pressed
85 //!
86 //! Activates transmission on this radio channel when the talk button is pressed.
87 virtual void talkButtonPressed();
88
89 //! \brief Slot called when the talk button is released
90 //!
91 //! Deactivates transmission on this radio channel when the talk button is released.
92 virtual void talkButtonReleased();
93
94 //! \brief Slot called when the volume setting changes
95 //! \param value The new volume value
96 //!
97 //! Updates the volume level for this radio channel.
98 virtual void volumeChanged(int value);
99
100 //! \brief Slot called when the microphone mute state changes
101 //! \param state The new mute state (true = muted, false = unmuted)
102 //!
103 //! Mutes or unmutes the microphone input for this radio channel.
104 virtual void micMuteChanged(bool state);
105
106 //! \brief Slot called when the speaker mute state changes
107 //! \param state The new mute state (true = muted, false = unmuted)
108 //!
109 //! Mutes or unmutes the speaker output for this radio channel.
110 virtual void speakerMuteChanged(bool state);
111
112 //! \brief Slot called when the jammer state changes
113 //! \param state The new jammer state (true = active, false = inactive)
114 //!
115 //! Activates or deactivates jamming capabilities for this radio channel.
116 virtual void jammerChanged(bool state);
117
118 //! \brief Updates the signal level indicators
119 //!
120 //! Updates the visual indicators for signal strength and activity levels.
121 virtual void updateLevels();
122
123protected:
124 //! \brief Updates the frequency display text
125 //!
126 //! Updates the text display showing the current radio frequency
127 //! based on the active channel.
128 virtual void updateFrequencyText();
129
130 //! \brief Pointer to the radio object this widget controls
131 //!
132 //! References the underlying radio simulation object that this widget controls.
133 makRadio::DtRadio* myRadio;
134
135 //! \brief Pointer to the jammer radio object
136 //!
137 //! References the radio object used for jamming functionality, if available.
138 makRadio::DtRadio* myJammer;
139
140 //! \brief Pointer to the parent radio stack widget
141 //!
142 //! References the parent radio stack widget that contains this radio widget.
144
145 //! \brief The UI components for this widget
146 //!
147 //! Contains the actual UI components defined in the UI file.
148 Ui::DtRadioWidgetUI myUi;
149};
150} // namespace makVrv
Radio stack widget for managing multiple radio interfaces.
Definition radioStackWidget.h:40
makRadio::DtRadio * myJammer
Pointer to the jammer radio object.
Definition radioWidget.h:138
virtual void powerChanged(bool state)
Slot called when the power state changes.
Ui::DtRadioWidgetUI myUi
The UI components for this widget.
Definition radioWidget.h:148
virtual void talkButtonPressed()
Slot called when the talk button is pressed.
virtual ~DtRadioWidget()
Virtual destructor.
virtual void updateGuiFromRadio()
Updates the GUI to reflect the current radio state.
virtual makRadio::DtRadio * radio()
Gets the radio object controlled by this widget.
virtual void channelChanged(int channel)
Slot called when the channel selection changes.
DtRadioWidget(makRadio::DtRadio *radio, DtRadioStackWidget *parent)
Constructor.
makRadio::DtRadio * myRadio
Pointer to the radio object this widget controls.
Definition radioWidget.h:133
virtual void updateFrequencyText()
Updates the frequency display text.
virtual void volumeChanged(int value)
Slot called when the volume setting changes.
virtual void talkButtonReleased()
Slot called when the talk button is released.
virtual void speakerMuteChanged(bool state)
Slot called when the speaker mute state changes.
virtual void updateLevels()
Updates the signal level indicators.
virtual void micMuteChanged(bool state)
Slot called when the microphone mute state changes.
virtual void jammerChanged(bool state)
Slot called when the jammer state changes.
DtRadioStackWidget * myStack
Pointer to the parent radio stack widget.
Definition radioWidget.h:143
Definition makRadio.h:23
Definition appLauncherComponent.h:28