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 111 of file SampleFormat.h.

Constructor & Destructor Documentation

◆ SampleBuffer() [1/3]

SampleBuffer::SampleBuffer ( )
inline

Definition at line 114 of file SampleFormat.h.

115 : mPtr(0)
116 {}
samplePtr mPtr
Definition: SampleFormat.h:156

◆ SampleBuffer() [2/3]

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

Definition at line 117 of file SampleFormat.h.

118 : mPtr((samplePtr)malloc(count * SAMPLE_SIZE(format)))
119 {}
int format
Definition: ExportPCM.cpp:53
char * samplePtr
Definition: SampleFormat.h:55
#define SAMPLE_SIZE(SampleFormat)
Definition: SampleFormat.h:50

◆ ~SampleBuffer()

SampleBuffer::~SampleBuffer ( )
inline

Definition at line 120 of file SampleFormat.h.

121 {
122 Free();
123 }

References Free().

Here is the call graph for this function:

◆ SampleBuffer() [3/3]

SampleBuffer::SampleBuffer ( SampleBuffer &&  other)
inline

Definition at line 124 of file SampleFormat.h.

125 {
126 mPtr = other.mPtr;
127 other.mPtr = nullptr;
128 }

References mPtr.

Member Function Documentation

◆ Allocate()

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

Definition at line 138 of file SampleFormat.h.

139 {
140 Free();
141 mPtr = (samplePtr)malloc(count * SAMPLE_SIZE(format));
142 return *this;
143 }

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

Referenced by Sequence::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 146 of file SampleFormat.h.

147 {
148 free(mPtr);
149 mPtr = 0;
150 }

References mPtr.

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

Here is the caller graph for this function:

◆ operator=()

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

Definition at line 129 of file SampleFormat.h.

130 {
131 auto ptr = other.mPtr;
132 other.mPtr = nullptr;
133 mPtr = ptr;
134 return *this;
135 }
samplePtr ptr() const
Definition: SampleFormat.h:152

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 156 of file SampleFormat.h.

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


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