NAP
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
SequencePlayerAudioOutput Class Referencefinal

#include <sequenceplayeraudiooutput.h>

Public Member Functions

 SequencePlayerAudioOutput (SequenceService &service)
 
bool init (utility::ErrorState &errorState) override
 
void onDestroy () override
 
virtual const std::vector< rtti::ObjectPtr< audio::AudioBufferResource > > & getBuffers () const
 
void connectInputPin (audio::InputPin &inputPin, int channel)
 
void disconnectInputPin (audio::InputPin &inputPin, int channel)
 
audio::OutputPingetOutputForChannel (int channel)
 
int getChannelCount () const
 
- Public Member Functions inherited from SequencePlayerOutput
 SequencePlayerOutput (SequenceService &service)
 
 ~SequencePlayerOutput () override=default
 
- Public Member Functions inherited from Resource
 Resource ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Public Attributes

std::vector< ResourcePtr< audio::AudioBufferResource > > mAudioBuffers
 Property: 'Audio Buffers' resource pointers to audio buffers. More...
 
bool mManualRouting = false
 Property: 'Manual Routing' if output should directly output Audio to AudioDevice as selected in AudioService. More...
 
int mMaxChannels = 8
 Property: 'Max Channels' maximum number of audio channels should use. More...
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Protected Member Functions

void update (double deltaTime) override
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 
- Protected Attributes inherited from SequencePlayerOutput
SequenceServicemService = nullptr
 

Description

The SequencePlayerAudioOutput is responsible for translating updates from SequencePlayerAudioAdapters to appropriate calls to audio::MultiSampleBufferPlayerNodes. When an adapter registers itself to the SequencePlayerAudioOutput multiple MultiSampleBufferPlayerNodes are created, each adapter gets its own MultiSampleBufferPlayerNode for each AudioBufferResource. All MultiSampleBufferPlayerNodes output pins are connected to MixNodes owned by the SequencePlayerAudioOutput. You can connect your own Node inputPins to the appropriate outputPins using connectPinaudio::InputPin& inputPin, int channel) or getOutputForChannel(int channel). When mCreateOutputNodes is set to true, the SequencePlayerAudioOutput will create it's own OutputNodes routing the audio to the selected audio interface by the AudioService.

Inheritance diagram for SequencePlayerAudioOutput:
[legend]
Collaboration diagram for SequencePlayerAudioOutput:
[legend]

Constructor & Destructor Documentation

◆ SequencePlayerAudioOutput()

Constructor

Parameters
servicereference to service

Member Function Documentation

◆ connectInputPin()

void connectInputPin ( audio::InputPin inputPin,
int  channel 
)

Connect an inputPin to one of the SequencePlayerAudioOutput channels. Assert when channel index is out of bounds.

Parameters
inputPinreference to audio::inputPin
channelthe channel to connect to

◆ disconnectInputPin()

void disconnectInputPin ( audio::InputPin inputPin,
int  channel 
)

Disconnect an inputPin from one of the SequencePlayerAudioOutput channels. Assert when channel index is out of bounds.

Parameters
inputPinreference to audio::inputPin
channelthe channel to connect to

◆ getBuffers()

virtual const std::vector<rtti::ObjectPtr<audio::AudioBufferResource> >& getBuffers ( ) const
virtual

Returns a const reference to a vector of ObjectPointers to audio buffer resources

Returns
const reference to a vector of ObjectPointers to audio buffer resources

◆ getChannelCount()

int getChannelCount ( ) const

Returns amount of channels

Returns
amount of channels

◆ getOutputForChannel()

audio::OutputPin* getOutputForChannel ( int  channel)

Returns OutputPin for given channel. Assert when channel index is out of bounds.

Parameters
channel
Returns
pointer to outputPin of given channel

◆ init()

bool init ( utility::ErrorState errorState)
overridevirtual

Initialization function

Parameters
errorStatecontains any errors
Returns
true on success

Reimplemented from SequencePlayerOutput.

◆ onDestroy()

void onDestroy ( )
overridevirtual

called before deconstruction of the resource

Reimplemented from SequencePlayerOutput.

◆ update()

void update ( double  deltaTime)
overrideprotectedvirtual

inherited update function, called from sequence service

Parameters
deltaTime

Reimplemented from SequencePlayerOutput.

Member Data Documentation

◆ mAudioBuffers

std::vector<ResourcePtr<audio::AudioBufferResource> > mAudioBuffers

Property: 'Audio Buffers' resource pointers to audio buffers.

◆ mManualRouting

bool mManualRouting = false

Property: 'Manual Routing' if output should directly output Audio to AudioDevice as selected in AudioService.

When set to false the SequencePlayerAudioOutput will create the necessary output nodes to route audio to the selected playback device by AudioService

◆ mMaxChannels

int mMaxChannels = 8

Property: 'Max Channels' maximum number of audio channels should use.

Maximum output channels, the SequencePlayerAudioOutput cannot play AudioFiles with more then this amount of channels