VR-Engage  2.2
Loading...
Searching...
No Matches
radioManager.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file radioManager.h
7//! \ingroup vreMakRadio
8//! \brief VREngage radio management system integration
9//!
10//! This file defines the DtVreRadioManager class which provides integration between
11//! VREngage and the MAK Radio communications subsystem. It manages radio devices,
12//! configurations, and provides the interface for radio operations within the simulation.
13
14#pragma once
15
16#include <vreMakRadio/export.h>
17
18#include <makRadio/radioManager.h>
19
20#include <vrvCore/DtDe.h>
21#include <vrvUtil/DtVirtualBaseClass.h>
22#include <vreUtil/initializer.h>
23
24namespace makVrv
25{
26class DtDe;
27}
28
29namespace makVre
30{
31//! \brief VREngage radio manager class for controlling radio communications
32//!
33//! This class extends the base radio manager functionality and integrates with VREngage
34//! to provide radio communications capabilities within simulations. It manages all radios,
35//! handles configuration, and provides the central interface for radio operations.
36class DT_DLL_VREMAKRADIO DtVreRadioManager : public makRadio::DtRadioManager, public makVrv::DtVirtualBaseClass
37{
38public:
39 //! \brief Gets the singleton instance of the radio manager
40 //! \param de Reference to the display engine to integrate with
41 //! \return Reference to the singleton radio manager instance
42 //!
43 //! This static method follows the singleton pattern, creating the instance
44 //! if it doesn't exist or returning the existing one if it does.
45 static DtVreRadioManager& instance(makVrv::DtDe& de);
46
47 //! \brief Virtual destructor
48 virtual ~DtVreRadioManager() override;
49
50 //! \brief Initializes the radio manager
51 //! \param init Initialization table containing radio configuration data
52 //! \param captureDevice Name of the audio capture device to use for radio input
53 //!
54 //! This method initializes the radio manager with the specified configuration
55 //! and sets up the audio capture device for radio input.
56 virtual void init(makVre::DtInitTable& init, const std::string& captureDevice);
57
58 //! \brief Shuts down the radio manager
59 //!
60 //! This method properly shuts down the radio manager, releasing all resources
61 //! and cleaning up any active radio connections.
62 virtual void shutdown() override;
63
64 //! \brief Sets the currently active radio
65 //! \param radio Pointer to the radio to set as current
66 //!
67 //! This method sets the specified radio as the currently active radio
68 //! for transmission and reception operations.
69 virtual void setCurrentRadio(makRadio::DtRadio* radio) override;
70
71 //! \brief Adds a new radio with the specified state
72 //! \param state Initial radio state configuration
73 //! \return Pointer to the newly created radio
74 //!
75 //! This method creates a new radio with the provided state configuration
76 //! and adds it to the radio manager's collection of managed radios.
77 virtual makRadio::DtRadio* addRadio(makRadio::DtRwRadioState& state);
78
79 //! \brief Removes a radio at the specified index
80 //! \param idx Index of the radio to remove
81 //!
82 //! This method removes the radio at the specified index from the manager's
83 //! collection and properly cleans up its resources.
84 virtual void removeRadio(int idx) override;
85
86protected:
87 //! \brief Protected constructor for singleton pattern
89
90 //! \brief Configures radios from initialization data
91 //! \param radios Initialization table containing radio configurations
92 //!
93 //! This method configures all radios based on the data in the initialization table.
94 virtual void configureRadios(makVre::DtInitTable& radios);
95
96 //! \brief Recreates all managed radios
97 //!
98 //! This method recreates all radios after a configuration change or reset.
99 virtual void recreateRadios() override;
100};
101} // namespace makVre
Table-based access to Lua state for configuration data.
Definition initializer.h:38
virtual void recreateRadios() override
Recreates all managed radios.
virtual void shutdown() override
Shuts down the radio manager.
virtual void setCurrentRadio(makRadio::DtRadio *radio) override
Sets the currently active radio.
virtual void removeRadio(int idx) override
Removes a radio at the specified index.
static DtVreRadioManager & instance(makVrv::DtDe &de)
Gets the singleton instance of the radio manager.
virtual makRadio::DtRadio * addRadio(makRadio::DtRwRadioState &state)
Adds a new radio with the specified state.
virtual void configureRadios(makVre::DtInitTable &radios)
Configures radios from initialization data.
virtual void init(makVre::DtInitTable &init, const std::string &captureDevice)
Initializes the radio manager.
DtVreRadioManager()
Protected constructor for singleton pattern.
virtual ~DtVreRadioManager() override
Virtual destructor.
Export/import macros for vreMakRadio library.
#define DT_DLL_VREMAKRADIO
Definition export.h:23
Provides configuration initialization for VREngage components.
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
Definition appLauncherComponent.h:28
makVrv::DtDe * de()
Gets the display element pointer used by the plugin.