#include <audio/node/bufferplayernode.h>
Public Member Functions | |
BufferPlayerNode (NodeManager &manager) | |
void | play (int channel=0, DiscreteTimeValue position=0, ControllerValue speed=1.) |
void | stop () |
void | setSpeed (ControllerValue speed) |
void | setPosition (DiscreteTimeValue position) |
void | setChannel (int channel) |
void | setBuffer (SafePtr< MultiSampleBuffer > buffer) |
ControllerValue | getSpeed () const |
DiscreteTimeValue | getPosition () const |
int | getChannel () const |
![]() | |
Node (NodeManager &manager) | |
const std::set< OutputPin * > & | getOutputs () const |
const std::set< InputPinBase * > & | getInputs () const |
![]() | |
Process (NodeManager &nodeManager) | |
Process (ParentProcess &parent) | |
Process (const Process &)=delete | |
Process & | operator= (const Process &)=delete |
virtual | ~Process () |
void | update () |
NodeManager & | getNodeManager () const |
int | getBufferSize () const |
float | getSampleRate () const |
DiscreteTimeValue | getSampleTime () const |
Public Attributes | |
OutputPin | audioOutput = {this} |
Additional Inherited Members | |
![]() | |
SampleBuffer & | getOutputBuffer (OutputPin &output) |
![]() | |
virtual void | sampleRateChanged (float sampleRate) |
virtual void | bufferSizeChanged (int bufferSize) |
bool | isRegisteredWithNodeManager () const |
Node to play back audio from a buffer
BufferPlayerNode | ( | NodeManager & | manager | ) |
int getChannel | ( | ) | const |
DiscreteTimeValue getPosition | ( | ) | const |
ControllerValue getSpeed | ( | ) | const |
void play | ( | int | channel = 0 , |
DiscreteTimeValue | position = 0 , |
||
ControllerValue | speed = 1. |
||
) |
Tells the node to start playback
channel | the channel within the buffer to be played |
position | the starting position in the source buffer in samples |
speed | the playbackspeed, 1.0 means 1 sample per sample, 2 means double speed, etc. |
void setBuffer | ( | SafePtr< MultiSampleBuffer > | buffer | ) |
Sets the buffer to be played back from. Can't be called while playing!
buffer | SafePtr to a multichannel sample buffer |
void setChannel | ( | int | channel | ) |
Sets the current channel of playback while playing.
channel | index of the channel |
void setPosition | ( | DiscreteTimeValue | position | ) |
Sets the current position of playback while playing.
position | in samples |
void setSpeed | ( | ControllerValue | speed | ) |
Set the playback speed
speed | as a fraction of the original speed of the audio material in the buffer. |
void stop | ( | ) |
Stops playback
OutputPin audioOutput = {this} |
The output to connect to other nodes