AudioUtils.h
author Jens Alfke <jens@mooseyard.com>
Sun Jul 13 10:45:42 2008 -0700 (2008-07-13)
changeset 16 ce9c83f7ec14
permissions -rw-r--r--
* Minor fixes to glitches detected by the clang static analyzer.
* Added MYAnimatingSplitView class.
     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