File: programming/cocoa/UKSoundUKSystemSound.zip/UKSound.h


//
//  UKSound.h
//  MobileMoose
//
//  Created by Uli Kusterer on 14.07.08.
//  Copyright 2008 The Void Software. All rights reserved.
//
 
#import <UIKit/UIKit.h>
#import <AudioToolbox/AudioToolbox.h>
 
 
#define kNumberBuffers			2
 
 
@class UKSound;
 
 
@protocol UKSoundDelegate
 
@optional
-(void)	sound: (UKSound*)sender didFinishPlaying: (BOOL)state;
 
@end
 
 
 
@interface UKSound : NSObject
{
	AudioFileID						mAudioFile;
	AudioStreamBasicDescription		mDataFormat;
	AudioQueueRef					mQueue;
	AudioQueueBufferRef				mBuffers[kNumberBuffers];
	UInt64							mPacketIndex;
	UInt32							mNumPacketsToRead;
	AudioStreamPacketDescription *	mPacketDescs;
	BOOL							mDone;
	id<UKSoundDelegate>				delegate;
	int								maxBufferSizeBytes;
}
 
@property (assign) id<UKSoundDelegate> delegate;
 
-(id)	initWithContentsOfURL: (NSURL*)theURL;
 
-(void)	play;
 
 
// private:
-(void)	audioQueue: (AudioQueueRef)inAQ processBuffer: (AudioQueueBufferRef)inCompleteAQBuffer;
 
@end

This code uses the PclZip Zip File reading code, which is subject to the GNU LGPL. It also uses the GeSHi syntax highlighter, subject to the GPL. Ask if you want this for your own web site, it's free.