use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class Kontrol1ControllerSetup method createModes.
/**
* {@inheritDoc}
*/
@Override
protected void createModes() {
final Kontrol1ControlSurface surface = this.getSurface();
final ModeManager modeManager = surface.getModeManager();
modeManager.register(Modes.TRACK, new TrackMode(surface, this.model));
modeManager.register(Modes.VOLUME, new VolumeMode(surface, this.model));
modeManager.register(Modes.DEVICE_PARAMS, new ParamsMode(surface, this.model));
modeManager.register(Modes.BROWSER, new BrowseMode(surface, this.model));
modeManager.register(Modes.SCALES, new ScaleMode(surface, this.model));
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class MasterCommand method executeShifted.
/**
* {@inheritDoc}
*/
@Override
public void executeShifted(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
this.model.toggleCurrentTrackBank();
if (this.model.isEffectTrackBankActive()) {
// No Sends on effect tracks
final ModeManager modeManager = this.surface.getModeManager();
final int mode = modeManager.getActiveID().ordinal();
if (mode >= Modes.SEND1.ordinal() && mode <= Modes.SEND8.ordinal())
modeManager.setActive(Modes.PAN);
}
// Make sure that a track is selected
if (!this.model.getCursorTrack().doesExist())
this.model.getCurrentTrackBank().getItem(0).select();
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class MoveTrackBankCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ModeManager modeManager = this.surface.getModeManager();
if (modeManager.isActive(this.deviceMode)) {
final ICursorDevice cursorDevice = this.model.getCursorDevice();
if (this.moveBy1) {
this.handleBankMovement(cursorDevice.getParameterBank());
return;
}
if (this.moveLeft)
cursorDevice.selectPrevious();
else
cursorDevice.selectNext();
return;
}
if (modeManager.isActive(Modes.MARKERS)) {
this.handleBankMovement(this.model.getMarkerBank());
return;
}
this.handleBankMovement(this.model.getCurrentTrackBank());
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class LaunchkeyMiniMk3ControllerSetup method createModes.
/**
* {@inheritDoc}
*/
@Override
protected void createModes() {
final LaunchkeyMiniMk3ControlSurface surface = this.getSurface();
final ModeManager modeManager = surface.getModeManager();
final BooleanSupplier offSupplier = () -> false;
modeManager.register(Modes.VOLUME, new TrackVolumeMode<>(surface, this.model, true, AbstractMode.DEFAULT_KNOB_IDS, offSupplier));
modeManager.register(Modes.PAN, new TrackPanMode<>(surface, this.model, true, AbstractMode.DEFAULT_KNOB_IDS, offSupplier));
modeManager.register(Modes.SEND1, new TrackSendMode<>(0, surface, this.model, true, AbstractMode.DEFAULT_KNOB_IDS, offSupplier));
modeManager.register(Modes.SEND2, new TrackSendMode<>(1, surface, this.model, true, AbstractMode.DEFAULT_KNOB_IDS, offSupplier));
modeManager.register(Modes.DEVICE_PARAMS, new ParameterMode<>(surface, this.model, true, AbstractMode.DEFAULT_KNOB_IDS, offSupplier));
modeManager.register(Modes.USER, new UserMode<>(surface, this.model, true, ContinuousID.createSequentialList(ContinuousID.DEVICE_KNOB1, 8), offSupplier));
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class SLControllerSetup method startup.
/**
* {@inheritDoc}
*/
@Override
public void startup() {
final SLControlSurface surface = this.getSurface();
// Initialize 2nd display
final ModeManager modeManager = surface.getModeManager();
modeManager.get(Modes.VOLUME).updateDisplay();
surface.getViewManager().setActive(Views.CONTROL);
modeManager.setActive(Modes.TRACK);
}
Aggregations