use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.
the class APCPlayPositionCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final int value) {
if (this.surface.isPressed(ButtonID.TAP_TEMPO)) {
this.surface.setTriggerConsumed(ButtonID.TAP_TEMPO);
this.tempoCommand.execute(value);
final ViewManager viewManager = this.surface.getViewManager();
if (!viewManager.isActive(Views.TEMPO))
viewManager.setTemporary(Views.TEMPO);
this.timeout.delay(viewManager::restore);
return;
}
if (this.surface.isPressed(ButtonID.ARROW_LEFT)) {
this.surface.setTriggerConsumed(ButtonID.ARROW_LEFT);
this.transport.changeLoopStart(this.model.getValueChanger().isIncrease(value), this.surface.isKnobSensitivitySlow());
this.mvHelper.delayDisplay(() -> "Loop Start: " + this.transport.getLoopStartBeatText());
return;
}
if (this.surface.isPressed(ButtonID.ARROW_RIGHT)) {
this.surface.setTriggerConsumed(ButtonID.ARROW_RIGHT);
this.transport.changeLoopLength(this.model.getValueChanger().isIncrease(value), this.surface.isKnobSensitivitySlow());
this.mvHelper.delayDisplay(() -> "Loop Length: " + this.transport.getLoopLengthBeatText());
return;
}
super.execute(value);
}
use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.
the class Kontrol1ControllerSetup method createViews.
/**
* {@inheritDoc}
*/
@Override
protected void createViews() {
final Kontrol1ControlSurface surface = this.getSurface();
final ViewManager viewManager = surface.getViewManager();
viewManager.register(Views.CONTROL, new ControlView(surface, this.model));
}
use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.
the class LaunchkeyMiniMk3ControllerSetup method registerTriggerCommands.
/**
* {@inheritDoc}
*/
@Override
protected void registerTriggerCommands() {
final LaunchkeyMiniMk3ControlSurface surface = this.getSurface();
final ITransport t = this.model.getTransport();
final ViewManager viewManager = surface.getViewManager();
this.addButton(ButtonID.SHIFT, "Shift", NopCommand.INSTANCE, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_SHIFT);
this.addButton(ButtonID.PLAY, "Play", new PlayCommand<>(this.model, surface), 15, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_PLAY, t::isPlaying);
final ConfiguredRecordCommand<LaunchkeyMiniMk3ControlSurface, LaunchkeyMiniMk3Configuration> recordCommand = new ConfiguredRecordCommand<>(this.model, surface);
this.addButton(ButtonID.RECORD, "Record", recordCommand, 15, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_RECORD, recordCommand::isLit);
final ModeCursorCommand<LaunchkeyMiniMk3ControlSurface, LaunchkeyMiniMk3Configuration> leftCommand = new ModeCursorCommand<>(Direction.LEFT, this.model, surface, true);
this.addButton(ButtonID.MOVE_TRACK_LEFT, "Previous", leftCommand, 15, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_LEFT, leftCommand::canScroll);
final ModeCursorCommand<LaunchkeyMiniMk3ControlSurface, LaunchkeyMiniMk3Configuration> rightCommand = new ModeCursorCommand<>(Direction.RIGHT, this.model, surface, true);
this.addButton(ButtonID.MOVE_TRACK_RIGHT, "Next", rightCommand, 15, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_RIGHT, rightCommand::canScroll);
// Scene buttons
this.addButton(ButtonID.SCENE1, "Scene 1", new ViewButtonCommand<>(ButtonID.SCENE1, surface), LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_SCENE1, new FeatureGroupButtonColorSupplier(viewManager, ButtonID.SCENE1));
this.addButton(ButtonID.SCENE2, "Scene 2", new ViewButtonCommand<>(ButtonID.SCENE2, surface), LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_SCENE2, new FeatureGroupButtonColorSupplier(viewManager, ButtonID.SCENE2));
// View selection with Pads in Shift mode
this.createViewButton(ButtonID.ROW2_1, OutputID.LED_RING1, "Session", Views.SESSION, LaunchkeyMiniMk3ControlSurface.PAD_MODE_SESSION);
this.createViewButton(ButtonID.ROW2_2, OutputID.LED_RING2, "Drum", Views.DRUM, LaunchkeyMiniMk3ControlSurface.PAD_MODE_DRUM);
this.createViewButton(ButtonID.ROW2_3, OutputID.LED_RING3, "Custom", Views.PLAY, LaunchkeyMiniMk3ControlSurface.PAD_MODE_CUSTOM);
// Knob mode selection with Pads in Shift mode
this.createModeButton(ButtonID.ROW1_1, OutputID.LED1, "Device", Modes.DEVICE_PARAMS, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_PARAMS);
this.createModeButton(ButtonID.ROW1_2, OutputID.LED2, "Volume", Modes.VOLUME, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_VOLUME);
this.createModeButton(ButtonID.ROW1_3, OutputID.LED3, "Pan", Modes.PAN, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_PAN);
this.createModeButton(ButtonID.ROW1_4, OutputID.LED4, "Send 1", Modes.SEND1, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_SEND1);
this.createModeButton(ButtonID.ROW1_5, OutputID.LED5, "Send 2", Modes.SEND2, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_SEND2);
this.createModeButton(ButtonID.ROW1_6, OutputID.LED6, "Custom", Modes.USER, LaunchkeyMiniMk3ControlSurface.KNOB_MODE_CUSTOM);
// Online state
this.addButton(ButtonID.CONTROL, "DAW Online", (event, velocity) -> surface.setDAWConnected(velocity > 0), 15, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_DAW_ONLINE, surface::isDAWConnected);
}
use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.
the class LaunchkeyMiniMk3ControllerSetup method createViews.
/**
* {@inheritDoc}
*/
@Override
protected void createViews() {
final LaunchkeyMiniMk3ControlSurface surface = this.getSurface();
final ViewManager viewManager = surface.getViewManager();
viewManager.register(Views.SESSION, new SessionView(surface, this.model));
viewManager.register(Views.CONTROL, new PadModeSelectView(surface, this.model));
viewManager.register(Views.DRUM, new DrumView(surface, this.model));
viewManager.register(Views.PLAY, new UserPadView(surface, this.model));
viewManager.register(Views.SHIFT, new DrumConfigView(surface, this.model));
}
use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.
the class AbstractTrackCommand method onModeButton.
protected void onModeButton(final ButtonEvent event, final Modes controlMode, final String notification) {
final ModeManager modeManager = this.surface.getModeManager();
final ViewManager viewManager = this.surface.getViewManager();
switch(event) {
case DOWN:
this.firstRowUsed = false;
if (modeManager.isActive(controlMode)) {
modeManager.setActive(Modes.DUMMY);
return;
}
modeManager.setActive(controlMode);
this.wasSession = viewManager.isActive(Views.SESSION);
if (!this.wasSession)
viewManager.setActive(Views.SESSION);
this.surface.getDisplay().notify(notification);
break;
case LONG:
this.firstRowUsed = true;
break;
case UP:
if (this.firstRowUsed) {
modeManager.setActive(Modes.DUMMY);
if (!this.wasSession)
viewManager.restore();
}
break;
}
}
Aggregations