use of de.mossgrabers.framework.daw.data.ICursorDevice in project DrivenByMoss by git-moss.
the class DeviceHandler method scrollParameterBank.
private void scrollParameterBank(final KnobMode knobMode, final MidiValue value) {
if (isAbsolute(knobMode) || !this.increaseKnobMovement())
return;
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final IParameterBank parameterBank = cursorDevice.getParameterBank();
if (this.isIncrease(knobMode, value))
parameterBank.selectNextPage();
else
parameterBank.selectPreviousPage();
this.mvHelper.notifySelectedParameterPage();
}
use of de.mossgrabers.framework.daw.data.ICursorDevice 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.ICursorDevice 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.ICursorDevice 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.ICursorDevice in project DrivenByMoss by git-moss.
the class ParamsMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final Kontrol1Display d = (Kontrol1Display) this.surface.getDisplay();
d.clear();
if (this.model.hasSelectedDevice()) {
final ICursorDevice cursorDevice = this.model.getCursorDevice();
d.setCell(0, 0, cursorDevice.getName(8).toUpperCase(Locale.US));
final Optional<String> selectedItem = cursorDevice.getParameterPageBank().getSelectedItem();
if (selectedItem.isPresent())
d.setCell(1, 0, selectedItem.get().toUpperCase(Locale.US));
for (int i = 0; i < 8; i++) {
final IParameter p = this.bank.getItem(i);
final String name = StringUtils.shortenAndFixASCII(p.getName(8), 8).toUpperCase(Locale.US);
if (!name.isEmpty())
d.setCell(0, 1 + i, name).setCell(1, 1 + i, checkForUpperCase(StringUtils.shortenAndFixASCII(p.getDisplayedValue(8), 8)));
d.setBar(1 + i, this.surface.getContinuous(ContinuousID.get(ContinuousID.KNOB1, i)).isTouched() && p.doesExist(), p.getValue());
}
} else
d.setCell(0, 3, " PLEASE").setCell(0, 4, "SELECT A").setCell(0, 5, "DEVICE").allDone();
d.allDone();
}
Aggregations