use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class VolumeMode method onValueKnobTouch.
/**
* {@inheritDoc}
*/
@Override
public void onValueKnobTouch(final int index, final boolean isTouched) {
this.isKnobTouched[index] = isTouched;
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack t = tb.getTrack(index);
if (!t.doesExist())
return;
if (isTouched) {
if (this.surface.isDeletePressed()) {
this.surface.setButtonConsumed(this.surface.getDeleteButtonId());
t.resetVolume();
} else
this.surface.getDisplay().notify("Volume: " + t.getVolumeStr(8));
}
t.touchVolume(isTouched);
this.checkStopAutomationOnKnobRelease(isTouched);
}
use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class ColorView method onGridNote.
/**
* {@inheritDoc}
*/
@Override
public void onGridNote(final int note, final int velocity) {
if (velocity == 0)
return;
final int color = note - 36;
if (color < BitwigColors.BITWIG_COLORS.length) {
final double[] entry = BitwigColors.getColorEntry(BitwigColors.BITWIG_COLORS[color]);
switch(this.mode) {
case MODE_TRACK:
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack t = tb.getSelectedTrack();
if (t == null) {
final IMasterTrack master = this.model.getMasterTrack();
if (master.isSelected())
master.setColor(entry[0], entry[1], entry[2]);
} else
t.setColor(entry[0], entry[1], entry[2]);
break;
case MODE_LAYER:
final ICursorDevice cd = this.model.getCursorDevice();
final IChannel deviceChain = cd.getSelectedLayerOrDrumPad();
cd.setLayerOrDrumPadColor(deviceChain.getIndex(), entry[0], entry[1], entry[2]);
break;
case MODE_CLIP:
final ICursorClip clip = this.model.getCursorClip();
if (clip != null)
clip.setColor(entry[0], entry[1], entry[2]);
break;
}
}
this.surface.getViewManager().restoreView();
}
use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class DrumViewBase method onScene.
/**
* {@inheritDoc}
*/
@Override
public void onScene(final int index, final ButtonEvent event) {
if (event != ButtonEvent.DOWN || !this.model.canSelectedTrackHoldNotes())
return;
if (!this.surface.isShiftPressed()) {
super.onScene(index, event);
return;
}
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack selectedTrack = tb.getSelectedTrack();
if (selectedTrack != null)
this.onLowerScene(index);
}
use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class PanSendCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
final ModeManager modeManager = this.surface.getModeManager();
final Integer currentMode = modeManager.getActiveModeId();
// Layer mode selection for Push 1
Integer mode;
final PushConfiguration config = this.surface.getConfiguration();
if (!config.isPush2() && this.surface.isSelectPressed() && Modes.isLayerMode(currentMode)) {
if (this.model.isEffectTrackBankActive()) {
// No Sends on FX tracks
mode = Modes.MODE_DEVICE_LAYER_PAN;
} else {
mode = Integer.valueOf(currentMode.intValue() + 1);
// Wrap
if (mode.intValue() < Modes.MODE_DEVICE_LAYER_PAN.intValue() || mode.intValue() > Modes.MODE_DEVICE_LAYER_SEND6.intValue())
mode = Modes.MODE_DEVICE_LAYER_PAN;
// Check if Send channel exists
if (mode.intValue() >= Modes.MODE_DEVICE_LAYER_SEND1.intValue() && mode.intValue() <= Modes.MODE_DEVICE_LAYER_SEND6.intValue() && fxTrackBank != null && !fxTrackBank.getTrack(mode.intValue() - Modes.MODE_DEVICE_LAYER_SEND1.intValue()).doesExist())
mode = Modes.MODE_DEVICE_LAYER_PAN;
}
modeManager.setActiveMode(mode);
return;
}
if (this.model.isEffectTrackBankActive()) {
// No Sends on FX tracks
mode = Modes.MODE_PAN;
} else {
mode = Integer.valueOf(currentMode.intValue() + 1);
// Wrap
if (mode.intValue() < Modes.MODE_PAN.intValue() || mode.intValue() > Modes.MODE_SEND6.intValue())
mode = Modes.MODE_PAN;
// Check if Send channel exists
if (mode.intValue() >= Modes.MODE_SEND1.intValue() && mode.intValue() <= Modes.MODE_SEND6.intValue() && fxTrackBank != null && !fxTrackBank.getTrack(mode.intValue() - Modes.MODE_SEND1.intValue()).doesExist())
mode = Modes.MODE_PAN;
}
modeManager.setActiveMode(mode);
}
use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.
the class SelectPlayViewCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ViewManager viewManager = this.surface.getViewManager();
if (Views.isSessionView(viewManager.getActiveViewId())) {
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack selectedTrack = tb.getSelectedTrack();
if (selectedTrack == null) {
this.surface.getDisplay().notify("Please select a track first.");
return;
}
final Integer preferredView = viewManager.getPreferredView(selectedTrack.getPosition());
viewManager.setActiveView(preferredView == null ? Views.VIEW_PLAY : preferredView);
return;
}
final ModeManager modeManager = this.surface.getModeManager();
if (modeManager.isActiveMode(Modes.MODE_VIEW_SELECT))
modeManager.restoreMode();
else
modeManager.setActiveMode(Modes.MODE_VIEW_SELECT);
}
Aggregations