Re: CAAudiofile.h in CoreAudio Public Utility and other things
Re: CAAudiofile.h in CoreAudio Public Utility and other things
- Subject: Re: CAAudiofile.h in CoreAudio Public Utility and other things
- From: William Stewart <email@hidden>
- Date: Fri, 7 Apr 2006 11:23:21 -0700
Please put these details into a but report - http://
bugreporter.apple.com/ - we've made these kinds of changes elsewhere
in the past, so in principle, this shouldn't be a problem
Thanks
Bill
On 07/04/2006, at 7:09 AM, Roni Music wrote:
----- Original Message ----- From: <email@hidden>
To: "Roni Music" <email@hidden>
Sent: Friday, April 07, 2006 3:52 PM
Subject: Re: CAAudiofile.h in CoreAudio Public Utility and other
things
I started designing my app on 10.4, and was told that it needs to
run under 10.3 as well. When I switched the SDKs, I noticed the
same thing as you. Since I am not using the 10.4-only extensions
in CAHardwareDevice, I would also prefer if they were wrapped in
macros.
Agree,
The reason I changed from the 10.4 SDK to the 10.3.9 SDK
was that if one uses certain functions from the Standard C++
library such as
std::log10() etc
and call with float parameters i.e.
float someFloatValue = 1.0;
std::log10(someFloatValue);
you need to type cast them into double's
std::log10(double(someFloatValue));
else the applications will not run on anything but OS X 10.4 or higher
Using the 10.3.9 SDK solved this problem but of course introduces
new ones ;-)
It's not to hard to change the CoreAudio publicity files, but as
soon as a new CoreAudio SDK is out
those changes will have to be added again.
Better if they were there from the start
Rolf
- Rick
Roni Music wrote:
Hi,
I'm using a lot of all the useful stuff in CoreAudio Public
Utility. It's great!
I recently had to change from using the 10.4u SDK to 10.3.9 SDK
for reason I will not explain now.
This makes the following part fail to compile (I want to avoid
making changes myself in the CoreAudio Public Utility files if
possible):
from CAAudiofile.h:
#ifndef MAC_OS_X_VERSION_10_4
// we have pre-Tiger headers; add our own declarations
typedef UInt32 AudioFileTypeID;
enum {
kExtAudioFileError_InvalidProperty = -66561,
kExtAudioFileError_InvalidPropertySize = -66562,
kExtAudioFileError_NonPCMClientFormat = -66563,
kExtAudioFileError_InvalidChannelMap = -66564, // number of
channels doesn't match format
kExtAudioFileError_InvalidOperationOrder = -66565,
kExtAudioFileError_InvalidDataFormat = -66566,
kExtAudioFileError_MaxPacketSizeUnknown = -66567,
kExtAudioFileError_InvalidSeek = -66568, // writing, or
offset out of bounds
kExtAudioFileError_AsyncWriteTooLarge = -66569,
kExtAudioFileError_AsyncWriteBufferOverflow = -66570 // an
async write could not be completed in time
};
#else
#if !defined(__COREAUDIO_USE_FLAT_INCLUDES__)
#include <AudioToolbox/ExtendedAudioFile.h>
#else
#include "ExtendedAudioFile.h"
#endif
#endif
-------------------------
the AvailabilityMacros.h file (regardless if it's from SDK
10.2.8, 10.3.9 or 10.4u) has the following #defines
#define MAC_OS_X_VERSION_10_0 1000
#define MAC_OS_X_VERSION_10_1 1010
#define MAC_OS_X_VERSION_10_2 1020
#define MAC_OS_X_VERSION_10_3 1030
#define MAC_OS_X_VERSION_10_4 1040
so even when I use SDK 10.3.9 it will try to include
ExtendedAudioFile.h which is not available until Tiger
wouldn't
#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3
be better?
Or something that makes it compile regardless what SDK we use?
-----------
Also some classes in files such as for example
CAAudioHardwareDevice.h and CAAudioHardwareDevice.cpp
has some newer member functions that relies on things introduced
in Tiger, for example:
bool CAAudioHardwareDevice::GetSoloControlValue(UInt32 inChannel,
CAAudioHardwareDeviceSectionID inSection) const
{
UInt32 theValue = 0;
UInt32 theSize = sizeof(UInt32);
GetPropertyData(inChannel, inSection, kAudioDevicePropertySolo,
theSize, &theValue);
return theValue != 0;
}
kAudioDevicePropertySolo is not available when using SDK 10.3.9
or earlier which again makes it difficult to use other SDK's than
10.4
it would be good if those newer additions were wrapped in
something as:
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
bool CAAudioHardwareDevice::GetSoloControlValue(UInt32 inChannel,
CAAudioHardwareDeviceSectionID inSection) const
{
UInt32 theValue = 0;
UInt32 theSize = sizeof(UInt32);
GetPropertyData(inChannel, inSection, kAudioDevicePropertySolo,
theSize, &theValue);
return theValue != 0;
}
#endif
Any comments?
Rolf
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden