VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
makRadio Library API Changes

Table of Contents

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:

Changes that are internal to an implementation or limited to comments are not listed.

Breaking Changes

The Duplex enumeration was replaced by AudioChannel

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.

// 5.2
enum Duplex { Duplex_FULL, Duplex_HALF };
// 5.3

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

DtRwRadioState duplex accessors were replaced by audio channel accessors

The duplex property of the reflected radio state was removed and an audio channel property added in the same position:

// 5.2
virtual Duplex duplex() const;
virtual void setDuplex(Duplex val);
boost::signals2::signal<void(DtRadio*, Duplex)> signal_duplexChanged;
// 5.3
virtual AudioChannel audioChannel() const;
virtual void setAudioChannel(AudioChannel val);
boost::signals2::signal<void(DtRadio*, AudioChannel)> signal_audioChannelChanged;

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.

DtRwRadioState::myRadioEntityType changed type

The protected member that holds the radio entity type changed from a plain DtEntityType to the reflected DtRwEntityType:

// 5.2
DtEntityType myRadioEntityType;
// 5.3
DtRwEntityType myRadioEntityType;

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.

DtRadioManager::tick changed signature

The tick method now takes a simulation time argument:

// 5.2
virtual void tick();
// 5.3
virtual void tick(double t = 0.000);

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.

Audio format defaults changed

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:

initializer.setSampleRate(11025);
initializer.setFormat("MONO8");

Additions

makRadio/radioAudioManager.h and DtRadioAudioManager

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:

makRadio::DtRadioAudioManager* audio = radioManager.radioAudioManager();
std::vector<std::string> devices = audio->playbackDeviceList();
audio->changePlaybackDevice(devices.front());
audio->setSoundVolume(0.8);

It also publishes signal_playbackDeviceInitialized and signal_captureDeviceInitialized, and exposes audioManager(), audioCaptureManager(), context(), nextBuffer(), and maximumOutputDecibelCapability() / setMaximumOutputDecibelCapability().

DtRadioManager audio device and volume control

DtRadioManager gained accessors that forward to the new audio manager, along with signals that report changes made through any path:

DtRadioAudioManager* radioAudioManager() const;
virtual makAudio::DtAudioManager* audioManager() const;
virtual void setSoundVolume(double);
virtual double soundVolume() const;
boost::signals2::signal<void (double)> signal_soundVolumeChanged;
virtual std::vector<std::string> playbackDeviceList() const;
virtual std::string playbackDeviceName() const;
virtual bool changePlaybackDevice(const std::string&);
boost::signals2::signal<void(const std::string&)> signal_playbackDeviceChanged;
virtual std::vector<std::string> captureDeviceList() const;
virtual std::string captureDeviceName() const;
boost::signals2::signal<void(const std::string&)> signal_captureDeviceChanged;

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.

Global channel configuration

Channels can now be defined once for the radio system instead of only per radio. DtRadioSystemInitializer holds the shared list:

virtual const Channels& channels() const;
virtual Channels& channels();
virtual void clearChannels();
virtual void addChannel(const DtRwRadioChannel&);
virtual void removeChannel(const DtString&);
virtual DtRwRadioChannel* findChannel(int index);
virtual int numChannels() const;

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:

virtual const DtRadioSystemInitializer::Channels& globalChannels() const;
virtual DtRadioSystemInitializer::Channels& globalChannels();
virtual DtRwRadioChannel* findGlobalChannel(int index);
virtual int numGlobalChannels() const;
virtual DtRadioSystemInitializer* radioSystemInitializer();
virtual void reconfigureRadios();

Call reconfigureRadios after modifying the global channel list to push the new configuration into the existing radios.

DtRwRadioChannel modulation, crypto, and spread spectrum properties

DtRwRadioChannel previously carried only a name and a frequency. It now carries the full set of transmitter parameters, each as a reflected property:

virtual const DtRwModulationType& modulationType() const;
virtual void setModulationType(const DtRwModulationType& val);
virtual int cryptoMode() const;
virtual void setCryptoMode(int val);
virtual int cryptoSystem() const;
virtual void setCryptoSystem(int val);
virtual unsigned short cryptoKey() const;
virtual void setCryptoKey(unsigned short val);
virtual bool freqHopInUse() const;
virtual void setFreqHopInUse(bool val);
virtual bool pseudoNoiseInUse() const;
virtual void setPseudoNoiseInUse(bool val);
virtual bool timeHopInUse() const;
virtual void setTimeHopInUse(bool val);

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.

DtRadioSystemInitializer::setSoundVolume

The initializer carries the master sound volume, defaulting to 1.0, reflected as a volume element:

virtual void setSoundVolume(double);
virtual double soundVolume() const;

DtRadio::canHearSelfChanged

DtRadio gained a virtual notification method alongside the existing property change handlers:

virtual void canHearSelfChanged(DtRadio* radio, bool val);

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.

Summary of Header Changes

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]


Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)