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