quicktime.app.audio
Class MusicPartControl

java.lang.Object
  |
  +--quicktime.app.audio.MusicPartControl
All Implemented Interfaces:
AudioSpec, ExtendedAudioSpec, MusicPart

public class MusicPartControl
extends java.lang.Object
implements MusicPart

This class provides an implementation of the ExtendedAudioSpec interface for dealing with specific charactertics of the parts of the MusicMedia.

Currently any actions on the part do not reset the MusicMedia with which they are derived from - any changes that are made to a part are only active for an unpredicatable period of time as they do not interact on the Media object itself.


Constructor Summary
MusicPartControl(MusicMediaHandler mh, int partNumber)
          Create a new MusicPartControl from the given MusicMediaHandler.
 
Method Summary
 float getBalance()
          This method gets the balance of the this object.
 java.lang.String getInstrumentName()
          Returns the name of the current instrument for this part.
 NoteChannel getNoteChannel()
          This method gets the NoteChannel being controlled by this object.
 float getVolume()
          This method will get the volume of this object.
 boolean isMuted()
          Returns the current mute status
 void selectInstrument(java.lang.String prompt)
          This method allows for the class to allow some selection process whereby the user would choose a particular instrument that will be consequently used by a MusicPart to produce the sounds that it plays.
 void setBalance(float val)
          This method sets the balance of this object.
 void setMuted(boolean flag)
          Allows the muting of the specific channel.
 void setVolume(float volume)
          This method will set the volume of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MusicPartControl

public MusicPartControl(MusicMediaHandler mh,
                        int partNumber)
                 throws QTException
Create a new MusicPartControl from the given MusicMediaHandler.
Parameters:
mh - the MusicMediaHandler to extract the part from
partNumber - the part number within the MusicMedia to control
Method Detail

isMuted

public boolean isMuted()
Returns the current mute status
Specified by:
isMuted in interface AudioSpec
Returns:
the current mute status

setMuted

public void setMuted(boolean flag)
              throws QTException
Allows the muting of the specific channel. When unmuted the AudioSpec object will return to its current volume setting.
Specified by:
setMuted in interface AudioSpec
Parameters:
flag - turn muting on - true or off - false.

setVolume

public void setVolume(float volume)
               throws QTException
This method will set the volume of this object.
Specified by:
setVolume in interface AudioSpec
Parameters:
volume - the desired volume (range: 0.0F - 1.0F)

getVolume

public float getVolume()
                throws QTException
This method will get the volume of this object. (range: 0.0 - 1.0)
Specified by:
getVolume in interface AudioSpec
Returns:
the current volume.

setBalance

public void setBalance(float val)
                throws QTException
This method sets the balance of this object.
Specified by:
setBalance in interface ExtendedAudioSpec
Parameters:
val - the desired balance (range: -1F -> 1F)

getBalance

public float getBalance()
                 throws QTException
This method gets the balance of the this object. (range: -1.0 -> 1.0)
Specified by:
getBalance in interface ExtendedAudioSpec
Returns:
the balance

getInstrumentName

public java.lang.String getInstrumentName()
                                   throws QTException
Returns the name of the current instrument for this part.
Specified by:
getInstrumentName in interface MusicPart
Returns:
name of the current instrument for this part

selectInstrument

public void selectInstrument(java.lang.String prompt)
                      throws QTException
This method allows for the class to allow some selection process whereby the user would choose a particular instrument that will be consequently used by a MusicPart to produce the sounds that it plays.
Specified by:
selectInstrument in interface MusicPart
Parameters:
prompt - - any information that the program wants to display to the user to aid in the selection process.

getNoteChannel

public final NoteChannel getNoteChannel()
                                 throws QTException
This method gets the NoteChannel being controlled by this object.
Specified by:
getNoteChannel in interface MusicPart
Returns:
the NoteChannel