AudioUtils.h
author Jens Alfke <jens@mooseyard.com>
Wed Sep 02 08:41:25 2009 -0700 (2009-09-02)
changeset 35 5cab3034d3a1
permissions -rw-r--r--
10.6 compatibility: Fix some new compiler warnings, and work around apparent regressions in NSTask and -stringByStandardizingPath.
     1 //
     2 //  AudioUtils.h
     3 //  Cloudy
     4 //
     5 //  Created by Jens Alfke on 6/17/08.
     6 //  Copyright 2008 Jens Alfke. All rights reserved.
     7 //
     8 
     9 #import <Cocoa/Cocoa.h>
    10 
    11 #ifdef __cplusplus
    12 extern "C" {
    13 #endif
    14     
    15     #define MYCoreAudioErrorDomain @"MYCoreAudioDomain"
    16 
    17     NSString* MYCAErrorString( OSStatus coreAudioError );
    18     NSError* MYCAError( OSStatus coreAudioError, NSString *message );
    19 
    20 #ifdef __cplusplus
    21 }
    22 #endif
    23 
    24        
    25 
    26 #define XWarnIfError(error, operation) \
    27     do {																	\
    28         OSStatus __err = error;												\
    29         if (__err) _MYWarnCAError(__err,@""operation);	\
    30     } while (0)
    31 
    32 void _MYWarnCAError( OSStatus error, NSString *operation );
    33 
    34 #ifdef __cplusplus
    35 
    36     #define XThrowIfError(error, operation) \
    37         do {																	\
    38             OSStatus __err = error;												\
    39             if (__err) _MYThrowCAError(__err,@""operation);	\
    40         } while (0)
    41 
    42     void _MYThrowCAError( OSStatus error, NSString *operation ) throw(NSError*) __attribute__((noreturn));
    43 
    44 #endif __cplusplus