Crash using QTCreateStandardParameterDialog from Cocoa
Crash using QTCreateStandardParameterDialog from Cocoa
- Subject: Crash using QTCreateStandardParameterDialog from Cocoa
- From: "Douglas A. Welton" <email@hidden>
- Date: Tue, 22 Jul 2003 11:11:52 -0400
NOTE: This message is cross-posted on Cocoa-Dev and QuickTime-API
--
Hello boys and girls,
My Cocoa application needs to use the QuickTime Standard Effects Parameter
Dialog to get a response from the user. This means mixing Cocoa and Carbon
event handling. I have read the PDF on Integrating Cocoa & Carbon, and the
associated QuickTime documentation on using QTCreateStandardParameterDialog.
(If there's something else I should read, please point me to it)
I can get the dialog box to display, and I can click on "most" (and there's
the rub) of the items. However, when I click a disclosure triangle in the
effect names outline view and then click on one of the newly display effect
names, my program goes off into endless-spinning-color-wheel mode. The
crash log seems to indicate that something is going awry when the preview
image is being created. I do nothing with preview images, except take what
is already there.
Below is my crash log, followed by the code I am using. Can anyone give me
a pointer as to what I might be doing wrong?
thanks in advance,
douglas
---
(Here is my crash log)
Date/Time: 2003-07-20 23:47:22 -0400
OS Version: 10.2.6 (Build 6L60)
Host: dance.local.
Command: The Paris Lab
PID: 23083
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x0000001c
Thread 0 Crashed:
#0 0x92024200 in NewTimeBase_priv
#1 0x8a1e68f8 in CreatePreviewRecord
#2 0x8a1e6e28 in PreviewUserItem
#3 0x8a1e458c in SetDialogPreview
#4 0x8a1dbb84 in GenericEffectStandardParameterDialogDoAction
#5 0x9022235c in CallComponentFunctionCommon
#6 0x8a1de324 in GenericEffectComponentDispatch
#7 0x014bb834 in EffectsFrameComponentDispatch
#8 0x9202edf0 in ImageCodecStandardParameterDialogDoAction
#9 0x91ffaad8 in StandardSetupPanel
#10 0x91ff25f0 in SelectNewComponent
#11 0x91ffa61c in ProcessListClick
#12 0x91ff5ccc in QTIsStandardParameterDialogEvent_priv
#13 0x00008238 in -[TPL_WindowController Set_Transition_Effect:]
(TPL_WindowController.m:360)
#14 0x930f9cac in -[NSApplication sendAction:to:from:]
#15 0x9311a3ec in -[NSControl sendAction:to:]
#16 0x9315e54c in -[NSCell _sendActionFrom:]
#17 0x930f36b8 in -[NSCell trackMouse:inRect:ofView:untilMouseUp:]
#18 0x9315e168 in -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:]
#19 0x9312de6c in -[NSControl mouseDown:]
#20 0x930c102c in -[NSWindow sendEvent:]
#21 0x930a8e20 in -[NSApplication sendEvent:]
#22 0x930b1dac in -[NSApplication run]
#23 0x9315fc58 in NSApplicationMain
#24 0x00006da0 in main (main.m:13)
#25 0x00004728 in _start (crt.c:267)
#26 0x000045a8 in start
PPC Thread State:
srr0: 0x92024200 srr1: 0x0200f030 vrsave: 0x00000000
xer: 0x00000000 lr: 0x92024200 ctr: 0x89f2d1f4 mq: 0x00000000
r0: 0x89f2ce24 r1: 0xbfffd310 r2: 0x00000000 r3: 0x00000000
r4: 0x00000000 r5: 0x00000000 r6: 0x000003f0 r7: 0x00000001
r8: 0x92024200 r9: 0x90222150 r10: 0x8a3b6368 r11: 0xffffffff
r12: 0x89f2d1f4 r13: 0x015c18a4 r14: 0x00000062 r15: 0x015c1880
r16: 0x00000049 r17: 0x73720000 r18: 0x015c79b0 r19: 0x00000002
r20: 0x73720000 r21: 0x01621a90 r22: 0x001a6898 r23: 0xbfffd440
r24: 0x73726361 r25: 0x00000002 r26: 0xa1f70cc4 r27: 0x00000117
r28: 0x000f4240 r29: 0x000100f2 r30: 0x01607180 r31: 0x920240a8
---
(Here is my source code. NOTE: QuickTime_Effect_List is defined and
populated elsewhere in the object)
- (IBAction) Set_Transition_Effect: (id)sender
{
QTAtomContainer Selected_QuickTime_Effect = NULL;
QTParameterDialog QuickTime_Effects_Dialog_Pointer;
OSErr Return_Code = noErr;
OSStatus Event_Status;
EventRecord Carbon_Event;
EventRef Carbon_Event_Ref;
EventTargetRef Carbon_Event_Target;
BOOL done = NO;
//+
// Set up the Standard QuickTime Effects Dialog box
//-
Return_Code = QTNewAtomContainer( &Selected_QuickTime_Effect );
Return_Code = QTCreateStandardParameterDialog( QuickTime_Effect_List,
Selected_QuickTime_Effect,
0,
&QuickTime_Effects_Dialog_Pointer );
//+
// The loop below allows the user to manipulate the
// Effects dialog. When the user finishes, the loop will be completed
//-
Carbon_Event_Target = GetEventDispatcherTarget();
while ( ReceiveNextEvent( 0, NULL, kEventDurationForever, true,
&Carbon_Event_Ref ) == noErr && done == NO)
{
ConvertEventRefToEventRecord( Carbon_Event_Ref, &Carbon_Event);
Return_Code = QTIsStandardParameterDialogEvent( &Carbon_Event,
QuickTime_Effects_Dialog_Pointer );
switch ( Return_Code )
{
case featureUnsupported:
Event_Status = SendEventToEventTarget( Carbon_Event_Ref,
Carbon_Event_Target );
break;
case codecParameterDialogConfirm:
case userCanceledErr:
QTDismissStandardParameterDialog(
QuickTime_Effects_Dialog_Pointer );
QuickTime_Effects_Dialog_Pointer = nil;
done = YES;
break;
}
ReleaseEvent( Carbon_Event_Ref );
}
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.