Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
loop_playback_cursor.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4
6
7namespace pulp::audio {
8
10 double read_position = 0.0;
11 double blend_position = 0.0;
12 double primary_gain = 1.0;
13 double blend_gain = 0.0;
14 bool blend = false;
17 bool wrapped = false;
18};
19
21 bool active = false;
23 bool wrapped = false;
24};
25
28public:
30 std::uint64_t source_frames) noexcept;
31 void reset() noexcept;
32 void start() noexcept;
33 void stop() noexcept { active_ = false; }
34
38 void set_playback_rate(double rate) noexcept;
39 void set_playback_mode(LoopPlaybackMode mode) noexcept {
40 region_.playback_mode = mode;
41 }
42
43 bool active() const noexcept { return active_; }
44 double position() const noexcept { return position_; }
45 double step() const noexcept;
46 const LoopRegion& region() const noexcept { return region_; }
47
50
51private:
52 void initialize_entry() noexcept;
53
54 LoopRegion region_;
55 double position_ = 0.0;
56 double playback_rate_ = 1.0;
57 bool active_ = false;
58 int pingpong_direction_ = 1;
59 int step_direction_ = 1;
60};
61
62} // namespace pulp::audio
Allocation-free loop traversal state independent of sample storage.
Definition loop_playback_cursor.hpp:27
LoopPlaybackAdvanceResult advance() noexcept
double step() const noexcept
LoopFrameReadPlan frame_read_plan() const noexcept
const LoopRegion & region() const noexcept
Definition loop_playback_cursor.hpp:46
void set_playback_rate(double rate) noexcept
Sets the finite nonzero source-frame step value.
bool active() const noexcept
Definition loop_playback_cursor.hpp:43
bool set_region(const LoopRegion &region, std::uint64_t source_frames) noexcept
void set_playback_mode(LoopPlaybackMode mode) noexcept
Definition loop_playback_cursor.hpp:39
void stop() noexcept
Definition loop_playback_cursor.hpp:33
double position() const noexcept
Definition loop_playback_cursor.hpp:44
Definition analyzer_provider.hpp:12
LoopPlaybackMode
Definition loop_types.hpp:7
Definition loop_playback_cursor.hpp:9
double blend_position
Definition loop_playback_cursor.hpp:11
bool blend
Definition loop_playback_cursor.hpp:14
double blend_gain
Definition loop_playback_cursor.hpp:13
bool wrapped
A wrap-crossfade read pair is active for this frame.
Definition loop_playback_cursor.hpp:17
double read_position
Definition loop_playback_cursor.hpp:10
double primary_gain
Definition loop_playback_cursor.hpp:12
Definition loop_playback_cursor.hpp:20
bool active
Definition loop_playback_cursor.hpp:21
bool wrapped
Traversal crossed or reflected at least one loop boundary.
Definition loop_playback_cursor.hpp:23
Definition loop_types.hpp:42