use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.
the class TrackKnobRowCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final int value) {
final ModeManager modeManager = this.surface.getModeManager();
Integer cm = modeManager.getActiveModeId();
if (cm != Modes.MODE_TRACK && cm != Modes.MODE_MASTER) {
modeManager.setActiveMode(Modes.MODE_TRACK);
cm = Modes.MODE_TRACK;
}
if (cm == Modes.MODE_MASTER) {
if (this.index == 0)
this.model.getMasterTrack().setVolume(value);
else if (this.index == 1)
this.model.getMasterTrack().setPan(value);
return;
}
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack track = tb.getSelectedTrack();
if (track == null)
return;
switch(this.index) {
// Volume
case 0:
track.setVolume(value);
break;
// Pan
case 1:
track.setPan(value);
break;
case 2:
if (this.surface.getConfiguration().isDisplayCrossfader())
track.setCrossfadeModeAsNumber(value == 0 ? 0 : value == 127 ? 2 : 1);
else if (tb instanceof ITrackBank)
track.getSend(0).setValue(value);
break;
// Send 1 - 5
default:
if (tb instanceof ITrackBank)
track.getSend(this.index - (this.surface.getConfiguration().isDisplayCrossfader() ? 3 : 2)).setValue(value);
break;
}
}
use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.
the class ButtonRowSelectCommand method onSliderRowSelect.
private void onSliderRowSelect() {
final ModeManager modeManager = this.surface.getModeManager();
if (!modeManager.isActiveMode(Modes.MODE_VOLUME)) {
modeManager.setActiveMode(Modes.MODE_VOLUME);
this.activateTrackMode(false, false);
return;
}
if (this.model.getMasterTrack().isSelected())
this.activateTrackMode(false, false);
else if (this.model.isEffectTrackBankActive())
this.activateMasterMode(false);
else
this.activateTrackMode(false, true);
}
Aggregations