#import <MKScoreRecorder.h>
Public Member Functions | |
(id) | - init |
Inits the receiver; you never invoke this method directly. | |
(id) | - setScore: |
Removes and frees the receiver's current MKPartRecorders, sets its MKScore to aScore, and then creates and adds a MKPartRecorder for each MKPart in the MKScore. | |
(MKScore *) | - score |
Returns the receiver's MKScore. | |
(id) | - copyWithZone: |
Creates and returns a MKScoreRecorder as a copy of the receiver. | |
(id) | - removePartRecorders |
Removes the receiver's MKPartRecorders and sets its MKScore to nil. | |
(MKTimeUnit) | - timeUnit |
Returns the receiver's time unit, either MK_second, MK_timeTag or MK_beat. | |
(id) | - setTimeUnit: |
Sets the receiver's time unit to aTimeUnit, one of MK_beat, MK_timeTag and MK_second, and forwards the setTimeUnit:aTimeUnit message to the receiver's MKPartRecorders. | |
(NSArray *) | - partRecorders |
Returns a NSArray object that contains the receiver's MKPartRecorders. | |
(BOOL) | - inPerformance |
Returns YES if the receiver is in performance, otherwise returns NO. | |
(id) | - firstNote: |
You never invoke this method; it's invoked automatically when the first MKNote is received by any of the receiver's MKPartRecorders. | |
(id) | - afterPerformance |
You never invoke this method; it's invoked automatically at the end of the performance. | |
(NSArray *) | - noteReceivers |
Returns a NSArray object that contains the receiver's MKNoteReceivers. | |
(MKPartRecorder *) | - partRecorderForPart: |
Returns the receiver's MKPartRecorder for aPart, or nil if not found. | |
(id) | - setPartRecorderClass: |
Normally, MKScoreRecorders create instances of the MKPartRecorder class. | |
(Class) | - partRecorderClass |
Returns the class used for MKPartRecorders, as set by setPartRecorderClass:. | |
Protected Attributes | |
NSMutableArray * | partRecorders |
MKScore * | score |
MKTimeUnit | timeUnit |
Class | partRecorderClass |
It does this by creating a MKPartRecorder, a true MKInstrument, for each of the MKScore's MKPart objects. A MKScoreRecorder's MKScore is set through the setScore: method. If you add MKParts to or remove MKParts from the MKScore after sending the setScore: message, the changes will not be seen by the MKScoreRecorder.
A MKScoreRecorder can access a MKPartRecorder by the name of the MKPart with which it's associated. It can also set the time unit of all its MKPartRecorders through a single message, setTimeUnit:.
A MKScoreRecorder is said to be in performance from the time any of its MKPartRecorders receives a MKNote until the performance is finished.
- (id) init |
Inits the receiver; you never invoke this method directly.
A subclass implementation should send [super init]
before performing its own initialization.
- (id) setScore: | (MKScore *) | aScore |
Removes and frees the receiver's current MKPartRecorders, sets its MKScore to aScore, and then creates and adds a MKPartRecorder for each MKPart in the MKScore.
Subsequent changes to aScore (adding or removing MKParts) aren't seen by the receiver. If the receiver is in performance, this does nothing and returns nil, otherwise it returns the receiver.
If you want to set the MKScore without freeing the current MKPartRecorders you should send removePartRecorders before invoking this method; the MKPartRecorders are then removed but not freed.
aScore | is an MKScore instance. |
- (id) copyWithZone: | (NSZone *) | zone |
Creates and returns a MKScoreRecorder as a copy of the receiver.
The new object has the same MKScore as the receiver, but contains its own set of MKPartRecorders.
- (id) removePartRecorders |
Removes the receiver's MKPartRecorders and sets its MKScore to nil.
The MKPartRecorder objects aren't freed.
- (MKTimeUnit) timeUnit |
Returns the receiver's time unit, either MK_second, MK_timeTag or MK_beat.
- (id) setTimeUnit: | (MKTimeUnit) | aTimeUnit |
Sets the receiver's time unit to aTimeUnit, one of MK_beat, MK_timeTag and MK_second, and forwards the setTimeUnit:aTimeUnit message to the receiver's MKPartRecorders.
If the receiver is in performance, this does nothing and returns nil. Otherwise returns the receiver.
aTimeUnit | is a MKTimeUnit. |
- (NSArray *) partRecorders |
Returns a NSArray object that contains the receiver's MKPartRecorders.
- (BOOL) inPerformance |
Returns YES if the receiver is in performance, otherwise returns NO.
- (id) firstNote: | (MKNote *) | aNote |
You never invoke this method; it's invoked automatically when the first MKNote is received by any of the receiver's MKPartRecorders.
The default does nothing; a subclass can implement this method for performance initialization. The returns value is ignored.
aNote | is an MKNote instance. |
- (id) afterPerformance |
You never invoke this method; it's invoked automatically at the end of the performance.
The default does nothing; a subclass can implement this method for post-performance cleanup. A subclass version should always invoke [super afterPerformance]. The return value is ignored.
- (NSArray *) noteReceivers |
Returns a NSArray object that contains the receiver's MKNoteReceivers.
- (MKPartRecorder *) partRecorderForPart: | (MKPart *) | aPart |
Returns the receiver's MKPartRecorder for aPart, or nil if not found.
aPart | is an MKPart instance. |
- (id) setPartRecorderClass: | (Class) | aPartRecorderSubclass |
Normally, MKScoreRecorders create instances of the MKPartRecorder class.
aPartRecorderSubclass | is an id. |
- (Class) partRecorderClass |
Returns the class used for MKPartRecorders, as set by setPartRecorderClass:.
The default is MKPartRecorder itself.
- (NSMutableArray*) partRecorders [protected] |
The object's collection of MKPartRecorders.
- (MKTimeUnit) timeUnit [protected] |
The unit the object's MKPartRecorders use to measure time; one of MK_second or MK_beat.
- (Class) partRecorderClass [protected] |
The MKPartRecorder subclass used.