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

#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
 
- Public Member Functions inherited from Node
 Node (NodeManager &manager)
 
const std::set< OutputPin * > & getOutputs () const
 
const std::set< InputPinBase * > & getInputs () const
 
- Public Member Functions inherited from Process
 Process (NodeManager &nodeManager)
 
 Process (ParentProcess &parent)
 
 Process (const Process &)=delete
 
Processoperator= (const Process &)=delete
 
virtual ~Process ()
 
void update ()
 
NodeManagergetNodeManager () const
 
int getBufferSize () const
 
float getSampleRate () const
 
DiscreteTimeValue getSampleTime () const
 

Public Attributes

OutputPin audioOutput = {this}
 

Additional Inherited Members

- Protected Member Functions inherited from Node
SampleBuffergetOutputBuffer (OutputPin &output)
 
- Protected Member Functions inherited from Process
virtual void sampleRateChanged (float sampleRate)
 
virtual void bufferSizeChanged (int bufferSize)
 
bool isRegisteredWithNodeManager () const
 

Description

Node to play back audio from a buffer

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

Constructor & Destructor Documentation

◆ BufferPlayerNode()

BufferPlayerNode ( NodeManager manager)

Member Function Documentation

◆ getChannel()

int getChannel ( ) const
Returns
the current playback channel within the source buffer.

◆ getPosition()

DiscreteTimeValue getPosition ( ) const
Returns
the current playback position within the source buffer.

◆ getSpeed()

ControllerValue getSpeed ( ) const
Returns
the playback speed as a fraction of the original speed of the audio material in the buffer.

◆ play()

void play ( int  channel = 0,
DiscreteTimeValue  position = 0,
ControllerValue  speed = 1. 
)

Tells the node to start playback

Parameters
channelthe channel within the buffer to be played
positionthe starting position in the source buffer in samples
speedthe playbackspeed, 1.0 means 1 sample per sample, 2 means double speed, etc.

◆ setBuffer()

void setBuffer ( SafePtr< MultiSampleBuffer buffer)

Sets the buffer to be played back from. Can't be called while playing!

Parameters
bufferSafePtr to a multichannel sample buffer

◆ setChannel()

void setChannel ( int  channel)

Sets the current channel of playback while playing.

Parameters
channelindex of the channel

◆ setPosition()

void setPosition ( DiscreteTimeValue  position)

Sets the current position of playback while playing.

Parameters
positionin samples

◆ setSpeed()

void setSpeed ( ControllerValue  speed)

Set the playback speed

Parameters
speedas a fraction of the original speed of the audio material in the buffer.

◆ stop()

void stop ( )

Stops playback

Member Data Documentation

◆ audioOutput

OutputPin audioOutput = {this}

The output to connect to other nodes