MusicKit  0.0.0
SndPerformance.h
00001 
00002 //
00003 //  $Id$
00004 //    
00005 //  Original Author: Leigh Smith, <leigh@tomandandy.com>
00006 //
00007 //  Copyright (c) 2001, The MusicKit Project.  All rights reserved.
00008 //
00009 //  Permission is granted to use and modify this code for commercial and 
00010 //  non-commercial purposes so long as the author attribution and copyright 
00011 //  messages remain intact and accompany all relevant code.
00012 //
00014 
00015 #ifndef __SND_PERFORMANCE_H__
00016 #define __SND_PERFORMANCE_H__
00017 
00018 #import <Foundation/Foundation.h>
00019 #import "Snd.h"
00020 #import "SndAudioBuffer.h"
00021 #import "SndAudioProcessorChain.h"
00022 
00034 @interface SndPerformance : NSObject
00035 {
00037     Snd    *snd;
00039     double  playTime;
00041     long    startAtIndex;
00043     long  playIndex;
00046     long    endAtIndex;
00048     BOOL    paused;
00050     SndAudioProcessorChain *audioProcessorChain;
00051 
00053     BOOL looping;
00055     long loopStartIndex;
00057     long loopEndIndex;
00058 
00059     // ivars for variable speed playback - TODO needs fixing and documenting
00060     double  deltaTime;
00061 
00062     double  actualTime;
00063 }
00064 
00073 + (SndPerformance *) performanceOfSnd: (Snd *) s playingAtTime: (double) seconds;
00074 
00084 + (SndPerformance *) performanceOfSnd: (Snd *) s 
00085                         playingAtTime: (double) seconds
00086                          beginAtIndex: (long) beginIndex
00087                            endAtIndex: (long) endIndex;
00096 - initWithSnd: (Snd *) s playingAtTime: (double) seconds;
00097 
00107 - initWithSnd: (Snd *) s
00108 playingAtTime: (double) seconds
00109  beginAtIndex: (long) beginIndex
00110    endAtIndex: (long) endIndex;
00111 
00122 - initWithSnd: (Snd *) s
00123 playingAtTime: (double) playTime
00124 startPosition: (double) startPosition
00125      duration: (double) duration
00126     deltaTime: (double) deltaTime;
00127 
00132 - (Snd *) snd;
00133 
00138 - (double) playTime;
00139 
00143 - setPlayTime: (double) t;
00144 
00145 - (double) deltaTime;
00146 - (void) setDeltaTime: (double) _deltaTime;
00147 
00152 - (long) playIndex;
00153 
00158 - (void) setPlayIndex: (long) newPlayIndex;
00159 
00169 - (long) rewindPlayIndexBySamples: (long) numberOfSamplesToRewind;
00170 
00177 - (long) endAtIndex;
00178 
00183 - (long) startAtIndex;
00184 
00192 - (void) setEndAtIndex: (long) newEndAtIndex;
00193 
00198 - (void) setLooping: (BOOL) yesOrNo;
00199 
00204 -  (BOOL) looping;
00205 
00214 - (void) setLoopStartIndex: (long) loopStartIndex;
00215 
00220 - (long) loopStartIndex;
00221 
00232 - (void) setLoopEndIndex: (long) newLoopEndIndex;
00233 
00238 - (long) loopEndIndex;
00239 
00244 - (void) stopInFuture: (double) inSeconds;
00245 
00249 - (void) stopNow;
00250 
00255 - (BOOL) isEqual: (id) anotherPerformance;
00256 
00261 - (NSString *) description;
00262 
00267 - (BOOL) isPaused;
00268 
00274 - setPaused: (BOOL) isPaused;
00275 
00279 - pause;
00280 
00284 - resume;
00285 
00291 - (BOOL) isPlaying;
00292 
00297 - (SndAudioProcessorChain *) audioProcessorChain;
00298 
00303 - (void) setAudioProcessorChain: (SndAudioProcessorChain *) anAudioProcessorChain;
00304 
00316 - (long) retrievePerformBuffer: (SndAudioBuffer *) bufferToFill ofLength: (long) buffLength;
00317 
00322 - (BOOL) atEndOfPerformance;
00323 
00324 @end
00325 
00327 
00328 #endif