diff -r 000000000000 -r ce9c83f7ec14 AudioUtils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/AudioUtils.h Sun Jul 13 10:45:42 2008 -0700 @@ -0,0 +1,44 @@ +// +// AudioUtils.h +// Cloudy +// +// Created by Jens Alfke on 6/17/08. +// Copyright 2008 Jens Alfke. All rights reserved. +// + +#import + +#ifdef __cplusplus +extern "C" { +#endif + + #define MYCoreAudioErrorDomain @"MYCoreAudioDomain" + + NSString* MYCAErrorString( OSStatus coreAudioError ); + NSError* MYCAError( OSStatus coreAudioError, NSString *message ); + +#ifdef __cplusplus +} +#endif + + + +#define XWarnIfError(error, operation) \ + do { \ + OSStatus __err = error; \ + if (__err) _MYWarnCAError(__err,@""operation); \ + } while (0) + +void _MYWarnCAError( OSStatus error, NSString *operation ); + +#ifdef __cplusplus + + #define XThrowIfError(error, operation) \ + do { \ + OSStatus __err = error; \ + if (__err) _MYThrowCAError(__err,@""operation); \ + } while (0) + + void _MYThrowCAError( OSStatus error, NSString *operation ) throw(NSError*) __attribute__((noreturn)); + +#endif __cplusplus