com.frinika.project
Class MidiDeviceDescriptor

java.lang.Object
  extended by com.frinika.project.MidiDeviceDescriptor
All Implemented Interfaces:
MidiDeviceIconProvider, java.io.Serializable
Direct Known Subclasses:
DrumMapperDescriptor, FrinikaSynthRackDescriptor, SynthesizerDescriptor

public class MidiDeviceDescriptor
extends java.lang.Object
implements java.io.Serializable, MidiDeviceIconProvider

A serializable representation of a Midi Device used in a Frinika project. Contains resources neccesary for re-opening the correct midi device.

Author:
Peter Johan Salomonsen
See Also:
Serialized Form

Field Summary
protected  java.io.Serializable serializableMidiDevice
           
 
Constructor Summary
MidiDeviceDescriptor(javax.sound.midi.MidiDevice midiDevice)
          Construct a new MidiDeviceDescriptor from a MidiDevice
 
Method Summary
 javax.swing.Icon getIcon()
           
 javax.swing.Icon getLargeIcon()
           
 javax.sound.midi.MidiDevice getMidiDevice()
           
 java.lang.String getMidiDeviceName()
          Name of the midi device as registered in MidiSystem
 java.lang.String getProjectName()
          Get the name of the midi device as the user has set for it in the Frinika project
 java.io.Serializable getSerializableMidiDevice()
           
 void install(ProjectContainer project)
          Install a MidiDevice that this descriptor describes into the given project
protected  void installImp(ProjectContainer project)
          Called from install to actually do the work.
 void setMidiDeviceName(java.lang.String midiDeviceName)
          Set the name of the midi device as registered in MidiSystem
 void setProjectName(java.lang.String projectName)
          Set the name of the midi device as the user wants to name it in the Frinika project
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serializableMidiDevice

protected java.io.Serializable serializableMidiDevice
Constructor Detail

MidiDeviceDescriptor

public MidiDeviceDescriptor(javax.sound.midi.MidiDevice midiDevice)
Construct a new MidiDeviceDescriptor from a MidiDevice

Parameters:
midiDevice -
Method Detail

getMidiDeviceName

public java.lang.String getMidiDeviceName()
Name of the midi device as registered in MidiSystem

Returns:

setMidiDeviceName

public void setMidiDeviceName(java.lang.String midiDeviceName)
Set the name of the midi device as registered in MidiSystem

Parameters:
midiDeviceName -

getProjectName

public java.lang.String getProjectName()
Get the name of the midi device as the user has set for it in the Frinika project

Returns:

setProjectName

public void setProjectName(java.lang.String projectName)
Set the name of the midi device as the user wants to name it in the Frinika project

Parameters:
projectName -

install

public final void install(ProjectContainer project)
Install a MidiDevice that this descriptor describes into the given project

Parameters:
container -

installImp

protected void installImp(ProjectContainer project)
Called from install to actually do the work. Typically you want to override this but make sure super.installImp is called.

Parameters:
project -

getMidiDevice

public javax.sound.midi.MidiDevice getMidiDevice()

getSerializableMidiDevice

public java.io.Serializable getSerializableMidiDevice()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getIcon

public javax.swing.Icon getIcon()
Specified by:
getIcon in interface MidiDeviceIconProvider

getLargeIcon

public javax.swing.Icon getLargeIcon()