20 #include "../fragments/sequence.h"
21 #include "../context.h"
24 #include "../utils/input_stream.h"
41 class Pointer :
public Sequence::Pointer {
110 static void prepare(
Signal& signal,
int skipOnStart = 0,
int numSteps = 1);
162 const dtime maxBufferLen
170 const dtime bufferLength
void measureInFragments(dtime len, int resolution, sample *min, sample *max)
Measures signal dynamics in a given period of time.
static void prepareSignal(Signal &signal, bool runTask=true)
Precomputes the dynamics lookup all over the signal, where needed.
void measure(dtime len, int resolution, sample min[], sample max[])
Measures signal dynamics in a given period of time.
Meter(Signal &signal, dtime time, MeasuringMode mode=MeasuringMode::approximateUsingLookup)
Constructs a new meter.
MeasuringMode
Specifies how to compute signal dynamics (minima and maxima in a given period of time)
@ approximateUsingLookup
Find an approximated range using a lookup tree.
@ preciseUsingLookupAndSamples
Use lookup and then precise the measurement using sample data.
@ preciseUsingSamples
Just run across all samples.
void setMode(MeasuringMode newMode)
static void prepare(Signal &signal, int skipOnStart=0, int numSteps=1)
Implements a Sequence::Pointer for audio signals.
unsigned char getChannelCount() const
virtual void releaseBuffer()
Pointer(Signal &signal, dtime time, bool writing)
Provides reading access to the signal.
Reader(Signal &signal, dtime time)
dtime acquireBuffer(const void *&data)
Audio::Source reading samples from a given Signal.
unsigned char numChannels
void prepare(const dtime sampleRate, const AudioSampleFormat sampleFormat, const unsigned char numChannels, const dtime maxBufferLen)
Prepares a source to render audio data.
AudioSampleFormat sampleFormat
void render(TaskThread &thread, sample8 *buffer, const dtime bufferLength)
Renders audio data to the target output buffer given by the user.
ThreadIndex getMaxThreads()
Returns the maximum number of working threads for rendering from this source.
void setClock(dtime time)
Called by the source user when an abrupt time change occurs (e.g., due to seeking)
Provides writing access to the signal.
Writer(Signal &signal, dtime time)
dtime acquireBuffer(void *&data)
void insert(const Signal &signal, dtime time)
Inserts a Signal into the current signal at a specific time moment.
Context & getContext() const
unsigned char getChannelCount() const
static const int DEFAULT_FRAGMENT_LENGTH_SEC
AudioSampleFormat format
sample format
AudioSampleFormat getSampleFormat() const
Signal(Context &context, AudioSampleFormat format, int sampleRate, unsigned char channels, float defaultFragmentLenSec=DEFAULT_FRAGMENT_LENGTH_SEC)
Creates an empty signal.
unsigned char channelCount
number of channels
void reserve(dtime length)
Prolongates the sequence if necessary, to ensure given length.
static Signal * loadWAV(Context &ctx, const char *fileName)
int sampleRate
sampling frequency
void saveWAV(const char *filename)
Stores the signal to a PCM-encoded WAV file.
virtual Signal * createEmpty() const
Initializes an empty sequence, used to bootstrap copying operations.
const dtime defaultFragmentSize
Abstract source of audio signal.
Basic class: task and memory management, any kind of static data.
Base class for all exceptions.
unsigned char ThreadIndex
number of threads / thread index
AudioSampleFormat
Format of audio samples.
CustomPoint< numeric > min(const CustomPoint< numeric > &a, const CustomPoint< numeric > &b)
CustomPoint< numeric > max(const CustomPoint< numeric > &a, const CustomPoint< numeric > &b)
JNIEnv jobject jint jint jint channels
JNIEnv jlong jstring filename