Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
quirk_apply.hpp
Go to the documentation of this file.
1#pragma once
2
9
12#include <pulp/state/store.hpp>
13
14namespace pulp::format {
15
19inline constexpr state::ParamID kSynthesizedBypassParamId = 0x70427970; // 'pByp'
20
36 if (!q.synthesize_bypass_parameter) return false;
37 for (const auto& p : store.all_params()) {
38 // Suppress synthesis only when the plugin already declares a
39 // DETECTABLE bypass — the same contract the adapters use to find one
40 // (state::is_bypass_param): a declared `Bypass` designation, or the
41 // legacy boolean-"Bypass" name/range heuristic. A non-boolean param
42 // merely *named* "Bypass" is not a bypass surface, so we still
43 // synthesize one rather than leave the host without a bypass control.
44 if (state::is_bypass_param(p)) return false;
45 if (p.id == kSynthesizedBypassParamId) return false; // ID-collision guard
46 }
49 info.name = "Bypass";
50 info.range = {0.0f, 1.0f, 0.0f, 1.0f}; // boolean: step 1 → two states
51 store.add_parameter(info);
52 return true;
53}
54
55} // namespace pulp::format
Centralized parameter storage with lock-free value access.
Definition store.hpp:164
void add_parameter(const ParamInfo &info)
Register a parameter.
std::span< const ParamInfo > all_params() const
View of all registered parameters (in registration order).
Definition store.hpp:439
Per-host accommodation flags consumed by format adapters.
What the product grants a device: the quota table indexed by capability tier and live thermal state.
Definition aax_editor.hpp:31
bool maybe_synthesize_bypass(state::StateStore &store, const HostQuirks &q)
synthesize_bypass_parameter: when the plugin declares no Bypass parameter and the quirk is enforced,...
Definition quirk_apply.hpp:35
constexpr state::ParamID kSynthesizedBypassParamId
Reserved ParamID for the synthesized Bypass parameter.
Definition quirk_apply.hpp:19
bool is_bypass_param(const ParamInfo &info)
Decide whether info is a bypass control.
Definition parameter.hpp:514
uint32_t ParamID
Unique parameter identifier, stable across plugin versions.
Definition parameter.hpp:55
Always-on / host-gated defensive behaviors that the adapters consult.
Definition host_quirks.hpp:66
Immutable parameter metadata, registered once at plugin initialization.
Definition parameter.hpp:316