use of de.mossgrabers.framework.daw.data.bank.ISendBank 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.bank.ISendBank 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;
}
}
use of de.mossgrabers.framework.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class TrackMode method getKnobValue.
/**
* {@inheritDoc}
*/
@Override
public int getKnobValue(final int index) {
final Optional<ITrack> track = this.model.getCurrentTrackBank().getSelectedItem();
if (track.isEmpty())
return -1;
final ITrack t = track.get();
switch(index) {
case 0:
return t.getVolume();
case 1:
return t.getPan();
default:
final ISendBank sendBank = t.getSendBank();
if (!sendBank.hasExistingItems())
return 0;
return sendBank.getItem(index - 2).getValue();
}
}
use of de.mossgrabers.framework.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class SendLayerOrDrumPadParameterProvider method get.
/**
* {@inheritDoc}
*/
@Override
public IParameter get(final int index) {
if (this.sendIndex == -1) {
final Optional<? extends IChannel> channel = this.bank.getSelectedItem();
if (channel.isEmpty())
return EmptyParameter.INSTANCE;
final ISendBank sendBank = channel.get().getSendBank();
return sendBank.getItemCount() > 0 ? sendBank.getItem(index) : EmptyParameter.INSTANCE;
}
final ISendBank sendBank = this.bank.getItem(index).getSendBank();
return sendBank.getItemCount() == 0 ? EmptyParameter.INSTANCE : sendBank.getItem(this.sendIndex);
}
use of de.mossgrabers.framework.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class MaschineSendSelectCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
final ModeManager modeManager = this.surface.getModeManager();
final Modes activeMode = modeManager.getActiveID();
super.executeNormal(event);
final Modes newMode = modeManager.getActiveID();
if (activeMode == newMode)
return;
final int sendIndex = newMode.ordinal() - Modes.SEND1.ordinal();
final Optional<ITrack> t = this.model.getCurrentTrackBank().getSelectedItem();
if (t.isEmpty())
return;
final ISendBank sendBank = t.get().getSendBank();
final ISend send = sendBank.getItem(sendIndex);
if (send.doesExist())
this.surface.getDisplay().notify("Send " + (sendIndex + 1) + ": " + send.getName());
}
Aggregations