![]() |
Audacity 3.2.0
|
Go to the source code of this file.
Classes | |
class | SampleBuffer |
class | GrowableSampleBuffer |
Macros | |
#define | SAMPLE_SIZE(SampleFormat) (SampleFormat >> 16) |
#define | SAMPLE_SIZE_DISK(SampleFormat) |
Return the size on disk of one uncompressed sample (bytes) More... | |
Typedefs | |
using | samplePtr = char * |
using | constSamplePtr = const char * |
using | Floats = ArrayOf< float > |
using | FloatBuffers = ArraysOf< float > |
using | Doubles = ArrayOf< double > |
Enumerations | |
enum | sampleFormat : unsigned { int16Sample = 0x00020001 , int24Sample = 0x00040001 , floatSample = 0x0004000F , narrowestSampleFormat = int16Sample , widestSampleFormat = floatSample } |
enum | fillFormat { fillZero = 0 , fillTwo = 2 } |
Functions | |
MATH_API TranslatableString | GetSampleFormatStr (sampleFormat format) |
MATH_API void | SamplesToFloats (constSamplePtr src, sampleFormat srcFormat, float *dst, size_t len, size_t srcStride=1, size_t dstStride=1) |
Copy samples from any format into the widest format, which is 32 bit float, with no dithering. More... | |
MATH_API void | CopySamples (constSamplePtr src, sampleFormat srcFormat, samplePtr dst, sampleFormat dstFormat, size_t len, DitherType ditherType=gHighQualityDither, unsigned int srcStride=1, unsigned int dstStride=1) |
Copy samples from any format to any other format; apply dithering only if narrowing the format. More... | |
MATH_API void | ClearSamples (samplePtr buffer, sampleFormat format, size_t start, size_t len) |
MATH_API void | ReverseSamples (samplePtr buffer, sampleFormat format, int start, int len) |
MATH_API void | InitDitherers () |
Variables | |
MATH_API DitherType | gLowQualityDither |
These global variables are assigned at application startup or after change of preferences. More... | |
MATH_API DitherType | gHighQualityDither |
#define SAMPLE_SIZE | ( | SampleFormat | ) | (SampleFormat >> 16) |
Definition at line 44 of file SampleFormat.h.
#define SAMPLE_SIZE_DISK | ( | SampleFormat | ) |
Return the size on disk of one uncompressed sample (bytes)
Definition at line 59 of file SampleFormat.h.
using constSamplePtr = const char * |
Definition at line 50 of file SampleFormat.h.
Definition at line 200 of file SampleFormat.h.
using FloatBuffers = ArraysOf<float> |
Definition at line 199 of file SampleFormat.h.
Definition at line 198 of file SampleFormat.h.
using samplePtr = char * |
Definition at line 49 of file SampleFormat.h.
enum fillFormat |
Enumerator | |
---|---|
fillZero | |
fillTwo |
Definition at line 53 of file SampleFormat.h.
enum sampleFormat : unsigned |
Definition at line 28 of file SampleFormat.h.
MATH_API void ClearSamples | ( | samplePtr | buffer, |
sampleFormat | format, | ||
size_t | start, | ||
size_t | len | ||
) |
Definition at line 77 of file SampleFormat.cpp.
References format, SAMPLE_SIZE, and size.
Referenced by RingBuffer::Clear(), AudioIO::DrainRecordBuffers(), Sequence::Get(), WaveTrack::Get(), SampleBlock::GetSamples(), RingBuffer::Put(), and Sequence::SetSamples().
MATH_API void CopySamples | ( | constSamplePtr | src, |
sampleFormat | srcFormat, | ||
samplePtr | dst, | ||
sampleFormat | dstFormat, | ||
size_t | len, | ||
DitherType | ditherType = gHighQualityDither , |
||
unsigned int | srcStride = 1 , |
||
unsigned int | dstStride = 1 |
||
) |
Copy samples from any format to any other format; apply dithering only if narrowing the format.
src | address of source samples |
srcFormat | format of source samples, determines sizeof each one |
dst | address of floating-point numbers |
len | count of samples to copy |
srcStride | how many samples to advance src after copying each one |
dstString | how many samples to advance dst after copying each one |
dstFormat | format of destination samples, determines sizeof each one |
ditherType | choice of dithering algorithm to use if narrowing the format |
ditherType | default is loaded from a global variable |
Definition at line 111 of file SampleFormat.cpp.
References Dither::Apply(), and gDitherAlgorithm.
Referenced by AUPImportFileHandle::AddSamples(), WaveClip::Append(), Sequence::ConvertToSampleFormat(), Sequence::DoAppend(), ExportPCM::Export(), RingBuffer::Get(), SqliteSampleBlock::GetBlob(), Mixer::Process(), RingBuffer::Put(), SamplesToFloats(), and Sequence::SetSamples().
MATH_API TranslatableString GetSampleFormatStr | ( | sampleFormat | format | ) |
Definition at line 60 of file SampleFormat.cpp.
References floatSample, format, int16Sample, int24Sample, and XO.
Referenced by FormatMenuTable::OnFormatChange(), Sequence::Paste(), and anonymous_namespace{WaveTrackControls.cpp}::Status2DrawFunction().
MATH_API void InitDitherers | ( | ) |
Definition at line 53 of file SampleFormat.cpp.
References Dither::BestDitherChoice(), Dither::FastDitherChoice(), gHighQualityDither, and gLowQualityDither.
Referenced by QualityPrefs::Commit(), and AudacityApp::InitPart2().
MATH_API void ReverseSamples | ( | samplePtr | buffer, |
sampleFormat | format, | ||
int | start, | ||
int | len | ||
) |
Definition at line 84 of file SampleFormat.cpp.
References floatSample, format, SAMPLE_SIZE, and size.
Referenced by Mixer::MixSameRate(), and Mixer::MixVariableRates().
MATH_API void SamplesToFloats | ( | constSamplePtr | src, |
sampleFormat | srcFormat, | ||
float * | dst, | ||
size_t | len, | ||
size_t | srcStride = 1 , |
||
size_t | dstStride = 1 |
||
) |
Copy samples from any format into the widest format, which is 32 bit float, with no dithering.
src | address of source samples |
srcFormat | format of source samples, determines sizeof each one |
dst | address of floating-point numbers |
len | count of samples to copy |
srcStride | how many samples to advance src after copying each one |
dstString | how many samples to advance dst after copying each one |
Definition at line 102 of file SampleFormat.cpp.
References CopySamples(), floatSample, and none.
Referenced by AudioIoCallback::AudioCallback(), SqliteSampleBlock::CalcSummary(), DoSoftwarePlaythrough(), and WaveClipWaveformCache::GetWaveDisplay().
MATH_API DitherType gHighQualityDither |
Definition at line 23 of file SampleFormat.h.
|
extern |
These global variables are assigned at application startup or after change of preferences.
Definition at line 49 of file SampleFormat.cpp.
Referenced by InitDitherers(), and Mixer::Process().