use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class AbstractDrumView64 method onOctaveUp.
/**
* {@inheritDoc}
*/
@Override
public void onOctaveUp(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
this.clearPressedKeys();
final int oldDrumOctave = this.drumOctave;
this.drumOctave = Math.min(1, this.drumOctave + 1);
this.offsetY = DRUM_START_KEY + this.drumOctave * 16;
this.updateNoteMapping();
this.surface.getDisplay().notify(this.getDrumRangeText(), true, true);
if (oldDrumOctave != this.drumOctave) {
final ICursorDevice drumDevice64 = this.model.getDrumDevice64();
// TODO Bugfix required: scrollChannelsUp scrolls the whole bank
for (int i = 0; i < 16; i++) drumDevice64.scrollDrumPadsDown();
}
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class MCUControllerSetup method updateButtons.
@SuppressWarnings("unchecked")
private void updateButtons() {
final MCUControlSurface surface = this.getSurface();
final Integer mode = surface.getModeManager().getActiveModeId();
if (mode == null)
return;
this.updateVUandFaders();
this.updateSegmentDisplay();
// Set button states
final ITransport t = this.model.getTransport();
final boolean isShift = surface.isShiftPressed();
final boolean isFlipRecord = this.configuration.isFlipRecord();
final boolean isRecordShifted = isShift && !isFlipRecord || !isShift && isFlipRecord;
final boolean isTrackOn = Modes.MODE_TRACK.equals(mode) || Modes.MODE_VOLUME.equals(mode);
final boolean isPanOn = Modes.MODE_PAN.equals(mode);
final boolean isSendOn = mode.intValue() >= Modes.MODE_SEND1.intValue() && mode.intValue() <= Modes.MODE_SEND8.intValue();
final boolean isDeviceOn = Modes.MODE_DEVICE_PARAMS.equals(mode);
final boolean isLEDOn = surface.isPressed(MCUControlSurface.MCU_OPTION) ? this.model.isCursorTrackPinned() : isTrackOn;
surface.updateButton(MCUControlSurface.MCU_MODE_IO, isLEDOn ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_MODE_PAN, isPanOn ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_MODE_SENDS, isSendOn ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final boolean isOn = surface.isPressed(MCUControlSurface.MCU_OPTION) ? cursorDevice.isPinned() : isDeviceOn;
surface.updateButton(MCUControlSurface.MCU_MODE_PLUGIN, isOn ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_USER, Modes.MODE_BROWSER.equals(mode) ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
final ITransport transport = this.model.getTransport();
final String automationWriteMode = transport.getAutomationWriteMode();
final boolean writingArrangerAutomation = transport.isWritingArrangerAutomation();
surface.updateButton(MCUControlSurface.MCU_F6, transport.isPunchInEnabled() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_F7, transport.isPunchOutEnabled() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_READ, !writingArrangerAutomation ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
final int writeState = writingArrangerAutomation && ITransport.AUTOMATION_MODES_VALUES[2].equals(automationWriteMode) ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF;
surface.updateButton(MCUControlSurface.MCU_WRITE, writeState);
surface.updateButton(MCUControlSurface.MCU_GROUP, writeState);
surface.updateButton(MCUControlSurface.MCU_TRIM, transport.isWritingClipLauncherAutomation() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_TOUCH, writingArrangerAutomation && ITransport.AUTOMATION_MODES_VALUES[1].equals(automationWriteMode) ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_LATCH, writingArrangerAutomation && ITransport.AUTOMATION_MODES_VALUES[0].equals(automationWriteMode) ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
final View view = surface.getViewManager().getView(Views.VIEW_CONTROL);
surface.updateButton(MCUControlSurface.MCU_REWIND, ((WindCommand<MCUControlSurface, MCUConfiguration>) view.getTriggerCommand(Commands.COMMAND_REWIND)).isRewinding() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_FORWARD, ((WindCommand<MCUControlSurface, MCUConfiguration>) view.getTriggerCommand(Commands.COMMAND_FORWARD)).isForwarding() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_REPEAT, t.isLoop() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_STOP, !t.isPlaying() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_PLAY, t.isPlaying() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_RECORD, isRecordShifted ? t.isLauncherOverdub() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF : t.isRecording() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_NAME_VALUE, surface.getConfiguration().isDisplayTrackNames() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_ZOOM, surface.getConfiguration().isZoomState() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_SCRUB, surface.getModeManager().isActiveMode(Modes.MODE_DEVICE_PARAMS) ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_MIDI_TRACKS, MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_INPUTS, MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_AUDIO_TRACKS, surface.isShiftPressed() && cursorDevice.isWindowOpen() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_AUDIO_INSTR, MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_CLICK, (isShift ? t.isMetronomeTicksOn() : t.isMetronomeOn()) ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_SOLO, this.model.getGroove().getParameters()[0].getValue() > 0 ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_REPLACE, (isShift ? t.isLauncherOverdub() : t.isArrangerOverdub()) ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_FLIP, this.model.isEffectTrackBankActive() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
final boolean displayTicks = this.configuration.isDisplayTicks();
surface.updateButton(MCUControlSurface.MCU_SMPTE_BEATS, displayTicks ? MCU_BUTTON_STATE_OFF : MCU_BUTTON_STATE_ON);
surface.updateButton(MCUControlSurface.MCU_SMPTE_LED, displayTicks ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
surface.updateButton(MCUControlSurface.MCU_BEATS_LED, displayTicks ? MCU_BUTTON_STATE_OFF : MCU_BUTTON_STATE_ON);
surface.updateButton(MCUControlSurface.MCU_MARKER, this.model.getArranger().areCueMarkersVisible() ? MCU_BUTTON_STATE_ON : MCU_BUTTON_STATE_OFF);
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class MCUControllerSetup method updateIndication.
private void updateIndication(final Integer mode) {
final ITrackBank tb = this.model.getTrackBank();
final IChannelBank tbe = this.model.getEffectTrackBank();
final boolean isEffect = this.model.isEffectTrackBankActive();
final boolean isPan = Modes.MODE_PAN.equals(mode);
final boolean isTrack = Modes.MODE_TRACK.equals(mode);
final boolean isDevice = Modes.MODE_DEVICE_PARAMS.equals(mode);
tb.setIndication(!isEffect);
tbe.setIndication(isEffect);
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final ITrack selectedTrack = tb.getSelectedTrack();
for (int i = 0; i < tb.getNumTracks(); i++) {
final boolean hasTrackSel = selectedTrack != null && selectedTrack.getIndex() == i && isTrack;
final ITrack track = tb.getTrack(i);
track.setVolumeIndication(!isEffect && (isTrack || hasTrackSel));
track.setPanIndication(!isEffect && (isPan || hasTrackSel));
for (int j = 0; j < tb.getNumSends(); j++) track.getSend(j).setIndication(!isEffect && (mode.intValue() - Modes.MODE_SEND1.intValue() == j || hasTrackSel));
final ITrack fxTrack = tbe.getTrack(i);
fxTrack.setVolumeIndication(isEffect);
fxTrack.setPanIndication(isEffect && isPan);
}
for (int i = 0; i < cursorDevice.getNumParameters(); i++) cursorDevice.indicateParameter(i, isDevice);
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class DeviceParamsMode method updateKnobLEDs.
/**
* {@inheritDoc}
*/
@Override
protected void updateKnobLEDs() {
final int upperBound = this.model.getValueChanger().getUpperBound();
final ICursorDevice cd = this.model.getCursorDevice();
final int extenderOffset = this.surface.getExtenderOffset();
for (int i = 0; i < 8; i++) {
final IParameter param = cd.getFXParam(extenderOffset + i);
this.surface.setKnobLED(i, MCUControlSurface.KNOB_LED_MODE_WRAP, param.doesExist() ? param.getValue() : 0, upperBound);
}
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class BaseMode method drawDisplay2.
protected void drawDisplay2() {
if (!this.surface.getConfiguration().hasDisplay2())
return;
final IChannelBank tb = this.model.getCurrentTrackBank();
// Format track names
final Display d2 = this.surface.getSecondDisplay();
final int extenderOffset = this.surface.getExtenderOffset();
final boolean isMainDevice = this.surface.isMainDevice();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getTrack(extenderOffset + i);
d2.setCell(0, i, StringUtils.shortenAndFixASCII(t.getName(), isMainDevice ? 6 : 7));
}
if (isMainDevice)
d2.setCell(0, 8, "Maste");
d2.done(0);
d2.clearRow(1);
if (isMainDevice) {
final IMasterTrack masterTrack = this.model.getMasterTrack();
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final ITrack selectedTrack = masterTrack.isSelected() ? masterTrack : tb.getSelectedTrack();
d2.setBlock(1, 0, "Sel.track: ").setBlock(1, 1, selectedTrack == null ? "None" : StringUtils.fixASCII(selectedTrack.getName()));
d2.setBlock(1, 2, "Sel.devce: ").setBlock(1, 3, cursorDevice.hasSelectedDevice() ? cursorDevice.getName() : "None");
}
d2.done(1);
}
Aggregations