libvpb  4.2.61
HostToneGen Class Reference

Host based tone generator implementation. More...

#include <tonegen.h>

Inheritance diagram for HostToneGen:
Inheritance graph
Collaboration diagram for HostToneGen:
Collaboration graph

Public Member Functions

 HostToneGen ()
 Default constructor.
 
bool MixTone (int16_t *buf, size_t samples)
 Add the next samples of this tone to the signal in buf. More...
 
- Public Member Functions inherited from ToneGen
 ToneGen ()
 Default constructor.
 
virtual ~ToneGen ()
 Virtual destructor.
 
void Start (Config *tone, bool sync=false)
 Begin generation of a single tone. More...
 
void Stop ()
 Stop tone generation. More...
 
State GetState () const
 Return the current state of this ToneGen. More...
 
void BeginSequence (Config *tone, bool sync=false)
 Prepare the tone generator for playing a sequence of related tones. More...
 
void ContinueSequence ()
 Begin the next discrete tone in an atomic sequence. More...
 
void EndSequence ()
 Signal the completion of an atomic sequence of tones. More...
 
void SignalCompletion ()
 Notify the tone generator of an external completion event. More...
 
ConfigGetConfig () const
 Return the ToneGen::Config data. More...
 

Protected Member Functions

State ImplStart ()
 Called by Start() for implementation specific operations.
 
- Protected Member Functions inherited from ToneGen
virtual void ImplStop ()
 Called by Stop() for implementation specific operations.
 

Additional Inherited Members

- Public Types inherited from ToneGen
enum  State { IDLE , SEQUENCE , CONTINUOUS , ONESHOT }
 ToneGen state information More...
 
typedef std::vector< ToneGen * > List
 Container type for a list of pointers to ToneGen structures.
 
typedef void(* CompletionCallback) (ToneGen &)
 Call back type for tone completion notification.
 

Detailed Description

Host based tone generator implementation.

Member Function Documentation

◆ MixTone()

bool HostToneGen::MixTone ( int16_t *  buf,
size_t  samples 
)

Add the next samples of this tone to the signal in buf.

Parameters
bufA buffer of 16bit linear audio data to add this tone to.
samplesThe number of tone samples to place in buf.
Returns
true if the tone generator is not IDLE, else false.