NAP
Public Member Functions | Public Attributes | List of all members
PlaybackComponent Class Reference

#include <audio/component/playbackcomponent.h>

Public Member Functions

 PlaybackComponent ()
 
bool isStereo () const
 
- Public Member Functions inherited from AudioComponentBase
 AudioComponentBase ()
 
- Public Member Functions inherited from Component
virtual void getDependentComponents (std::vector< rtti::TypeInfo > &components) const
 
virtual const rtti::TypeInfo getInstanceType () const =0
 
- Public Member Functions inherited from Resource
 Resource ()
 
- Public Member Functions inherited from Object
 Object ()
 
virtual ~Object ()
 
virtual bool init (utility::ErrorState &errorState)
 
virtual void onDestroy ()
 
 Object (Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&)=delete
 
Objectoperator= (Object &&)=delete
 

Public Attributes

ResourcePtr< AudioBufferResourcemBuffer = nullptr
 property: 'Buffer' The buffer containing the audio to be played back More...
 
std::vector< int > mChannelRouting = { }
 property: 'ChannelRouting' The size of this array indicates the number of channels to be played back. Each element indicates a channel number of the buffer to be played. If left empty it will be filled with the channels in the buffer in ascending order. More...
 
bool mAutoPlay = true
 property: 'AutoPlay' If set to true, the component will start playing on initialization. More...
 
TimeValue mStartPosition = 0
 property: 'StartPosition' Start position of playback in milliseconds. More...
 
TimeValue mDuration = 0
 property: 'Duration' Duration of playback in milliseconds. More...
 
TimeValue mFadeInTime = 0
 property: 'FadeInTime' Fade in time of playback in milliseconds, to prevent clicks. More...
 
TimeValue mFadeOutTime = 0
 property: 'FadeOutTime' Fade out time of playback in milliseconds, to prevent clicks More...
 
ControllerValue mPitch = 1.0
 property: 'Pitch' Pitch as a fraction of the original: 2.0 means double speed, 0.5 means halve speed. More...
 
ControllerValue mGain = 1.0
 property: 'Gain' Overall gain More...
 
ControllerValue mStereoPanning = 0.5
 property: 'StereoPanning' Panning in the stereo field: 0 means far left, 0.5 means center, 1.0 means far right. This property only applies when two channels are being played back. More...
 
- Public Attributes inherited from Object
std::string mID
 Property: 'mID' unique name of the object. Used as an identifier by the system. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Object
static bool isIDProperty (rtti::Instance &object, const rtti::Property &property)
 

Description

Plays-back audio from a nap::audio::AudioBufferResource. Playback can be started on initialization using the AutoPlay property or using the start() method, and is stopped using the stop() method or by specifying the "Duration" property. The component has to be used in combination with an nap::audio::OutputComponent to send the playback to DAC.

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

Constructor & Destructor Documentation

◆ PlaybackComponent()

Member Function Documentation

◆ isStereo()

bool isStereo ( ) const

Returns if the playback consists of 2 audio channels

Member Data Documentation

◆ mAutoPlay

bool mAutoPlay = true

property: 'AutoPlay' If set to true, the component will start playing on initialization.

◆ mBuffer

ResourcePtr<AudioBufferResource> mBuffer = nullptr

property: 'Buffer' The buffer containing the audio to be played back

◆ mChannelRouting

std::vector<int> mChannelRouting = { }

property: 'ChannelRouting' The size of this array indicates the number of channels to be played back. Each element indicates a channel number of the buffer to be played. If left empty it will be filled with the channels in the buffer in ascending order.

◆ mDuration

TimeValue mDuration = 0

property: 'Duration' Duration of playback in milliseconds.

◆ mFadeInTime

TimeValue mFadeInTime = 0

property: 'FadeInTime' Fade in time of playback in milliseconds, to prevent clicks.

◆ mFadeOutTime

TimeValue mFadeOutTime = 0

property: 'FadeOutTime' Fade out time of playback in milliseconds, to prevent clicks

◆ mGain

ControllerValue mGain = 1.0

property: 'Gain' Overall gain

◆ mPitch

ControllerValue mPitch = 1.0

property: 'Pitch' Pitch as a fraction of the original: 2.0 means double speed, 0.5 means halve speed.

◆ mStartPosition

TimeValue mStartPosition = 0

property: 'StartPosition' Start position of playback in milliseconds.

◆ mStereoPanning

ControllerValue mStereoPanning = 0.5

property: 'StereoPanning' Panning in the stereo field: 0 means far left, 0.5 means center, 1.0 means far right. This property only applies when two channels are being played back.