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.

78 lines
2.4KB

  1. /*
  2. * Carla Plugin Host
  3. * Copyright (C) 2011-2020 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 "CarlaUtils.h"
  18. #include "CarlaUtils.hpp"
  19. #ifdef USING_JUCE
  20. // -------------------------------------------------------------------------------------------------------------------
  21. #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  22. # pragma GCC diagnostic push
  23. # pragma GCC diagnostic ignored "-Wconversion"
  24. # pragma GCC diagnostic ignored "-Weffc++"
  25. # pragma GCC diagnostic ignored "-Wsign-conversion"
  26. # pragma GCC diagnostic ignored "-Wundef"
  27. #endif
  28. #include "AppConfig.h"
  29. #include "juce_events/juce_events.h"
  30. #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  31. # pragma GCC diagnostic pop
  32. #endif
  33. // -------------------------------------------------------------------------------------------------------------------
  34. void carla_juce_init()
  35. {
  36. juce::initialiseJuce_GUI();
  37. #if !(defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN))
  38. juce::MessageManager::getInstance()->setCurrentThreadAsMessageThread();
  39. #endif
  40. }
  41. void carla_juce_idle()
  42. {
  43. #if !(defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN))
  44. const juce::MessageManager* const msgMgr(juce::MessageManager::getInstanceWithoutCreating());
  45. CARLA_SAFE_ASSERT_RETURN(msgMgr != nullptr,);
  46. for (; msgMgr->dispatchNextMessageOnSystemQueue(true);) {}
  47. #endif
  48. }
  49. void carla_juce_cleanup()
  50. {
  51. juce::shutdownJuce_GUI();
  52. }
  53. // -------------------------------------------------------------------------------------------------------------------
  54. #else // USING_JUCE
  55. // -------------------------------------------------------------------------------------------------------------------
  56. void carla_juce_init() {}
  57. void carla_juce_idle() {}
  58. void carla_juce_cleanup() {}
  59. // -------------------------------------------------------------------------------------------------------------------
  60. #endif // USING_JUCE