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.

bypass.c 2.6KB

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