12#ifndef __AUDIO_SAMPLE_PLAYBACK_H__
13#define __AUDIO_SAMPLE_PLAYBACK_H__
17#include "utils/types.h"
19#include "juce_wrapper.h"
33 SamplePlayback () =
default;
35 std::shared_ptr<zrythm::utils::audio::AudioBuffer> buf,
46 std::shared_ptr<zrythm::utils::audio::AudioBuffer>
buf_;
78#define sample_playback_init( \
79 self, _buf, _buf_size, _channels, _vol, _start_offset) \
82 z_error ("channels: {}", _channels); \
85 (self)->buf_size = _buf_size; \
86 (self)->volume = _vol; \
88 (self)->channels = _channels; \
89 (self)->start_offset = _start_offset; \
90 (self)->file = __FILE__; \
91 (self)->func = __func__; \
92 (self)->lineno = __LINE__
uint_fast64_t unsigned_frame_t
Unsigned type for frame index.
uint32_t nframes_t
Frame count.
nframes_t start_offset_
Offset relative to the current processing cycle to start playing the sample.
float volume_
The volume to play the sample at (ratio from 0.0 to 2.0, where 1.0 is the normal volume).
std::shared_ptr< zrythm::utils::audio::AudioBuffer > buf_
A pointer to the original buffer.
const char * func_
Function initialized from.
const char * file_
Source file initialized from.
unsigned_frame_t offset_
The number of channels.
int lineno_
Line no initialized from.