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.

71 lines
1.8KB

  1. /*
  2. * Carla Plugin Host
  3. * Copyright (C) 2011-2022 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. #ifndef CARLA_JUCE_HPP_INCLUDED
  18. #define CARLA_JUCE_HPP_INCLUDED
  19. #include "AppConfig.h"
  20. #include "CarlaDefines.h"
  21. #ifdef USING_JUCE
  22. # if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)
  23. # define USE_STANDALONE_JUCE_APPLICATION
  24. # else
  25. # define USE_REFCOUNTER_JUCE_MESSAGE_MANAGER
  26. # endif
  27. #endif
  28. #ifdef USE_STANDALONE_JUCE_APPLICATION
  29. # include <functional>
  30. #endif
  31. namespace juce {
  32. class MessageManager;
  33. }
  34. namespace CarlaJUCE {
  35. void initialiseJuce_GUI();
  36. void idleJuce_GUI();
  37. void shutdownJuce_GUI();
  38. const char* getVersion();
  39. struct ScopedJuceInitialiser_GUI {
  40. ScopedJuceInitialiser_GUI();
  41. ~ScopedJuceInitialiser_GUI();
  42. };
  43. #ifdef USE_REFCOUNTER_JUCE_MESSAGE_MANAGER
  44. struct ReferenceCountedJuceMessageMessager {
  45. ReferenceCountedJuceMessageMessager();
  46. ~ReferenceCountedJuceMessageMessager();
  47. void incRef() const;
  48. void decRef() const;
  49. };
  50. void setMessageManagerForThisThread();
  51. void dispatchMessageManagerMessages();
  52. #endif
  53. #ifdef USE_STANDALONE_JUCE_APPLICATION
  54. void setupAndUseMainApplication(std::function<void()> idleFn, volatile bool* closedSignalPtr);
  55. #endif
  56. } // namespace CarlaJUCE
  57. #endif // CARLA_JUCE_HPP_INCLUDED