Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
plugin_identifier.h
Go to the documentation of this file.
1// clang-format off
2// SPDX-FileCopyrightText: © 2020-2021, 2023 Alexandros Theodotou <alex@zrythm.org>
3// SPDX-License-Identifier: LicenseRef-ZrythmLicense
4// clang-format on
5
12#ifndef __PLUGINS_PLUGIN_IDENTIFIER_H__
13#define __PLUGINS_PLUGIN_IDENTIFIER_H__
14
15#include "zrythm-config.h"
16
17#include <cstddef>
18#include <cstdint>
19
27{
28 Z_PLUGIN_SLOT_INVALID,
29 Z_PLUGIN_SLOT_INSERT,
30 Z_PLUGIN_SLOT_MIDI_FX,
31 Z_PLUGIN_SLOT_INSTRUMENT,
32
35};
36
40typedef struct PluginIdentifier
41{
42 ZPluginSlotType slot_type;
43
45 unsigned int track_name_hash;
46
54 int slot;
56
57void
58plugin_identifier_init (PluginIdentifier * self);
59
60static inline int
61plugin_identifier_is_equal (
62 const PluginIdentifier * a,
63 const PluginIdentifier * b)
64{
65 return a->slot_type == b->slot_type
66 && a->track_name_hash == b->track_name_hash && a->slot == b->slot;
67}
68
69void
70plugin_identifier_copy (PluginIdentifier * dest, const PluginIdentifier * src);
71
72NONNULL bool
73plugin_identifier_validate (const PluginIdentifier * self);
74
79bool
81 ZPluginSlotType slot_type,
82 int slot);
83
84void
85plugin_identifier_print (const PluginIdentifier * self, char * str);
86
87uint32_t
88plugin_identifier_get_hash (const void * id);
89
94#endif
bool plugin_identifier_validate_slot_type_slot_combo(ZPluginSlotType slot_type, int slot)
Verifies that slot_type and slot is a valid combination.
ZPluginSlotType
@ Z_PLUGIN_SLOT_MODULATOR
Plugin is part of a modulator.
Plugin identifier.
int slot
The slot this plugin is in the channel, or the index if this is part of a modulator.
unsigned int track_name_hash
Track name hash.