Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
types.hpp
Go to the documentation of this file.
1#pragma once
2
3// ARA 2.x core type layer.
4//
5// SDK-independent mirrors of the ARA concepts a Pulp plugin needs to author
6// against. The companion factory layer translates between these types and the
7// Celemony ARA SDK's C interface for VST3, AU, and CLAP. Plugin authors only
8// ever see the Pulp types; the SDK header is never re-exported from a Pulp
9// public header so that PULP_HAS_ARA gating stays invisible to consumers.
10//
11// All identifiers are opaque integer handles (ARAObjectRef-like): they are
12// minted by the host and Pulp passes them back through callbacks. Pulp
13// never inspects them.
14
15#include <cstdint>
16#include <string>
17#include <string_view>
18#include <vector>
19
21
22// ── Opaque host-minted identifiers ───────────────────────────────────────
23
24using AudioSourceId = uint64_t;
25using AudioModificationId = uint64_t;
26using MusicalContextId = uint64_t;
27using RegionSequenceId = uint64_t;
28using PlaybackRegionId = uint64_t;
29
30// ── Audio source ─────────────────────────────────────────────────────────
31
36 std::string name;
37 std::string persistent_id;
38 int64_t sample_count = 0;
39 double sample_rate = 0.0;
42};
43
44// ── Audio modification ───────────────────────────────────────────────────
45
56
57// ── Musical context ──────────────────────────────────────────────────────
58
63 double position_seconds = 0.0;
64 double position_quarters = 0.0;
65};
66
69 std::string name;
70 std::vector<AraTempoEntry> tempo_map;
73};
74
75// ── Region sequence + playback region ────────────────────────────────────
76
86
104
105// ── Content-changed flags ────────────────────────────────────────────────
106
109enum class AudioSourceContentChange : uint32_t {
110 None = 0,
111 Notes = 1u << 0,
112 Tempo = 1u << 1,
113 Tuning = 1u << 2,
114 KeySignatures = 1u << 3,
115 Samples = 1u << 4,
116};
117
120 return static_cast<AudioSourceContentChange>(
121 static_cast<uint32_t>(a) | static_cast<uint32_t>(b));
122}
123inline bool any(AudioSourceContentChange flags) {
124 return static_cast<uint32_t>(flags) != 0;
125}
127 return (static_cast<uint32_t>(flags) & static_cast<uint32_t>(bit)) != 0;
128}
129
130} // namespace pulp::format::ara
Definition types.hpp:20
uint64_t RegionSequenceId
Definition types.hpp:27
uint64_t AudioModificationId
Definition types.hpp:25
bool has(AudioSourceContentChange flags, AudioSourceContentChange bit)
Definition types.hpp:126
uint64_t MusicalContextId
Definition types.hpp:26
AudioSourceContentChange operator|(AudioSourceContentChange a, AudioSourceContentChange b)
Definition types.hpp:118
bool any(AudioSourceContentChange flags)
Definition types.hpp:123
uint64_t AudioSourceId
Definition types.hpp:24
AudioSourceContentChange
Bitset describing what changed about an audio source's content.
Definition types.hpp:109
@ KeySignatures
Definition types.hpp:114
@ Samples
raw sample data changed
Definition types.hpp:115
uint64_t PlaybackRegionId
Definition types.hpp:28
A user-editable view onto an AraAudioSource.
Definition types.hpp:50
std::string persistent_id
Definition types.hpp:54
AudioSourceId source_id
Definition types.hpp:52
std::string name
Definition types.hpp:53
Properties of an audio source, as reported by the host.
Definition types.hpp:34
int channel_count
Definition types.hpp:40
int64_t sample_count
Total length in frames at native rate.
Definition types.hpp:38
std::string persistent_id
Stable across host sessions when reopened.
Definition types.hpp:37
double sample_rate
Native sample rate.
Definition types.hpp:39
std::string name
Display name (track name, sample name, ...).
Definition types.hpp:36
bool merits_content_based_processing
Definition types.hpp:41
int time_signature_numerator
Definition types.hpp:71
std::vector< AraTempoEntry > tempo_map
Sparse; empty = constant tempo.
Definition types.hpp:70
int time_signature_denominator
Definition types.hpp:72
std::string name
Definition types.hpp:69
A playback region maps a span of an audio modification onto the host's timeline.
Definition types.hpp:93
double start_in_playback_time
Definition types.hpp:97
int colour_argb
Definition types.hpp:102
AudioModificationId modification_id
Definition types.hpp:95
double start_in_modification_time
Definition types.hpp:99
std::string name
Definition types.hpp:101
double duration_in_playback_time
Definition types.hpp:98
RegionSequenceId region_sequence_id
Definition types.hpp:96
double duration_in_modification_time
Definition types.hpp:100
A region sequence groups playback regions on the same logical track (host's notion of "track" or "lan...
Definition types.hpp:80
int colour_argb
Track color, AARRGGBB; 0 if unset.
Definition types.hpp:84
MusicalContextId musical_context_id
Definition types.hpp:82
std::string name
Definition types.hpp:83
Tempo + meter context shared by one or more region sequences.
Definition types.hpp:62
double position_quarters
Definition types.hpp:64
double position_seconds
Definition types.hpp:63