OpenShot Library | libopenshot-audio 0.2.0
|
Used as a template parameter for AudioData::Pointer. More...
#include <juce_AudioDataConverters.h>
Public Member Functions | |
Pointer (typename Constness::VoidType *sourceData) noexcept | |
Creates a non-interleaved pointer from some raw data in the appropriate format. | |
Pointer (typename Constness::VoidType *sourceData, int numInterleaved) noexcept | |
Creates a pointer from some raw data in the appropriate format with the specified number of interleaved channels. | |
Pointer (const Pointer &other) noexcept | |
Creates a copy of another pointer. | |
Pointer & | operator= (const Pointer &other) noexcept |
float | getAsFloat () const noexcept |
Returns the value of the first sample as a floating point value. | |
void | setAsFloat (float newValue) noexcept |
Sets the value of the first sample as a floating point value. | |
int32 | getAsInt32 () const noexcept |
Returns the value of the first sample as a 32-bit integer. | |
void | setAsInt32 (int32 newValue) noexcept |
Sets the value of the first sample as a 32-bit integer. | |
Pointer & | operator++ () noexcept |
Moves the pointer along to the next sample. | |
Pointer & | operator-- () noexcept |
Moves the pointer back to the previous sample. | |
Pointer & | operator+= (int samplesToJump) noexcept |
Adds a number of samples to the pointer's position. | |
void | convertSamples (Pointer source, int numSamples) const noexcept |
Writes a stream of samples into this pointer from another pointer. | |
template<class OtherPointerType > | |
void | convertSamples (OtherPointerType source, int numSamples) const noexcept |
Writes a stream of samples into this pointer from another pointer. | |
void | clearSamples (int numSamples) const noexcept |
Sets a number of samples to zero. | |
Range< float > | findMinAndMax (size_t numSamples) const noexcept |
Scans a block of data, returning the lowest and highest levels as floats. | |
void | findMinAndMax (size_t numSamples, float &minValue, float &maxValue) const noexcept |
Scans a block of data, returning the lowest and highest levels as floats. | |
int | getNumInterleavedChannels () const noexcept |
Returns the number of interleaved channels in the format. | |
int | getNumBytesBetweenSamples () const noexcept |
Returns the number of bytes between the start address of each sample. | |
const void * | getRawData () const noexcept |
Returns a pointer to the underlying data. | |
Static Public Member Functions | |
static bool | isFloatingPoint () noexcept |
Returns true if the pointer is using a floating-point format. | |
static bool | isBigEndian () noexcept |
Returns true if the format is big-endian. | |
static int | getBytesPerSample () noexcept |
Returns the number of bytes in each sample (ignoring the number of interleaved channels). | |
static int | get32BitResolution () noexcept |
Returns the accuracy of this format when represented as a 32-bit integer. | |
Used as a template parameter for AudioData::Pointer.
Indicates that the samples can only be used for const data.. A pointer to a block of audio data with a particular encoding.
This object can be used to read and write from blocks of encoded audio samples. To create one, you specify the audio format as a series of template parameters, e.g.
The convertSamples() method lets you copy a range of samples from one format to another, automatically converting its format.
Definition at line 358 of file juce_AudioDataConverters.h.
|
inlinenoexcept |
Creates a non-interleaved pointer from some raw data in the appropriate format.
This constructor is only used if you've specified the AudioData::NonInterleaved option - for interleaved formats, use the constructor that also takes a number of channels.
Definition at line 366 of file juce_AudioDataConverters.h.
|
inlinenoexcept |
Creates a pointer from some raw data in the appropriate format with the specified number of interleaved channels.
For non-interleaved data, use the other constructor.
Definition at line 377 of file juce_AudioDataConverters.h.
|
inlinenoexcept |
Creates a copy of another pointer.
Definition at line 383 of file juce_AudioDataConverters.h.
|
inlinenoexcept |
Definition at line 388 of file juce_AudioDataConverters.h.
|
inlinenoexcept |
Returns the value of the first sample as a floating point value.
The value will be in the range -1.0 to 1.0 for integer formats. For floating point formats, the value could be outside that range, although -1 to 1 is the standard range.
Definition at line 400 of file juce_AudioDataConverters.h.
Referenced by juce::AudioData::Pointer< SampleFormat, Endianness, InterleavingType, Constness >::findMinAndMax().
|
inlinenoexcept |
Sets the value of the first sample as a floating point value.
(This method can only be used if the AudioData::NonConst option was used). The value should be in the range -1.0 to 1.0 - for integer formats, values outside that range will be clipped. For floating point formats, any value passed in here will be written directly, although -1 to 1 is the standard range.
Definition at line 409 of file juce_AudioDataConverters.h.
|
inlinenoexcept |
Returns the value of the first sample as a 32-bit integer.
The value returned will be in the range 0x80000000 to 0x7fffffff, and shorter values will be shifted to fill this range (e.g. if you're reading from 24-bit data, the values will be shifted up by 8 bits when returned here). If the source data is floating point, values beyond -1.0 to 1.0 will be clipped so that -1.0 maps onto -0x7fffffff and 1.0 maps to 0x7fffffff.
Definition at line 422 of file juce_AudioDataConverters.h.
Referenced by juce::AudioData::Pointer< SampleFormat, Endianness, InterleavingType, Constness >::findMinAndMax().
|
inlinenoexcept |
Sets the value of the first sample as a 32-bit integer.
This will be mapped to the range of the format that is being written - see getAsInt32().
Definition at line 427 of file juce_AudioDataConverters.h.
|
inlinenoexcept |
Moves the pointer along to the next sample.
Definition at line 435 of file juce_AudioDataConverters.h.
|
inlinenoexcept |
Moves the pointer back to the previous sample.
Definition at line 438 of file juce_AudioDataConverters.h.
|
inlinenoexcept |
Adds a number of samples to the pointer's position.
Definition at line 441 of file juce_AudioDataConverters.h.
|
inlinenoexcept |
Writes a stream of samples into this pointer from another pointer.
This will copy the specified number of samples, converting between formats appropriately.
Definition at line 446 of file juce_AudioDataConverters.h.
References juce::Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::data().
|
inlinenoexcept |
Writes a stream of samples into this pointer from another pointer.
This will copy the specified number of samples, converting between formats appropriately.
Definition at line 463 of file juce_AudioDataConverters.h.
|
inlinenoexcept |
Sets a number of samples to zero.
Definition at line 490 of file juce_AudioDataConverters.h.
|
inlinenoexcept |
Scans a block of data, returning the lowest and highest levels as floats.
Definition at line 497 of file juce_AudioDataConverters.h.
References juce::AudioData::Pointer< SampleFormat, Endianness, InterleavingType, Constness >::getAsFloat(), and juce::AudioData::Pointer< SampleFormat, Endianness, InterleavingType, Constness >::getAsInt32().
|
inlinenoexcept |
Scans a block of data, returning the lowest and highest levels as floats.
Definition at line 540 of file juce_AudioDataConverters.h.
|
inlinestaticnoexcept |
Returns true if the pointer is using a floating-point format.
Definition at line 548 of file juce_AudioDataConverters.h.
|
inlinestaticnoexcept |
Returns true if the format is big-endian.
Definition at line 551 of file juce_AudioDataConverters.h.
|
inlinestaticnoexcept |
Returns the number of bytes in each sample (ignoring the number of interleaved channels).
Definition at line 554 of file juce_AudioDataConverters.h.
|
inlinenoexcept |
Returns the number of interleaved channels in the format.
Definition at line 557 of file juce_AudioDataConverters.h.
|
inlinenoexcept |
Returns the number of bytes between the start address of each sample.
Definition at line 560 of file juce_AudioDataConverters.h.
|
inlinestaticnoexcept |
Returns the accuracy of this format when represented as a 32-bit integer.
This is the smallest number above 0 that can be represented in the sample format, converted to a 32-bit range. E,g. if the format is 8-bit, its resolution is 0x01000000; if the format is 24-bit, its resolution is 0x100.
Definition at line 567 of file juce_AudioDataConverters.h.
|
inlinenoexcept |
Returns a pointer to the underlying data.
Definition at line 570 of file juce_AudioDataConverters.h.
References juce::Array< ElementType, TypeOfCriticalSectionToUse, minimumAllocatedSize >::data().