use of de.mossgrabers.framework.daw.ITransport in project DrivenByMoss by git-moss.
the class PlayView method getButtonColor.
/**
* {@inheritDoc}
*/
@Override
public int getButtonColor(final ButtonID buttonID) {
final int buttonIDOrdinal = buttonID.ordinal();
// Button row 2: Track toggles
if (buttonIDOrdinal >= ButtonID.ROW1_1.ordinal() && buttonIDOrdinal <= ButtonID.ROW1_8.ordinal() || buttonIDOrdinal >= ButtonID.ROW2_1.ordinal() && buttonIDOrdinal <= ButtonID.ROW2_8.ordinal())
return SLControlSurface.MKII_BUTTON_STATE_OFF;
final Modes mode = this.surface.getModeManager().getActiveID();
final boolean isSession = Modes.SESSION == mode;
final boolean isDevice = Modes.DEVICE_PARAMS == mode;
final boolean isPlayOptions = Modes.PLAY_OPTIONS == mode;
final boolean isTrack = Modes.TRACK == mode;
final boolean isVolume = Modes.VOLUME == mode;
switch(buttonID) {
case ROW_SELECT_1:
return isSession ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
case ROW_SELECT_2:
return isDevice ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
case ROW_SELECT_3:
return isPlayOptions ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
case ROW_SELECT_4:
return isTrack ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
case ROW_SELECT_5:
return SLControlSurface.MKII_BUTTON_STATE_OFF;
case ROW_SELECT_6:
return isVolume ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
case ROW_SELECT_7:
case ROW_SELECT_8:
return SLControlSurface.MKII_BUTTON_STATE_OFF;
default:
// Fall through
break;
}
// Transport buttons
if (this.surface.isTransportActive()) {
if (buttonIDOrdinal >= ButtonID.ROW3_1.ordinal() && buttonIDOrdinal <= ButtonID.ROW3_8.ordinal())
return SLControlSurface.MKII_BUTTON_STATE_OFF;
final ITransport transport = this.model.getTransport();
switch(buttonID) {
case ROW4_3:
return !transport.isPlaying() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
case ROW4_4:
return transport.isPlaying() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
case ROW4_5:
return transport.isLoop() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
case ROW4_6:
return transport.isRecording() ? SLControlSurface.MKII_BUTTON_STATE_ON : SLControlSurface.MKII_BUTTON_STATE_OFF;
default:
return 0;
}
}
// Draw sequencer
return this.drawDrumGrid(buttonIDOrdinal);
}
use of de.mossgrabers.framework.daw.ITransport in project DrivenByMoss by git-moss.
the class MasterHandler method changeMasterCrossfader.
private void changeMasterCrossfader(final KnobMode knobMode, final MidiValue value) {
final ITransport transport = this.model.getTransport();
final int val = value.getValue();
final IParameter crossfadeParameter = transport.getCrossfadeParameter();
if (isAbsolute(knobMode))
crossfadeParameter.setValue(this.getAbsoluteValueChanger(value), val);
else
crossfadeParameter.changeValue(this.getRelativeValueChanger(knobMode), val);
}
use of de.mossgrabers.framework.daw.ITransport in project DrivenByMoss by git-moss.
the class ShiftView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final ITransport t = this.model.getTransport();
final IPadGrid padGrid = this.surface.getPadGrid();
padGrid.light(36, t.isPlaying() ? BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK : BeatstepColorManager.BEATSTEP_BUTTON_STATE_BLUE);
padGrid.light(37, t.isRecording() ? BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK : BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED);
padGrid.light(38, t.isLoop() ? BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK : BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
padGrid.light(39, t.isMetronomeOn() ? BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK : BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
padGrid.light(40, BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
padGrid.light(41, BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED);
padGrid.light(42, BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED);
padGrid.light(43, BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED);
padGrid.light(44, BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED);
padGrid.light(45, BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED);
padGrid.light(46, BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK);
padGrid.light(47, BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK);
padGrid.light(48, BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK);
padGrid.light(49, BeatstepColorManager.BEATSTEP_BUTTON_STATE_BLUE);
padGrid.light(50, BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
padGrid.light(51, BeatstepColorManager.BEATSTEP_BUTTON_STATE_PINK);
}
use of de.mossgrabers.framework.daw.ITransport in project DrivenByMoss by git-moss.
the class TransportHandler method handleMetronomeVolume.
private void handleMetronomeVolume(final KnobMode knobMode, final MidiValue value) {
final ITransport transport = this.model.getTransport();
final IParameter metronomeVolumeParameter = transport.getMetronomeVolumeParameter();
final int val = value.getValue();
if (isAbsolute(knobMode))
metronomeVolumeParameter.setValue(this.getAbsoluteValueChanger(value), val);
else
metronomeVolumeParameter.changeValue(this.getRelativeValueChanger(knobMode), val);
}
use of de.mossgrabers.framework.daw.ITransport in project DrivenByMoss by git-moss.
the class TransportHandler method handleTempo.
private void handleTempo(final KnobMode knobMode, final MidiValue value) {
final ITransport transport = this.model.getTransport();
if (isAbsolute(knobMode)) {
final int val = value.getValue();
transport.setTempo(transport.scaleTempo(val, value.isHighRes() ? 16384 : 128));
} else
transport.changeTempo(this.isIncrease(knobMode, value), this.surface.isKnobSensitivitySlow());
}
Aggregations