MusicKit  0.0.0
MKScorefileWriter.h
00001 /*
00002   $Id$
00003   Defined In: The MusicKit
00004 
00005   Description:
00006     A MKScorefileWriter is an MKInstrument that realizes MKNotes by writing
00007     them to a scorefile.  Each of the receiver's MKNoteReceivers 
00008     correspond to a MKPart that will appear in the scorefile.
00009     Unlike most MKInstruments, the MKScorefileWriter class doesn't add
00010     any MKNoteReceivers to a newly created object, they must be added by 
00011     invoking the addNoteReceiver:. method. 
00012 
00013     The names of the MKParts represented in the scorefile are taken from the
00014     MKNoteRecievers for which they were created.  You can name a MKNoteReceiver by
00015     calling the MKNameObject() function.
00016 
00017     The header of the scorefile always includes a part statement naming the
00018     MKParts represented in the MKScore, and a tagRange statement, outlining the
00019     range of noteTag values used in the MKNote statements.
00020 
00021     You shouldn't change the name of a data object (such as an
00022     MKEnvelope, MKWaveTable, or MKNoteReceiver) during a performance involving a
00023     MKScorefileWriter.
00024 
00025   Original Author: David A. Jaffe
00026 
00027   Copyright (c) 1988-1992, NeXT Computer, Inc.
00028   Portions Copyright (c) 1994 NeXT Computer, Inc. and reproduced under license from NeXT
00029   Portions Copyright (c) 1994 CCRMA, Stanford University
00030   Portions Copyright (c) 1999-2001, The MusicKit Project.
00031 */
00059 #ifndef __MK_ScorefileWriter_H___
00060 #define __MK_ScorefileWriter_H___
00061 
00062 #import "MKFileWriter.h"
00063 
00064 @interface MKScorefileWriter : MKFileWriter
00065 {
00067     MKNote *info; 
00068     
00069 @private
00070     int _highTag;
00071     int _lowTag;
00072     BOOL _isOptimized;
00073     void *_p;
00074 }
00075  
00082 + (NSString *) fileExtension;
00083 
00093 - (NSString *) fileExtension;
00094 
00101 - (void) setInfoNote: (MKNote *) aNote;
00102 
00107 - (MKNote *) infoNote;
00108 
00122 - setInfoNote: (MKNote *) aPartInfo forNoteReceiver: (MKNoteReceiver *) aNoteReceiver;
00123 
00130 - (MKNote *) infoNoteForNoteReceiver: (MKNoteReceiver *) aNoteReceiver;
00131 
00139 - initializeFile; 
00140 
00146 - finishFile; 
00147 
00154 - copyWithZone: (NSZone *) zone; 
00155 
00165 - realizeNote: (MKNote *) aNote fromNoteReceiver: (MKNoteReceiver *) aNoteReceiver; 
00166 
00175 - setFile: (NSString *) aName;
00176 
00184 - setStream: (NSMutableData *) aStream;
00185 
00191 - setOptimizedStream: (NSMutableData *) aStream;
00192 
00199 - setOptimizedFile: (NSString *) aName;
00200 
00201 /* 
00202      You never send this message directly.  
00203      Invokes superclass write:, which archives MKNoteReceivers.
00204      Then archives info, isOptimized, and MKPart info MKNotes.  
00205  */
00206 - (void) encodeWithCoder: (NSCoder *) aCoder;
00207 
00208 /* 
00209    You never send this message directly.  
00210      Note that -init is not sent to newly unarchived objects.
00211      See write:. 
00212  */
00213 - (id) initWithCoder: (NSCoder *) aDecoder;
00214 
00215 @end
00216 
00217 #endif