Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
aax_entry.hpp
Go to the documentation of this file.
1#pragma once
2
3#if !defined(PULP_AAX_HEADLESS)
5#endif
7
8#include <AAX.h>
9#include <AAX_Callbacks.h>
10
11#include <string_view>
12
13class AAX_ICollection;
14class IACFUnknown;
15
16namespace pulp::format::aax {
17
22
24 std::string_view manufacturer_code,
25 std::string_view product_code,
26 std::string_view native_code)
27{
28 return {
29 .factory = factory,
30 .codes = {
31 .manufacturer_id = fourcc(manufacturer_code),
32 .product_id = fourcc(product_code),
33 .native_id_base = fourcc(native_code),
34 },
35 };
36}
37
38IACFUnknown* create_effect_parameters(const EntryConfig& config);
39
44AAX_Result get_effect_descriptions(AAX_ICollection* out_collection,
45 const EntryConfig& config,
46 AAXCreateObjectProc create_proc,
47 AAXCreateObjectProc create_gui_proc = nullptr);
48
49} // namespace pulp::format::aax
50
51#if defined(PULP_AAX_HEADLESS)
52#define PULP_AAX_GUI_THUNK
53#else
54#define PULP_AAX_GUI_THUNK \
55 [[maybe_unused]] static IACFUnknown* AAX_CALLBACK _pulp_aax_create_effect_gui() { \
56 return ::pulp::format::aax::create_effect_gui(); \
57 }
58#endif
59
60#if !defined(PULP_MANUFACTURER_CODE)
61#error "PULP_MANUFACTURER_CODE must be defined for AAX targets"
62#endif
63
64#if !defined(PULP_AAX_PRODUCT_CODE)
65#error "PULP_AAX_PRODUCT_CODE must be defined for AAX targets"
66#endif
67
68#if !defined(PULP_AAX_NATIVE_CODE)
69#error "PULP_AAX_NATIVE_CODE must be defined for AAX targets"
70#endif
71
72// Shared body of the AAX entry-point macros. @p gui_proc_expr is the value
73// handed to `get_effect_descriptions` as the editor's create proc: null selects
74// the host's parameter strip, a proc address selects the custom editor.
75#define PULP_AAX_PLUGIN_IMPL_(factory_fn, gui_proc_expr) \
76 namespace { \
77 static const ::pulp::format::aax::EntryConfig& _pulp_aax_entry_config() { \
78 static const auto config = ::pulp::format::aax::make_entry_config( \
79 factory_fn, PULP_MANUFACTURER_CODE, PULP_AAX_PRODUCT_CODE, PULP_AAX_NATIVE_CODE); \
80 return config; \
81 } \
82 static IACFUnknown* AAX_CALLBACK _pulp_aax_create_effect_parameters() { \
83 return ::pulp::format::aax::create_effect_parameters(_pulp_aax_entry_config()); \
84 } \
85 PULP_AAX_GUI_THUNK \
86 } \
87 AAX_Result GetEffectDescriptions(AAX_ICollection* outCollection) { \
88 return ::pulp::format::aax::get_effect_descriptions( \
89 outCollection, _pulp_aax_entry_config(), &_pulp_aax_create_effect_parameters, \
90 (gui_proc_expr)); \
91 }
92
93// Generate an AAX entry point that leaves the host on its auto-generated
94// parameter strip. This is the default because the strip is what Pro Tools
95// draws with no editor registered, and it is the behavior every plugin had
96// before the custom editor existed: rebuilding must never silently trade it
97// for a different UI. Pair with PULP_AAX_PLUGIN_WITH_GUI to opt in.
98//
99// The unused editor thunk below is discarded, so this macro links without the
100// editor shell (and its view stack) at all.
101#define PULP_AAX_PLUGIN(factory_fn) \
102 PULP_AAX_PLUGIN_IMPL_(factory_fn, nullptr)
103
104// Generate an AAX entry point that registers Pulp's custom editor, so the host
105// instantiates the plugin's own `create_view()` UI instead of the parameter
106// strip. Opt in deliberately: the editor has not been validated in Pro Tools
107// itself, so a plugin choosing it is choosing an unproven path over a working
108// one. The only difference from PULP_AAX_PLUGIN is the editor create proc —
109// the data model, codes, and descriptor are identical.
110#define PULP_AAX_PLUGIN_WITH_GUI(factory_fn) \
111 PULP_AAX_PLUGIN_IMPL_(factory_fn, &_pulp_aax_create_effect_gui)
Definition aax_editor.hpp:31
uint32_t fourcc(std::string_view text)
EntryConfig make_entry_config(ProcessorFactory factory, std::string_view manufacturer_code, std::string_view product_code, std::string_view native_code)
Definition aax_entry.hpp:23
IACFUnknown * create_effect_parameters(const EntryConfig &config)
AAX_Result get_effect_descriptions(AAX_ICollection *out_collection, const EntryConfig &config, AAXCreateObjectProc create_proc, AAXCreateObjectProc create_gui_proc=nullptr)
Describe the plugin to the host.
std::unique_ptr< Processor >(*)() ProcessorFactory
Factory function type — plugins provide this to create processor instances.
Definition processor.hpp:1416
Definition aax_entry.hpp:18
ProcessorFactory factory
Definition aax_entry.hpp:19
PluginCodes codes
Definition aax_entry.hpp:20
Definition aax_model.hpp:14