#import <MKNoteReceiver.h>
Public Member Functions | |
(id) | - owner |
Returns the MKInstrument (or MKMidi object) that owns the MKNoteReceiver. | |
(id) | - init |
Initializes a MKNoteReceiver that was created through allocFromZone:. | |
(void) | - dealloc |
Disconnects and frees the receiver. | |
(id) | - disconnect: |
Severs the connection between the MKNoteReceiver and aNoteSender; if the MKNoteSender isn't connected, this does nothing. | |
(id) | - disconnect |
Severs the connections between the MKNoteReceiver and all the MKNoteSenders it's connected to. | |
(BOOL) | - isConnected: |
Returns YES if aNoteSender is connected to the MKNoteReceiver, otherwise returns NO. | |
(id) | - connect: |
Connects aNoteSender to the MKNoteReceiver; if the argument isn't a MKNoteSender, the connection isn't made. | |
(id) | - squelch |
Disables the MKNoteReceiver's ability to send realizeNote:fromMKNoteReceiver: messages to its owner. | |
(id) | - unsquelch |
Enables the MKNoteReceiver's ability to send realizeNote:fromMKNoteReceiver: messages to its owner, undoing the effect of a previous squelch message. | |
(BOOL) | - isSquelched |
Returns YES if the MKNoteReceiver is squelched, otherwise returns NO. | |
(id) | - copyWithZone: |
Creates and returns a new MKNoteReceiver with the same connections as the receiver. | |
(unsigned) | - connectionCount |
Returns the number of MKNoteSenders that are connected to the MKNoteReceiver. | |
(NSArray *) | - connections |
Creates and returns a NSArray of the MKNoteSenders that are connected to the MKNoteReceiver. | |
(id) | - receiveNote: |
Sends the message realizeNote:aNote fromMKNoteReceiver:self to the MKNoteReceiver's owner thereby causing aNote to be realized by the receiver's owner. | |
(id) | - receiveNote:atTime: |
Enqueues, with the MKConductor object described below, a request for receiveNote:aNote to be sent to self at time beatsSinceStart, measured in beats from the beginning of the MKConductor's performance. | |
(id) | - receiveNote:withDelay: |
Enqueues, with the appropriate MKConductor, a request for receiveNote:aNote to be sent to self after delayTime, measured in beats from the time this message is received. | |
Protected Attributes | |
NSMutableArray * | noteSenders |
BOOL | isSquelched |
MKInstrument * | owner |
MKNoteReceiver is an auxilliary class that completes the implementation of MKInstrument. Instances of MKNoteReceiver are owned by MKInstrument objects to provide the following:
Unlike MKNoteSenders, which are generally expected to be created by the MKPerformers that own them, MKNoteReceivers can be created either by their owners or by your application. For example, each MKSynthInstrument object creates and adds to itself a single MKNoteReceiver. MKScorefileWriter objects, on the other hand, don't create any MKNoteReceivers; it's left to your application to create and add them. A MKNoteReceiver is created through the new class method and added to an MKInstrument through the latter's addNoteReceiver:.
A MKNoteReceiver can be owned by only one MKInstrument at a time; however, it can be connected to any number of MKNoteSenders. In addition, two different MKNoteReceivers can be connected to the same MKNoteSender. Thus the connections between MKPerformers and MKInstruments can describe an arbitrarily complicated network. To retrieve the MKNoteReceivers that are owned by a particular MKInstrument you invoke the MKInstrument's noteReceiver or noteReceivers method.
MKNoteReceivers are also created, owned, and used by MKMidi objects as part of their assumption of the role of MKInstrument.
- (id) owner |
Returns the MKInstrument (or MKMidi object) that owns the MKNoteReceiver.
- (id) init |
Initializes a MKNoteReceiver that was created through allocFromZone:.
Subclass should send [super init] when overriding this method.
- (id) disconnect: | (MKNoteSender *) | aNoteSender |
Severs the connection between the MKNoteReceiver and aNoteSender; if the MKNoteSender isn't connected, this does nothing.
aNoteSender | is an MKNoteSender instance. |
- (id) disconnect |
Severs the connections between the MKNoteReceiver and all the MKNoteSenders it's connected to.
- (BOOL) isConnected: | (MKNoteSender *) | aNoteSender |
Returns YES if aNoteSender is connected to the MKNoteReceiver, otherwise returns NO.
aNoteSender | is an MKNoteSender instance. |
- (id) connect: | (MKNoteSender *) | aNoteSender |
Connects aNoteSender to the MKNoteReceiver; if the argument isn't a MKNoteSender, the connection isn't made.
aNoteSender | is an MKNoteSender instance. |
- (id) squelch |
Disables the MKNoteReceiver's ability to send realizeNote:fromMKNoteReceiver: messages to its owner.
- (id) unsquelch |
Enables the MKNoteReceiver's ability to send realizeNote:fromMKNoteReceiver: messages to its owner, undoing the effect of a previous squelch message.
- (BOOL) isSquelched |
Returns YES if the MKNoteReceiver is squelched, otherwise returns NO.
A squelched MKNoteReceiver won't invoke its owner's realizeNote:fromNoteReceiver: method.
- (id) copyWithZone: | (NSZone *) | zone |
Creates and returns a new MKNoteReceiver with the same connections as the receiver.
This is the same as copy, but the new object is allocated from zone.
zone | is a NSZone instance. |
- (unsigned) connectionCount |
Returns the number of MKNoteSenders that are connected to the MKNoteReceiver.
- (NSArray *) connections |
Creates and returns a NSArray of the MKNoteSenders that are connected to the MKNoteReceiver.
- (id) receiveNote: | (MKNote *) | aNote |
Sends the message realizeNote:aNote fromMKNoteReceiver:self to the MKNoteReceiver's owner thereby causing aNote to be realized by the receiver's owner.
aNote | is an MKNote instance. |
- (id) receiveNote: | (MKNote *) | aNote | ||
atTime: | (double) | time | ||
Enqueues, with the MKConductor object described below, a request for receiveNote:aNote to be sent to self at time beatsSinceStart, measured in beats from the beginning of the MKConductor's performance.
aNote | is an MKNote instance. | |
time | is a double. |
- (id) receiveNote: | (MKNote *) | aNote | ||
withDelay: | (double) | delayTime | ||
Enqueues, with the appropriate MKConductor, a request for receiveNote:aNote to be sent to self after delayTime, measured in beats from the time this message is received.
aNote | is an MKNote instance. | |
delayTime | is a double. |
- (NSMutableArray*) noteSenders [protected] |
Array of connected MKNoteSenders.
- (BOOL) isSquelched [protected] |
YES if the object is currently squelched.
- (MKInstrument*) owner [protected] |
MKInstrument that owns MKNoteReceiver.