MKConductor Class Reference

The MKConductor class defines the mechanism that controls the timing of a MusicKit performance. More...

#import <MKConductor.h>

List of all members.

Creating and Freeing a Conductor

(id) + allocWithZone:
 Allocates memory for a new MKConductor, from specified zone, if not in performance.
(id) + alloc
 Creates and returns a new MKConductor object with a tempo of 60.0 beats per minute, allocated from the default zone.
(id) - init
 Initializes a new MKConductor.
(id) - copyWithZone:
 Returns a new MKConductor created through [MKConductor new].

Controlling a Performance

(id) + startPerformance
 Starts a performance.
(id) + finishPerformance
 Ends the performance.
(id) + pausePerformance
 Pauses the performance.
(id) + resumePerformance
 Resumes a performance, allowing it to continue from where it was paused.
(id) - pause
 Pauses the performance of the receiver and sends hasPaused: to its delegate.
(id) - pauseFor:
 A convenience method.
(id) - resume
 Resumes the receiver's performance and returns the receiver.

Querying the Object

(MKConductor *) + defaultConductor
 Returns the defaultConductor.
(BOOL) + inPerformance
 Returns YES if a performance is currently taking place (even if it's paused), otherwise returns NO.
(BOOL) + isPaused
 Returns YES if the performance is paused, otherwise returns NO.
(id) + currentConductor
 Returns the MKConductor instance that's currently sending a message, or nil if no message is being sent.
(id) + clockConductor
 Returns the clockConductor.
(BOOL) + isClocked
 Returns YES if the performance is clocked, NO if it isn't.
(BOOL) + isEmpty
 Returns YES if a performance is in progress and all the MKConductor instances' message request queues are are empty, otherwise returns NO..
(BOOL) + finishWhenEmpty
 Returns YES if the performance will finish when all MKConductors' message queues are empty, otherwise returns NO.
(double) + timeInSeconds
 Same as [[MKConductor clockConductor] time].
(double) + deltaT
 Returns the delta time in seconds.
(id) + delegate
 Returns the receiver's delegate object, as set through the setDelegate: method.
(BOOL) - isPaused
 Returns YES if the receiver is paused.
(double) - beatSize
 Returns the size of the receiver's beat in seconds.
(double) - tempo
 Returns the receiver's tempo in beats per minute.
(double) - timeInBeats
 Returns the receiver's notion of the current time in beats.
(double) - timeOffset
 Returns the receiver's performance time offset in seconds.
(BOOL) - isCurrentConductor
 Returns YES if the receiver is currently sending a message from its message request queue.
(id) - delegate
 Returns the receiver's delegate object, as set through the setDelegate: method.
(id) - activePerformers
 Returns a List of currently active Performers that are assigned to this MKConductor.

Modifying the Object

(id) + setClocked:
 If yesOrNo is YES (the default), the MKConductors dispatches each message at the specified time, waiting if necessary.
(id) + setFinishWhenEmpty:
 If yesOrNo is YES (the default), the performance is terminated when all the MKConductors' message queues are empty.
(void) + setDeltaT:
 Set the delta time in seconds.
(void) + setDelegate:
 Sets the receiver's delegate object to delegate and returns the receiver.
(id) - emptyQueue
 Removes all message requests from the receiver's message request queue and returns the receiver.
(void) - setDelegate:
 Sets the receiver's delegate object to delegate and returns the receiver.

Manipulating Time

(id) + adjustTime
 This method is superceded by +lockPerformance and +unlockPerformance.
(double) - setBeatSize:
 Sets the tempo by changing the size of a beat to newBeatSize, measured in seconds.
(double) - setTempo:
 Sets the receiver's tempo to newTempo, measured in beats per minute.
(double) - setTimeOffset:
 Sets the receiver's performance time offset to newTimeOffset seconds.
(double) - predictTime:

Requesting Messages

(MKMsgStruct *) + afterPerformanceSel:to:argCount:
 Enqueues a request for aSelector to be sent to toObject immediately after the current (or next) performance ends.
(MKMsgStruct *) + afterPerformanceSel:to:argCount:arg1:retain:arg2:retain:
 Enqueues a request for aSelector to be sent to toObject immediately after the current (or next) performance ends.
(MKMsgStruct *) + beforePerformanceSel:to:argCount:
 Enqueues a request for aSelector to be sent to toObject at the beginning of the next performance.
(MKMsgStruct *) + beforePerformanceSel:to:argCount:arg1:retain:arg2:retain:
 Enqueues a request for aSelector to be sent to toObject at the beginning of the next performance.
(id) - sel:to:withDelay:argCount:
 Places, in the receiver's message request queue, a request for aSelector to be sent to toObject at time beats beats from the receiver's notion of the current time.
(id) - sel:to:withDelay:argCount:arg1:retain:arg2:retain:
 Places, in the receiver's message request queue, a request for aSelector to be sent to toObject at time beats beats from the receiver's notion of the current time.
(id) - sel:to:atTime:argCount:
 Places, in the receiver's message request queue, a request for aSelector to be sent to toObject at time time beats from the beginning of the receiver's performance.
(id) - sel:to:atTime:argCount:arg1:retain:arg2:retain:
 Places, in the receiver's message request queue, a request for aSelector to be sent to toObject at time time beats from the beginning of the receiver's performance.

Protected Attributes

double time
double nextMsgTime
double beatSize
double timeOffset
BOOL isPaused
id delegate
NSMutableArray * activePerformers
id MTCSynch


Detailed Description

The MKConductor class defines the mechanism that controls the timing of a MusicKit performance.

A MKConductor's most important tasks are to schedule the sending of MKNotes by MKPerformers (and MKMidi), and to control the timing of MKEnvelope objects during DSP synthesis. Even in the absence of MKPerformers and MKEnvelopes, you may want to use a MKConductor to take advantage of the convenient scheduling mechanism that it provides.

Each instance of MKConductor contains a message request queue, a list of messages that are to be sent to particular objects at specific times. To enqueue a message request with a MKConductor, you invoke the sel:to:atTime:argCount: or sel:to:withDelay:argCount: method. The former sends a message at a specific time measured in beats from the time the MKConductor started performing, while the latter sends the message a specified number of beats after the request is received. Once you have made a message request through these methods, you can't rescind the action; if you need more control over message requests - for example, if you need to be able to reschedule or remove a request - you should use the following C functions:

For more information on these functions, see Chapter 3, "C Functions."

The MKConductor class provides two special message request queues, one that contains messages that are sent at the beginning of a performance and another for messages that are sent after a performance ends. The class methods beforePerformanceSel:to:argCount: and afterPerformanceSel:to:argCount: enqueue message requests in the before- and after-performance queues, respectively.

A MusicKit performance starts when the MKConductor class receives the startPerformance message. At that time, the MKConductor class sends the messages in its before-performance queue and then the MKConductor instances start processing their individual message request queues. As a message is sent, the request that prompted the message is removed from its queue. The performance ends when the MKConductor class receives finishPerformance, at which time the after-performance messages are sent. Any message requests that remain in the individual MKConductors' message request queues are removed. Note, however, that the before-performance queue isn't similarly cleared. If you invoke beforePerformanceSel:to:argCount: during a performance, the message request will survive a subsequent finishPerformance and will affect the next performance.

By default, if all the MKConductors' queues become empty at the same time (not including the before- and after-performance queues), finishPerformance is invoked automatically. This is convenient if you're performing a MKPart or MKScore and you want the performance to end when all the MKNotes have been played. However, for many applications, such as those that create and perform MKNotes in response to a user's actions, universally empty queues isn't necessarily an indication that the performance is over. To allow a performance to continue even if all the queues are empty, send setFinishWhenEmpty:NO to the MKConductor class.

You can pause and resume an entire performance through methods sent to the MKConductor class:

These messages are ignored if a performance isn't in progress.

You can pause and resume individual MKConductor objects through the pause and resume methods. In addition, you can pause a MKConductor object for a predetermined number of seconds (not beats) through pauseFor:. To offset the begin time of a MKConductor object before a performance starts, invoke setTimeOffset:. Here again, the arguments is taken as seconds. You can also offset the begin time of a MKConductor object by an indeterminate amount of time by sending it the pause message before a performance begins and then sending it resume while the performance is in progress. After a performance has ended, all currently paused MKConductor objects are (virtually) resumed. Thus, a MKConductor object is guaranteed not to be paused when a performance starts (unless, of course, you have specifically sent it the pause message since finishPerformance was last sent).

A MKConductor object can be given a delegate that's sent the hasPaused: message when the MKConductor is paused and hasResumed: when the MKConductor resumes. As in the AppKit's delegate paradigm, a delegate messages is sent only if the delegate responds to it.

The rate at which a MKConductor object processes its message request queue can be set through either the Tempo Protocol or the Time Map Protocol. The Tempo Protocol consists of the following two methods (you may use either):

You can change a MKConductor's tempo anytime, even during a performance. If your application requires multiple simultaneous tempi, you need to create more than one MKConductor, one for each tempo. A MKConductor's tempo is initialized to 60.0 beats per minute.

An alternative way to modify tempo is to use a tempo track or "Time Map". This protocol relies on the MKConductor's delegate to implement two methods that specify the mapping between "beat time" and "clock time." If the delegate implements one of these methods, it must implement both. By implementing these methods, the delegate specifies that it is using the Time Map Protocol. The two methods are beatToClock:from: and clockToBeat:from:. These methods map from pre-tempo to post-tempo time. For details, see the section entitled Music Performance

The responsiveness of a performance to the user's actions depends on whether the MKConductor class is clocked and upon the value of the performance's delta time. By default, the MKConductor class is clocked which means that message request queues are processed in a timely fashion: If, for example, two requests are specified to be sent one beat apart, then the message sending mechanism sends the first message and then, one beat later, sends the second message. When the MKConductor class is clocked, a running NSApplication object is assumed to be present. If you don't need interactive control over a performance, you may find it beneficial to have the messages in the message request queues sent one after another as quickly as possible, while depending on another device, such as the DSP or MIDI drivers, to handle the timing of the actual realization (this is further explained in the descriptions of the MKOrchestra and MKMidi classes). To allow the queues to be processed in this way, you set the MKConductor class to be unclocked by sending it the setClocked:NO message. If you set the MKConductor class to be unclocked, be aware that the startPerformance method doesn't return until the performance is over. (In this situation, sending setFinishWhenEmpty:NO to the MKConductor class is ill-advised since startPerformance would never return.)

Setting a performance's delta time further refines the responsiveness of a performance. Delta time is set through the setDeltaT: class method; the argument defines an imposed time lag, in seconds, between the MKConductor's notion of time and that of the DSP and MIDI device drivers. It acts as a timing cushion that can help to maintain rhythmic integrity by granting your application a sort of computational head start: As you set the delta time to larger values, your application has more time to process MKNotes before they are realized. However, this computational advantage is obtained at the expense of degraded responsiveness. Choosing the proper delta time value depends on how responsive your application needs to be. For example, if you are driving DSP synthesis from MIDI input (in other words, you have a MKMidi object connected to a MKSynthInstrument - this is usually the most demanding scenario in terms of desired real-time response), a delta time of as much as 10 milliseconds (0.01 seconds) is generally acceptable. If you are adjusting MKNote parameters by moving a NSSlider with the mouse, a delta time of 100 milliseconds or more can be tolerated. Finding the right delta time for your application is largely a matter of experimentation.

Every MKConductor instance has a notion of the current time measured in its own tempo, as returned by sending it the time message. The returned value is the number of beats the receiver has spent in performance and doesn't include the receiver's time offset, any time it has spent while paused, nor does it include the performance's delta time. The MKConductor class also responds to the time message; it returns the current duration of the performance in seconds, excluding any time that the entire performance has been paused (and also excluding deltat time). The value returned by the time message, whether sent to the MKConductor class or to an instance, is actually the time at which the last message from any of the MKConductors' queues was sent. This latency is present because the MKConductor class updates its notion of time (from which all the MKConductor instances compute their time) only when a message from one of the request queues is sent. If your application sends a message (or calls a C function) in response to an asynchronous event, it must first update the MKConductors' notions of time by bracketing the code you invoke with [MKConductor lockPerformance] and [MKConductor unlockPerformance]. You should send these messages before performing tasks such as pausing or resuming a MKConductor - you should even send them immediately before sending finishPerformance. If, for yet another example, your application sends MKNotes directly to MKInstruments, you should send lockPerformance immediately before each MKNote is sent and unlockPerformance afterwards. (This API supercedes the older adjustTime, which will still work only if the MusicKit is not run in a separate thread. See +useSeparateThread:.)

MKConductors and MKPerformers have a special relationship: Every MKPerformer object is controlled by an instance of MKConductor, as set through MKPerformer's setConductor: method. While a MKPerformer can be controlled by only one MKConductor, a single MKConductor can control any number of MKPerformers. As a MKPerformer acquires successive MKNotes, it enqueues, with its associated MKConductor, requests for the MKNotes to be sent to its connected MKInstruments. This enqueuing is performed automatically through a mechanism defined by the MKPerformer class. As a convenience, the MusicKit automatically creates an instance of MKConductor called the defaultConductor; if you don't set a MKPerformer's MKConductor directly, it's controlled by the defaultConductor. You can retrieve the defaultConductor (in order to set its tempo or to enqueue message requests, for example) by sending the defaultConductor message to the MKConductor class.

The MusicKit also creates an instance of MKConductor called the clockConductor, which you can retrieve through the clockConductor class method. The clockConductor has an unchangeable tempo of 60.0 beats per minute and can't be paused. While the clockConductor can be used to control MKPerformers, its most important task is to control the timing of MKEnvelope objects during DSP synthesis. All MKEnvelopes are controlled by the clockConductor automatically. The clockConductor also controls the duration of any MKNoteDurs that you send directly to an MKInstrument. In other words, the duration of such a MKNote is always computed using the 60.0 beats-per-minute tempo of the clockConductor.

The clockConductor's queue is treated like any other queue: You can enqueue message requests with the clockConductor just as you would with any other MKConductor. This also means that the clockConductor's queue contributes to a determination of whether all the queues are empty.

MKConductors can synchronize to incoming MIDI time code. This functionality is described in Appendix B. entitled MIDI Time Code in the MusicKit.

See also:
MKPerformer, MKOrchestra, MKMidi

Member Function Documentation

+ (id) allocWithZone: (NSZone *)  zone  

Allocates memory for a new MKConductor, from specified zone, if not in performance.

Returns:
Returns an id.

+ (id) alloc  

Creates and returns a new MKConductor object with a tempo of 60.0 beats per minute, allocated from the default zone.

Returns:
Returns an id. You must send init to the new instance. If a performance is currently in progress, this does nothing and returns nil.

- (id) init  

Initializes a new MKConductor.

Returns:
Returns an id. You must send this message after using alloc or allocFromZone: to create a MKConductor.

- (id) copyWithZone: (NSZone *)  zone  

Returns a new MKConductor created through [MKConductor new].

Returns:
Returns an id.

+ (id) startPerformance  

Starts a performance.

Returns:
Returns an id.
All MKConductor objects begin at the same time. If the performance is clocked and you don't have a running NSRunLoop, this does nothing and returns nil. In all other cases, the receiver is returned; however, if the performance is unclocked, this method doesn't return until the performance is over.

+ (id) finishPerformance  

Ends the performance.

Returns:
Returns an id. All enqueued messages are removed (from MKConductor instances' message queues - not from the before- and after-performance queues) and the after-performance messages are sent. If finishWhenEmpty is YES, this message is automatically sent when all message queues are exhausted. Returns nil.

+ (id) pausePerformance  

Pauses the performance.

Returns:
Returns an id. The performance is suspended until the MKConductor class receives the resumePerformance message. You can't pause an unclocked performance; returns nil if the performance is unclocked. Otherwise returns the receiver. This message is ignore and the receiver is returned if a performance isn't in progress. You cannot pause a performance in which a MKConductor is synchronizing to MIDI time code. An attempt to do so will be ignored.

+ (id) resumePerformance  

Resumes a performance, allowing it to continue from where it was paused.

Returns:
Returns an id. If the performance is unclocked, return nil, otherwise returns the receiver.

- (id) pause  

Pauses the performance of the receiver and sends hasPaused: to its delegate.

Returns:
Returns an id. The effect is restricted to the present performance. Invoke resume to unpause a MKConductor. You can't pause the clockConductor; returns nil in this case (and the delegate message isn't sent). Otherwise returns the receiver. Note that you can pause a MKConductor object before a performance begins. You cannot pause a MKConductor that is synchronizing to MIDI time code. An attempt to do so is ignored.

- (id) pauseFor: (double)  seconds  

A convenience method.

Parameters:
seconds is a double.
Returns:
Returns an id. Pauses the performance of the receiver, sends hasPaused: to its delegate, and schedules a request for resume to be sent to the receiver in seconds seconds. If the receiver is currently paused through a previous invocation of this method, the current resume request supercedes the previous one. The effect is restricted to the present performance. You can't pause the clockConductor; returns nil in this case (and the delegate message isn't sent). Otherwise returns the receiver. Note that you can invoke this method before a performance begins; the resume message is enqueued to be sent seconds seconds after the performance starts.

- (id) resume  

Resumes the receiver's performance and returns the receiver.

Returns:
Returns an id. If the receiver isn't currently paused, this has no effect.

+ (MKConductor *) defaultConductor  

Returns the defaultConductor.

Returns:
Returns an MKConductor.

+ (BOOL) inPerformance  

Returns YES if a performance is currently taking place (even if it's paused), otherwise returns NO.

Returns:
Returns a BOOL.

+ (BOOL) isPaused  

Returns YES if the performance is paused, otherwise returns NO.

Returns:
Returns a BOOL.

+ (id) currentConductor  

Returns the MKConductor instance that's currently sending a message, or nil if no message is being sent.

Returns:
Returns an id.

+ (id) clockConductor  

Returns the clockConductor.

Returns:
Returns an id.

+ (BOOL) isClocked  

Returns YES if the performance is clocked, NO if it isn't.

Returns:
Returns a BOOL. By default, a performance is clocked.

+ (BOOL) isEmpty  

Returns YES if a performance is in progress and all the MKConductor instances' message request queues are are empty, otherwise returns NO..

Returns:
Returns a BOOL.

+ (BOOL) finishWhenEmpty  

Returns YES if the performance will finish when all MKConductors' message queues are empty, otherwise returns NO.

Returns:
Returns a BOOL.

- (BOOL) isPaused  

Returns YES if the receiver is paused.

Returns:
Returns a BOOL.

- (double) beatSize  

Returns the size of the receiver's beat in seconds.

Returns:
Returns a double.

- (double) tempo  

Returns the receiver's tempo in beats per minute.

Returns:
Returns a double.

+ (double) timeInSeconds  

Same as [[MKConductor clockConductor] time].

Returns the current performance time, in seconds. This doesn't include time that the performance has been paused, nor does it include the performance's delta time. If a performance isn't in progress, MK_NODVAL is returned . Use MKIsNoDVal() to check for this return value.

Returns:
Returns a double.

- (double) timeInBeats  

Returns the receiver's notion of the current time in beats.

Returns:
Returns a double.

- (double) timeOffset  

Returns the receiver's performance time offset in seconds.

Returns:
Returns a double.

- (BOOL) isCurrentConductor  

Returns YES if the receiver is currently sending a message from its message request queue.

Returns:
Returns a BOOL.

+ (double) deltaT  

Returns the delta time in seconds.

Returns:
Returns a double.

- (id) delegate  

Returns the receiver's delegate object, as set through the setDelegate: method.

Returns:
Returns an id.

+ (id) delegate  

Returns the receiver's delegate object, as set through the setDelegate: method.

Returns:
Returns an id.

- (id) activePerformers  

Returns a List of currently active Performers that are assigned to this MKConductor.

The NSMutableArray is not copied and should not be freed or altered.

Returns:
Returns an id.

+ (id) setClocked: (BOOL)  yesOrNo  

If yesOrNo is YES (the default), the MKConductors dispatches each message at the specified time, waiting if necessary.

Parameters:
yesOrNo is a BOOL.
Returns:
Returns an id. If NO, messages are sent as quickly as possible. In an unclocked performance, a subsequent startPerformance message doesn't return until the performance is over, thus effectively disabling the user interface. Does nothing and returns nil if a performance is in progress, otherwise returns the receiver. Unclocked performances involving MIDI time code conductors are not supported.

+ (id) setFinishWhenEmpty: (BOOL)  yesOrNo  

If yesOrNo is YES (the default), the performance is terminated when all the MKConductors' message queues are empty.

Parameters:
yesOrNo is a BOOL.
Returns:
Returns an id. If NO, the performance continues until the finishPerformance message is sent to the MKConductor class.

- (id) emptyQueue  

Removes all message requests from the receiver's message request queue and returns the receiver.

Doesn't send any of the messages.

Returns:
Returns an id.

+ (void) setDeltaT: (double)  newDeltaT  

Set the delta time in seconds.

Parameters:
newDeltaT is a double.
See also:
MKSetDeltaT()

- (void) setDelegate: (id)  delegate  

Sets the receiver's delegate object to delegate and returns the receiver.

The delegate is sent hasPaused: and hasResumed: as the receiver is paused and resumed, respectively.

Parameters:
delegate is an id.
Returns:
Returns an id.

+ (void) setDelegate: (id)  delegate  

Sets the receiver's delegate object to delegate and returns the receiver.

The delegate is sent hasPaused: and hasResumed: as the receiver is paused and resumed, respectively.

Parameters:
delegate is an id.
Returns:
Returns an id.

+ (id) adjustTime  

This method is superceded by +lockPerformance and +unlockPerformance.

Returns:
Returns an id. Updates every MKConductor's notion of time.
This method may be invoked just before you send a message or call a C function that affects the performance. Typical examples include methods that are in response to the user's actions, methods that send MKNotes directly to MKInstruments, and methods, such as pause and resume, that are sent to a MKConductor object or to the MKConductor class. You do not need to send this message if you are invoked in response to MKConductor or MKMidi messages. Returns the receiver.

- (double) setBeatSize: (double)  newBeatSize  

Sets the tempo by changing the size of a beat to newBeatSize, measured in seconds.

Parameters:
newBeatSize is a double.
Returns:
Returns a double. The default beat size is 1.0 (one second). Attempts to set the tempo of the clockConductor are ignored. Returns the previous beat size.

- (double) setTempo: (double)  newTempo  

Sets the receiver's tempo to newTempo, measured in beats per minute.

Parameters:
newTempo is a double.
Returns:
Returns a double. Attempts to set the tempo of the clockConductor are ignored. Returns the previous tempo.

- (double) setTimeOffset: (double)  newTimeOffset  

Sets the receiver's performance time offset to newTimeOffset seconds.

Keep in mind that since the offset is measured in seconds, it's not affected by the receiver's tempo. Attempts to set the offset of the clockConductor are ignored. Returns the previous time offset.

Parameters:
newTimeOffset is a double.
Returns:
Returns a double.

- (id) sel: (SEL)  aSelector
to: (id)  toObject
withDelay: (double)  beats
argCount: (int)  argCount
,   ... 

Places, in the receiver's message request queue, a request for aSelector to be sent to toObject at time beats beats from the receiver's notion of the current time.

To ensure that the receiver's notion of time is up to date, you should send lockPerformance before invoking this method and unlockPerformanceafterwards. argCount specifies the number of four-byte arguments to aSelector followed by the arguments themselves, seperated by commas (two arguments, maximum).

Parameters:
aSelector is a SEL.
toObject is an id.
beats is a double.
argCount,... is an int counting variable arguments.
Returns:
Returns an id.

- (id) sel: (SEL)  aSelector
to: (id)  toObject
withDelay: (double)  beats
argCount: (int)  argCount
arg1: (id)  arg1
retain: (BOOL)  retainArg1
arg2: (id)  arg2
retain: (BOOL)  retainArg2 

Places, in the receiver's message request queue, a request for aSelector to be sent to toObject at time beats beats from the receiver's notion of the current time.

To ensure that the receiver's notion of time is up to date, you should send lockPerformance before invoking this method and unlockPerformanceafterwards. argCount specifies the number of four-byte arguments to aSelector. If arg1 or arg2 are objects, set the retain: argument following them to TRUE to prevent the object from any chance of deallocation between this method being called, and the message being dispatched.

Parameters:
aSelector is a SEL.
toObject is an id.
beats is a double.
argCount is an int
arg1 is an id or any 4-byte data type
retainArg1 is a BOOL
arg2 is an id or any 4-byte data type
retainArg2 is a BOOL
Returns:
Returns an id.

- (id) sel: (SEL)  aSelector
to: (id)  toObject
atTime: (double)  time
argCount: (int)  argCount
,   ... 

Places, in the receiver's message request queue, a request for aSelector to be sent to toObject at time time beats from the beginning of the receiver's performance.

argCount specifies the number of four-byte arguments to aSelector followed by the arguments themselves, seperated by commas (two arguments, maximum).

Parameters:
aSelector is a SEL.
toObject is an id.
time is a double.
argCount,... is an int counting variable arguments.
Returns:
Returns an id.

- (id) sel: (SEL)  aSelector
to: (id)  toObject
atTime: (double)  time
argCount: (int)  argCount
arg1: (id)  arg1
retain: (BOOL)  retainArg1
arg2: (id)  arg2
retain: (BOOL)  retainArg2 

Places, in the receiver's message request queue, a request for aSelector to be sent to toObject at time time beats from the beginning of the receiver's performance.

argCount specifies the number of four-byte arguments to aSelector. If arg1 or arg2 are objects, set the retain: argument following them to TRUE to prevent the object from any chance of deallocation between this method being called, and the message being dispatched.

Parameters:
aSelector is a SEL.
toObject is an id.
time is a double.
argCount,... is an int
arg1 is an object or any 4-byte type
retainArg1 is a BOOL
arg2 is an object or any 4-byte type
retainArg2 is a BOOL
Returns:
Returns an id.

+ (MKMsgStruct *) afterPerformanceSel: (SEL)  aSelector
to: (id)  toObject
argCount: (int)  argCount
,   ... 

Enqueues a request for aSelector to be sent to toObject immediately after the current (or next) performance ends.

Parameters:
aSelector is a SEL.
toObject is an id.
argCount,... is an int.
Returns:
Returns a MKMsgStruct *. argCount specifies the number of four-byte arguments to aSelector followed by the arguments themselves, separated by commas (two arguments, maximum). You can enqueue as many of these requests as you want; they're sent in the order that they were enqueued. Returns a pointer to a message request structure that can be passed to a C function such as MKCancelMsgRequest().

+ (MKMsgStruct *) afterPerformanceSel: (SEL)  aSelector
to: (id)  toObject
argCount: (int)  argCount
arg1: (id)  arg1
retain: (BOOL)  retainArg1
arg2: (id)  arg2
retain: (BOOL)  retainArg2 

Enqueues a request for aSelector to be sent to toObject immediately after the current (or next) performance ends.

argCount specifies the number of four-byte arguments to aSelector. arg1 and arg2 can be objects or other 4-byte object types (eg int). If either is an object, specify retain:TRUE for that object, and it will receive retain and release messages, meaning that they should not become accidentally deallocated before the message containing them as arguments is dispatched. You can enqueue as many of these requests as you want; they're sent in the order that they were enqueued. Returns a pointer to a message request structure that can be passed to a C function such as MKCancelMsgRequest().

Parameters:
aSelector is a SEL.
toObject is an id.
argCount is an int.
arg1 is an id or any 4-byte type.
retainArg1 is a BOOL.
arg2 is an id or any 4-byte type.
retainArg2 is a BOOL.
Returns:
Returns a MKMsgStruct *.

+ (MKMsgStruct *) beforePerformanceSel: (SEL)  aSelector
to: (id)  toObject
argCount: (int)  argCount
,   ... 

Enqueues a request for aSelector to be sent to toObject at the beginning of the next performance.

Parameters:
aSelector is a SEL.
toObject is an id.
argCount,... is an int.
Returns:
Returns a MKMsgStruct *. argCount specifies the number of four-byte arguments to aSelector followed by the arguments themselves, separated by commas (two arguments, maximum). You can enqueue as many of these requests as you want; they're sent in the order that they were enqueued. Returns a pointer to a message request structure that can be passed to a C function such as MKCancelMsgRequest().

+ (MKMsgStruct *) beforePerformanceSel: (SEL)  aSelector
to: (id)  toObject
argCount: (int)  argCount
arg1: (id)  arg1
retain: (BOOL)  retainArg1
arg2: (id)  arg2
retain: (BOOL)  retainArg2 

Enqueues a request for aSelector to be sent to toObject at the beginning of the next performance.

argCount specifies the number of four-byte arguments to aSelector. arg1 and arg2 can be objects or other 4-byte object types (eg int). If either is an object, specify retain:TRUE for that object, and it will receive retain and release messages, meaning that they should not become accidentally deallocated before the message containing them as arguments is dispatched. You can enqueue as many of these requests as you want; they're sent in the order that they were enqueued. Returns a pointer to a message request structure that can be passed to a C function such as MKCancelMsgRequest().

Parameters:
aSelector is a SEL.
toObject is an id.
argCount is an int.
arg1 is an id or any 4-byte type.
retainArg1 is a BOOL.
arg2 is an id or any 4-byte type.
retainArg2 is a BOOL.
Returns:
Returns a MKMsgStruct *.


Member Data Documentation

- (double) time [protected]

Current Time in beats, updated (for all instances) after timed entry fires off.

- (double) nextMsgTime [protected]

Time, in seconds, when next message is scheduled to be sent by this MKConductor.

- (double) beatSize [protected]

The duration of a single beat in seconds.

- (double) timeOffset [protected]

Performance timeOffset in seconds.

- (BOOL) isPaused [protected]

Set to YES if this instance is paused.

Note that pausing all MKConductors through the pause factory method doesn't set this to YES.

- (id) delegate [protected]

The object's delegate.

- (NSMutableArray*) activePerformers [protected]

An NSMutableArray object of active performers using this conductor. Don't alter this NSMutableArray.

- (id) MTCSynch [protected]

MIDI Time Code synchronization object, if any.


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