#import <MKScorefileWriter.h>
Public Member Functions | |
(NSString *) | - fileExtension |
Returns "score", the default file extension for score files if the file was set with setFile: or setStream:. | |
(void) | - setInfoNote: |
Sets the receiver's info MKNote, freeing a previously set info MKNote, if any. | |
(MKNote *) | - infoNote |
Returns the receiver's info MKNote, as set through setInfo:. | |
(id) | - setInfoNote:forNoteReceiver: |
Sets aPartInfo as the MKNote that's written as the info MKNote for the MKPart that corresponds to the MKNoteReceiver aNoteReceiver. | |
(MKNote *) | - infoNoteForNoteReceiver: |
Returns the info MKNote that's associated with an MKNoteReceiver (as set through -setInfo:forNoteReceiver:). | |
(id) | - initializeFile |
Initializes the scorefile. | |
(id) | - finishFile |
You never invoke this method; it's invoked automatically at the end of a performance. | |
(id) | - copyWithZone: |
Creates and returns a new MKScorefileWriter as a copy of the receiver. | |
(id) | - realizeNote:fromNoteReceiver: |
Realizes aNote by writing it to the scorefile. | |
(id) | - setFile: |
Sets file and specifies that the data be written in ascii (.score ) format. | |
(id) | - setStream: |
Sets stream and specifies that the data be written in ascii (.score ) format. | |
(id) | - setOptimizedStream: |
Same as setStream: but specifies that the data be written in optimized scorefile (.playscore ) format. | |
(id) | - setOptimizedFile: |
Same as setFile: but specifies that the data be written in optimized (.playscore ) format. | |
Static Public Member Functions | |
(NSString *) | + fileExtension |
Returns the default file extension for score files. | |
Protected Attributes | |
MKNote * | info |
The name of the scorefile to which the MKNotes are written is set through methods inherited from MKFileWriter.
Each of a MKScorefileWriter's MKNoteReceivers corresponds to a MKPart that will appear in the scorefile. Unlike most MKInstruments, the MKScorefileWriter class doesn't add any MKNoteReceivers to a newly created object, they must be added by invoking the addNoteReceiver: method.
The names of the MKParts represented in the scorefile are taken from the MKNoteRecievers for which they were created. You can name a MKNoteReceiver by calling the MKNameObject() function.
The header of the scorefile always includes a part statement that names the MKParts represented in the MKScore, and a tagRange statement that states the range of noteTag values used in the MKNote statements. A MKScorefileWriter can be given an info MKNote that's written as a MKScore info statement in the file; similarly, the MKScorefileWriter's MKNoteReceivers can each contain a MKPart info MKNote. These, too, are written to the scorefile, each in a separate MKPart info statement.
You shouldn't change the name of a data object (such as an MKEnvelope, MKWaveTable, or MKNoteReceiver) during a performance involving a MKScorefileWriter.
+ (NSString *) fileExtension |
Returns the default file extension for score files.
The string isn't copied. Note: This method is superceded by the instance method of the same name.
Reimplemented from MKFileWriter.
- (NSString *) fileExtension |
Returns "score", the default file extension for score files if the file was set with setFile: or setStream:.
Returns "playscore", the default file extension for optimized format score files if the file was set with setOptimizedFile: or setOptimizedStream:. The string is not copied.
Reimplemented from MKFileWriter.
- (void) setInfoNote: | (MKNote *) | aNote |
- (MKNote *) infoNote |
- (id) setInfoNote: | (MKNote *) | aPartInfo | ||
forNoteReceiver: | (MKNoteReceiver *) | aNoteReceiver | ||
Sets aPartInfo as the MKNote that's written as the info MKNote for the MKPart that corresponds to the MKNoteReceiver aNoteReceiver.
The MKPart's previously set info MKNote, if any, is freed. If the receiver is in performance, or if aNoteReceiver doesn't belong to the receiver, does nothing and returns nil, otherwise returns the receiver.
aPartInfo | is an MKNote. | |
aNoteReceiver | is an MKNoteReceiver. |
- (MKNote *) infoNoteForNoteReceiver: | (MKNoteReceiver *) | aNoteReceiver |
Returns the info MKNote that's associated with an MKNoteReceiver (as set through -setInfo:forNoteReceiver:).
aNoteReceiver | is an MKNoteReceiver instance. |
- (id) initializeFile |
Initializes the scorefile.
You never invoke this method; it's invoked automatically just before the receiver writes its first MKNote to the scorefile.
Reimplemented from MKFileWriter.
- (id) finishFile |
You never invoke this method; it's invoked automatically at the end of a performance.
Reimplemented from MKFileWriter.
- (id) copyWithZone: | (NSZone *) | zone |
Creates and returns a new MKScorefileWriter as a copy of the receiver.
The new object copies the receivers MKNoteReceivers and info MKNotes.
Reimplemented from MKFileWriter.
- (id) realizeNote: | (MKNote *) | aNote | ||
fromNoteReceiver: | (MKNoteReceiver *) | aNoteReceiver | ||
Realizes aNote by writing it to the scorefile.
The MKNote statement created from aNote is assigned to the MKPart that corresponds to aNoteReceiver.
aNote | is an MKNote instance. | |
aNoteReceiver | is an MKNoteReceiver instance. |
Reimplemented from MKInstrument.
- (id) setFile: | (NSString *) | aName |
Sets file and specifies that the data be written in ascii (.score
) format.
See superclass documentation for details.
aName | is an NSString instance. |
Reimplemented from MKFileWriter.
- (id) setStream: | (NSMutableData *) | aStream |
Sets stream and specifies that the data be written in ascii (.score
) format.
See superclass documentation for details.
aStream | is an NSMutableData instance. |
Reimplemented from MKFileWriter.
- (id) setOptimizedStream: | (NSMutableData *) | aStream |
Same as setStream: but specifies that the data be written in optimized scorefile (.playscore
) format.
aStream | is an NSMutableData. |
- (id) setOptimizedFile: | (NSString *) | aName |
Same as setFile: but specifies that the data be written in optimized (.playscore
) format.
aName | is an NSString. |