Running QuickTime Effects dialog from Cocoa
Running QuickTime Effects dialog from Cocoa
- Subject: Running QuickTime Effects dialog from Cocoa
- From: Sarwat Khan <email@hidden>
- Date: Sun, 23 Sep 2001 03:52:47 -0400
Hi,
I'm trying to run the QT Standard Effects dialog from Cocoa,
which requires running a WaitNextEvent loop. The code I'm
currently using is below.
I've got one main problem with this. When the dialog comes up,
it draws the whole dialog fine, but then for some reason
immediately erases the content area (the area that lets you edit
the effect). There are other issues, like being able to select
menu commands and raise other windows.
Also, kEventDurationForever should change, because filter
previews like Film Noise don't animate unless if you move the
mouse.
- (BOOL) _runDialogInEventLoop:(QTParameterDialog)dialogID
{
EventRef theEvent;
EventTargetRef theTarget;
EventRecord theRecord;
OSErr result;
BOOL done = NO;
BOOL useEffect = NO;
theTarget = GetEventDispatcherTarget();
while (ReceiveNextEvent(0, NULL, kEventDurationForever,true,
&theEvent) == noErr
&& done == NO)
{
//check if it's an event for the dialog.
ConvertEventRefToEventRecord(theEvent, &theRecord);
result = QTIsStandardParameterDialogEvent(&theRecord, dialogID);
switch (result)
{
case featureUnsupported:
SendEventToEventTarget(theEvent, theTarget);
break;
case codecParameterDialogConfirm:
QTDismissStandardParameterDialog(dialogID);
useEffect = YES;
dialogID = nil;
done = YES;
break;
case userCanceledErr:
QTDismissStandardParameterDialog(dialogID);
dialogID = nil;
done = YES;
break;
}
ReleaseEvent(theEvent);
}
return useEffect;
}
Thanks for any help,
Sarwat.
{sarwat khan : email@hidden :
http://sarwat.net}