use of de.mossgrabers.framework.daw.data.ILayer in project DrivenByMoss by git-moss.
the class DeviceLayerRightCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ICursorDevice cd = this.model.getCursorDevice();
final IChannelBank<ILayer> bank = cd.getLayerBank();
final Optional<ILayer> sel = bank.getSelectedItem();
if (!cd.hasLayers() || sel.isEmpty())
cd.selectNext();
else
bank.selectNextItem();
}
use of de.mossgrabers.framework.daw.data.ILayer in project DrivenByMoss by git-moss.
the class DeviceLayerRightCommand method executeShifted.
/**
* {@inheritDoc}
*/
@Override
public void executeShifted(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
// Enter layer
final ICursorDevice cd = this.model.getCursorDevice();
if (!cd.hasLayers())
return;
final IChannelBank<ILayer> bank = cd.getLayerBank();
final Optional<ILayer> layer = bank.getSelectedItem();
if (layer.isEmpty())
bank.getItem(0).select();
else
layer.get().enter();
}
use of de.mossgrabers.framework.daw.data.ILayer in project DrivenByMoss by git-moss.
the class DeviceLayerLeftCommand method canExecute.
/**
* Check if the command can be executed.
*
* @return True if it can
*/
public boolean canExecute() {
if (this.surface.isShiftPressed())
return true;
final ICursorDevice cd = this.model.getCursorDevice();
final IChannelBank<ILayer> bank = cd.getLayerBank();
final Optional<ILayer> layer = bank.getSelectedItem();
return cd.hasLayers() && layer.isPresent() ? bank.canScrollBackwards() : cd.canSelectPreviousFX();
}
use of de.mossgrabers.framework.daw.data.ILayer 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;
}
}
Aggregations