Cleanup
[carla.git] / source / native-plugins / bypass.c
blobda09e4fd87514367a881fc45c85f2cc71a17526c
1 /*
2 * Carla Native Plugins
3 * Copyright (C) 2012-2019 Filipe Coelho <falktx@falktx.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * For a full copy of the GNU General Public License see the doc/GPL.txt file.
18 #include "CarlaNative.h"
20 #include <string.h>
22 // -----------------------------------------------------------------------
24 static NativePluginHandle bypass_instantiate(const NativeHostDescriptor* host)
26 // dummy, return non-NULL
27 return (NativePluginHandle)0x1;
29 // unused
30 (void)host;
33 // FIXME for v3.0, use const for the input buffer
34 static void bypass_process(NativePluginHandle handle,
35 float** inBuffer, float** outBuffer, uint32_t frames,
36 const NativeMidiEvent* midiEvents, uint32_t midiEventCount)
38 if (outBuffer[0] != inBuffer[0])
39 memcpy(outBuffer[0], inBuffer[0], sizeof(float)*frames);
40 return;
42 // unused
43 (void)handle;
44 (void)midiEvents;
45 (void)midiEventCount;
48 // -----------------------------------------------------------------------
50 static const NativePluginDescriptor bypassDesc = {
51 .category = NATIVE_PLUGIN_CATEGORY_NONE,
52 .hints = NATIVE_PLUGIN_IS_RTSAFE,
53 .supports = NATIVE_PLUGIN_SUPPORTS_NOTHING,
54 .audioIns = 1,
55 .audioOuts = 1,
56 .cvIns = 0,
57 .cvOuts = 0,
58 .midiIns = 0,
59 .midiOuts = 0,
60 .paramIns = 0,
61 .paramOuts = 0,
62 .name = "Bypass",
63 .label = "bypass",
64 .maker = "falkTX",
65 .copyright = "GNU GPL v2+",
67 .instantiate = bypass_instantiate,
68 .cleanup = NULL,
70 .get_parameter_count = NULL,
71 .get_parameter_info = NULL,
72 .get_parameter_value = NULL,
74 .get_midi_program_count = NULL,
75 .get_midi_program_info = NULL,
77 .set_parameter_value = NULL,
78 .set_midi_program = NULL,
79 .set_custom_data = NULL,
81 .ui_show = NULL,
82 .ui_idle = NULL,
84 .ui_set_parameter_value = NULL,
85 .ui_set_midi_program = NULL,
86 .ui_set_custom_data = NULL,
88 .activate = NULL,
89 .deactivate = NULL,
90 .process = bypass_process,
92 .get_state = NULL,
93 .set_state = NULL,
95 .dispatcher = NULL
98 // -----------------------------------------------------------------------
100 void carla_register_native_plugin_bypass(void);
102 void carla_register_native_plugin_bypass(void)
104 carla_register_native_plugin(&bypassDesc);
107 // -----------------------------------------------------------------------