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.

82 lines
2.6KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. void MessageManager::doPlatformSpecificInitialisation() {}
  18. void MessageManager::doPlatformSpecificShutdown() {}
  19. //==============================================================================
  20. bool MessageManager::dispatchNextMessageOnSystemQueue (const bool returnIfNoPendingMessages)
  21. {
  22. Logger::outputDebugString ("*** Modal loops are not possible in Android!! Exiting...");
  23. exit (1);
  24. return true;
  25. }
  26. //==============================================================================
  27. bool MessageManager::postMessageToSystemQueue (MessageManager::MessageBase* const message)
  28. {
  29. message->incReferenceCount();
  30. android.activity.callVoidMethod (JuceAppActivity.postMessage, (jlong) (pointer_sized_uint) message);
  31. return true;
  32. }
  33. JUCE_JNI_CALLBACK (JUCE_ANDROID_ACTIVITY_CLASSNAME, deliverMessage, void, (JNIEnv* env, jobject activity, jlong value))
  34. {
  35. setEnv (env);
  36. JUCE_TRY
  37. {
  38. MessageManager::MessageBase* const message = (MessageManager::MessageBase*) (pointer_sized_uint) value;
  39. message->messageCallback();
  40. message->decReferenceCount();
  41. }
  42. JUCE_CATCH_EXCEPTION
  43. }
  44. //==============================================================================
  45. void MessageManager::broadcastMessage (const String&)
  46. {
  47. }
  48. void MessageManager::runDispatchLoop()
  49. {
  50. }
  51. void MessageManager::stopDispatchLoop()
  52. {
  53. struct QuitCallback : public CallbackMessage
  54. {
  55. QuitCallback() {}
  56. void messageCallback() override
  57. {
  58. android.activity.callVoidMethod (JuceAppActivity.finish);
  59. }
  60. };
  61. (new QuitCallback())->post();
  62. quitMessagePosted = true;
  63. }