MKScoreRecorder Class Reference

A MKScoreRecorder is a pseudo-MKInstrument that adds MKNotes to the MKParts in a given MKScore. More...

#import <MKScoreRecorder.h>

List of all members.

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
MKScorescore
MKTimeUnit timeUnit
Class partRecorderClass


Detailed Description

A MKScoreRecorder is a pseudo-MKInstrument that adds MKNotes to the MKParts in a given MKScore.

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.

See also:
MKPartRecorder

Member Function Documentation

- (id) init  

Inits the receiver; you never invoke this method directly.

A subclass implementation should send [super init] before performing its own initialization.

Returns:
Returns self

- (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.

Parameters:
aScore is an MKScore instance.
Returns:
Returns an id.

- (MKScore *) score  

Returns the receiver's MKScore.

Returns:
Returns an MKScore.

- (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.

Returns:
Returns the receiver.

Returns the receiver's time unit, either MK_second, MK_timeTag or MK_beat.

Returns:
Returns a MKTimeUnit.

- (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.

Parameters:
aTimeUnit is a MKTimeUnit.
Returns:
Returns an id.

- (NSArray *) partRecorders  

Returns a NSArray object that contains the receiver's MKPartRecorders.

Returns:
Returns an NSArray instance.

- (BOOL) inPerformance  

Returns YES if the receiver is in performance, otherwise returns NO.

Returns:
Returns a BOOL.

- (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.

Parameters:
aNote is an MKNote instance.
Returns:
Returns an id.

- (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.

Returns:
Returns an id.

- (NSArray *) noteReceivers  

Returns a NSArray object that contains the receiver's MKNoteReceivers.

Returns:
Returns an NSArray.

- (MKPartRecorder *) partRecorderForPart: (MKPart *)  aPart  

Returns the receiver's MKPartRecorder for aPart, or nil if not found.

Parameters:
aPart is an MKPart instance.
Returns:
Returns an MKPartRecorder instance.

- (id) setPartRecorderClass: (Class)  aPartRecorderSubclass  

Normally, MKScoreRecorders create instances of the MKPartRecorder class.

Parameters:
aPartRecorderSubclass is an id.
Returns:
Returns an id. This method allows you to specify that instances of some MKPartRecorder subclass be created instead. If aPartRecorderSubclass is not a subclass of MKPartRecorder (or MKPartRecorder itself), this method has no effect and returns nil. Otherwise, it returns self.

- (Class) partRecorderClass  

Returns the class used for MKPartRecorders, as set by setPartRecorderClass:.

The default is MKPartRecorder itself.

Returns:
Returns a Class.


Member Data Documentation

- (NSMutableArray*) partRecorders [protected]

The object's collection of MKPartRecorders.

- (MKScore*) score [protected]

The object's MKScore.

- (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.


The documentation for this class was generated from the following file:

Generated on Sat Dec 5 17:01:15 2009 for MusicKit by  doxygen 1.5.6