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.

DistrhoPluginProM.cpp 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * DISTRHO ProM Plugin
  3. * Copyright (C) 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 Lesser General Public
  7. * License as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser General Public License for more details.
  13. *
  14. * For a full copy of the license see the LICENSE file.
  15. */
  16. #include "DistrhoPluginProM.hpp"
  17. #include "libprojectM/projectM.hpp"
  18. START_NAMESPACE_DISTRHO
  19. // -----------------------------------------------------------------------
  20. DistrhoPluginProM::DistrhoPluginProM()
  21. : Plugin(0, 0, 0),
  22. fPM(nullptr)
  23. {
  24. }
  25. DistrhoPluginProM::~DistrhoPluginProM()
  26. {
  27. DISTRHO_SAFE_ASSERT(fPM == nullptr);
  28. }
  29. // -----------------------------------------------------------------------
  30. // Init
  31. void DistrhoPluginProM::d_initParameter(uint32_t, Parameter&)
  32. {
  33. }
  34. // -----------------------------------------------------------------------
  35. // Internal data
  36. float DistrhoPluginProM::d_getParameterValue(uint32_t) const
  37. {
  38. return 0.0f;
  39. }
  40. void DistrhoPluginProM::d_setParameterValue(uint32_t, float)
  41. {
  42. }
  43. // -----------------------------------------------------------------------
  44. // Process
  45. void DistrhoPluginProM::d_run(const float** inputs, float** outputs, uint32_t frames)
  46. {
  47. const float* in = inputs[0];
  48. float* out = outputs[0];
  49. if (out != in)
  50. std::memcpy(out, in, sizeof(float)*frames);
  51. const MutexLocker csm(fMutex);
  52. if (fPM == nullptr)
  53. return;
  54. if (PCM* const pcm = const_cast<PCM*>(fPM->pcm()))
  55. pcm->addPCMfloat(in, frames);
  56. }
  57. // -----------------------------------------------------------------------
  58. Plugin* createPlugin()
  59. {
  60. return new DistrhoPluginProM();
  61. }
  62. // -----------------------------------------------------------------------
  63. END_NAMESPACE_DISTRHO