Browse Source

Fix for setting up RTAS parameters and mac messaging

tags/2021-05-28
Julian Storer 16 years ago
parent
commit
dfc5fd54db
3 changed files with 17 additions and 7 deletions
  1. +12
    -0
      extras/audio plugins/wrapper/RTAS/juce_RTAS_Wrapper.cpp
  2. +2
    -3
      juce_amalgamated.cpp
  3. +3
    -4
      src/native/mac/juce_mac_MessageManager.mm

+ 12
- 0
extras/audio plugins/wrapper/RTAS/juce_RTAS_Wrapper.cpp View File

@@ -259,6 +259,8 @@ public:
deleteAndZero (wrapper);
wrapper = new EditorCompWrapper (hostWindow, editorComp, this);
process->touchAllParameters();
}
else
{
@@ -786,6 +788,16 @@ protected:
// xxx is there an RTAS equivalent?
}
void touchAllParameters()
{
for (int i = 0; i < juceFilter->getNumParameters(); ++i)
{
audioProcessorParameterChangeGestureBegin (0, i);
audioProcessorParameterChanged (0, i, juceFilter->getParameter (i));
audioProcessorParameterChangeGestureEnd (0, i);
}
}
//==============================================================================
private:
AudioProcessor* juceFilter;


+ 2
- 3
juce_amalgamated.cpp View File

@@ -271445,16 +271445,15 @@ bool MessageManager::runDispatchLoopUntil (int millisecondsToRunFor)
jassert (isThisTheMessageThread()); // must only be called by the message thread

uint32 endTime = Time::getMillisecondCounter() + millisecondsToRunFor;
NSDate* endDate = [NSDate dateWithTimeIntervalSinceNow: millisecondsToRunFor * 0.001 + 1.0];

while (! quitMessagePosted)
{
const ScopedAutoReleasePool pool;

CFRunLoopRunInMode (kCFRunLoopDefaultMode, 0.002, true);
CFRunLoopRunInMode (kCFRunLoopDefaultMode, 0.001, true);

NSEvent* e = [NSApp nextEventMatchingMask: NSAnyEventMask
untilDate: endDate
untilDate: [NSDate dateWithTimeIntervalSinceNow: 0.001]
inMode: NSDefaultRunLoopMode
dequeue: YES];



+ 3
- 4
src/native/mac/juce_mac_MessageManager.mm View File

@@ -395,22 +395,21 @@ bool MessageManager::runDispatchLoopUntil (int millisecondsToRunFor)
jassert (isThisTheMessageThread()); // must only be called by the message thread
uint32 endTime = Time::getMillisecondCounter() + millisecondsToRunFor;
NSDate* endDate = [NSDate dateWithTimeIntervalSinceNow: millisecondsToRunFor * 0.001 + 1.0];
while (! quitMessagePosted)
{
const ScopedAutoReleasePool pool;
CFRunLoopRunInMode (kCFRunLoopDefaultMode, 0.002, true);
CFRunLoopRunInMode (kCFRunLoopDefaultMode, 0.001, true);
NSEvent* e = [NSApp nextEventMatchingMask: NSAnyEventMask
untilDate: endDate
untilDate: [NSDate dateWithTimeIntervalSinceNow: 0.001]
inMode: NSDefaultRunLoopMode
dequeue: YES];
if (e != 0 && ! isEventBlockedByModalComps (e))
[NSApp sendEvent: e];
if (Time::getMillisecondCounter() >= endTime)
break;
}


Loading…
Cancel
Save