use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class PolySequencerView method onButton.
/**
* {@inheritDoc}
*/
@Override
public void onButton(final ButtonID buttonID, final ButtonEvent event, final int velocity) {
if (event != ButtonEvent.DOWN || !this.isActive())
return;
final ITrack cursorTrack = this.model.getCursorTrack();
final INoteClip clip = this.getClip();
switch(buttonID) {
case ARROW_LEFT:
if (this.surface.isPressed(ButtonID.ALT))
this.setResolutionIndex(this.selectedResolutionIndex - 1);
else {
clip.scrollStepsPageBackwards();
this.mvHelper.notifyEditPage(clip);
}
break;
case ARROW_RIGHT:
if (this.surface.isPressed(ButtonID.ALT))
this.setResolutionIndex(this.selectedResolutionIndex + 1);
else {
clip.scrollStepsPageForward();
this.mvHelper.notifyEditPage(clip);
}
break;
case SCENE1:
cursorTrack.stop();
break;
case SCENE2:
cursorTrack.toggleMute();
break;
case SCENE3:
cursorTrack.toggleSolo();
break;
case SCENE4:
cursorTrack.toggleRecArm();
break;
default:
// Not used
break;
}
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class TrackView method onKnob.
/**
* {@inheritDoc}
*/
@Override
public void onKnob(final int index, final int value, final boolean isTurnedRight) {
if (index < 12) {
this.extensions.onTrackKnob(index, value, isTurnedRight);
return;
}
final ITrackBank tb = this.model.getCurrentTrackBank();
final Optional<ITrack> selectedTrack = tb.getSelectedItem();
if (selectedTrack.isEmpty())
return;
switch(index) {
// Send 5 - 6
case 12:
case 13:
if (!this.model.isEffectTrackBankActive())
selectedTrack.get().getSendBank().getItem(index - 8).changeValue(value);
break;
case 14:
// Not used
break;
// Crossfader
case 15:
this.model.getTransport().changeCrossfade(value);
break;
default:
// Not used
break;
}
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class SendsView method setupFader.
/**
* {@inheritDoc}
*/
@Override
public void setupFader(final int index) {
final ITrack track = this.model.getCurrentTrackBank().getItem(index);
final int color = this.colorManager.getColorIndex(DAWColor.getColorIndex(track.getColor()));
this.surface.setupFader(index, color, false);
final ISend send = track.getSendBank().getItem(this.selectedSend);
this.surface.setFaderValue(index, send.getValue());
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class MixView method getButtonColor.
/**
* {@inheritDoc}
*/
@Override
public int getButtonColor(final ButtonID buttonID) {
final int index = 7 - (buttonID.ordinal() - ButtonID.SCENE1.ordinal());
int color = 0;
int value = 0;
final Optional<ITrack> track = this.model.getCurrentTrackBank().getSelectedItem();
if (track.isPresent()) {
switch(this.faderMode) {
default:
case VOLUME:
value = track.get().getVolume();
color = LaunchpadColorManager.LAUNCHPAD_COLOR_CYAN;
break;
case PAN:
value = track.get().getPan();
color = LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI;
break;
case SEND1:
final ISend send1 = track.get().getSendBank().getItem(0);
value = send1.doesExist() ? send1.getValue() : 0;
color = LaunchpadColorManager.LAUNCHPAD_COLOR_ORCHID_HI;
break;
case SEND2:
final ISend send2 = track.get().getSendBank().getItem(1);
value = send2.doesExist() ? send2.getValue() : 0;
color = LaunchpadColorManager.LAUNCHPAD_COLOR_LIME_HI;
break;
}
}
this.fader.setup(color, this.faderMode == FaderMode.PAN);
this.fader.setValue(value);
return this.fader.getColorState(index);
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class SelectNoteViewCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
if (event != ButtonEvent.UP)
return;
final ViewManager viewManager = this.surface.getViewManager();
if (viewManager.isActive(Views.CONTROL)) {
viewManager.restore();
this.surface.getDisplay().notify(viewManager.getActive().getName());
return;
}
Views viewID = viewManager.getActiveID();
if (Views.isNoteView(viewID) || Views.isSequencerView(viewID)) {
viewManager.setActive(Views.CONTROL);
this.surface.getDisplay().notify("Note / sequencer mode selection");
return;
}
final ITrack cursorTrack = this.model.getCursorTrack();
if (!cursorTrack.doesExist()) {
viewManager.setActive(Views.SESSION);
this.surface.getDisplay().notify("Session");
return;
}
viewID = viewManager.getPreferredView(cursorTrack.getPosition());
if (viewID == null)
viewID = Views.PLAY;
viewManager.setActive(viewID);
this.surface.getDisplay().notify(viewManager.get(viewID).getName());
}
Aggregations