The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
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.

115 lines
4.3KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2022 - Raw Material Software Limited
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 7 End-User License
  8. Agreement and JUCE Privacy Policy.
  9. End User License Agreement: www.juce.com/juce-7-licence
  10. Privacy Policy: www.juce.com/juce-privacy-policy
  11. Or: You may also use this code under the terms of the GPL v3 (see
  12. www.gnu.org/licenses).
  13. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  14. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  15. DISCLAIMED.
  16. ==============================================================================
  17. */
  18. #include "juce_ARAPlugInInstanceRoles.h"
  19. namespace juce
  20. {
  21. bool ARARenderer::processBlock ([[maybe_unused]] AudioBuffer<double>& buffer,
  22. [[maybe_unused]] AudioProcessor::Realtime realtime,
  23. [[maybe_unused]] const AudioPlayHead::PositionInfo& positionInfo) noexcept
  24. {
  25. // If you hit this assertion then either the caller called the double
  26. // precision version of processBlock on a processor which does not support it
  27. // (i.e. supportsDoublePrecisionProcessing() returns false), or the implementation
  28. // of the ARARenderer forgot to override the double precision version of this method
  29. jassertfalse;
  30. return false;
  31. }
  32. void ARARenderer::prepareToPlay ([[maybe_unused]] double sampleRate,
  33. [[maybe_unused]] int maximumSamplesPerBlock,
  34. [[maybe_unused]] int numChannels,
  35. [[maybe_unused]] AudioProcessor::ProcessingPrecision precision,
  36. [[maybe_unused]] AlwaysNonRealtime alwaysNonRealtime) {}
  37. //==============================================================================
  38. #if ARA_VALIDATE_API_CALLS
  39. void ARAPlaybackRenderer::addPlaybackRegion (ARA::ARAPlaybackRegionRef playbackRegionRef) noexcept
  40. {
  41. if (araExtension)
  42. ARA_VALIDATE_API_STATE (! araExtension->isPrepared);
  43. ARA::PlugIn::PlaybackRenderer::addPlaybackRegion (playbackRegionRef);
  44. }
  45. void ARAPlaybackRenderer::removePlaybackRegion (ARA::ARAPlaybackRegionRef playbackRegionRef) noexcept
  46. {
  47. if (araExtension)
  48. ARA_VALIDATE_API_STATE (! araExtension->isPrepared);
  49. ARA::PlugIn::PlaybackRenderer::removePlaybackRegion (playbackRegionRef);
  50. }
  51. #endif
  52. bool ARAPlaybackRenderer::processBlock ([[maybe_unused]] AudioBuffer<float>& buffer,
  53. [[maybe_unused]] AudioProcessor::Realtime realtime,
  54. [[maybe_unused]] const AudioPlayHead::PositionInfo& positionInfo) noexcept
  55. {
  56. return false;
  57. }
  58. //==============================================================================
  59. bool ARAEditorRenderer::processBlock ([[maybe_unused]] AudioBuffer<float>& buffer,
  60. [[maybe_unused]] AudioProcessor::Realtime isNonRealtime,
  61. [[maybe_unused]] const AudioPlayHead::PositionInfo& positionInfo) noexcept
  62. {
  63. return true;
  64. }
  65. //==============================================================================
  66. void ARAEditorView::doNotifySelection (const ARA::PlugIn::ViewSelection* viewSelection) noexcept
  67. {
  68. listeners.call ([&] (Listener& l)
  69. {
  70. l.onNewSelection (*viewSelection);
  71. });
  72. }
  73. void ARAEditorView::doNotifyHideRegionSequences (std::vector<ARA::PlugIn::RegionSequence*> const& regionSequences) noexcept
  74. {
  75. listeners.call ([&] (Listener& l)
  76. {
  77. l.onHideRegionSequences (ARA::vector_cast<ARARegionSequence*> (regionSequences));
  78. });
  79. }
  80. void ARAEditorView::addListener (Listener* l)
  81. {
  82. listeners.add (l);
  83. }
  84. void ARAEditorView::removeListener (Listener* l)
  85. {
  86. listeners.remove (l);
  87. }
  88. void ARAEditorView::Listener::onNewSelection ([[maybe_unused]] const ARAViewSelection& viewSelection) {}
  89. void ARAEditorView::Listener::onHideRegionSequences ([[maybe_unused]] const std::vector<ARARegionSequence*>& regionSequences) {}
  90. } // namespace juce