Skip to content

Commit

Permalink
Release 20.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
git-moss committed Apr 23, 2023
1 parent adc4e25 commit d055410
Show file tree
Hide file tree
Showing 28 changed files with 184 additions and 129 deletions.
Binary file modified DrivenByMoss-Manual.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>de.mossgrabers</groupId>
<artifactId>DrivenByMoss</artifactId>
<name>DrivenByMoss</name>
<version>20.0.0</version>
<version>20.1.0</version>
<licenses>
<license>
<name>LGPL-2.1-or-later</name>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>DrivenByMoss</artifactId>
<packaging>jar</packaging>
<name>DrivenByMoss</name>
<version>20.0.0</version>
<version>20.1.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import de.mossgrabers.controller.ableton.push.controller.PushControlSurface;
import de.mossgrabers.framework.command.core.AbstractTriggerCommand;
import de.mossgrabers.framework.daw.IModel;
import de.mossgrabers.framework.daw.data.ITrack;
import de.mossgrabers.framework.featuregroup.ModeManager;
import de.mossgrabers.framework.featuregroup.ViewManager;
import de.mossgrabers.framework.mode.Modes;
Expand Down Expand Up @@ -46,15 +45,7 @@ public void execute (final ButtonEvent event, final int velocity)
final ViewManager viewManager = this.surface.getViewManager ();
if (Views.isSessionView (viewManager.getActiveID ()))
{
final ITrack cursorTrack = this.model.getCursorTrack ();
if (!cursorTrack.doesExist ())
{
this.surface.getDisplay ().notify ("Please select a track first.");
return;
}

final Views preferredView = viewManager.getPreferredView (cursorTrack.getPosition ());
viewManager.setActive (preferredView == null ? Views.PLAY : preferredView);
this.surface.recallPreferredView (this.model.getCursorTrack ());

if (modeManager.isActive (Modes.SESSION) || modeManager.isTemporary ())
modeManager.restore ();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Written by Jürgen Moßgraber - mossgrabers.de
// (c) 2017-2023
// Licensed under LGPLv3 - http://www.gnu.org/licenses/lgpl-3.0.txt

package de.mossgrabers.controller.akai.fire.command.trigger;

import de.mossgrabers.controller.akai.fire.FireConfiguration;
import de.mossgrabers.controller.akai.fire.controller.FireControlSurface;
import de.mossgrabers.framework.command.trigger.view.ViewMultiSelectCommand;
import de.mossgrabers.framework.daw.IModel;
import de.mossgrabers.framework.utils.ButtonEvent;
import de.mossgrabers.framework.view.Views;


/**
* Selects the next view from a list. Added some Fire specifics.
*
* @author Jürgen Moßgraber
*/
public abstract class AbstractFireViewMultiSelectCommand extends ViewMultiSelectCommand<FireControlSurface, FireConfiguration>
{
/**
* Constructor.
*
* @param model The model
* @param surface The surface
* @param viewIds The list with IDs of the views to select
*/
protected AbstractFireViewMultiSelectCommand (final IModel model, final FireControlSurface surface, final Views... viewIds)
{
super (model, surface, true, ButtonEvent.UP, viewIds);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

package de.mossgrabers.controller.akai.fire.command.trigger;

import de.mossgrabers.controller.akai.fire.FireConfiguration;
import de.mossgrabers.controller.akai.fire.controller.FireControlSurface;
import de.mossgrabers.framework.command.trigger.view.ViewMultiSelectCommand;
import de.mossgrabers.framework.controller.ButtonID;
import de.mossgrabers.framework.daw.IModel;
import de.mossgrabers.framework.daw.ITransport;
Expand All @@ -25,7 +23,7 @@
*
* @author Jürgen Moßgraber
*/
public class DrumSequencerSelectCommand extends ViewMultiSelectCommand<FireControlSurface, FireConfiguration>
public class DrumSequencerSelectCommand extends AbstractFireViewMultiSelectCommand
{
/**
* Constructor.
Expand All @@ -35,7 +33,7 @@ public class DrumSequencerSelectCommand extends ViewMultiSelectCommand<FireContr
*/
public DrumSequencerSelectCommand (final IModel model, final FireControlSurface surface)
{
super (model, surface, true, ButtonEvent.UP, Views.DRUM, Views.DRUM4, Views.DRUM64);
super (model, surface, Views.DRUM, Views.DRUM4, Views.DRUM64);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

package de.mossgrabers.controller.akai.fire.command.trigger;

import de.mossgrabers.controller.akai.fire.FireConfiguration;
import de.mossgrabers.controller.akai.fire.controller.FireControlSurface;
import de.mossgrabers.framework.command.trigger.view.ViewMultiSelectCommand;
import de.mossgrabers.framework.controller.ButtonID;
import de.mossgrabers.framework.daw.IModel;
import de.mossgrabers.framework.daw.constants.RecordQuantization;
Expand All @@ -21,7 +19,7 @@
*
* @author Jürgen Moßgraber
*/
public class PlaySelectCommand extends ViewMultiSelectCommand<FireControlSurface, FireConfiguration>
public class PlaySelectCommand extends AbstractFireViewMultiSelectCommand
{
/**
* Constructor.
Expand All @@ -31,7 +29,7 @@ public class PlaySelectCommand extends ViewMultiSelectCommand<FireControlSurface
*/
public PlaySelectCommand (final IModel model, final FireControlSurface surface)
{
super (model, surface, true, ButtonEvent.UP, Views.PLAY, Views.PIANO);
super (model, surface, Views.PLAY, Views.PIANO);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import de.mossgrabers.controller.akai.fire.FireConfiguration;
import de.mossgrabers.controller.akai.fire.controller.FireControlSurface;
import de.mossgrabers.framework.command.trigger.view.ViewMultiSelectCommand;
import de.mossgrabers.framework.controller.ButtonID;
import de.mossgrabers.framework.daw.IModel;
import de.mossgrabers.framework.daw.data.ITrack;
Expand All @@ -24,7 +23,7 @@
*
* @author Jürgen Moßgraber
*/
public class StepSequencerSelectCommand extends ViewMultiSelectCommand<FireControlSurface, FireConfiguration>
public class StepSequencerSelectCommand extends AbstractFireViewMultiSelectCommand
{
/**
* Constructor.
Expand All @@ -34,7 +33,7 @@ public class StepSequencerSelectCommand extends ViewMultiSelectCommand<FireContr
*/
public StepSequencerSelectCommand (final IModel model, final FireControlSurface surface)
{
super (model, surface, true, ButtonEvent.UP, Views.SEQUENCER, Views.POLY_SEQUENCER);
super (model, surface, Views.SEQUENCER, Views.POLY_SEQUENCER);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ public int getButtonColor (final ButtonID buttonID)
case SCENE4:
return this.surface.isPressed (ButtonID.SCENE4) ? 2 : 1;

case SCENE1:
case SCENE2:
case SCENE1, SCENE2:
default:
return 0;
}
Expand All @@ -74,8 +73,7 @@ public int getSoloButtonColor (final int index)
case 3:
return 1;

case 0:
case 1:
case 0, 1:
default:
return 0;
}
Expand All @@ -90,6 +88,7 @@ public void onSelectKnobValue (final int value)
this.scales.incDrumOctave ();
else
this.scales.decDrumOctave ();
this.model.getDrumDevice ().getDrumPadBank ().scrollTo (this.scales.getDrumOffset (), false);
this.updateNoteMapping ();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
import de.mossgrabers.framework.controller.ButtonID;
import de.mossgrabers.framework.controller.display.ITextDisplay;
import de.mossgrabers.framework.daw.IModel;
import de.mossgrabers.framework.daw.constants.DeviceID;
import de.mossgrabers.framework.daw.data.IChannel;
import de.mossgrabers.framework.daw.data.ICursorDevice;
import de.mossgrabers.framework.daw.data.ILayer;
import de.mossgrabers.framework.daw.data.ISpecificDevice;
import de.mossgrabers.framework.daw.data.bank.IChannelBank;
import de.mossgrabers.framework.utils.ButtonEvent;
import de.mossgrabers.framework.utils.StringUtils;
Expand All @@ -34,15 +35,15 @@ public abstract class AbstractLayerMode extends BaseMode<ILayer>
*/
protected AbstractLayerMode (final String name, final MCUControlSurface surface, final IModel model)
{
super (name, surface, model, model.getCursorDevice ().getLayerBank ());
super (name, surface, model, getDevice (model).getLayerBank ());
}


/** {@inheritDoc} */
@Override
protected void drawTrackNameHeader ()
{
final ICursorDevice cursorDevice = this.model.getCursorDevice ();
final ISpecificDevice cursorDevice = getDevice (this.model);
final IChannelBank<? extends IChannel> layerBank = cursorDevice.hasDrumPads () ? cursorDevice.getDrumPadBank () : cursorDevice.getLayerBank ();

final int extenderOffset = this.getExtenderOffset ();
Expand Down Expand Up @@ -81,7 +82,7 @@ public void onButton (final int row, final int index, final ButtonEvent event)
return;
}

final ICursorDevice cursorDevice = this.model.getCursorDevice ();
final ISpecificDevice cursorDevice = getDevice (this.model);
final IChannelBank<? extends IChannel> layerBank = cursorDevice.hasDrumPads () ? cursorDevice.getDrumPadBank () : cursorDevice.getLayerBank ();
final IChannel channel = layerBank.getItem (this.getExtenderOffset () + index);
if (row == 2)
Expand All @@ -108,7 +109,7 @@ public int getButtonColor (final ButtonID buttonID)
if (this.pinFXtoLastDevice)
return super.getButtonColor (buttonID);

final ICursorDevice cursorDevice = this.model.getCursorDevice ();
final ISpecificDevice cursorDevice = getDevice (this.model);
final IChannelBank<? extends IChannel> layerBank = cursorDevice.hasDrumPads () ? cursorDevice.getDrumPadBank () : cursorDevice.getLayerBank ();

final int extenderOffset = this.getExtenderOffset ();
Expand All @@ -129,4 +130,10 @@ public int getButtonColor (final ButtonID buttonID)

return MCUControllerSetup.MCU_BUTTON_STATE_OFF;
}


protected static final ISpecificDevice getDevice (final IModel model)
{
return model.getSpecificDevice (DeviceID.FIRST_INSTRUMENT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import de.mossgrabers.framework.controller.display.ITextDisplay;
import de.mossgrabers.framework.daw.IModel;
import de.mossgrabers.framework.daw.data.IChannel;
import de.mossgrabers.framework.daw.data.ICursorDevice;
import de.mossgrabers.framework.daw.data.ISpecificDevice;
import de.mossgrabers.framework.daw.data.bank.IChannelBank;
import de.mossgrabers.framework.mode.Modes;
import de.mossgrabers.framework.parameterprovider.IParameterProvider;
Expand Down Expand Up @@ -47,9 +47,9 @@ public LayerMode (final MCUControlSurface surface, final IModel model)
{
final int surfaceID = surface.getSurfaceID ();
if (surfaceID == 0)
parameterProvider = new RangeFilterParameterProvider (new SelectedLayerOrDrumPadParameterProvider (model.getCursorDevice ()), 0, 8);
parameterProvider = new RangeFilterParameterProvider (new SelectedLayerOrDrumPadParameterProvider (getDevice (model)), 0, 8);
else if (surfaceID == 1)
parameterProvider = new RangeFilterParameterProvider (new SendLayerOrDrumPadParameterProvider (model.getCursorDevice (), 6), 0, 8);
parameterProvider = new RangeFilterParameterProvider (new SendLayerOrDrumPadParameterProvider (getDevice (model), 6), 0, 8);
else
parameterProvider = new EmptyParameterProvider (8);
}
Expand Down Expand Up @@ -88,7 +88,7 @@ protected void drawParameterHeader ()
// Overwrite the label of the first cell
if (this.surface.getExtenderOffset () == 0 && this.configuration.isDisplayTrackNames ())
{
final ICursorDevice cursorDevice = this.model.getCursorDevice ();
final ISpecificDevice cursorDevice = getDevice (this.model);
final IChannelBank<? extends IChannel> layerBank = cursorDevice.hasDrumPads () ? cursorDevice.getDrumPadBank () : cursorDevice.getLayerBank ();
final Optional<? extends IChannel> selectedLayer = layerBank.getSelectedItem ();
if (selectedLayer.isEmpty ())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public LayerPanMode (final MCUControlSurface surface, final IModel model)
else
{
final int surfaceID = surface.getSurfaceID ();
parameterProvider = new RangeFilterParameterProvider (new PanLayerOrDrumPadParameterProvider (model.getCursorDevice ()), surfaceID * 8, 8);
parameterProvider = new RangeFilterParameterProvider (new PanLayerOrDrumPadParameterProvider (getDevice (model)), surfaceID * 8, 8);
}
this.setParameterProvider (parameterProvider);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public LayerSendMode (final MCUControlSurface surface, final IModel model, final
else
{
final int surfaceID = surface.getSurfaceID ();
parameterProvider = new RangeFilterParameterProvider (new SendLayerOrDrumPadParameterProvider (model.getCursorDevice (), sendIndex), surfaceID * 8, 8);
parameterProvider = new RangeFilterParameterProvider (new SendLayerOrDrumPadParameterProvider (getDevice (model), sendIndex), surfaceID * 8, 8);
}
this.setParameterProvider (parameterProvider);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public LayerVolumeMode (final MCUControlSurface surface, final IModel model)
else
{
final int surfaceID = surface.getSurfaceID ();
parameterProvider = new RangeFilterParameterProvider (new VolumeLayerOrDrumPadParameterProvider (model.getCursorDevice ()), surfaceID * 8, 8);
parameterProvider = new RangeFilterParameterProvider (new VolumeLayerOrDrumPadParameterProvider (getDevice (model)), surfaceID * 8, 8);
}
this.setParameterProvider (parameterProvider);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@
*/
public class LaunchControlXLControllerDefinition extends DefaultControllerDefinition
{
private static final UUID EXTENSION_ID = UUID.fromString ("5AFA5045-FF92-4737-A091-5B371CD5E529");
private static final UUID EXTENSION_ID = UUID.fromString ("5AFA5045-FF92-4737-A091-5B371CD5E529");
private static final String LAUNCH_CONTROL_XL = "Launch Control XL";


/**
* Constructor.
*/
public LaunchControlXLControllerDefinition ()
{
super (EXTENSION_ID, "Launch Control XL", "Novation", 1, 1);
super (EXTENSION_ID, LAUNCH_CONTROL_XL, "Novation", 1, 1);
}


Expand All @@ -40,16 +41,17 @@ public LaunchControlXLControllerDefinition ()
{
default:
case WINDOWS:
midiDiscoveryPairs.addAll (this.createWindowsDeviceDiscoveryPairs ("%sLaunch Control XL", "%sLaunch Control XL"));
final String pattern = "%s" + LAUNCH_CONTROL_XL;
midiDiscoveryPairs.addAll (this.createWindowsDeviceDiscoveryPairs (pattern, pattern));
break;

case MAC:
midiDiscoveryPairs.add (this.addDeviceDiscoveryPair ("Launch Control XL"));
midiDiscoveryPairs.add (this.addDeviceDiscoveryPair (LAUNCH_CONTROL_XL));
break;

case LINUX:
midiDiscoveryPairs.add (this.addDeviceDiscoveryPair ("Launch Control XL"));
midiDiscoveryPairs.add (this.addDeviceDiscoveryPair ("Launch Control XL Launch Contro"));
midiDiscoveryPairs.add (this.addDeviceDiscoveryPair (LAUNCH_CONTROL_XL));
midiDiscoveryPairs.add (this.addDeviceDiscoveryPair (LAUNCH_CONTROL_XL + " Launch Contro"));
break;
}
return midiDiscoveryPairs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected int getFirstRowColor (final int index)
public void selectPreviousItem ()
{
this.scales.decDrumOctave ();
this.host.showNotification (this.scales.getDrumRangeText ());
this.adjustDrumDevice ();
}


Expand All @@ -97,6 +97,13 @@ public void selectPreviousItem ()
public void selectNextItem ()
{
this.scales.incDrumOctave ();
this.adjustDrumDevice ();
}


private void adjustDrumDevice ()
{
this.model.getDrumDevice ().getDrumPadBank ().scrollTo (this.scales.getDrumOffset (), false);
this.host.showNotification (this.scales.getDrumRangeText ());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ public void execute (final ButtonEvent event, final int velocity)
return;
}

Views viewID = viewManager.getPreferredView (cursorTrack.getPosition ());
if (viewID == null)
viewID = Views.PLAY;
viewManager.setActive (viewID);
display.notify (viewManager.get (viewID).getName ());
this.surface.recallPreferredView (this.model.getCursorTrack ());
}
}
Loading

0 comments on commit d055410

Please sign in to comment.