Shared SizzleDeviceAU base for effects and instruments; sizzle::Instrument voice pools; Android's factory presets generated into the specs header; the app hosts every device in-process (no dependence on the system plugin registry). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
44 lines
1.3 KiB
C++
44 lines
1.3 KiB
C++
// SPDX-FileCopyrightText: 2026 Reactorcoremeltdown
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
#pragma once
|
|
|
|
// Plain descriptions of Sizzle's devices and their parameters. The tables
|
|
// themselves are generated from the Android app (DeviceSpecs.gen.hpp).
|
|
|
|
namespace sizzle {
|
|
|
|
enum class Kind { Instrument, Effect };
|
|
|
|
/** One parameter, as ToolboxType's ParamSpec: choices != nullptr marks an enum
|
|
* (nullptr-terminated list of names; the default is an index into it). */
|
|
struct ParamSpec {
|
|
const char *key;
|
|
const char *label;
|
|
float def, min, max;
|
|
bool isInt;
|
|
const char *const *choices;
|
|
bool isEnum() const { return choices != nullptr; }
|
|
int choiceCount() const { int n = 0; if (choices) while (choices[n]) ++n; return n; }
|
|
};
|
|
|
|
struct DeviceSpec {
|
|
const char *type; // ToolboxType name, e.g. "BITCRUSHER"
|
|
const char *displayName;
|
|
Kind kind;
|
|
const ParamSpec *params;
|
|
int paramCount;
|
|
};
|
|
|
|
/** A factory preset: the device it belongs to, its name, and the slot's full
|
|
* settings as nullptr-terminated key/value text pairs. */
|
|
struct FactoryPreset {
|
|
const char *type;
|
|
const char *name;
|
|
const char *const *values;
|
|
};
|
|
|
|
/** The device with ToolboxType name [type], or nullptr. */
|
|
const DeviceSpec *findDevice(const char *type);
|
|
|
|
} // namespace sizzle
|