Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
SampleBuffer Class Reference

#include <SampleFormat.h>

Inheritance diagram for SampleBuffer:
[legend]

Public Member Functions

 SampleBuffer ()
 
 SampleBuffer (size_t count, sampleFormat format)
 
 ~SampleBuffer ()
 
 SampleBuffer (SampleBuffer &&other)
 
SampleBufferoperator= (SampleBuffer &&other)
 
SampleBufferAllocate (size_t count, sampleFormat format)
 
void Free ()
 
samplePtr ptr () const
 

Private Attributes

samplePtr mPtr
 

Detailed Description

Definition at line 69 of file SampleFormat.h.

Constructor & Destructor Documentation

◆ SampleBuffer() [1/3]

SampleBuffer::SampleBuffer ( )
inline

Definition at line 72 of file SampleFormat.h.

73 : mPtr(0)
74 {}
samplePtr mPtr
Definition: SampleFormat.h:114

◆ SampleBuffer() [2/3]

SampleBuffer::SampleBuffer ( size_t  count,
sampleFormat  format 
)
inline

Definition at line 75 of file SampleFormat.h.

76 : mPtr((samplePtr)malloc(count * SAMPLE_SIZE(format)))
77 {}
int format
Definition: ExportPCM.cpp:56
char * samplePtr
Definition: SampleFormat.h:49
#define SAMPLE_SIZE(SampleFormat)
Definition: SampleFormat.h:44

◆ ~SampleBuffer()

SampleBuffer::~SampleBuffer ( )
inline

Definition at line 78 of file SampleFormat.h.

79 {
80 Free();
81 }

References Free().

Here is the call graph for this function:

◆ SampleBuffer() [3/3]

SampleBuffer::SampleBuffer ( SampleBuffer &&  other)
inline

Definition at line 82 of file SampleFormat.h.

83 {
84 mPtr = other.mPtr;
85 other.mPtr = nullptr;
86 }

References mPtr.

Member Function Documentation

◆ Allocate()

SampleBuffer & SampleBuffer::Allocate ( size_t  count,
sampleFormat  format 
)
inline

Definition at line 96 of file SampleFormat.h.

97 {
98 Free();
99 mPtr = (samplePtr)malloc(count * SAMPLE_SIZE(format));
100 return *this;
101 }

References format, Free(), mPtr, and SAMPLE_SIZE.

Referenced by WaveClip::Append(), Sequence::Delete(), AudioIO::DrainRecordBuffers(), anonymous_namespace{Sequence.cpp}::ensureSampleBufferSize(), PCMImportFileHandle::Import(), GrowableSampleBuffer::Resize(), and Sequence::SetSamples().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Free()

void SampleBuffer::Free ( )
inline

Definition at line 104 of file SampleFormat.h.

105 {
106 free(mPtr);
107 mPtr = 0;
108 }

References mPtr.

Referenced by Allocate(), GrowableSampleBuffer::Free(), and ~SampleBuffer().

Here is the caller graph for this function:

◆ operator=()

SampleBuffer & SampleBuffer::operator= ( SampleBuffer &&  other)
inline

Definition at line 87 of file SampleFormat.h.

88 {
89 auto ptr = other.mPtr;
90 other.mPtr = nullptr;
91 mPtr = ptr;
92 return *this;
93 }
samplePtr ptr() const
Definition: SampleFormat.h:110

References mPtr, and ptr().

Here is the call graph for this function:

◆ ptr()

samplePtr SampleBuffer::ptr ( ) const
inline

Member Data Documentation

◆ mPtr

samplePtr SampleBuffer::mPtr
private

Definition at line 114 of file SampleFormat.h.

Referenced by Allocate(), Free(), operator=(), ptr(), and SampleBuffer().


The documentation for this class was generated from the following file: