-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Complete example of a CLAP plugin based on template. (#1)
- Swaps left and right audio channels. - Logs (CLAP) note on/off messages.
- Loading branch information
Showing
8 changed files
with
333 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module plugin | ||
|
||
const clap_ext_audio_ports = unsafe { (&char(C.CLAP_EXT_AUDIO_PORTS)).vstring() } | ||
const clap_port_stereo = unsafe { (&char(C.CLAP_PORT_STEREO)).vstring() } | ||
const clap_port_mono = unsafe { (&char(C.CLAP_PORT_MONO)).vstring() } | ||
|
||
@[typedef] | ||
struct C.clap_audio_port_info_t { | ||
mut: | ||
id C.clap_id | ||
name [256]char | ||
flags u32 | ||
channel_count u32 | ||
port_type &char | ||
in_place_pair C.clap_id | ||
} | ||
|
||
@[typedef] | ||
struct C.clap_plugin_audio_ports_t { | ||
count fn (&C.clap_plugin_t, bool) u32 | ||
get fn (&C.clap_plugin_t, u32, bool, &C.clap_audio_port_info_t) bool | ||
} | ||
|
||
enum ClapAudioPortFlags as u32 { | ||
is_main = 1 << 0 | ||
supports_64_bits = 1 << 1 | ||
prefers_64_bits = 1 << 2 | ||
requires_common_sample_size = 1 << 3 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module plugin | ||
|
||
const clap_ext_latency = unsafe { (&char(C.CLAP_EXT_LATENCY)).vstring() } | ||
|
||
@[typedef] | ||
struct C.clap_plugin_latency_t { | ||
get fn (&C.clap_plugin_t) u32 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module plugin | ||
|
||
const clap_ext_note_ports = unsafe { (&char(C.CLAP_EXT_NOTE_PORTS)).vstring() } | ||
|
||
@[typedef] | ||
struct C.clap_note_port_info_t { | ||
mut: | ||
id C.clap_id | ||
supported_dialects u32 | ||
preferred_dialect u32 | ||
name [256]char | ||
} | ||
|
||
@[typedef] | ||
struct C.clap_plugin_note_ports_t { | ||
count fn (&C.clap_plugin_t, bool) u32 | ||
get fn (&C.clap_plugin_t, u32, bool, &C.clap_note_port_info_t) bool | ||
} | ||
|
||
enum ClapNoteDialect as u32 { | ||
clap = 1 << 0 | ||
midi = 1 << 1 | ||
midi_mpe = 1 << 2 | ||
midi2 = 1 << 3 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.