VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
makRadio::DtRadioManager Class Reference
Inheritance diagram for makRadio::DtRadioManager:
Inheritance graph
[legend]

Public Member Functions

 DtRadioManager ()
 
virtual ~DtRadioManager ()
 
virtual void init (const DtFilename &)
 
virtual void init (const DtRadioSystemInitializer &init, const std::string &captureDevice="")
 
virtual void tick ()
 
virtual void shutdown ()
 
virtual void addReference ()
 Adds a refernce to this manager. If the reference count is 0 at the time will setEnabled to true. More...
 
virtual void removeReference ()
 Removes a reference to this manager. If the reference count is 0 will setEnabled to false. More...
 
virtual void setEnabled (bool enable)
 If enabled is false will immediately set the reference count to 0. More...
 
virtual void setSystemEnabled (bool b, bool save=true)
 The difference between systemEnabled and enabled is that the system can be enabled but no one is using the manager, so, it is not enabled for listening/sending. More...
 
virtual bool systemEnabled () const
 
virtual void registerConnection (DtRadioConnectionBundle *connection)
 
virtual void unregisterConnection (DtRadioConnectionBundle *connection)
 
virtual void audioOut (makAudio::DtAudioBuffer *buffer)
 
virtual void setActiveEntity (const DtEntityIdentifier &entityId)
 Jams the radio on the given frequency. More...
 
virtual DtEntityIdentifier activeEntity ()
 
virtual DtRadiofindRadio (int idx)
 
virtual void setRadios (const std::vector< DtRwRadioState > &, bool save=true)
 Sets the radios into the manager, replacing the existing radios. More...
 
virtual std::vector< DtRadio * > & radios ()
 
virtual DtRadiocreateRadio (DtRwRadioState &state)
 
virtual void removeRadio (int idx)
 
virtual void removeRadio (DtRadio *radio)
 
virtual void clearRadios ()
 
virtual void sendRadioStreamMessage (StreamAudioMessage *msg)
 
virtual void sendControlMessage (ControlMessage *msg)
 
virtual bool changeCaptureDevice (const std::string &)
 
virtual int nextRadioId ()
 
virtual float voxThreshold ()
 
virtual void setVoxThreshold (float val)
 
virtual bool jammersEnabled ()
 
virtual void setJammersEnabled (bool set)
 
virtual bool setAutoSave (bool)
 Set to false to not automatically save any radio configuration changes. Default is true. Returns the current value. More...
 
virtual bool autoSave () const
 
virtual void setSampleRate (int, bool save=true, bool reinitialize=true)
 Sets the sample rate. More...
 
virtual int sampleRate () const
 
virtual void setFormat (const std::string &, bool save=true, bool reinitialize=true)
 Sets the format of the radio. More...
 
virtual std::string format () const
 
virtual double captureFrequency () const
 get/set the capture frequency (in hertz). More...
 
virtual void setCaputreFrequency (double hertz, bool save=true)
 
virtual bool jammerEnabled (DtRadio *) const
 Whether or not this radio is being jammed. More...
 
virtual void changeJammerFrequency (double oldFrequency, double newFrequency)
 Updates the jamming of this radio. If there is no jammer by this frequency will do nothing. More...
 
virtual bool setJammed (DtRadio *, bool)
 Sets the radio to be jammed/not jammed. Return true on state change. More...
 
virtual void clearJammers ()
 Clears out all the jammers. More...
 
virtual DtRadiofindCurrentRadio ()
 
virtual void setCurrentRadio (DtRadio *radio)
 

Protected Types

typedef std::list
< DtRadioConnectionBundle * > 
ConnectionList
 

Protected Member Functions

virtual void configureRadios (const DtRadioSystemInitializer::Radios &radios)
 
virtual void recreateRadios ()
 
virtual void handleNetStreamMessage (StreamAudioMessage *msg)
 

Protected Attributes

std::vector< DtRwRadioStatemyRadioInit
 
std::vector< DtRadio * > myRadios
 
std::map< double, DtRadio * > myJammers
 These are not cleared out when the radios are. More...
 
unsigned int myNextRadioId
 
DtEntityIdentifier myActiveEntityId
 
ConnectionList myConnections
 
float myVoxThreshold
 
bool myJammersEnabled
 
double myCaptureFrequency
 
double myNextCaptureTime
 
int myReferenceCount
 
DtRadiomyCurrentRadio
 
DtRadioSystemInitializermyRadioSystemInitializer
 
bool myAutoSave
 
bool myEnabled
 
bool mySystemEnabled
 

Member Typedef Documentation

Constructor & Destructor Documentation

makRadio::DtRadioManager::DtRadioManager ( )
virtual makRadio::DtRadioManager::~DtRadioManager ( )
virtual

Member Function Documentation

virtual void makRadio::DtRadioManager::init ( const DtFilename &  )
virtual
virtual void makRadio::DtRadioManager::init ( const DtRadioSystemInitializer init,
const std::string &  captureDevice = "" 
)
virtual
virtual void makRadio::DtRadioManager::tick ( )
virtual

Reimplemented in makVrf::DtVrfRadioManager.

virtual void makRadio::DtRadioManager::shutdown ( )
virtual

Reimplemented in makVrf::DtVrfRadioManager.

virtual void makRadio::DtRadioManager::addReference ( )
virtual

Adds a refernce to this manager. If the reference count is 0 at the time will setEnabled to true.

virtual void makRadio::DtRadioManager::removeReference ( )
virtual

Removes a reference to this manager. If the reference count is 0 will setEnabled to false.

virtual void makRadio::DtRadioManager::setEnabled ( bool  enable)
virtual

If enabled is false will immediately set the reference count to 0.

virtual void makRadio::DtRadioManager::setSystemEnabled ( bool  b,
bool  save = true 
)
virtual

The difference between systemEnabled and enabled is that the system can be enabled but no one is using the manager, so, it is not enabled for listening/sending.

If this is false (default is true) it will override whatever the enabled setting is

Reimplemented in makVrf::DtVrfRadioManager.

virtual bool makRadio::DtRadioManager::systemEnabled ( ) const
virtual
virtual void makRadio::DtRadioManager::registerConnection ( DtRadioConnectionBundle connection)
virtual
virtual void makRadio::DtRadioManager::unregisterConnection ( DtRadioConnectionBundle connection)
virtual
virtual void makRadio::DtRadioManager::audioOut ( makAudio::DtAudioBuffer *  buffer)
virtual
virtual void makRadio::DtRadioManager::setActiveEntity ( const DtEntityIdentifier &  entityId)
virtual

Jams the radio on the given frequency.

Reimplemented in makVrf::DtVrfRadioManager.

virtual DtEntityIdentifier makRadio::DtRadioManager::activeEntity ( )
virtual
virtual DtRadio* makRadio::DtRadioManager::findRadio ( int  idx)
virtual
virtual void makRadio::DtRadioManager::setRadios ( const std::vector< DtRwRadioState > &  ,
bool  save = true 
)
virtual

Sets the radios into the manager, replacing the existing radios.

If the save flag is given, and, auto save is turned on, it will also write out the current system initializer back to it's loaded file with the new radios

virtual std::vector<DtRadio*>& makRadio::DtRadioManager::radios ( )
inlinevirtual
virtual DtRadio* makRadio::DtRadioManager::createRadio ( DtRwRadioState state)
virtual
virtual void makRadio::DtRadioManager::removeRadio ( int  idx)
virtual
virtual void makRadio::DtRadioManager::removeRadio ( DtRadio radio)
virtual
virtual void makRadio::DtRadioManager::clearRadios ( )
virtual

Reimplemented in makVrf::DtVrfRadioManager.

virtual void makRadio::DtRadioManager::sendRadioStreamMessage ( StreamAudioMessage msg)
virtual
virtual void makRadio::DtRadioManager::sendControlMessage ( ControlMessage msg)
virtual
virtual bool makRadio::DtRadioManager::changeCaptureDevice ( const std::string &  )
virtual
virtual int makRadio::DtRadioManager::nextRadioId ( )
virtual
virtual float makRadio::DtRadioManager::voxThreshold ( )
virtual
virtual void makRadio::DtRadioManager::setVoxThreshold ( float  val)
virtual
virtual bool makRadio::DtRadioManager::jammersEnabled ( )
virtual
virtual void makRadio::DtRadioManager::setJammersEnabled ( bool  set)
virtual
virtual bool makRadio::DtRadioManager::setAutoSave ( bool  )
virtual

Set to false to not automatically save any radio configuration changes. Default is true. Returns the current value.

virtual bool makRadio::DtRadioManager::autoSave ( ) const
virtual
virtual void makRadio::DtRadioManager::setSampleRate ( int  ,
bool  save = true,
bool  reinitialize = true 
)
virtual

Sets the sample rate.

Valid options are 11025, 22050, 44100. If save is set then will also save the settings (if autoSave is on). If reinitialize is also set will reinitialize the radio capture for the new sample rate

virtual int makRadio::DtRadioManager::sampleRate ( ) const
virtual
virtual void makRadio::DtRadioManager::setFormat ( const std::string &  ,
bool  save = true,
bool  reinitialize = true 
)
virtual

Sets the format of the radio.

Valid options are MONO8, MONO16, MLAW8. If save is set then will also save the settings (if autoSave is on). If reinitialize is also set will reinitialize the radio capture for the new sample rate

virtual std::string makRadio::DtRadioManager::format ( ) const
virtual
virtual double makRadio::DtRadioManager::captureFrequency ( ) const
virtual

get/set the capture frequency (in hertz).

This is the frequency that the capture device will be polled for new information lower values means large audio buffers, fewer PDUs, and larger latency higher values means smaller audio buffers, more PDU's and higher latency the upper limit will be limited by the framerate of the application ticking the radio manager

virtual void makRadio::DtRadioManager::setCaputreFrequency ( double  hertz,
bool  save = true 
)
virtual
virtual bool makRadio::DtRadioManager::jammerEnabled ( DtRadio ) const
virtual

Whether or not this radio is being jammed.

virtual void makRadio::DtRadioManager::changeJammerFrequency ( double  oldFrequency,
double  newFrequency 
)
virtual

Updates the jamming of this radio. If there is no jammer by this frequency will do nothing.

Reimplemented in makVrf::DtVrfRadioManager.

virtual bool makRadio::DtRadioManager::setJammed ( DtRadio ,
bool   
)
virtual

Sets the radio to be jammed/not jammed. Return true on state change.

Reimplemented in makVrf::DtVrfRadioManager.

virtual void makRadio::DtRadioManager::clearJammers ( )
virtual

Clears out all the jammers.

virtual DtRadio* makRadio::DtRadioManager::findCurrentRadio ( )
virtual
virtual void makRadio::DtRadioManager::setCurrentRadio ( DtRadio radio)
virtual
virtual void makRadio::DtRadioManager::configureRadios ( const DtRadioSystemInitializer::Radios radios)
protectedvirtual
virtual void makRadio::DtRadioManager::recreateRadios ( )
protectedvirtual
virtual void makRadio::DtRadioManager::handleNetStreamMessage ( StreamAudioMessage msg)
protectedvirtual

Member Data Documentation

std::vector<DtRwRadioState> makRadio::DtRadioManager::myRadioInit
protected
std::vector<DtRadio*> makRadio::DtRadioManager::myRadios
protected
std::map<double, DtRadio*> makRadio::DtRadioManager::myJammers
protected

These are not cleared out when the radios are.

Only cleared when the manager is deleted or they are turned off

unsigned int makRadio::DtRadioManager::myNextRadioId
protected
DtEntityIdentifier makRadio::DtRadioManager::myActiveEntityId
protected
ConnectionList makRadio::DtRadioManager::myConnections
protected
float makRadio::DtRadioManager::myVoxThreshold
protected
bool makRadio::DtRadioManager::myJammersEnabled
protected
double makRadio::DtRadioManager::myCaptureFrequency
protected
double makRadio::DtRadioManager::myNextCaptureTime
protected
int makRadio::DtRadioManager::myReferenceCount
protected
DtRadio* makRadio::DtRadioManager::myCurrentRadio
protected
DtRadioSystemInitializer* makRadio::DtRadioManager::myRadioSystemInitializer
protected
bool makRadio::DtRadioManager::myAutoSave
protected
bool makRadio::DtRadioManager::myEnabled
protected
bool makRadio::DtRadioManager::mySystemEnabled
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)