Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
2.8KB

  1. /*
  2. * Carla Native Plugins
  3. * Copyright (C) 2012-2019 Filipe Coelho <falktx@falktx.com>
  4. *
  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.
  9. *
  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.
  14. *
  15. * For a full copy of the GNU General Public License see the doc/GPL.txt file.
  16. */
  17. #include "CarlaNative.h"
  18. #include <string.h>
  19. // -----------------------------------------------------------------------
  20. static NativePluginHandle bypass_instantiate(const NativeHostDescriptor* host)
  21. {
  22. // dummy, return non-NULL
  23. return (NativePluginHandle)0x1;
  24. // unused
  25. (void)host;
  26. }
  27. static void bypass_process(NativePluginHandle handle,
  28. const float** inBuffer, float** outBuffer, uint32_t frames,
  29. const NativeMidiEvent* midiEvents, uint32_t midiEventCount)
  30. {
  31. if (outBuffer[0] != inBuffer[0])
  32. memcpy(outBuffer[0], inBuffer[0], sizeof(float)*frames);
  33. return;
  34. // unused
  35. (void)handle;
  36. (void)midiEvents;
  37. (void)midiEventCount;
  38. }
  39. // -----------------------------------------------------------------------
  40. static const NativePluginDescriptor bypassDesc = {
  41. .category = NATIVE_PLUGIN_CATEGORY_NONE,
  42. .hints = NATIVE_PLUGIN_IS_RTSAFE,
  43. .supports = NATIVE_PLUGIN_SUPPORTS_NOTHING,
  44. .audioIns = 1,
  45. .audioOuts = 1,
  46. .cvIns = 0,
  47. .cvOuts = 0,
  48. .midiIns = 0,
  49. .midiOuts = 0,
  50. .paramIns = 0,
  51. .paramOuts = 0,
  52. .name = "Bypass",
  53. .label = "bypass",
  54. .maker = "falkTX",
  55. .copyright = "GNU GPL v2+",
  56. .instantiate = bypass_instantiate,
  57. .cleanup = NULL,
  58. .get_parameter_count = NULL,
  59. .get_parameter_info = NULL,
  60. .get_parameter_value = NULL,
  61. .get_midi_program_count = NULL,
  62. .get_midi_program_info = NULL,
  63. .set_parameter_value = NULL,
  64. .set_midi_program = NULL,
  65. .set_custom_data = NULL,
  66. .ui_show = NULL,
  67. .ui_idle = NULL,
  68. .ui_set_parameter_value = NULL,
  69. .ui_set_midi_program = NULL,
  70. .ui_set_custom_data = NULL,
  71. .activate = NULL,
  72. .deactivate = NULL,
  73. .process = bypass_process,
  74. .get_state = NULL,
  75. .set_state = NULL,
  76. .dispatcher = NULL,
  77. .render_inline_display = NULL
  78. };
  79. // -----------------------------------------------------------------------
  80. void carla_register_native_plugin_bypass(void);
  81. void carla_register_native_plugin_bypass(void)
  82. {
  83. carla_register_native_plugin(&bypassDesc);
  84. }
  85. // -----------------------------------------------------------------------