-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
71 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,36 @@ | ||
package sojamo.midimapper; | ||
|
||
import javax.sound.midi.MidiUnavailableException; | ||
import javax.sound.midi.Transmitter; | ||
|
||
public class MidiNote { | ||
|
||
private final AssignedDevice device; | ||
private final int note; | ||
private final Object parent; | ||
|
||
public MidiNote( Object theParent , int theNote ) { | ||
public MidiNote( AssignedDevice theDevice , Object theParent , int theNote ) { | ||
device = theDevice; | ||
parent = theParent; | ||
note = theNote; | ||
} | ||
|
||
public AssignedDevice to( Object theTarget , String theMember ) { | ||
return to( new MidiReceiver( note , theTarget , theMember ) ); | ||
} | ||
|
||
public MidiReceiver to( Object theTarget , String theMember ) { | ||
return new MidiReceiver( note , theTarget , theMember ); | ||
public AssignedDevice to( String theMember ) { | ||
return to( parent , theMember ); | ||
} | ||
|
||
public MidiReceiver to( String theMember ) { | ||
return to( parent , theMember ); | ||
public AssignedDevice to( MidiReceiver theReceiver ) { | ||
try { | ||
Transmitter conTrans; | ||
conTrans = device.get( ).getTransmitter( ); | ||
conTrans.setReceiver( theReceiver ); | ||
} catch ( MidiUnavailableException e ) { | ||
e.printStackTrace( ); | ||
} catch ( NullPointerException e ) {} | ||
return device; | ||
} | ||
} |