use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.
the class ControlView method onButtonRow1Select.
/**
* {@inheritDoc}
*/
@Override
public void onButtonRow1Select() {
final ModeManager modeManager = this.surface.getModeManager();
modeManager.setActiveMode(modeManager.getActiveModeId() == Modes.MODE_FUNCTIONS ? Modes.MODE_FIXED : Modes.MODE_FUNCTIONS);
}
use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.
the class PlayView method onButtonRow1.
/**
* {@inheritDoc}
*/
@Override
public void onButtonRow1(final int index, final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ModeManager modeManager = this.surface.getModeManager();
final Integer activeModeId = modeManager.getActiveModeId();
if (activeModeId == Modes.MODE_VIEW_SELECT) {
if (index == 0) {
this.surface.getViewManager().setActiveView(Views.VIEW_CONTROL);
if (modeManager.getPreviousModeId() == Modes.MODE_VOLUME)
modeManager.restoreMode();
else
modeManager.setActiveMode(Modes.MODE_TRACK);
} else
modeManager.restoreMode();
this.surface.turnOffTransport();
return;
}
if (activeModeId != Modes.MODE_SESSION)
modeManager.setActiveMode(Modes.MODE_SESSION);
this.model.getSceneBank().launchScene(index);
}
use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.
the class PlayView method onButtonRow2.
/**
* {@inheritDoc}
*/
@Override
public void onButtonRow2(final int index, final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ModeManager modeManager = this.surface.getModeManager();
final Integer cm = modeManager.getActiveModeId();
if (cm != Modes.MODE_PLAY_OPTIONS)
modeManager.setActiveMode(Modes.MODE_PLAY_OPTIONS);
switch(index) {
// Down
case 0:
this.clearPressedKeys();
this.scales.decDrumOctave();
this.model.getPrimaryDevice().scrollDrumPadsPageUp();
this.offsetY = Scales.DRUM_NOTE_START + this.scales.getDrumOctave() * 16;
this.updateNoteMapping();
this.surface.getDisplay().notify(this.scales.getDrumRangeText());
break;
// Up
case 1:
this.clearPressedKeys();
this.scales.incDrumOctave();
this.model.getPrimaryDevice().scrollDrumPadsPageDown();
this.offsetY = Scales.DRUM_NOTE_START + this.scales.getDrumOctave() * 16;
this.updateNoteMapping();
this.surface.getDisplay().notify(this.scales.getDrumRangeText());
break;
case 2:
this.changeResolution(0);
this.surface.getDisplay().notify(RESOLUTION_TEXTS[this.selectedIndex]);
break;
case 3:
this.changeResolution(127);
this.surface.getDisplay().notify(RESOLUTION_TEXTS[this.selectedIndex]);
break;
case 4:
this.changeScrollPosition(0);
break;
case 5:
this.changeScrollPosition(127);
break;
case 6:
break;
// Toggle play / sequencer
case 7:
this.isPlayMode = !this.isPlayMode;
this.surface.getDisplay().notify(this.isPlayMode ? "Play/Select" : "Sequence");
this.updateNoteMapping();
break;
default:
// Intentionally empty
break;
}
}
use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.
the class PlayView method onButtonP1.
/**
* {@inheritDoc}
*/
@Override
public void onButtonP1(final boolean isUp, final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final Integer activeModeId = this.surface.getModeManager().getActiveModeId();
if (activeModeId == Modes.MODE_SESSION) {
if (isUp)
this.model.getSceneBank().scrollScenesPageDown();
else
this.model.getSceneBank().scrollScenesPageUp();
return;
}
if (activeModeId == Modes.MODE_VOLUME) {
new P2ButtonCommand(isUp, this.model, this.surface).execute(event);
return;
}
if (activeModeId == Modes.MODE_TRACK || activeModeId == Modes.MODE_MASTER) {
new ButtonRowSelectCommand<>(3, this.model, this.surface).execute(event);
return;
}
if (activeModeId == Modes.MODE_PLAY_OPTIONS)
return;
final ModeManager modeManager = this.surface.getModeManager();
if (isUp)
((DeviceParamsMode) modeManager.getMode(Modes.MODE_PARAMS)).nextPage();
else
((DeviceParamsMode) modeManager.getMode(Modes.MODE_PARAMS)).previousPage();
}
use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.
the class SequencerView method onGridNoteLongPress.
/**
* {@inheritDoc}
*/
@Override
public void onGridNoteLongPress(final int note) {
if (!this.model.canSelectedTrackHoldNotes())
return;
this.surface.setGridNoteConsumed(note);
final int index = note - 36;
final int y = index / 8;
if (y >= this.numSequencerRows)
return;
// TODO Bugfix required - setStep makes Bitwig hang
// https://github.com/teotigraphix/Framework4Bitwig/issues/124
final int x = index % 8;
final ICursorClip cursorClip = this.model.getCursorClip(8, 128);
final int state = cursorClip.getStep(x, this.noteMap[y]);
final ModeManager modeManager = this.surface.getModeManager();
final NoteMode noteMode = (NoteMode) modeManager.getMode(Modes.MODE_NOTE);
noteMode.setValues(cursorClip, x, note, state == 2 ? 1.0 : 0, 127);
modeManager.setActiveMode(Modes.MODE_NOTE);
}
Aggregations