Skip to content

Commit

Permalink
Finished v20 features.
Browse files Browse the repository at this point in the history
  • Loading branch information
git-moss committed Apr 16, 2023
1 parent 51d9597 commit cdd374d
Show file tree
Hide file tree
Showing 83 changed files with 988 additions and 583 deletions.
Binary file modified DrivenByMoss-Manual.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,12 @@ public boolean isPlaying ()

/** {@inheritDoc} */
@Override
public void stop ()
public void stop (final boolean isAlternative)
{
this.track.stop ();
if (isAlternative)
this.track.stopAlt ();
else
this.track.stop ();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
*/
public abstract class AbstractChannelBankImpl<B extends Bank<?>, T extends IChannel> extends AbstractItemBankImpl<B, T> implements IChannelBank<T>
{
protected final int numScenes;
protected final int numSends;
protected final int numScenes;
protected final int numSends;

protected ISceneBank sceneBank;
protected SceneBankImpl sceneBank;


/**
Expand Down Expand Up @@ -62,15 +62,6 @@ public String getSelectedChannelColorEntry ()
}


/** {@inheritDoc} */
@Override
public void stop ()
{
if (this.sceneBank != null)
this.sceneBank.stop ();
}


/** {@inheritDoc} */
@Override
public ISceneBank getSceneBank ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ public void enableObservers (final boolean enable)
}


/** {@inheritDoc} */
@Override
public void stop (final boolean isAlternative)
{
if (this.sceneBank != null)
this.sceneBank.stop (isAlternative);
}


/** {@inheritDoc} */
@Override
public void setIndication (final boolean enable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,22 @@ public SceneBankImpl (final IHost host, final IValueChanger valueChanger, final
}


/** {@inheritDoc} */
@Override
public void stop ()
/**
* Stop all playing clips. Alternative function to stop the playback of all clips, e.g. not
* quantized, if true.
*
* @param isAlternative True, to execute the alternative function
*/
public void stop (final boolean isAlternative)
{
if (this.bank.isPresent ())
this.bank.get ().stop ();
if (this.bank.isEmpty ())
return;

final SceneBank sceneBank = this.bank.get ();
if (isAlternative)
sceneBank.stopAlt ();
else
sceneBank.stop ();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void onFirstRow (final int index, final ButtonEvent event)
if (this.surface.isPressed (ButtonID.STOP_CLIP))
{
this.surface.setTriggerConsumed (ButtonID.STOP_CLIP);
track.stop ();
track.stop (true);
return;
}

Expand Down Expand Up @@ -159,7 +159,8 @@ public void onSecondRow (final int index, final ButtonEvent event)
final ITrack track = tb.getItem (index);
if (this.surface.isPressed (ButtonID.STOP_CLIP))
{
track.stop ();
this.surface.setTriggerConsumed (ButtonID.STOP_CLIP);
track.stop (false);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import de.mossgrabers.framework.controller.grid.LightInfo;
import de.mossgrabers.framework.daw.IModel;
import de.mossgrabers.framework.daw.data.IScene;
import de.mossgrabers.framework.daw.data.ISlot;
import de.mossgrabers.framework.daw.data.ITrack;
import de.mossgrabers.framework.daw.data.bank.ISceneBank;
import de.mossgrabers.framework.featuregroup.AbstractFeatureGroup;
import de.mossgrabers.framework.utils.ButtonEvent;
Expand Down Expand Up @@ -82,6 +84,29 @@ public void onGridNote (final int note, final int velocity)
}


/** {@inheritDoc} */
@Override
protected boolean handleButtonCombinations (final ITrack track, final ISlot slot)
{
if (this.isButtonCombination (ButtonID.SELECT))
{
if (slot.doesExist ())
slot.select ();
return true;
}

return super.handleButtonCombinations (track, slot);
}


/** {@inheritDoc} */
@Override
public boolean isBirdsEyeActive ()
{
return this.surface.isShiftPressed () && this.surface.isSelectPressed ();
}


/** {@inheritDoc} */
@Override
public String getButtonColorID (final ButtonID buttonID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ protected void registerTriggerCommands ()

final ButtonID stopID = ButtonID.get (ButtonID.ROW1_1, i);
label = "Track Stop " + (i + 1);
this.addReceiveButton (stopID, label, () -> tb.getItem (index).stop (), 0, ACVSControlSurface.NOTE_TRACK1_STOP + i);
this.addReceiveButton (stopID, label, () -> tb.getItem (index).stop (surface.isShiftPressed ()), 0, ACVSControlSurface.NOTE_TRACK1_STOP + i);

for (int j = 0; j < 8; j++)
{
Expand Down Expand Up @@ -346,11 +346,11 @@ protected void handleScene (final ACVSControlSurface surface, final IScene scene
}

scene.select ();
if (surface.isShiftPressed ())
if (surface.isSelectPressed ())
return;
}

scene.launch (isPressed, surface.isSelectPressed ());
scene.launch (isPressed, surface.isShiftPressed ());
}


Expand Down Expand Up @@ -429,7 +429,7 @@ private void registerMPCTouchDisplayTriggerCommands (final ACVSControlSurface su
// NOTE_MPC_NEW - from where is this triggered?
// NOTE_MPC_BACK_TO_ARRANGEMENT - from where is this triggered?

this.addReceiveButton (ButtonID.STOP_ALL_CLIPS, "Stop all clips", tb::stop, 0x0A, ACVSControlSurface.NOTE_STOP_ALL_CLIPS);
this.addReceiveButton (ButtonID.STOP_ALL_CLIPS, "Stop all clips", () -> tb.stop (surface.isShiftPressed ()), 0x0A, ACVSControlSurface.NOTE_STOP_ALL_CLIPS);
this.addReceiveButton (ButtonID.INSERT_SCENE, "Insert scene", this.model.getProject ()::createScene, 0x0A, ACVSControlSurface.NOTE_INSERT_SCENE);
final NewCommand<ACVSControlSurface, ACVSConfiguration> newCommand = new NewCommand<> (this.model, surface);
this.addReceiveButton (ButtonID.NEW, "REC (New)", newCommand::execute, 0x0A, ACVSControlSurface.NOTE_ARRANGE_RECORD, false);
Expand Down Expand Up @@ -684,7 +684,7 @@ else if (surface.isPressed (ButtonID.DUPLICATE))

this.addButton (ButtonID.F5, "STOP ALL CLIPS", (event, velocity) -> {
if (event == ButtonEvent.DOWN)
this.model.getTrackBank ().stop ();
trackBank.stop (surface.isShiftPressed ());
}, 0x0C, ACVSControlSurface.NOTE_FORCE_STOP_ALL_CLIPS);

// The following 3 buttons do currently nothing but could be used...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
import de.mossgrabers.controller.akai.apc.command.continuous.APCTempoCommand;
import de.mossgrabers.controller.akai.apc.command.trigger.APCBrowserCommand;
import de.mossgrabers.controller.akai.apc.command.trigger.APCCursorCommand;
import de.mossgrabers.controller.akai.apc.command.trigger.APCDeviceOnOffCommand;
import de.mossgrabers.controller.akai.apc.command.trigger.APCQuantizeCommand;
import de.mossgrabers.controller.akai.apc.command.trigger.APCRecordCommand;
import de.mossgrabers.controller.akai.apc.command.trigger.APCStopClipCommand;
import de.mossgrabers.controller.akai.apc.command.trigger.APCTapTempoCommand;
import de.mossgrabers.controller.akai.apc.command.trigger.SelectTrackSendOrClipLengthCommand;
import de.mossgrabers.controller.akai.apc.command.trigger.SendModeCommand;
import de.mossgrabers.controller.akai.apc.command.trigger.SessionRecordCommand;
import de.mossgrabers.controller.akai.apc.command.trigger.StopAllClipsOrBrowseCommand;
import de.mossgrabers.controller.akai.apc.controller.APCColorManager;
import de.mossgrabers.controller.akai.apc.controller.APCControlSurface;
import de.mossgrabers.controller.akai.apc.controller.APCScales;
Expand All @@ -38,9 +38,9 @@
import de.mossgrabers.framework.command.trigger.application.PanelLayoutCommand;
import de.mossgrabers.framework.command.trigger.application.RedoCommand;
import de.mossgrabers.framework.command.trigger.application.UndoCommand;
import de.mossgrabers.framework.command.trigger.clip.StopAllClipsCommand;
import de.mossgrabers.framework.command.trigger.device.DeviceLayerLeftCommand;
import de.mossgrabers.framework.command.trigger.device.DeviceLayerRightCommand;
import de.mossgrabers.framework.command.trigger.device.DeviceOnOffCommand;
import de.mossgrabers.framework.command.trigger.device.SelectNextDeviceOrParamPageCommand;
import de.mossgrabers.framework.command.trigger.device.SelectPreviousDeviceOrParamPageCommand;
import de.mossgrabers.framework.command.trigger.mode.ModeMultiSelectCommand;
Expand Down Expand Up @@ -81,6 +81,7 @@
import de.mossgrabers.framework.mode.device.ParameterMode;
import de.mossgrabers.framework.mode.track.TrackVolumeMode;
import de.mossgrabers.framework.parameter.IParameter;
import de.mossgrabers.framework.utils.ButtonEvent;
import de.mossgrabers.framework.utils.Timeout;
import de.mossgrabers.framework.view.TempoView;
import de.mossgrabers.framework.view.Views;
Expand Down Expand Up @@ -215,11 +216,11 @@ protected void registerTriggerCommands ()
this.addButton (ButtonID.SHIFT, "SHIFT", new ToggleShiftViewCommand<> (this.model, surface), APCControlSurface.APC_BUTTON_SHIFT);
this.addButton (ButtonID.PLAY, "PLAY", new PlayCommand<> (this.model, surface), APCControlSurface.APC_BUTTON_PLAY, t::isPlaying, ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.RECORD, "RECORD", new APCRecordCommand (this.model, surface), APCControlSurface.APC_BUTTON_RECORD, t::isRecording, ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.TAP_TEMPO, "Tempo", new APCTapTempoCommand (this.model, surface), APCControlSurface.APC_BUTTON_TAP_TEMPO);
this.addButton (ButtonID.TAP_TEMPO, "TEMPO", new APCTapTempoCommand (this.model, surface), APCControlSurface.APC_BUTTON_TAP_TEMPO);
this.addButton (ButtonID.QUANTIZE, this.isMkII ? "DEV.LOCK" : "REC QUANTIZATION", new APCQuantizeCommand (this.model, surface), APCControlSurface.APC_BUTTON_REC_QUANT, () -> surface.isPressed (ButtonID.QUANTIZE) ? 1 : 0, ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.MASTERTRACK, "Master", new MasterCommand<> (this.model, surface), APCControlSurface.APC_BUTTON_MASTER, this.model.getMasterTrack ()::isSelected, ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.MASTERTRACK, "MASTER", new MasterCommand<> (this.model, surface), APCControlSurface.APC_BUTTON_MASTER, this.model.getMasterTrack ()::isSelected, ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
// Note: the stop-all-clips button has no LED
this.addButton (ButtonID.STOP_ALL_CLIPS, "STOP CLIPS", new StopAllClipsOrBrowseCommand (this.model, surface), APCControlSurface.APC_BUTTON_STOP_ALL_CLIPS, () -> surface.isPressed (ButtonID.STOP_ALL_CLIPS) ? 1 : 0, ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.STOP_ALL_CLIPS, "STOP CLIPS", new StopAllClipsCommand<> (this.model, surface), APCControlSurface.APC_BUTTON_STOP_ALL_CLIPS, () -> surface.isPressed (ButtonID.STOP_ALL_CLIPS) ? 1 : 0, ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.PAN_SEND, "PAN", new ModeSelectCommand<> (this.model, surface, Modes.PAN), APCControlSurface.APC_BUTTON_PAN, () -> modeManager.isActive (Modes.PAN), ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);

if (this.isMkII)
Expand All @@ -236,22 +237,33 @@ protected void displayMode ()
}
else
{
this.addButton (ButtonID.SEND1, "Send A", new SendModeCommand (0, this.model, surface), APCControlSurface.APC_BUTTON_SEND_A, () -> modeManager.isActive (Modes.SEND1, Modes.SEND4, Modes.SEND7), ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.SEND2, "Send B", new SendModeCommand (1, this.model, surface), APCControlSurface.APC_BUTTON_SEND_B, () -> modeManager.isActive (Modes.SEND2, Modes.SEND5, Modes.SEND8), ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.SEND1, "SEND A", new SendModeCommand (0, this.model, surface), APCControlSurface.APC_BUTTON_SEND_A, () -> modeManager.isActive (Modes.SEND1, Modes.SEND4, Modes.SEND7), ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.SEND2, "SEND B", new SendModeCommand (1, this.model, surface), APCControlSurface.APC_BUTTON_SEND_B, () -> modeManager.isActive (Modes.SEND2, Modes.SEND5, Modes.SEND8), ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.SEND3, "SEND C", new SendModeCommand (2, this.model, surface), APCControlSurface.APC_BUTTON_SEND_C, () -> modeManager.isActive (Modes.SEND3, Modes.SEND6), ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
}

for (int i = 0; i < 8; i++)
{
final int index = i;

final CrossfadeModeCommand<APCControlSurface, APCConfiguration> crossfadeModeCommand = new CrossfadeModeCommand<> (i, this.model, surface);

this.addButton (ButtonID.get (ButtonID.ROW1_1, i), "Select " + (i + 1), new SelectTrackSendOrClipLengthCommand (i, this.model, surface), i, APCControlSurface.APC_BUTTON_TRACK_SELECTION, () -> this.getButtonState (index, APCControlSurface.APC_BUTTON_TRACK_SELECTION) ? 1 : 0, ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.get (ButtonID.ROW2_1, i), "Solo " + (i + 1), new SoloCommand<> (i, this.model, surface), i, APCControlSurface.APC_BUTTON_SOLO, () -> this.getButtonState (index, APCControlSurface.APC_BUTTON_SOLO) ? 1 : 0, ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.get (ButtonID.ROW3_1, i), (this.isMkII ? "Mute " : "Activator ") + (i + 1), new MuteCommand<> (i, this.model, surface), i, APCControlSurface.APC_BUTTON_ACTIVATOR, () -> this.getButtonState (index, APCControlSurface.APC_BUTTON_ACTIVATOR) ? 1 : 0, ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.get (ButtonID.ROW4_1, i), "Arm " + (i + 1), new RecArmCommand<> (i, this.model, surface), i, APCControlSurface.APC_BUTTON_RECORD_ARM, () -> this.getButtonState (index, APCControlSurface.APC_BUTTON_RECORD_ARM) ? 1 : 0, ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.get (ButtonID.ROW4_1, i), "Arm " + (i + 1), new RecArmCommand<> (i, this.model, surface)
{
/** {@inheritDoc} */
@Override
public void executeShifted (final ButtonEvent event)
{
if (!APCControllerSetup.this.isMkII)
crossfadeModeCommand.executeNormal (event);
}
}, i, APCControlSurface.APC_BUTTON_RECORD_ARM, () -> this.getButtonState (index, APCControlSurface.APC_BUTTON_RECORD_ARM) ? 1 : 0, ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);

if (this.isMkII)
this.addButton (ButtonID.get (ButtonID.ROW5_1, i), "X-fade " + (i + 1), new CrossfadeModeCommand<> (i, this.model, surface), i, APCControlSurface.APC_BUTTON_A_B, () -> this.getCrossfadeButtonColor (index), ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON, APCColorManager.BUTTON_STATE_BLINK);
this.addButton (ButtonID.get (ButtonID.ROW5_1, i), "X-fade " + (i + 1), crossfadeModeCommand, i, APCControlSurface.APC_BUTTON_A_B, () -> this.getCrossfadeButtonColor (index), ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON, APCColorManager.BUTTON_STATE_BLINK);

final ButtonID stopButtonID = ButtonID.get (ButtonID.ROW6_1, i);
final APCStopClipCommand apcStopClipCommand = new APCStopClipCommand (i, this.model, surface);
Expand All @@ -275,7 +287,7 @@ protected void displayMode ()
this.addButton (ButtonID.METRONOME, "METRONOME", new MetronomeCommand<> (this.model, surface, false), this.isMkII ? APCControlSurface.APC_BUTTON_SEND_C : APCControlSurface.APC_BUTTON_METRONOME, t::isMetronomeOn, ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.NUDGE_PLUS, "NUDGE+", new RedoCommand<> (this.model, surface), this.isMkII ? APCControlSurface.APC_BUTTON_NUDGE_MINUS : APCControlSurface.APC_BUTTON_NUDGE_PLUS);
this.addButton (ButtonID.NUDGE_MINUS, "NUDGE-", new UndoCommand<> (this.model, surface), this.isMkII ? APCControlSurface.APC_BUTTON_NUDGE_PLUS : APCControlSurface.APC_BUTTON_NUDGE_MINUS);
this.addButton (ButtonID.DEVICE_ON_OFF, "DEV. ON/OFF", new DeviceOnOffCommand<> (this.model, surface), this.isMkII ? APCControlSurface.APC_BUTTON_DETAIL_VIEW : APCControlSurface.APC_BUTTON_DEVICE_ON_OFF, this.model.getCursorDevice ()::isEnabled, ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.DEVICE_ON_OFF, "DEV. ON/OFF", new APCDeviceOnOffCommand (this.model, surface), this.isMkII ? APCControlSurface.APC_BUTTON_DETAIL_VIEW : APCControlSurface.APC_BUTTON_DEVICE_ON_OFF, this.model.getCursorDevice ()::isEnabled, ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.TOGGLE_DEVICES_PANE, this.isMkII ? "CLIP/DEV.VIEW" : "CLIP/TRACK", new PaneCommand<> (Panels.DEVICE, this.model, surface), this.isMkII ? APCControlSurface.APC_BUTTON_MIDI_OVERDUB : APCControlSurface.APC_BUTTON_CLIP_TRACK, () -> surface.isPressed (ButtonID.TOGGLE_DEVICES_PANE) ? 1 : 0, ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);
this.addButton (ButtonID.LAYOUT, "DETAIL VIEW", new PanelLayoutCommand<> (this.model, surface), this.isMkII ? APCControlSurface.APC_BUTTON_METRONOME : APCControlSurface.APC_BUTTON_DETAIL_VIEW, () -> !surface.isShiftPressed () && this.model.getCursorDevice ().isWindowOpen () ? 1 : 0, ColorManager.BUTTON_STATE_OFF, ColorManager.BUTTON_STATE_ON);

Expand Down
Loading

0 comments on commit cdd374d

Please sign in to comment.