use of de.mossgrabers.framework.featuregroup.IView in project DrivenByMoss by git-moss.
the class ShiftView method onGridNote.
/**
* {@inheritDoc}
*/
@Override
public void onGridNote(final int note, final int velocity) {
if (velocity == 0)
return;
int viewIndex;
IView view;
final ICursorDevice cursorDevice = this.model.getCursorDevice();
switch(note - 36) {
// Play
case 0:
this.playCommand.executeNormal(ButtonEvent.UP);
break;
// Record
case 1:
this.model.getTransport().startRecording();
break;
// Repeat
case 2:
this.model.getTransport().toggleLoop();
break;
// Click
case 3:
this.model.getTransport().toggleMetronome();
break;
// Tap Tempo
case 4:
this.model.getTransport().tapTempo();
break;
// Insert device before current
case 5:
this.model.getBrowser().insertBeforeCursorDevice();
break;
// Insert device after current
case 6:
this.model.getBrowser().insertAfterCursorDevice();
break;
// Open the browser
case 7:
this.model.getBrowser().replace(cursorDevice);
break;
// Toggle window of VSTs
case 15:
cursorDevice.toggleWindowOpen();
break;
default:
viewIndex = note - 44;
if (viewIndex < 0 || viewIndex >= 6)
return;
final ViewManager viewManager = this.surface.getViewManager();
final Views viewId = VIEWS[viewIndex];
viewManager.setPreviousID(viewId);
view = viewManager.get(viewId);
this.surface.getDisplay().notify(view.getName());
break;
}
}
use of de.mossgrabers.framework.featuregroup.IView in project DrivenByMoss by git-moss.
the class ButtonRowSelectCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
if (event != ButtonEvent.DOWN)
return;
final IView view = this.surface.getViewManager().getActive();
if (view == null)
return;
final ModeManager modeManager = this.surface.getModeManager();
switch(this.row) {
case 0:
((SLView) view).onButtonRow1Select();
break;
case 1:
modeManager.setActive(Modes.DEVICE_PARAMS);
this.model.getHost().showNotification("Device Parameters");
break;
case 2:
((SLView) view).onButtonRow2Select();
break;
case 3:
modeManager.setActive(Modes.TRACK);
this.model.getHost().showNotification("Track");
break;
case 4:
break;
case 5:
case 6:
case 7:
modeManager.setActive(Modes.VOLUME);
this.model.getHost().showNotification("Volume");
break;
default:
// Intentionally empty
break;
}
}
use of de.mossgrabers.framework.featuregroup.IView in project DrivenByMoss by git-moss.
the class Kontrol1ControllerSetup method handleTrackChange.
/**
* Handle a track selection change.
*
* @param isSelected Has the track been selected?
*/
private void handleTrackChange(final boolean isSelected) {
if (!isSelected)
return;
this.host.scheduleTask(() -> {
final Kontrol1ControlSurface surface = this.getSurface();
final IView activeView = surface.getViewManager().getActive();
if (activeView != null) {
activeView.updateNoteMapping();
activeView.drawGrid();
}
if (this.model.canSelectedTrackHoldNotes()) {
final IDrumDevice primary = this.model.getDrumDevice();
if (primary.hasDrumPads())
primary.getDrumPadBank().scrollTo(0);
}
}, 100);
}
use of de.mossgrabers.framework.featuregroup.IView in project DrivenByMoss by git-moss.
the class NoteViewSelectMode method updateDisplay1.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay1(final ITextDisplay display) {
final ViewManager viewManager = this.surface.getViewManager();
display.setBlock(1, 0, "Sequence:");
display.setBlock(2, 0, "Play:");
display.setBlock(2, 3, "Tools:");
for (int i = 0; i < VIEWS.length; i++) {
if (VIEWS[i] != null) {
final IView view = viewManager.get(VIEWS[i]);
String value = "";
if (view != null)
value = (viewManager.isActive(VIEWS[i]) ? Push1Display.SELECT_ARROW : "") + StringUtils.optimizeName(view.getName(), 8);
display.setCell(3, i, value);
}
if (VIEWS_TOP[i] != null) {
final IView view = viewManager.get(VIEWS_TOP[i]);
String value = "";
if (view != null)
value = (viewManager.isActive(VIEWS_TOP[i]) ? Push1Display.SELECT_ARROW : "") + StringUtils.optimizeName(view.getName(), 8);
display.setCell(0, i, value);
}
}
}
use of de.mossgrabers.framework.featuregroup.IView in project DrivenByMoss by git-moss.
the class NoteViewSelectMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2(final IGraphicDisplay display) {
final ViewManager viewManager = this.surface.getViewManager();
for (int i = 0; i < VIEWS.length; i++) {
String menuBottomName = "";
if (VIEWS[i] != null) {
final IView view = viewManager.get(VIEWS[i]);
if (view != null)
menuBottomName = view.getName();
}
final String menuTopName = VIEWS_TOP[i] == null ? "" : viewManager.get(VIEWS_TOP[i]).getName();
final boolean isMenuBottomSelected = VIEWS[i] != null && viewManager.isActive(VIEWS[i]);
final boolean isMenuTopSelected = VIEWS_TOP[i] != null && viewManager.isActive(VIEWS_TOP[i]);
String titleBottom = "";
String titleTop = "";
if (i == 0) {
titleTop = "Sequence";
titleBottom = "Play";
} else if (i == 6)
titleBottom = "Tools";
display.addOptionElement(titleTop, menuTopName, isMenuTopSelected, titleBottom, menuBottomName, isMenuBottomSelected, false);
}
}
Aggregations