10#ifndef __AUDIO_MIDI_MAPPING_H__
11#define __AUDIO_MIDI_MAPPING_H__
17typedef struct _WrappedObjectWithChangeSignal
26#define MIDI_MAPPING_SCHEMA_VERSION 1
27#define MIDI_MAPPINGS_SCHEMA_VERSION 1
29#define MIDI_MAPPINGS (PROJECT->midi_mappings)
63static const cyaml_schema_field_t midi_mapping_fields_schema[] = {
73 ext_port_fields_schema),
77 port_identifier_fields_schema),
83static const cyaml_schema_value_t midi_mapping_schema = {
88static const cyaml_schema_value_t
89 midi_mapping_schema_default =
104 size_t mappings_size;
108static const cyaml_schema_field_t midi_mappings_fields_schema[] = {
113 midi_mapping_schema),
118static const cyaml_schema_value_t midi_mappings_schema = {
135#define midi_mappings_bind_device( \
136 self, buf, dev_port, dest_port, fire_events) \
137 midi_mappings_bind_at ( \
138 self, buf, dev_port, dest_port, (self)->num_mappings, \
141#define midi_mappings_bind_track( \
142 self, buf, dest_port, fire_events) \
143 midi_mappings_bind_at ( \
144 self, buf, NULL, dest_port, (self)->num_mappings, \
178midi_mapping_new (
void);
181midi_mapping_set_enabled (
MidiMapping * self,
bool enabled);
184midi_mapping_get_index (
void midi_mappings_apply_from_cc_events(MidiMappings *self, MidiEvents *events, bool queued)
Applies the events to the appropriate mapping.
void midi_mappings_bind_at(MidiMappings *self, midi_byte_t *buf, ExtPort *device_port, Port *dest_port, int idx, bool fire_events)
Binds the CC represented by the given raw buffer (must be size 3) to the given Port.
void midi_mappings_init_loaded(MidiMappings *self)
Initializes the MidiMappings after a Project is loaded.
int midi_mappings_get_for_port(MidiMappings *self, Port *dest_port, GPtrArray *arr)
Get MIDI mappings for the given port.
void midi_mappings_apply(MidiMappings *self, midi_byte_t *buf)
Applies the given buffer to the matching ports.
MidiMappings * midi_mappings_new(void)
Returns a newly allocated MidiMappings.
void midi_mappings_unbind(MidiMappings *self, int idx, bool fire_events)
Unbinds the given binding.
#define YAML_FIELD_MAPPING_EMBEDDED(owner, member, schema)
Mapping embedded inside the struct.
#define YAML_VALUE_DEFAULT(cc, fields_schema)
Schema to be used for arrays of structs directly (not as pointers).
#define YAML_FIELD_FIXED_SIZE_PTR_ARRAY(owner, member, schema, size)
Fixed-width array of pointers with fixed count.
uint8_t midi_byte_t
MIDI byte.
#define YAML_VALUE_PTR(cc, fields_schema)
Schema to be used as a pointer.
#define YAML_FIELD_DYN_PTR_ARRAY_VAR_COUNT_OPT(owner, member, schema)
Dynamic-width (reallocated) array of pointers with variable count, nullable.
#define YAML_FIELD_MAPPING_PTR_OPTIONAL(owner, member, schema)
Mapping pointer to a struct.
Ports that transfer audio/midi/other signals to one another.
Container for passing midi events through ports.
A mapping from a MIDI value to a destination.
midi_byte_t key[3]
Raw MIDI signal.
ExtPort * device_port
The device that this connection will be mapped for.
volatile int enabled
Whether this binding is enabled.
WrappedObjectWithChangeSignal * gobj
Used in Gtk.
Port * dest
Destination pointer, for convenience.
PortIdentifier dest_id
Destination.
All MIDI mappings in Zrythm.
Struct used to identify Ports in the project.
Must ONLY be created via port_new()
A GObject-ified normal C object with a signal that interested parties can listen to for changes.