• 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: Philippe Wicker <email@hidden>
  • Date: Thu, 30 Jan 2003 23:18:23 +0100

On Thursday, January 30, 2003, at 04:46 PM, Howard Moon wrote:

I would love to compile with the new SDK, but unfortunately, Apple compiled it with ProjectBuilder, and included deprecated (non-carbonized) gcc headers in it, which I cannot compile with CodeWarrior. (And I'll be damned if I'm going to try to switch to ProjectBuilder for all my projects!) They say they'll fix it, but until then, we're stopping all our AudioUnits work.

The compilation problems you encounter are not due to the use of "non carbonized" gcc headers. The file "algo.h" you mentioned in an earlier post is a part of the gcc STL implementation. The equivalent CW file is "algorithm.h".

I use CW8 since 2 or 3 weeks (when the CW 8 Mac OSX edition became available) for my professional activity (I was using PB before and still use it for music software development). I did encounter some compilation problems but I could port the project to CW8 and recompile the whole library and run some test's apps with CW8 in a few days. So I was wondering what kind of compilation problems you have. This is what I did. I have created a C++ Toolbox Mach-O project with CW8 and added all the files from AUPublic in the AU SDK and tried to compile them. You're right, they do not compile immediately. I did some patches to the SDK code and it now compiles. Most of the errors come from difference in C++ syntax interpretation between the 2 compilers. Gcc has some non standard extensions which are sometimes used in the SDK code (eg the use of an integer variable - not a constant - as an array subscript). CW8 does not accept this. Gcc seems to ignore the "pascal" qualifier, CW8 does not. To test my modifications, I recompiled the CAGui demo from the framework of Urs Heckmann and tested it with AudioUnitHosting and it works. I have reproduced here after the patches for the SDK code. It will certainly not solve all your problems, but it could help. Oh, one more thing, I had to uncheck the ANSI Strict option in the compiler prefs panel. Gcc accepts array declaration with a null subscript, which is considered as a non ansi feature by CW8 (honestly, I don't know who is right...)

Ah, one more last thing. Don't give up :-)

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.
_______________________________________________
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.

  • Follow-Ups:
    • Re: Audio unit crash and fix
      • From: Howard Moon <email@hidden>
References: 
 >Re: Audio unit crash and fix (From: Howard Moon <email@hidden>)

  • Prev by Date: Re: What is HostTime?
  • Next by Date: AU "offline" processing
  • Previous by thread: Re: Audio unit crash and fix
  • Next by thread: Re: Audio unit crash and fix
  • Index(es):
    • Date
    • Thread