#include <audio/component/playbackcomponent.h>
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
![]() | |
NodeManager & | getNodeManager () |
AudioService & | getAudioService () |
Instance of PlaybackComponent. 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.
PlaybackComponentInstance | ( | EntityInstance & | entity, |
Component & | resource | ||
) |
|
overridevirtual |
Override this method to specify the number of audio channels output by this object.
Implements IMultiChannelOutput.
TimeValue getCurrentPlayingTime | ( | ) | const |
ControllerValue getFadeInTime | ( | ) | const |
ControllerValue getFadeOutTime | ( | ) | const |
ControllerValue getGain | ( | ) | const |
|
overridevirtual |
To be overridden by descendants.
channel | channel index to request the output for |
Implements IMultiChannelOutput.
ControllerValue getPitch | ( | ) | const |
ControllerValue getStereoPanning | ( | ) | const |
|
overridevirtual |
Initializes this component based on it's resource.
errorState | contains the error when initialization fails. |
Reimplemented from ComponentInstance.
bool isPlaying | ( | ) | const |
bool isStereo | ( | ) | const |
void setChannelGain | ( | int | channel, |
ControllerValue | gain | ||
) |
Sets the gain for a single channel relative to the overall gain. Use this for manual panning with for example non-stereo channel setups.
void setFadeInTime | ( | TimeValue | time | ) |
Sets the fade in time used in milliseconds when starting playback.
void setFadeOutTime | ( | TimeValue | time | ) |
Sets the fade out time used in milliseconds when stopping playback.
void setGain | ( | ControllerValue | gain | ) |
Sets the overall gain of playback.
void setPitch | ( | ControllerValue | pitch | ) |
Sets the pitch as a fraction of the original pitch of the audio material in the buffer.
void setStereoPanning | ( | ControllerValue | panning | ) |
Sets the panning for stereo playback: 0 means far left, 0.5 means center and 1.0 means far right. Only applies when there are 2 channels of playback.
startPosition | the start position in the buffer in milliseconds |
duration | the total duration of playback in milliseconds. 0 means play untill the end of the buffer |
void stop | ( | ) |
Fade out over fade out time and stop playback.
|
overridevirtual |
Update this component
deltaTime | the time in between cooks in seconds |
Reimplemented from ComponentInstance.