@@ -1194,6 +1194,15 @@ public: | |||||
const int numInputChans = data.inputs != nullptr ? (int) data.inputs[0].numChannels : 0; | const int numInputChans = data.inputs != nullptr ? (int) data.inputs[0].numChannels : 0; | ||||
const int numOutputChans = data.outputs != nullptr ? (int) data.outputs[0].numChannels : 0; | const int numOutputChans = data.outputs != nullptr ? (int) data.outputs[0].numChannels : 0; | ||||
if (numInputChans != pluginInstance->getNumInputChannels() | |||||
|| numOutputChans != pluginInstance->getNumOutputChannels()) | |||||
{ | |||||
const double sampleRate = pluginInstance->getSampleRate(); | |||||
const int bufferSize = (int) data.numSamples; | |||||
pluginInstance->setPlayConfigDetails (numInputChans, numOutputChans, sampleRate, bufferSize); | |||||
pluginInstance->prepareToPlay (sampleRate, bufferSize); | |||||
} | |||||
int totalChans = 0; | int totalChans = 0; | ||||
while (totalChans < numInputChans) | while (totalChans < numInputChans) | ||||
@@ -31,13 +31,17 @@ | |||||
live in juce_posix_SharedCode.h! | live in juce_posix_SharedCode.h! | ||||
*/ | */ | ||||
#if JUCE_IOS | |||||
bool isIOSAppActive = true; | |||||
#endif | |||||
//============================================================================== | //============================================================================== | ||||
JUCE_API bool JUCE_CALLTYPE Process::isForegroundProcess() | JUCE_API bool JUCE_CALLTYPE Process::isForegroundProcess() | ||||
{ | { | ||||
#if JUCE_MAC | #if JUCE_MAC | ||||
return [NSApp isActive]; | return [NSApp isActive]; | ||||
#else | #else | ||||
return true; // xxx change this if more than one app is ever possible on iOS! | |||||
return isIOSAppActive; | |||||
#endif | #endif | ||||
} | } | ||||
@@ -22,6 +22,8 @@ | |||||
============================================================================== | ============================================================================== | ||||
*/ | */ | ||||
extern bool isIOSAppActive; | |||||
} // (juce namespace) | } // (juce namespace) | ||||
@interface JuceAppStartupDelegate : NSObject <UIApplicationDelegate> | @interface JuceAppStartupDelegate : NSObject <UIApplicationDelegate> | ||||
@@ -32,6 +34,8 @@ | |||||
- (void) applicationWillTerminate: (UIApplication*) application; | - (void) applicationWillTerminate: (UIApplication*) application; | ||||
- (void) applicationDidEnterBackground: (UIApplication*) application; | - (void) applicationDidEnterBackground: (UIApplication*) application; | ||||
- (void) applicationWillEnterForeground: (UIApplication*) application; | - (void) applicationWillEnterForeground: (UIApplication*) application; | ||||
- (void) applicationDidBecomeActive: (UIApplication*) application; | |||||
- (void) applicationWillResignActive: (UIApplication*) application; | |||||
@end | @end | ||||
@@ -68,6 +72,18 @@ | |||||
app->resumed(); | app->resumed(); | ||||
} | } | ||||
- (void) applicationDidBecomeActive: (UIApplication*) application | |||||
{ | |||||
(void) application; | |||||
isIOSAppActive = true; | |||||
} | |||||
- (void) applicationWillResignActive: (UIApplication*) application | |||||
{ | |||||
(void) application; | |||||
isIOSAppActive = false; | |||||
} | |||||
@end | @end | ||||
namespace juce | namespace juce | ||||