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"
22 // -----------------------------------------------------------------------
24 static NativePluginHandle
bypass_instantiate(const NativeHostDescriptor
* host
)
26 // dummy, return non-NULL
27 return (NativePluginHandle
)0x1;
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
);
48 // -----------------------------------------------------------------------
50 static const NativePluginDescriptor bypassDesc
= {
51 .category
= NATIVE_PLUGIN_CATEGORY_NONE
,
52 .hints
= NATIVE_PLUGIN_IS_RTSAFE
,
53 .supports
= NATIVE_PLUGIN_SUPPORTS_NOTHING
,
65 .copyright
= "GNU GPL v2+",
67 .instantiate
= bypass_instantiate
,
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
,
84 .ui_set_parameter_value
= NULL
,
85 .ui_set_midi_program
= NULL
,
86 .ui_set_custom_data
= NULL
,
90 .process
= bypass_process
,
98 // -----------------------------------------------------------------------
100 void carla_register_native_plugin_bypass(void);
102 void carla_register_native_plugin_bypass(void)
104 carla_register_native_plugin(&bypassDesc
);
107 // -----------------------------------------------------------------------