use of de.mossgrabers.framework.daw.data.bank.ISceneBank in project DrivenByMoss by git-moss.
the class MixerMode method getKnobValue.
/**
* {@inheritDoc}
*/
@Override
public int getKnobValue(final int index) {
// Note: Since we need multiple value (more than 8), index is the MIDI CC of the knob
final IValueChanger valueChanger = this.model.getValueChanger();
if (index >= KontrolProtocolControlSurface.KONTROL_TRACK_VOLUME && index < KontrolProtocolControlSurface.KONTROL_TRACK_VOLUME + 8) {
final ITrack track = this.bank.getItem(index - KontrolProtocolControlSurface.KONTROL_TRACK_VOLUME);
return valueChanger.toMidiValue(track.getVolume());
}
if (index >= KontrolProtocolControlSurface.KONTROL_TRACK_PAN && index < KontrolProtocolControlSurface.KONTROL_TRACK_PAN + 8) {
final ITrack track = this.bank.getItem(index - KontrolProtocolControlSurface.KONTROL_TRACK_PAN);
return valueChanger.toMidiValue(track.getPan());
}
final Optional<ITrack> selectedTrack = this.bank.getSelectedItem();
final int scrollTracksState = (this.bank.canScrollBackwards() ? 1 : 0) + (this.bank.canScrollForwards() ? 2 : 0);
int scrollClipsState = 0;
if (selectedTrack.isPresent()) {
final ISlotBank slotBank = selectedTrack.get().getSlotBank();
scrollClipsState = (slotBank.canScrollBackwards() ? 1 : 0) + (slotBank.canScrollForwards() ? 2 : 0);
}
final ISceneBank sceneBank = this.model.getSceneBank();
final int scrollScenesState = (sceneBank.canScrollBackwards() ? 1 : 0) + (sceneBank.canScrollForwards() ? 2 : 0);
final KontrolProtocolConfiguration configuration = this.surface.getConfiguration();
switch(index) {
case KontrolProtocolControlSurface.KONTROL_NAVIGATE_BANKS:
return (this.bank.canScrollPageBackwards() ? 1 : 0) + (this.bank.canScrollPageForwards() ? 2 : 0);
case KontrolProtocolControlSurface.KONTROL_NAVIGATE_TRACKS:
if (configuration.isFlipTrackClipNavigation())
return configuration.isFlipClipSceneNavigation() ? scrollScenesState : scrollClipsState;
return scrollTracksState;
case KontrolProtocolControlSurface.KONTROL_NAVIGATE_CLIPS:
if (configuration.isFlipTrackClipNavigation())
return scrollTracksState;
return configuration.isFlipClipSceneNavigation() ? scrollScenesState : scrollClipsState;
default:
return 0;
}
}
use of de.mossgrabers.framework.daw.data.bank.ISceneBank in project DrivenByMoss by git-moss.
the class SessionView method getButtonColor.
/**
* {@inheritDoc}
*/
@Override
public int getButtonColor(final ButtonID buttonID) {
final ColorManager colorManager = this.model.getColorManager();
final int colorScene = colorManager.getColorIndex(AbstractSessionView.COLOR_SCENE);
final int colorSceneSelected = colorManager.getColorIndex(AbstractSessionView.COLOR_SELECTED_SCENE);
final int colorSceneOff = colorManager.getColorIndex(AbstractSessionView.COLOR_SCENE_OFF);
final ISceneBank sceneBank = this.model.getSceneBank();
IScene s = sceneBank.getItem(0);
if (buttonID == ButtonID.SCENE1) {
if (!s.doesExist())
return colorSceneOff;
return s.isSelected() ? colorSceneSelected : colorScene;
}
if (this.padMode == null) {
s = sceneBank.getItem(1);
if (!s.doesExist())
return colorSceneOff;
return s.isSelected() ? colorSceneSelected : colorScene;
}
switch(this.padMode) {
case REC_ARM:
return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_RED_HI;
case TRACK_SELECT:
return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_WHITE;
case MUTE:
return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_AMBER_HI;
case SOLO:
return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_YELLOW_HI;
case STOP_CLIP:
return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_ROSE;
default:
return LaunchkeyMiniMk3ColorManager.LAUNCHKEY_COLOR_BLACK;
}
}
use of de.mossgrabers.framework.daw.data.bank.ISceneBank in project DrivenByMoss by git-moss.
the class ChordsView method getButtonColorID.
/**
* {@inheritDoc}
*/
@Override
public String getButtonColorID(final ButtonID buttonID) {
if (!ButtonID.isSceneButton(buttonID))
return AbstractFeatureGroup.BUTTON_COLOR_OFF;
if (this.surface.isPressed(ButtonID.REPEAT))
return NoteRepeatSceneHelper.getButtonColorID(this.surface, buttonID);
final ISceneBank sceneBank = this.model.getSceneBank();
final int scene = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
final IScene s = sceneBank.getItem(scene);
if (s.doesExist())
return s.isSelected() ? AbstractSessionView.COLOR_SELECTED_SCENE : AbstractSessionView.COLOR_SCENE;
return AbstractSessionView.COLOR_SCENE_OFF;
}
use of de.mossgrabers.framework.daw.data.bank.ISceneBank in project DrivenByMoss by git-moss.
the class PlayView method getButtonColorID.
/**
* {@inheritDoc}
*/
@Override
public String getButtonColorID(final ButtonID buttonID) {
if (!ButtonID.isSceneButton(buttonID))
return AbstractFeatureGroup.BUTTON_COLOR_OFF;
if (this.surface.isPressed(ButtonID.REPEAT))
return NoteRepeatSceneHelper.getButtonColorID(this.surface, buttonID);
final ISceneBank sceneBank = this.model.getSceneBank();
final int scene = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
final IScene s = sceneBank.getItem(scene);
if (s.doesExist())
return s.isSelected() ? AbstractSessionView.COLOR_SELECTED_SCENE : AbstractSessionView.COLOR_SCENE;
return AbstractSessionView.COLOR_SCENE_OFF;
}
use of de.mossgrabers.framework.daw.data.bank.ISceneBank in project DrivenByMoss by git-moss.
the class SessionView method getButtonColorID.
/**
* {@inheritDoc}
*/
@Override
public String getButtonColorID(final ButtonID buttonID) {
final int scene = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
if (scene < 0 || scene >= 8)
return AbstractFeatureGroup.BUTTON_COLOR_OFF;
final ISceneBank sceneBank = this.model.getSceneBank();
final IScene s = sceneBank.getItem(scene);
if (s.doesExist())
return s.isSelected() ? AbstractSessionView.COLOR_SELECTED_SCENE : AbstractSessionView.COLOR_SCENE;
return AbstractSessionView.COLOR_SCENE_OFF;
}
Aggregations