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.

108 lines
2.9KB

  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. // FIXME for v3.0, use const for the input buffer
  28. static void bypass_process(NativePluginHandle handle,
  29. float** inBuffer, float** outBuffer, uint32_t frames,
  30. const NativeMidiEvent* midiEvents, uint32_t midiEventCount)
  31. {
  32. if (outBuffer[0] != inBuffer[0])
  33. memcpy(outBuffer[0], inBuffer[0], sizeof(float)*frames);
  34. return;
  35. // unused
  36. (void)handle;
  37. (void)midiEvents;
  38. (void)midiEventCount;
  39. }
  40. // -----------------------------------------------------------------------
  41. static const NativePluginDescriptor bypassDesc = {
  42. .category = NATIVE_PLUGIN_CATEGORY_NONE,
  43. .hints = NATIVE_PLUGIN_IS_RTSAFE,
  44. .supports = NATIVE_PLUGIN_SUPPORTS_NOTHING,
  45. .audioIns = 1,
  46. .audioOuts = 1,
  47. .cvIns = 0,
  48. .cvOuts = 0,
  49. .midiIns = 0,
  50. .midiOuts = 0,
  51. .paramIns = 0,
  52. .paramOuts = 0,
  53. .name = "Bypass",
  54. .label = "bypass",
  55. .maker = "falkTX",
  56. .copyright = "GNU GPL v2+",
  57. .instantiate = bypass_instantiate,
  58. .cleanup = NULL,
  59. .get_parameter_count = NULL,
  60. .get_parameter_info = NULL,
  61. .get_parameter_value = NULL,
  62. .get_midi_program_count = NULL,
  63. .get_midi_program_info = NULL,
  64. .set_parameter_value = NULL,
  65. .set_midi_program = NULL,
  66. .set_custom_data = NULL,
  67. .ui_show = NULL,
  68. .ui_idle = NULL,
  69. .ui_set_parameter_value = NULL,
  70. .ui_set_midi_program = NULL,
  71. .ui_set_custom_data = NULL,
  72. .activate = NULL,
  73. .deactivate = NULL,
  74. .process = bypass_process,
  75. .get_state = NULL,
  76. .set_state = NULL,
  77. .dispatcher = 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. // -----------------------------------------------------------------------