use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class DeviceLayerMode method moveUp.
/**
* Move up the hierarchy.
*/
protected void moveUp() {
// There is no device on the track move upwards to the track view
if (!this.cursorDevice.doesExist()) {
this.surface.getButton(ButtonID.TRACK).trigger(ButtonEvent.DOWN);
return;
}
this.setMode(Modes.DEVICE_PARAMS);
this.cursorDevice.selectChannel();
final ModeManager modeManager = this.surface.getModeManager();
((DeviceParamsMode) modeManager.get(Modes.DEVICE_PARAMS)).setShowDevices(true);
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class DeviceLayerMode method onSecondRow.
/**
* {@inheritDoc}
*/
@Override
public void onSecondRow(final int index, final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
if (!this.isPush2 || this.configuration.isMuteLongPressed() || this.configuration.isSoloLongPressed() || this.configuration.isMuteSoloLocked()) {
final int offset = this.getDrumPadIndex();
final ILayer layer = this.bank.getItem(offset + index);
if (this.configuration.isMuteState())
layer.toggleMute();
else
layer.toggleSolo();
return;
}
final ModeManager modeManager = this.surface.getModeManager();
ITrackBank fxTrackBank;
switch(index) {
case 0:
if (modeManager.isActive(Modes.DEVICE_LAYER_VOLUME))
this.setMode(Modes.DEVICE_LAYER);
else
this.setMode(Modes.DEVICE_LAYER_VOLUME);
break;
case 1:
if (modeManager.isActive(Modes.DEVICE_LAYER_PAN))
this.setMode(Modes.DEVICE_LAYER);
else
this.setMode(Modes.DEVICE_LAYER_PAN);
break;
case 2:
// Not used
break;
case 3:
if (this.model.isEffectTrackBankActive())
return;
// Check if there are more than 4 FX channels
if (!this.configuration.isSendsAreToggled()) {
fxTrackBank = this.model.getEffectTrackBank();
if (fxTrackBank == null || !fxTrackBank.getItem(4).doesExist())
return;
}
this.configuration.setSendsAreToggled(!this.configuration.isSendsAreToggled());
this.bindControls();
if (!modeManager.isActive(Modes.DEVICE_LAYER))
this.setMode(Modes.get(Modes.DEVICE_LAYER_SEND1, this.configuration.isSendsAreToggled() ? 4 : 0));
break;
case 7:
if (this.surface.isShiftPressed())
this.handleSendEffect(this.configuration.isSendsAreToggled() ? 7 : 3);
else
this.moveUp();
break;
default:
this.handleSendEffect(index - (this.configuration.isSendsAreToggled() ? 0 : 4));
break;
}
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class TrackCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
if (event != ButtonEvent.DOWN)
return;
final PushConfiguration config = this.surface.getConfiguration();
if (this.surface.isShiftPressed()) {
config.setVUMetersEnabled(!config.isEnableVUMeters());
return;
}
final ModeManager modeManager = this.surface.getModeManager();
final Modes currentMode = modeManager.getActiveID();
if (currentMode != null) {
if (config.isPush2()) {
if (Modes.TRACK.equals(currentMode) || Modes.VOLUME.equals(currentMode) || Modes.CROSSFADER.equals(currentMode) || Modes.PAN.equals(currentMode)) {
this.model.toggleCurrentTrackBank();
} else if (currentMode.ordinal() >= Modes.SEND1.ordinal() && currentMode.ordinal() <= Modes.SEND8.ordinal()) {
modeManager.setActive(Modes.TRACK);
this.model.toggleCurrentTrackBank();
} else
modeManager.setActive(config.getCurrentMixMode());
} else {
// Layer mode selection for Push 1
if (this.surface.isSelectPressed() && Modes.isLayerMode(currentMode)) {
modeManager.setActive(Modes.DEVICE_LAYER);
return;
}
if (Modes.TRACK.equals(currentMode))
this.model.toggleCurrentTrackBank();
else
modeManager.setActive(Modes.TRACK);
}
} else
modeManager.setActive(Modes.TRACK);
config.setDebugMode(modeManager.getActiveID());
final ITrackBank tb = this.model.getCurrentTrackBank();
final Optional<ITrack> track = tb.getSelectedItem();
if (track.isEmpty())
tb.getItem(0).select();
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class FaderTouchCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
final HUIConfiguration configuration = this.surface.getConfiguration();
final ModeManager modeManager = this.surface.getModeManager();
if (event == ButtonEvent.DOWN)
modeManager.setActive(Modes.VOLUME);
else if (event == ButtonEvent.UP)
modeManager.restore();
if (configuration.isTouchChannel())
super.executeNormal(event);
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class ModeSwitcher method scrollDown.
/**
* Scroll downwards through the modes.
*/
public void scrollDown() {
final ModeManager modeManager = this.surface.getModeManager();
final Modes activeModeId = modeManager.getActiveID();
if (Modes.PAN == activeModeId) {
modeManager.setActive(Modes.DEVICE_PARAMS);
this.surface.getDisplay().notify("Parameters");
} else if (Modes.VOLUME == activeModeId) {
modeManager.setActive(Modes.PAN);
this.surface.getDisplay().notify("Panorama");
} else if (Modes.TRACK == activeModeId) {
modeManager.setActive(Modes.VOLUME);
this.surface.getDisplay().notify("Volume");
} else {
modeManager.setActive(Modes.TRACK);
this.surface.getDisplay().notify("Track");
}
}
Aggregations