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.

98 lines
2.5KB

  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
  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 PluginHandle bypass_instantiate(const HostDescriptor* host)
  21. {
  22. // dummy, return non-NULL
  23. return (PluginHandle)host;
  24. }
  25. static void bypass_process(PluginHandle handle, float** inBuffer, float** outBuffer, uint32_t frames, const MidiEvent* midiEvents, uint32_t midiEventCount)
  26. {
  27. memcpy(outBuffer[0], inBuffer[0], sizeof(float)*frames);
  28. return;
  29. // unused
  30. (void)handle;
  31. (void)midiEvents;
  32. (void)midiEventCount;
  33. }
  34. // -----------------------------------------------------------------------
  35. static const PluginDescriptor bypassDesc = {
  36. .category = PLUGIN_CATEGORY_NONE,
  37. .hints = PLUGIN_IS_RTSAFE,
  38. .supports = 0x0,
  39. .audioIns = 1,
  40. .audioOuts = 1,
  41. .midiIns = 0,
  42. .midiOuts = 0,
  43. .paramIns = 0,
  44. .paramOuts = 0,
  45. .name = "ByPass",
  46. .label = "bypass",
  47. .maker = "falkTX",
  48. .copyright = "GNU GPL v2+",
  49. .instantiate = bypass_instantiate,
  50. .cleanup = NULL,
  51. .get_parameter_count = NULL,
  52. .get_parameter_info = NULL,
  53. .get_parameter_value = NULL,
  54. .get_parameter_text = NULL,
  55. .get_midi_program_count = NULL,
  56. .get_midi_program_info = NULL,
  57. .set_parameter_value = NULL,
  58. .set_midi_program = NULL,
  59. .set_custom_data = NULL,
  60. .ui_show = NULL,
  61. .ui_idle = NULL,
  62. .ui_set_parameter_value = NULL,
  63. .ui_set_midi_program = NULL,
  64. .ui_set_custom_data = NULL,
  65. .activate = NULL,
  66. .deactivate = NULL,
  67. .process = bypass_process,
  68. .get_state = NULL,
  69. .set_state = NULL,
  70. .dispatcher = NULL
  71. };
  72. // -----------------------------------------------------------------------
  73. void carla_register_native_plugin_bypass()
  74. {
  75. carla_register_native_plugin(&bypassDesc);
  76. }
  77. // -----------------------------------------------------------------------