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.

101 lines
2.6KB

  1. /*
  2. * Carla Native Plugins
  3. * Copyright (C) 2012-2013 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * 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 COPYING file
  16. */
  17. #include "carla_native.h"
  18. #include <string.h> // for memcpy
  19. static PluginHandle bypass_instantiate(const PluginDescriptor* _this_, HostDescriptor* host)
  20. {
  21. // dummy, return non-NULL
  22. return (PluginHandle)1;
  23. // unused
  24. (void)_this_;
  25. (void)host;
  26. }
  27. static void bypass_process(PluginHandle handle, float** inBuffer, float** outBuffer, uint32_t frames, uint32_t midiEventCount, const MidiEvent* midiEvents)
  28. {
  29. float* in = inBuffer[0];
  30. float* out = outBuffer[0];
  31. for (uint32_t i=0; i < frames; i++)
  32. *in++ = *out++;
  33. //memcpy(out, in, sizeof(float)*frames);
  34. return;
  35. // unused
  36. (void)handle;
  37. (void)midiEventCount;
  38. (void)midiEvents;
  39. }
  40. // -----------------------------------------------------------------------
  41. static const PluginDescriptor bypassDesc = {
  42. .category = PLUGIN_CATEGORY_NONE,
  43. .hints = /*PLUGIN_IS_RTSAFE*/0,
  44. .audioIns = 1,
  45. .audioOuts = 1,
  46. .midiIns = 0,
  47. .midiOuts = 0,
  48. .parameterIns = 0,
  49. .parameterOuts = 0,
  50. .name = "ByPass",
  51. .label = "bypass",
  52. .maker = "falkTX",
  53. .copyright = "GNU GPL v2+",
  54. .instantiate = bypass_instantiate,
  55. .get_parameter_count = NULL,
  56. .get_parameter_info = NULL,
  57. .get_parameter_value = NULL,
  58. .get_parameter_text = NULL,
  59. .get_midi_program_count = NULL,
  60. .get_midi_program_info = NULL,
  61. .set_parameter_value = NULL,
  62. .set_midi_program = NULL,
  63. .set_custom_data = NULL,
  64. .ui_show = NULL,
  65. .ui_idle = NULL,
  66. .ui_set_parameter_value = NULL,
  67. .ui_set_midi_program = NULL,
  68. .ui_set_custom_data = NULL,
  69. .activate = NULL,
  70. .deactivate = NULL,
  71. .cleanup = NULL,
  72. .process = bypass_process
  73. };
  74. // -----------------------------------------------------------------------
  75. void carla_register_native_plugin_bypass()
  76. {
  77. carla_register_native_plugin(&bypassDesc);
  78. }
  79. // -----------------------------------------------------------------------