Collection of tools useful for audio production
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.

93 lines
2.4KB

  1. /*
  2. * Carla Native Plugins
  3. * Copyright (C) 2012 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>
  19. static PluginHandle bypass_instantiate(struct _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, MidiEvent* midiEvents)
  28. {
  29. float* in = inBuffer[0];
  30. float* out = outBuffer[0];
  31. memcpy(out, in, sizeof(float)*frames);
  32. return;
  33. // unused
  34. (void)handle;
  35. (void)midiEventCount;
  36. (void)midiEvents;
  37. }
  38. // -----------------------------------------------------------------------
  39. static PluginDescriptor bypassDesc = {
  40. .category = PLUGIN_CATEGORY_NONE,
  41. .hints = 0x0,
  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. .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. .show_gui = NULL,
  63. .idle_gui = NULL,
  64. .activate = NULL,
  65. .deactivate = NULL,
  66. .cleanup = NULL,
  67. .process = bypass_process
  68. };
  69. // -----------------------------------------------------------------------
  70. void carla_register_native_plugin_bypass()
  71. {
  72. carla_register_native_plugin(&bypassDesc);
  73. }
  74. // -----------------------------------------------------------------------