pl-nk v0.4.5
Plonk|Plink|Plank are a set of cross-platform C/C++ frameworks for audio software development
Public Member Functions | Protected Member Functions
AudioHostBase< SampleType > Class Template Reference

An abstract class to interface with audio devices. More...

Inherits PlonkBase.

Inherited by PLONK_NAMESPACE::IOSAudioHostBase< SampleType >, PLONK_NAMESPACE::PortAudioAudioHostBase< SampleType >, and PLONK_NAMESPACE::RTAudioAudioHostBase< SampleType >.

List of all members.

Public Member Functions

 AudioHostBase () throw ()
 Constructor.
virtual ~AudioHostBase ()
 Destructor.
bool getIsRunning () const throw ()
 Determine whether the audio device is running.
bool getIsPaused () const throw ()
 Determine whether the audio device is paused.
const UnitTypegetOutputUnit () const throw ()
 Get a reference to the output unit.
int getNumInputs () const throw ()
 Get the number of audio inputs.
int getNumOutputs () const throw ()
 Get the number of audio outputs.
double getPreferredHostSampleRate () const throw ()
 Get the current preferred sample rate for the host.
int getPreferredHostBlockSize () const throw ()
 Get the current preferred block size for the host.
void setPreferredHostSampleRate (const double newRate) throw ()
 Set the host's preferred sample rate.
void setPreferredHostBlockSize (const int newSize) throw ()
 Set the host's preferred block size.
int getPreferredGraphBlockSize () const throw ()
 Get the current preferred block size for the graph.
void setPreferredGraphBlockSize (const int newSize) throw ()
 Set the graph's preferred block size.
void setNumInputs (const int numInputs) throw ()
 Set the number of audio inputs required.
void setNumOutputs (const int numOutputs) throw ()
 Set the number of audio inputs required.
OptionDictionary getOtherOptions () const throw ()
 Get other (normally platform dependent) options.

Protected Member Functions

const ConstBufferArraygetInputs () const throw ()
 Get the input buffers.
ConstBufferArraygetInputs () throw ()
 Get the input buffers.
const BufferArraygetOutputs () const throw ()
 Get the output buffers.
BufferArraygetOutputs () throw ()
 Get the output buffers.
virtual Text getHostName () const =0
 Get the name of the audio host.
virtual Text getNativeHostName () const =0
 Get the name of the native host audio API.
virtual Text getInputName () const =0
 Get the name of the audio input device.
virtual Text getOutputName () const =0
 Get the name of the audio output device.
virtual double getCpuUsage () const =0
 Get the current CPU usage for the DSP loop.
virtual void startHost ()=0
 Start the host.
virtual void stopHost ()=0
 Stop the host.
virtual UnitType constructGraph ()=0
 This must be implemented by your application.
void setIsRunning (const bool state) throw ()
 Set a flag to indicate the audio host is running.

Detailed Description

template<class SampleType>
class AudioHostBase< SampleType >

An abstract class to interface with audio devices.

See also:
PortAudioAudioHost, IOSAudioHost, JuceAudioHost

Member Function Documentation

template<class SampleType>
virtual UnitType AudioHostBase< SampleType >::constructGraph ( ) [protected, pure virtual]

This must be implemented by your application.

It should return the audio graph that is rendered to the host.

template<class SampleType>
virtual double AudioHostBase< SampleType >::getCpuUsage ( ) const [protected, pure virtual]

Get the current CPU usage for the DSP loop.

Implemented in PLONK_NAMESPACE::IOSAudioHostBase< SampleType >, and PLONK_NAMESPACE::IOSAudioHostBase< float >.

template<class SampleType>
virtual Text AudioHostBase< SampleType >::getHostName ( ) const [protected, pure virtual]
template<class SampleType>
virtual Text AudioHostBase< SampleType >::getInputName ( ) const [protected, pure virtual]

Get the name of the audio input device.

Implemented in PLONK_NAMESPACE::IOSAudioHostBase< SampleType >, and PLONK_NAMESPACE::IOSAudioHostBase< float >.

template<class SampleType>
bool AudioHostBase< SampleType >::getIsPaused ( ) const throw () [inline]

Determine whether the audio device is paused.

template<class SampleType>
bool AudioHostBase< SampleType >::getIsRunning ( ) const throw () [inline]

Determine whether the audio device is running.

template<class SampleType>
virtual Text AudioHostBase< SampleType >::getNativeHostName ( ) const [protected, pure virtual]

Get the name of the native host audio API.

Implemented in PLONK_NAMESPACE::IOSAudioHostBase< SampleType >, and PLONK_NAMESPACE::IOSAudioHostBase< float >.

template<class SampleType>
int AudioHostBase< SampleType >::getNumInputs ( ) const throw () [inline]

Get the number of audio inputs.

template<class SampleType>
int AudioHostBase< SampleType >::getNumOutputs ( ) const throw () [inline]

Get the number of audio outputs.

template<class SampleType>
OptionDictionary AudioHostBase< SampleType >::getOtherOptions ( ) const throw () [inline]

Get other (normally platform dependent) options.

template<class SampleType>
virtual Text AudioHostBase< SampleType >::getOutputName ( ) const [protected, pure virtual]

Get the name of the audio output device.

Implemented in PLONK_NAMESPACE::IOSAudioHostBase< SampleType >, and PLONK_NAMESPACE::IOSAudioHostBase< float >.

template<class SampleType>
const UnitType& AudioHostBase< SampleType >::getOutputUnit ( ) const throw () [inline]

Get a reference to the output unit.

template<class SampleType>
int AudioHostBase< SampleType >::getPreferredGraphBlockSize ( ) const throw () [inline]

Get the current preferred block size for the graph.

template<class SampleType>
int AudioHostBase< SampleType >::getPreferredHostBlockSize ( ) const throw () [inline]

Get the current preferred block size for the host.

template<class SampleType>
double AudioHostBase< SampleType >::getPreferredHostSampleRate ( ) const throw () [inline]

Get the current preferred sample rate for the host.

template<class SampleType>
void AudioHostBase< SampleType >::setIsRunning ( const bool  state) throw () [inline, protected]

Set a flag to indicate the audio host is running.

NB This does not start or stop the host use startHost() and stopHost() respectively.

template<class SampleType >
void AudioHostBase< SampleType >::setNumInputs ( const int  numInputs) throw ()

Set the number of audio inputs required.

This must be called before startHost() to have any effect.

template<class SampleType >
void AudioHostBase< SampleType >::setNumOutputs ( const int  numOutputs) throw ()

Set the number of audio inputs required.

This must be called before startHost() to have any effect.

template<class SampleType>
void AudioHostBase< SampleType >::setPreferredGraphBlockSize ( const int  newSize) throw () [inline]

Set the graph's preferred block size.

This must be called before startHost() to have any effect.

template<class SampleType>
void AudioHostBase< SampleType >::setPreferredHostBlockSize ( const int  newSize) throw () [inline]

Set the host's preferred block size.

This must be called before startHost() to have any effect.

template<class SampleType>
void AudioHostBase< SampleType >::setPreferredHostSampleRate ( const double  newRate) throw () [inline]

Set the host's preferred sample rate.

This must be called before startHost() to have any effect.

template<class SampleType>
virtual void AudioHostBase< SampleType >::startHost ( ) [protected, pure virtual]
template<class SampleType>
virtual void AudioHostBase< SampleType >::stopHost ( ) [protected, pure virtual]

The documentation for this class was generated from the following file:
 All Classes Functions Typedefs Enumerations Enumerator Properties