I just updated JUCE to Version 6.1.2 and the Tracktion engine to Version 1.1.
I’m getting this build error:
#if ! JUCE_MODAL_LOOPS_PERMITTED
#error "You must define JUCE_MODAL_LOOPS_PERMITTED=1 to use Tracktion Engine"
#endif
(JUCE Modules/tracktion_engine/traction_engine.h)
I found a entry here and changed it but i didn’t help…
>
> #if JUCE_ANDROID && ! defined (DOXYGEN)
> #define JUCE_MODAL_LOOPS_PERMITTED 0
> #elif ! defined (JUCE_MODAL_LOOPS_PERMITTED)
> /** Some operating environments don't provide a modal loop mechanism, so this flag can be
> used to disable any functions that try to run a modal loop. */
> #define JUCE_MODAL_LOOPS_PERMITTED 1
> #endif
How have you set up your project? Using the Projucer or CMake?
Basically you need to add a JUCE_MODAL_LOOPS_PERMITTED=1 in your preprocessor definitions.
I can’t seem to make this work on Android, I believe it’s due to juce_PlatformDefs.h where, the following is defined and probably overrides the jucer settings:
//==============================================================================
#if JUCE_ANDROID && ! defined (DOXYGEN)
#define JUCE_MODAL_LOOPS_PERMITTED 0
#elif ! defined (JUCE_MODAL_LOOPS_PERMITTED)
/** Some operating environments don't provide a modal loop mechanism, so this flag can be
used to disable any functions that try to run a modal loop. */
#define JUCE_MODAL_LOOPS_PERMITTED 0
#endif
AFAIK android is one of those mentioned “operating environments [that] don’t provide a modal loop mechanism”.
Even if you manage to override that setting, it won’t work properly. You need to implement your project in an asynchronous way.
Yes, that’s a good point. You can’t use modal loops on Android.
I thought for that very reason the engine could build without modal loops enabled… I’ll have to see if that’s still the case or one has snuck in accidentally.
I don’t think you need JUCE_MODAL_LOOPS_PERMITTED=1 to build the library any more, maybe just the demos but that should be done already in the cmake files.