quicktime.std.music
Class NoteAllocator

java.lang.Object
  |
  +--quicktime.QTObject
        |
        +--quicktime.std.comp.ComponentIdentifier
              |
              +--quicktime.std.comp.Component
                    |
                    +--quicktime.std.music.NoteAllocator
All Implemented Interfaces:
quicktime.jdirect.InterfaceLib, quicktime.jdirect.PrimitivesLib, quicktime.jdirect.QuickTimeLib, quicktime.jdirect.SharedLibrary, com.apple.jdirect.SharedLibrary

public final class NoteAllocator
extends Component
implements quicktime.jdirect.QuickTimeLib

Corresponds to the NoteAllocator component type.


Fields inherited from interface quicktime.jdirect.QuickTimeLib
JDirect_MacOSX, libraryInstance, name
 
Constructor Summary
NoteAllocator()
          Opens the NoteAllocator component.
NoteAllocator(int subType)
          Opens the NoteAllocator component with a specified subType.
 
Method Summary
 void copyrightDialog(Pict p, java.lang.String author, java.lang.String copyright, java.lang.String other, java.lang.String title)
          Displays a copyright dialog with information specific to a music device.
static NoteAllocator getDefault()
          Returns a system created NoteAllocator instance that can be used by applications.
 SynthesizerConnections getDefaultMIDIInput()
          Obtain external MIDI connection information about the MIDI device that is attached to the system and selected as the default MIDI input device.
 NoteChannel getIndNoteChannel(int index)
          Returns a new NoteChannel as indexed into the NoteAllocator instance.
 QTMIDIPortList getMIDIInPorts()
          Get the MIDI input ports that are available to the NoteAllocator.
 QTMIDIPortList getMIDIOutPorts()
          Get the MIDI output ports that are available to the NoteAllocator.
 MusicComponentInfo getRegisteredMusicDevice(int index)
          Return information about music components that are registered with the note allocator.
 void loseDefaultMIDIInput()
          Removes the external default MIDI service procedure call, if previously defined by the useDefaultMIDIInput call.
 int numMusicComponents()
          Return the number of MusicComponents that are registered with the note allocator.
 int numNoteChannels()
          Returns the number of NoteChannels handled by the specific NoteAllocator instance.
 void pickArrangement(java.lang.String prompt, Track track, java.lang.String songName)
          Displays a dialog to allow instrument selection.
 java.lang.String registerMusicDevice_SoundBank(QTFile soundBankFile)
          Registers a music component with the NoteAllocator, where the MusicComponent will use the supplied SoundBank for its sample data.
 void registerMusicDevice(int synthType, java.lang.String name, SynthesizerConnections connections)
          Registers a music component with the NoteAllocator.
 void saveMusicConfiguration()
          Saves the current list of registered devices to the QuickTime default file.
 void setDefaultMIDIInput(SynthesizerConnections sc)
          Initializes an external MIDI device that is used to receive external MIDI information.
 void task()
          Call periodically to allow the note allocator to perform tasks.
 void unregisterMusicDevice(int index)
          Removes a previously registered music component from the NoteAllocator.
 
Methods inherited from class quicktime.std.comp.Component
count
 
Methods inherited from class quicktime.std.comp.ComponentIdentifier
find, find, getInfo, toString
 
Methods inherited from class quicktime.QTObject
disposeQTObject, equals, ID
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NoteAllocator

public NoteAllocator()
              throws QTException
Opens the NoteAllocator component.

QuickTime::OpenADefaultComponent


NoteAllocator

public NoteAllocator(int subType)
              throws QTException
Opens the NoteAllocator component with a specified subType.

QuickTime::OpenADefaultComponent

Method Detail

getDefault

public static NoteAllocator getDefault()
                                throws QTException
Returns a system created NoteAllocator instance that can be used by applications.
Returns:
a NoteAllocator

numNoteChannels

public int numNoteChannels()
                    throws StdQTException
Returns the number of NoteChannels handled by the specific NoteAllocator instance.

QuickTime::NAGetIndNoteChannel

Returns:
number of NoteChannels

getIndNoteChannel

public NoteChannel getIndNoteChannel(int index)
                              throws StdQTException
Returns a new NoteChannel as indexed into the NoteAllocator instance.

QuickTime::NAGetIndNoteChannel

Parameters:
index - the index of the NoteChannel
Returns:
a new NoteChannel instance

task

public void task()
          throws StdQTException
Call periodically to allow the note allocator to perform tasks.

QuickTime::NATask


pickArrangement

public void pickArrangement(java.lang.String prompt,
                            Track track,
                            java.lang.String songName)
                     throws StdQTException
Displays a dialog to allow instrument selection.

QuickTime::NAPickArrangement

Parameters:
prompt - dialog box prompt.
track - a movie track
songName - the name of the song to display

copyrightDialog

public void copyrightDialog(Pict p,
                            java.lang.String author,
                            java.lang.String copyright,
                            java.lang.String other,
                            java.lang.String title)
                     throws StdQTException
Displays a copyright dialog with information specific to a music device.

QuickTime::NACopyrightDialog

Parameters:
p - picture for dialog
author - author information
copyright - copyright information
other - and additional information
title - title information

numMusicComponents

public int numMusicComponents()
                       throws StdQTException
Return the number of MusicComponents that are registered with the note allocator.

QuickTime::NAGetRegisteredMusicDevice

Returns:
the number of music components.

registerMusicDevice_SoundBank

public java.lang.String registerMusicDevice_SoundBank(QTFile soundBankFile)
                                               throws QTException
Registers a music component with the NoteAllocator, where the MusicComponent will use the supplied SoundBank for its sample data. The call returns the Name of the sample bank, which is used in the ToneDescription/NoteRequest as the synthesizerName field to create NoteChannels that use this component (the synthesizerType will be StdQTConstants.kSoftSynthComponentSubType).

QuickTime::NARegisterMusicDevice

Parameters:
soundBankFile - a DLS or SF2 file of sample data
Returns:
the name of the synthesizer to use when creating NoteChannels that use this bank

registerMusicDevice

public void registerMusicDevice(int synthType,
                                java.lang.String name,
                                SynthesizerConnections connections)
                         throws StdQTException
Registers a music component with the NoteAllocator.

QuickTime::NARegisterMusicDevice

Parameters:
synthType - the subType of the MusicComponent of the synth
name - the synthesizer name
connections - a synthesizer connections for a MIDI device.

unregisterMusicDevice

public void unregisterMusicDevice(int index)
                           throws StdQTException
Removes a previously registered music component from the NoteAllocator.

QuickTime::NAUnregisterMusicDevice

Parameters:
index - the index of the synthesizer to unregister.

getRegisteredMusicDevice

public MusicComponentInfo getRegisteredMusicDevice(int index)
                                            throws StdQTException
Return information about music components that are registered with the note allocator.

QuickTime::NAGetRegisteredMusicDevice

Parameters:
index - the index of the component you are interested in.
Returns:
music component information

getDefaultMIDIInput

public SynthesizerConnections getDefaultMIDIInput()
                                           throws StdQTException
Obtain external MIDI connection information about the MIDI device that is attached to the system and selected as the default MIDI input device.

QuickTime::NAGetDefaultMIDIInput()


setDefaultMIDIInput

public void setDefaultMIDIInput(SynthesizerConnections sc)
                         throws StdQTException
Initializes an external MIDI device that is used to receive external MIDI information.

QuickTime::NASetDefaultMIDIInput()

Parameters:
sc - connections for the external MIDI input device

saveMusicConfiguration

public void saveMusicConfiguration()
                            throws StdQTException
Saves the current list of registered devices to the QuickTime default file.

QuickTime::NASaveMusicConfiguration()


getMIDIInPorts

public QTMIDIPortList getMIDIInPorts()
                              throws QTException
Get the MIDI input ports that are available to the NoteAllocator.

QuickTime::NAGetMIDIPorts()

Returns:
the MIDI input ports list.

getMIDIOutPorts

public QTMIDIPortList getMIDIOutPorts()
                               throws QTException
Get the MIDI output ports that are available to the NoteAllocator.

QuickTime::NAGetMIDIPorts()

Returns:
the MIDI output ports list.

loseDefaultMIDIInput

public void loseDefaultMIDIInput()
                          throws StdQTException
Removes the external default MIDI service procedure call, if previously defined by the useDefaultMIDIInput call.

QuickTime::NALoseDefaultMIDIInput()