• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Audio unit crash and fix
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Audio unit crash and fix


  • Subject: Re: Audio unit crash and fix
  • From: Howard Moon <email@hidden>
  • Date: Fri, 31 Jan 2003 09:03:15 -0800

Regards.

Philippe Wicker
email@hidden


File AUBase.cpp:

comment <algo.h>:
This file is included to allow the us of std::sort in ProcessForScheduledParams which is available through the CW MSL-C++ (well, I think...). No need to include <algorithm.h>.

File AUCarbonViewControl.h:

in class AUCarbonViewControl

line 114, change
static void SliderTrackProc(ControlRef theControl, ControlPartCode partCode);
to
static pascal void SliderTrackProc(ControlRef theControl, ControlPartCode partCode);

line 116, change
static ControlKeyFilterResult NumericKeyFilterCallback(ControlRef theControl, SInt16 *keyCode, SInt16 *charCode,
to
static pascal ControlKeyFilterResult NumericKeyFilterCallback(ControlRef theControl, SInt16 *keyCode, SInt16 *charCode,

File AUCarbonViewControl.cpp:
line 249, change
void AUCarbonViewControl::SliderTrackProc(ControlRef theControl, ControlPartCode partCode)
to
pascal AUCarbonViewControl::SliderTrackProc(ControlRef theControl, ControlPartCode partCode)

line 255, change
ControlKeyFilterResult AUCarbonViewControl::NumericKeyFilterCallback(ControlRef theControl,
to
pascal ControlKeyFilterResult AUCarbonViewControl::NumericKeyFilterCallback(ControlRef theControl,


File CarbonEventHandler.cpp:

line 45, change
static OSStatus TheEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
to
static pascal OSStatus TheEventHandler(EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)

lines 62/63 (in the destructor of CarbonEventHandler), change
EventHandlerRef theHandlers[count];
CFDictionaryGetKeysAndValues(mHandlers, NULL, (const void **) &theHandlers);
to
EventHandlerRef theHandlers = new EventHandlerRef[count];
CFDictionaryGetKeysAndValues(mHandlers, NULL, (const void **) theHandlers);
(not really sure if the address operator & is really unneeded ...)

line 68, at the end of the block if (mHandlers != NULL) { ...., add
delete [] theHandlers ;
this one is just to avoid a memory leak.



Excellent! Exactly the conversion code I was trying to do myself (but failing).

Strange that this uses EventHandlerRef, though...I thought that under Carbon, one would expect to use an EventHandlerUPP (which I was unable to get working at all).

Anyways, shouldn't this line:

EventHandlerRef theHandlers = new EventHandlerRef[count];

really be:

EventHandlerRef * theHandlers = new EventHandlerRef[count];

I mean, you are defining a pointer here, which you will later delete with "delete []", right?

Thanks,
Howard
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Audio unit crash and fix (From: Philippe Wicker <email@hidden>)

  • Prev by Date: Re: Is ReWire necessary under OS X?
  • Next by Date: No callback problem
  • Previous by thread: Re: Audio unit crash and fix
  • Next by thread: CAUGui SDK updated!
  • Index(es):
    • Date
    • Thread