Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
loop_range.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <cstdint>
7
10
11namespace pulp::timeline_editor {
12
16
18enum class LoopRangeError : std::uint8_t {
21};
22
33 timebase::TickPosition second) noexcept {
34 if (first == second)
36
37 const auto start = first < second ? first : second;
38 const auto end = first < second ? second : first;
39 return runtime::Ok(timebase::LoopRegion{true, start, end});
40}
41
46[[nodiscard]] constexpr timebase::LoopRegion
47with_loop_enabled(timebase::LoopRegion loop, bool enabled) noexcept {
48 loop.enabled = enabled;
49 return loop;
50}
51
53
54} // namespace pulp::timeline_editor
Result<T, E> — either holds a T or an E, never both.
Definition result.hpp:76
constexpr timebase::LoopRegion with_loop_enabled(timebase::LoopRegion loop, bool enabled) noexcept
Return loop with only its enabled state changed.
Definition loop_range.hpp:47
LoopRangeError
Why an already-snapped loop range could not be constructed.
Definition loop_range.hpp:18
runtime::Result< timebase::LoopRegion, LoopRangeError > loop_region_from_snapped_endpoints(timebase::TickPosition first, timebase::TickPosition second) noexcept
Build an enabled, structurally canonical loop candidate.
Definition loop_range.hpp:32
@ CollapsedSpan
Both endpoints resolve to the same document tick.
Definition loop_range.hpp:20
Err(E) -> Err< E >
@ Ok
No error; bytes is authoritative.
Definition stream.hpp:32
ScriptedUiHost is a SequencerUiHost whose playhead is written by the caller instead of an engine,...
Definition edit_intent.hpp:14
Result<T, E> — success / failure union for fallible operations.
The loop bounds a transport honours, in document ticks.
Definition loop_region.hpp:20
Definition tick.hpp:61