use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class SendsView method getButtonColor.
/**
* {@inheritDoc}
*/
@Override
public int getButtonColor(final ButtonID buttonID) {
final int ordinal = buttonID.ordinal();
if (ordinal < ButtonID.SCENE1.ordinal() || ordinal > ButtonID.SCENE8.ordinal())
return 0;
final int scene = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
if (this.selectedSend == scene)
return LaunchpadColorManager.LAUNCHPAD_COLOR_ORCHID;
final ITrackBank tb = this.model.getTrackBank();
if (tb.canEditSend(scene))
return LaunchpadColorManager.LAUNCHPAD_COLOR_GREY_LO;
return LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK;
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class SendsView method onButton.
/**
* {@inheritDoc}
*/
@Override
public void onButton(final ButtonID buttonID, final ButtonEvent event, final int velocity) {
if (!ButtonID.isSceneButton(buttonID) || event != ButtonEvent.DOWN)
return;
this.selectedSend = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
final ITrackBank tb = this.model.getTrackBank();
final String sendName = tb.getEditSendName(this.selectedSend);
final String message = "Send " + (this.selectedSend + 1) + ": " + (sendName.isEmpty() ? "None" : sendName);
this.surface.getTextDisplay().notify(message);
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class SessionView method getButtonColorID.
/**
* {@inheritDoc}
*/
@Override
public String getButtonColorID(final ButtonID buttonID) {
final int index = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
if (index >= 0 || index < 8) {
final ITrackBank tb = this.model.getCurrentTrackBank();
final ISceneBank sceneBank = tb.getSceneBank();
final IScene s = sceneBank.getItem(index);
if (s.doesExist())
return DAWColor.getColorIndex(s.getColor());
}
return AbstractFeatureGroup.BUTTON_COLOR_OFF;
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class ModeMultiSelectCommand method executeShifted.
/**
* {@inheritDoc}
*/
@Override
public void executeShifted(final ButtonEvent event) {
if (event != ButtonEvent.UP)
return;
final Modes activeModeId = this.modeManager.getActiveID();
Modes newMode = this.currentModeID;
// If coming from a mode not on the list, activate the last one
if (this.currentModeID.equals(activeModeId)) {
final ITrackBank trackBank = this.model.getTrackBank();
int index = this.modeIds.indexOf(activeModeId);
// If a send mode is selected check if the according send exists
do {
index--;
if (index < 0 || index >= this.modeIds.size())
index = this.modeIds.size() - 1;
newMode = this.modeIds.get(index);
} while (Modes.isSendMode(newMode) && !trackBank.canEditSend(newMode.ordinal() - Modes.SEND1.ordinal()));
}
this.activateMode(newMode);
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class MVHelper method notifySelectedTrack.
/**
* Display the name of the selected track.
*/
public void notifySelectedTrack() {
this.delayDisplay(() -> {
final ITrackBank currentTrackBank = this.model.getCurrentTrackBank();
final Optional<ITrack> selectedTrack = currentTrackBank.getSelectedItem();
if (selectedTrack.isEmpty())
return SELECTED_TRACK_NONE;
final ITrack t = selectedTrack.get();
if (!t.doesExist())
return SELECTED_TRACK_NONE;
return t.getPosition() + 1 + ": " + t.getName();
});
}
Aggregations