![]() |
VR-Forces Developer's Guide
|
This document describes the public API changes in the makRadio library between VR-Forces 5.2 and VR-Forces 5.3.
It covers the following public headers:
makRadio/radio.hmakRadio/radioAudioManager.h (new in 5.3)makRadio/radioManager.hmakRadio/radioStateTypes.hmakRadio/radioSystemInitializer.hmakRadio/rwRadioState.hChanges that are internal to an implementation or limited to comments are not listed.
makRadio/radioStateTypes.h no longer declares the Duplex enumeration. In its place is AudioChannel, which selects the stereo position that received audio is played from rather than describing transmit/receive concurrency. The two enumerations are unrelated in meaning, so this is not a value-for-value substitution: code that queried duplex capability must be reworked, not renamed.
The string conversion helpers on DtRadioStateTypes were renamed along with the enumeration:
| 5.2 declaration | 5.3 declaration |
|---|---|
static std::string Duplex_toString(Duplex) | static std::string AudioChannel_toString(AudioChannel) |
static Duplex Duplex_fromString(const std::string&) | static AudioChannel AudioChannel_fromString(const std::string&) |
static bm_type Duplex_bimap | static bm_type AudioChannel_bimap |
The duplex property of the reflected radio state was removed and an audio channel property added in the same position:
The protected reflected member was renamed from myDuplex to myAudioChannel, which affects derived classes that access it directly.
This change is also visible in persisted data. The reader/writer element previously archived as duplex is now archived as audioChannel, and the default value changed from Duplex_HALF to AudioChannel_CENTER. Radio configuration files written by 5.2 carry a duplex element that 5.3 does not recognize, and the audio channel of every radio falls back to the default. Configuration files must be regenerated, or migrated by renaming the element and mapping the value to the intended stereo position. Any application that constructs radio configuration XML directly must emit the new element name.
The protected member that holds the radio entity type changed from a plain DtEntityType to the reflected DtRwEntityType:
The public accessors radioEntityType() and setRadioEntityType() still take and return DtEntityType, so callers that use the accessors are unaffected. Derived classes that read or assign the member directly must account for the reader/writer wrapper. Because the member is now registered with the state's reader/writer registry, the radio entity type is serialized as a radioEntityType element where 5.2 did not archive it at all.
The tick method now takes a simulation time argument:
The default argument keeps existing call sites compiling. Classes that derive from DtRadioManager and override tick must add the parameter, otherwise the override silently becomes an overload and the base implementation runs instead.
DtRadioSystemInitializer now defaults sampleRate() to 44100 rather than 11025, and format() to MONO16 rather than MONO8. Applications that relied on the previous defaults to interoperate with an external audio source must set the values explicitly:
The new header defines DtRadioAudioManager, a wrapper that owns the makAudio::DtAudioManager and makAudio::DtAudioCapture objects and applies the application's audio settings: enabled state, master volume, playback and capture device selection, and the maximum output decibel capability used to tune sound falloff. DtRadioManager creates and owns an instance, exposed through DtRadioManager::radioAudioManager().
The class is initialized from a DtRadioSystemInitializer and provides device enumeration and selection, per-tick updating, and shutdown:
It also publishes signal_playbackDeviceInitialized and signal_captureDeviceInitialized, and exposes audioManager(), audioCaptureManager(), context(), nextBuffer(), and maximumOutputDecibelCapability() / setMaximumOutputDecibelCapability().
DtRadioManager gained accessors that forward to the new audio manager, along with signals that report changes made through any path:
The existing changeCaptureDevice is unchanged; signal_captureDeviceChanged is emitted when it succeeds. Note that radioManager.h now includes <boost/signals2.hpp> because of these members.
Channels can now be defined once for the radio system instead of only per radio. DtRadioSystemInitializer holds the shared list:
addChannel replaces any existing channel with the same name. The list is reflected through the new protected member myChannels and is archived as a channels element.
DtRadioManager exposes the same list and the initializer that owns it:
Call reconfigureRadios after modifying the global channel list to push the new configuration into the existing radios.
DtRwRadioChannel previously carried only a name and a frequency. It now carries the full set of transmitter parameters, each as a reflected property:
The corresponding protected reflected members myModulationType, myCryptoMode, myCryptoSystem, myCryptoKey, myFreqHopInUse, myPseudoNoiseInUse, and myTimeHopInUse were added alongside the existing myChannelName and myFrequency. Channel records written by 5.3 contain the additional elements; 5.2 records load unchanged, with the new properties taking their default values.
DtRwModulationType is now declared before DtRwRadioChannel in rwRadioState.h so that the channel can hold one by value. The class itself is unchanged.
The initializer carries the master sound volume, defaulting to 1.0, reflected as a volume element:
DtRadio gained a virtual notification method alongside the existing property change handlers:
The method is connected to DtRwRadioState::signal_canHearSelfChanged by the radio constructor. Derived radios that need to react when the local monitoring setting changes should override it and call the base implementation, which applies the value to the state and republishes the radio interface.
| Header | Breaking | Additions |
|---|---|---|
radio.h | None | canHearSelfChanged |
radioAudioManager.h | None (new header) | DtRadioAudioManager |
radioManager.h | tick signature change | Audio manager, volume, and device accessors with signals; global channel accessors; radioSystemInitializer; reconfigureRadios |
radioStateTypes.h | Duplex enumeration and its conversion helpers removed | AudioChannel enumeration and conversion helpers |
radioSystemInitializer.h | Sample rate and format defaults changed | setSoundVolume / soundVolume; global channel list and accessors |
rwRadioState.h | duplex accessors and myDuplex replaced; myRadioEntityType type changed | DtRwRadioChannel modulation, crypto, and spread spectrum properties |
Return to VR-Forces 5.3 API Migration Guide.
[Home]