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.

105 lines
2.8KB

  1. /*
  2. * Carla Internal 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 "daz/daz-plugin.h"
  18. #include <string.h>
  19. // -----------------------------------------------------------------------
  20. // Implemented by Carla
  21. extern void carla_register_daz_plugin(const PluginDescriptor* desc);
  22. // -----------------------------------------------------------------------
  23. static const char* bypass_metadata[] = {
  24. "api", "1", // FIXME: should be a macro
  25. "features", PLUGIN_FEATURE_BUFFER_SIZE_CHANGES PLUGIN_FEATURE_SAMPLE_RATE_CHANGES DAZ_TERMINATOR,
  26. "audioIns", "1",
  27. "audioOuts", "1",
  28. "midiIns", "0",
  29. "midiOuts", "0",
  30. "paramIns", "0",
  31. "paramOuts", "0",
  32. "author", "falkTX",
  33. "name", "ByPass",
  34. "label", "bypass",
  35. "copyright", "GNU GPL v2+",
  36. "version", "1.0.0",
  37. NULL
  38. };
  39. // -----------------------------------------------------------------------
  40. static PluginHandle bypass_instantiate(const PluginHostDescriptor* host)
  41. {
  42. // dummy, return non-NULL
  43. return (PluginHandle)0x1;
  44. // unused
  45. (void)host;
  46. }
  47. static void bypass_process(PluginHandle handle, float** inBuffer, float** outBuffer, uint32_t frames, const Event* events, uint32_t eventCount)
  48. {
  49. memcpy(outBuffer[0], inBuffer[0], sizeof(float)*frames);
  50. return;
  51. // unused
  52. (void)handle;
  53. (void)events;
  54. (void)eventCount;
  55. }
  56. // -----------------------------------------------------------------------
  57. static const PluginDescriptor bypassDesc = {
  58. .metadata = bypass_metadata,
  59. .instantiate = bypass_instantiate,
  60. .cleanup = NULL,
  61. .get_parameter_count = NULL,
  62. .get_parameter_info = NULL,
  63. .get_parameter_value = NULL,
  64. .get_parameter_text = NULL,
  65. .get_midi_program_count = NULL,
  66. .get_midi_program_info = NULL,
  67. .idle = NULL,
  68. .non_rt_event = NULL,
  69. .get_state = NULL,
  70. .set_state = NULL,
  71. .activate = NULL,
  72. .deactivate = NULL,
  73. .process = bypass_process,
  74. .dispatcher = NULL
  75. };
  76. // -----------------------------------------------------------------------
  77. void carla_register_daz_plugin_bypass()
  78. {
  79. carla_register_daz_plugin(&bypassDesc);
  80. }
  81. // -----------------------------------------------------------------------