Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::AudioLoop Class Reference

#include <audioloop.h>

Inheritance diagram for jami::AudioLoop:
Inheritance graph
Collaboration diagram for jami::AudioLoop:
Collaboration graph

Public Member Functions

 AudioLoop (AudioFormat format)
 
AudioFormat getFormat () const
 
void getNext (AVFrame *output, bool mute)
 Get the next fragment of the tone the function change the intern position, and will loop.
 
std::unique_ptr< AudioFramegetNext (size_t samples=0, bool mute=false)
 
size_t getSize () const
 Accessor to the size of the buffer.
 
AudioLoopoperator= (AudioLoop &&o) noexcept
 
void reset ()
 Reset the pointer position.
 
void seek (double relative_position)
 
virtual ~AudioLoop ()
 

Protected Attributes

libjami::FrameBuffer buffer_ {}
 The data buffer.
 
AudioFormat format_
 
size_t pos_ {0}
 current position, set to 0, when initialize
 

Detailed Description

Definition at line 38 of file audioloop.h.

Constructor & Destructor Documentation

◆ AudioLoop()

jami::AudioLoop::AudioLoop ( AudioFormat  format)

Definition at line 34 of file audioloop.cpp.

◆ ~AudioLoop()

jami::AudioLoop::~AudioLoop ( )
virtual

Definition at line 41 of file audioloop.cpp.

Member Function Documentation

◆ getFormat()

AudioFormat jami::AudioLoop::getFormat ( ) const
inline

Definition at line 74 of file audioloop.h.

References format_.

◆ getNext() [1/2]

void jami::AudioLoop::getNext ( AVFrame output,
bool  mute 
)

Get the next fragment of the tone the function change the intern position, and will loop.

Parameters
outputThe data buffer
nbof int16 to send
gainThe gain [-1.0, 1.0]

Definition at line 51 of file audioloop.cpp.

References buffer_, jami::emitSignal(), format_, JAMI_ERR, jami::AudioFormat::nb_channels, pos_, and jami::AudioFormat::sampleFormat.

Referenced by getNext().

Here is the call graph for this function:

◆ getNext() [2/2]

std::unique_ptr< AudioFrame > jami::AudioLoop::getNext ( size_t  samples = 0,
bool  mute = false 
)

Definition at line 92 of file audioloop.cpp.

References buffer_, jami::emitSignal(), format_, and getNext().

Here is the call graph for this function:

◆ getSize()

size_t jami::AudioLoop::getSize ( ) const
inline

Accessor to the size of the buffer.

Returns
unsigned int The size

Definition at line 73 of file audioloop.h.

References buffer_.

Referenced by seek().

◆ operator=()

AudioLoop & jami::AudioLoop::operator= ( AudioLoop &&  o)
inlinenoexcept

Definition at line 43 of file audioloop.h.

References buffer_, jami::emitSignal(), and pos_.

Here is the call graph for this function:

◆ reset()

void jami::AudioLoop::reset ( )
inline

Reset the pointer position.

Definition at line 67 of file audioloop.h.

References pos_.

◆ seek()

void jami::AudioLoop::seek ( double  relative_position)

Definition at line 45 of file audioloop.cpp.

References jami::emitSignal(), getSize(), and pos_.

Here is the call graph for this function:

Member Data Documentation

◆ buffer_

libjami::FrameBuffer jami::AudioLoop::buffer_ {}
protected

The data buffer.

Definition at line 79 of file audioloop.h.

Referenced by jami::AudioFile::AudioFile(), getNext(), getNext(), getSize(), and operator=().

◆ format_

AudioFormat jami::AudioLoop::format_
protected

Definition at line 77 of file audioloop.h.

Referenced by jami::AudioFile::AudioFile(), getFormat(), getNext(), and getNext().

◆ pos_

size_t jami::AudioLoop::pos_ {0}
protected

current position, set to 0, when initialize

Definition at line 82 of file audioloop.h.

Referenced by getNext(), operator=(), reset(), and seek().


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