Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
git-moss committed Oct 27, 2019
1 parent 51e3798 commit 97d79cb
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public boolean hasSlotChains ()
}


/** {@inheritDoc} */
/** {@inheritDoc} */
@Override
public boolean canEditMarkers ()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public boolean isSelected ()
@Override
public int getHitCount ()
{
return this.item instanceof BrowserFilterItem ? safeGetInteger (((BrowserFilterItem) this.item).hitCount ()) : 0;
return this.item instanceof BrowserFilterItem ? this.safeGetInteger (((BrowserFilterItem) this.item).hitCount ()) : 0;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class LaunchkeyMiniMk3ControllerDefinition extends DefaultControllerDefin
{
private static final UUID EXTENSION_ID = UUID.fromString ("5359D5B1-28CD-4457-B49D-F8D3D7BC52B9");


/**
* Constructor.
*/
Expand Down Expand Up @@ -61,6 +62,14 @@ public LaunchkeyMiniMk3ControllerDefinition ()
break;

case LINUX:
midiDiscoveryPairs.add (this.addDeviceDiscoveryPair (new String []
{
"MK3 [hw:1,0,1]",
"MK3 [hw:1,0,0]"
}, new String []
{
"MK3 [hw:1,0,1]"
}));
midiDiscoveryPairs.add (this.addDeviceDiscoveryPair (new String []
{
"MK3 [hw:2,0,1]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ protected void createSurface ()
final IMidiAccess midiAccess = this.factory.createMidiAccess ();
final IMidiOutput output = midiAccess.createOutput ();
final IMidiInput input = midiAccess.createInput ("Pads", "80????", "90????", "81????", "91????", "82????", "92????", "83????", "93????", "84????", "94????", "85????", "95????", "86????", "96????", "87????", "97????", "88????", "98????", "89????", "99????", "8A????", "9A????", "8B????", "9B????", "8C????", "9C????", "8D????", "9D????", "8E????", "9E????");
IMidiInput inputKeys = midiAccess.createInput (1, "Keyboard", "8?????" /* Note off */,
final IMidiInput inputKeys = midiAccess.createInput (1, "Keyboard", "8?????" /* Note off */,
"9?????" /* Note on */, "B?01??" /* Modulation */, "B?40??" /* Sustainpedal */,
"E?????" /* Pitchbend */);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ public void drawGrid ()

/** {@inheritDoc} */
@Override
public void onGridNote (int note, int velocity)
public void onGridNote (final int note, final int velocity)
{
if (velocity == 0)
return;

final Pair<Integer, Integer> padPos = this.getPad (note);
int row = padPos.getValue ().intValue ();
final int row = padPos.getValue ().intValue ();
if (row == 0 || this.padMode == null)
super.onGridNote (note, velocity);
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ protected void registerContinuousCommands ()
this.addContinuousCommand (ContinuousCommandID.get (ContinuousCommandID.KNOB1, i), LaunchpadControlSurface.LAUNCHPAD_FADER_1 + i, new FaderCommand (i, this.model, surface));
final ViewManager viewManager = surface.getViewManager ();

Views [] views =
final Views [] views =
{
Views.PLAY,
Views.PIANO,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ protected void registerContinuousCommands ()
final ViewManager viewManager = surface.getViewManager ();
viewManager.registerPitchbendCommand (new PitchbendCommand (this.model, surface));

Views [] views =
final Views [] views =
{
Views.PLAY,
Views.PIANO,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ public void updateDisplay2 (final IGraphicDisplay display)
for (int i = 0; i < 8; i++)
{
final boolean isTopMenuOn = this.getTopMenuEnablement (cd, hasPinning, i);
String bottomMenu = i < slotChains.length ? slotChains[i] : "";
final String bottomMenu = i < slotChains.length ? slotChains[i] : "";
final String bottomMenuIcon = "";
boolean isBottomMenuOn = i < slotChains.length;
final boolean isBottomMenuOn = i < slotChains.length;
display.addParameterElement (this.hostMenu[i], isTopMenuOn, bottomMenu, bottomMenuIcon, bottomMenuColor, isBottomMenuOn, "", 0, "", false, -1);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ public void updateDisplay2 (final IGraphicDisplay display)
final IValueChanger valueChanger = this.model.getValueChanger ();
for (int i = 0; i < parameterBank.getPageSize (); i++)
{
final boolean isTopMenuOn = getTopMenuEnablement (cd, hasPinning, i);
final boolean isTopMenuOn = this.getTopMenuEnablement (cd, hasPinning, i);

String bottomMenu;
final String bottomMenuIcon;
Expand Down Expand Up @@ -476,7 +476,7 @@ protected boolean checkExists2 (final IGraphicDisplay display, final ICursorDevi
}


protected boolean getTopMenuEnablement (final ICursorDevice cd, final boolean hasPinning, int index)
protected boolean getTopMenuEnablement (final ICursorDevice cd, final boolean hasPinning, final int index)
{
switch (index)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ protected SessionColor getPadColor (final ISlot slot, final boolean isArmed)
protected Pair<Integer, Integer> getPad (final int note)
{
final int index = note - 36;
int t = index % this.columns;
int s = this.rows - 1 - index / this.columns;
final int t = index % this.columns;
final int s = this.rows - 1 - index / this.columns;
final C configuration = this.surface.getConfiguration ();
return configuration.isFlipSession () ? new Pair<> (Integer.valueOf (s), Integer.valueOf (t)) : new Pair<> (Integer.valueOf (t), Integer.valueOf (s));
}
Expand Down

0 comments on commit 97d79cb

Please sign in to comment.