#import <MKScorefilePerformer.h>
Public Member Functions | |
(id) | - init |
Initializes the receiver. | |
(MKNote *) | - infoNote |
Returns the receiver's info MKNote, fashioned from an info statement in the header of the scorefile. | |
(id) | - initializeFile |
You never invoke this method; it's invoked automatically by selfActivate (just before the file is performed). | |
(id) | - finishFile |
You never invoke this method; it's invoked automatically by deactivate. | |
(NSMutableData *) | - scorefilePrintStream |
Returns the receiver's scorefile print statement stream. | |
(MKNote *) | - nextNote |
Reads the next MKNote or time statement from the body of the scorefile. | |
(MKNote *) | - infoNoteForNoteSender: |
Returns the info MKNote of the MKPart associated with the MKNoteSender aNoteSender. | |
(id) | - performNote: |
Sends aNote to the appropriate MKNoteSender You never send performNote: directly to a MKScorefilePerformer; it's invoked by the perform method. | |
(MKNoteSender *) | - midiNoteSender: |
Returns the first MKNoteSender whose corresponding MKPart has a MK_midiChan info parameter equal to aChan, if any. | |
(id) | - copyWithZone: |
Creates and returns an initialised, inactive MKPerformer as a copy of the receiver. | |
(void) | - encodeWithCoder: |
You never invoke this method directly; to archive a MKFilePerformer, call the NSArchiver archiveRoot method. | |
(id) | - initWithCoder: |
You never invoke this method directly; to read an archived MKFilePerformer, call the NSUnarchiver methods. | |
Static Public Member Functions | |
(NSString *) | + fileExtension |
Returns the file name extension that's recognized by the class. | |
(NSArray *) | + fileExtensions |
Returns a NSArray of the default file extensions recognized by MKScorefilePerformer instances. | |
Protected Attributes | |
NSMutableData * | scorefilePrintStream |
MKNote * | info |
Instances of this class are used directly in an application; you don't have to design your own subclass. When the object is activated, it reads the file's header and creates a MKNoteSender for each (unique) member of the part statement. A MKNoteSender is given the same name as the MKPart for which it was created. Thus, you can find out the names of the MKParts in the file by getting an NSArray of the noteSenders (using -noteSenders) and using the function MKGetObjectName(noteSender).
During a performance, a MKScorefilePerformer reads successive MKNote and time statements from the file from which it creates MKNote objects that it sends through its MKNoteSenders. When it reaches the end of the file, the MKScorefilePerformer is deactivated.
A MKScorefilePerformer has its own info MKNote that it fashions from the info statement in the file, and defines an NSMutableData instance on which scorefile print statements are printed.
Much of MKScorefilePeformer's functionality is documented under MKFilePerformer, and MKPerformer.
- (id) init |
Initializes the receiver.
You invoke this method when creating a new intance. A subclass implementation should send [super init] before performing its own initialization.
Reimplemented from MKFilePerformer.
+ (NSString *) fileExtension |
Returns the file name extension that's recognized by the class.
The default implementation returns nil. A subclass may override this method to specify its own file extension.
Reimplemented from MKFilePerformer.
+ (NSArray *) fileExtensions |
Returns a NSArray of the default file extensions recognized by MKScorefilePerformer instances.
Reimplemented from MKFilePerformer.
- (MKNote *) infoNote |
- (id) initializeFile |
You never invoke this method; it's invoked automatically by selfActivate (just before the file is performed).
Reimplemented from MKFilePerformer.
- (id) finishFile |
You never invoke this method; it's invoked automatically by deactivate.
Reimplemented from MKFilePerformer.
- (NSMutableData *) scorefilePrintStream |
Returns the receiver's scorefile print statement stream.
- (MKNote *) nextNote |
Reads the next MKNote or time statement from the body of the scorefile.
Reimplemented from MKFilePerformer.
- (MKNote *) infoNoteForNoteSender: | (MKNoteSender *) | aNoteSender |
Returns the info MKNote of the MKPart associated with the MKNoteSender aNoteSender.
If aNoteSender isn't a contained in the receiver, returns nil.
aNoteSender | is an MKNoteSender instance. |
- (id) performNote: | (MKNote *) | aNote |
Sends aNote to the appropriate MKNoteSender You never send performNote: directly to a MKScorefilePerformer; it's invoked by the perform method.
aNote | is an MKNote instance. |
Reimplemented from MKFilePerformer.
- (MKNoteSender *) midiNoteSender: | (int) | aChan |
Returns the first MKNoteSender whose corresponding MKPart has a MK_midiChan info parameter equal to aChan, if any.
aChan equal to 0 corresponds to the MKPart representing MIDI system and channel mode messages.
aChan | is an int. |
- (id) copyWithZone: | (NSZone *) | zone |
Creates and returns an initialised, inactive MKPerformer as a copy of the receiver.
Reimplemented from MKFilePerformer.
- (void) encodeWithCoder: | (NSCoder *) | aCoder |
You never invoke this method directly; to archive a MKFilePerformer, call the NSArchiver archiveRoot method.
An archived MKFilePerformer maintains its filename, firstTimeTag, and lastTimeTag instance variables (as well as the instance variables defined in MKPerformer).
aCoder | is an NSCoder instance. |
Reimplemented from MKFilePerformer.
- (id) initWithCoder: | (NSCoder *) | aDecoder |
You never invoke this method directly; to read an archived MKFilePerformer, call the NSUnarchiver methods.
aDecoder | is an NSCoder instance. |
Reimplemented from MKFilePerformer.
- (NSMutableData*) scorefilePrintStream [protected] |
The stream used for the scorefile's print statements.