use of de.mossgrabers.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class TrackMode method onKnobTouch.
/**
* {@inheritDoc}
*/
@Override
public void onKnobTouch(final int index, final boolean isTouched) {
final Optional<ITrack> track = this.model.getCurrentTrackBank().getSelectedItem();
if (track.isEmpty())
return;
final ITrack t = track.get();
switch(index) {
case 0:
if (isTouched && this.surface.isDeletePressed())
t.resetVolume();
t.touchVolume(isTouched);
break;
case 1:
if (isTouched && this.surface.isDeletePressed())
t.resetPan();
t.touchPan(isTouched);
break;
default:
final ISendBank sendBank = t.getSendBank();
if (!sendBank.hasExistingItems())
return;
final ISend item = sendBank.getItem(index - 2);
if (isTouched && this.surface.isDeletePressed())
item.resetValue();
item.touchValue(isTouched);
break;
}
}
use of de.mossgrabers.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class TrackMode method onKnobValue.
/**
* {@inheritDoc}
*/
@Override
public void onKnobValue(final int index, final int value) {
final Optional<ITrack> track = this.model.getCurrentTrackBank().getSelectedItem();
if (track.isEmpty())
return;
final ITrack t = track.get();
switch(index) {
case 0:
if (this.isAbsolute)
t.setVolume(value);
else
t.changeVolume(value);
break;
case 1:
if (this.isAbsolute)
t.setPan(value);
else
t.changePan(value);
break;
default:
final ISendBank sendBank = t.getSendBank();
if (!sendBank.hasExistingItems())
return;
final ISend send = sendBank.getItem(index - 2);
if (this.isAbsolute)
send.setValue(value);
else
send.changeValue(value);
break;
}
}
Aggregations