MusicKit  0.0.0
MKScoreRecorder.h
00001 /*
00002   $Id$
00003   Defined In: The MusicKit
00004 
00005   Description:
00006     A MKScoreRecorder is a pseudo-MKInstrument that adds MKNotes to the MKParts in
00007     a given MKScore.  It does this by creating a MKPartRecorder, a true
00008     MKInstrument, for each of the MKScore's MKPart objects.  A MKScoreRecorder's
00009     MKScore is set through the setScore: method.  If you add MKParts to or
00010     remove MKParts from the MKScore after sending the setScore: message, the
00011     changes will not be seen by the MKScoreRecorder.  For example, if you
00012     add a MKPart to the MKScore, the MKScoreRecorder won't create an additional
00013     MKPartRecorder for that MKPart.
00014 
00015     A MKScoreRecorder can access a MKPartRecorder by the name of the MKPart with
00016     which it's associated.  It can also set the time unit of all its
00017     MKPartRecorders through a single message, setTimeUnit:.
00018 
00019     A MKScoreRecorder is said to be in performance from the time any of its
00020     MKPartRecorders receives a MKNote until the performance is finished.
00021 
00022   CF: MKPartRecorder
00023 
00024   Original Author: David A. Jaffe
00025 
00026   Copyright (c) 1988-1992, NeXT Computer, Inc.
00027   Portions Copyright (c) 1994 NeXT Computer, Inc. and reproduced under license from NeXT
00028   Portions Copyright (c) 1994 Stanford University
00029   Portions Copyright (c) 1999-2001, The MusicKit Project.
00030 */
00050 #ifndef __MK_ScoreRecorder_H___
00051 #define __MK_ScoreRecorder_H___
00052 
00053 #import <Foundation/NSObject.h>
00054 #import "MKScore.h"
00055 
00056 @interface MKScoreRecorder : NSObject
00057 {
00059     NSMutableArray *partRecorders;
00061     MKScore *score;
00063     MKTimeUnit timeUnit;
00065     Class partRecorderClass;
00066     BOOL compensatesDeltaT;
00067 
00068 @protected
00069     BOOL _noteSeen;
00070 }
00071 
00079 - init; 
00080 
00096 - setScore: (MKScore *) aScore; 
00097 
00102 - (MKScore *) score; 
00103 
00109 - copyWithZone: (NSZone *) zone; 
00110 
00117 - removePartRecorders; 
00118 
00123 - (MKTimeUnit) timeUnit;
00124 
00135 - setTimeUnit: (MKTimeUnit) aTimeUnit;
00136 
00141 - (NSArray *) partRecorders; 
00142 
00147 - (BOOL) inPerformance;
00148 
00159 - firstNote: (MKNote *) aNote; 
00160 
00171 - afterPerformance; 
00172 
00177 - (NSArray *) noteReceivers; 
00178 
00184 - (MKPartRecorder *) partRecorderForPart: (MKPart *) aPart; 
00185 
00197 - setPartRecorderClass: (Class) aPartRecorderSubclass;
00198 
00205 - (Class) partRecorderClass;
00206 
00207 /* 
00208   You never send this message directly.  
00209   Archives partRecorders, timeUnit and partRecorderClass.
00210   Also optionally archives score.
00211  */
00212 - (void) encodeWithCoder: (NSCoder *) aCoder;
00213 
00214 /* 
00215   You never send this message directly.  
00216  */
00217 - (id) initWithCoder: (NSCoder *) aDecoder;
00218    
00219 @end
00220 
00221 #endif