use of de.mossgrabers.framework.daw.ICursorClip in project DrivenByMoss by git-moss.
the class ClipMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
final ICursorClip clip = this.model.getCursorClip();
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack t0 = tb.getTrack(0);
final ITrack t1 = tb.getTrack(1);
final ITrack t2 = tb.getTrack(2);
final ITrack t3 = tb.getTrack(3);
final ITrack t4 = tb.getTrack(4);
final ITrack t5 = tb.getTrack(5);
final ITrack t6 = tb.getTrack(6);
final ITrack t7 = tb.getTrack(7);
message.addParameterElement("", false, t0.getName(), t0.getType(), t0.getColor(), t0.isSelected(), "Play Start", -1, this.formatMeasures(clip.getPlayStart(), 1), this.isKnobTouched[0], -1);
message.addParameterElement("", false, t1.getName(), t1.getType(), t1.getColor(), t1.isSelected(), "Play End", -1, this.formatMeasures(clip.getPlayEnd(), 1), this.isKnobTouched[1], -1);
message.addParameterElement("", false, t2.getName(), t2.getType(), t2.getColor(), t2.isSelected(), "Loop Start", -1, this.formatMeasures(clip.getLoopStart(), 1), this.isKnobTouched[2], -1);
message.addParameterElement("", false, t3.getName(), t3.getType(), t3.getColor(), t3.isSelected(), "Loop Lngth", -1, this.formatMeasures(clip.getLoopLength(), 0), this.isKnobTouched[3], -1);
message.addParameterElement("", false, t4.getName(), t4.getType(), t4.getColor(), t4.isSelected(), "Loop", -1, clip.isLoopEnabled() ? "On" : "Off", this.isKnobTouched[4], -1);
message.addParameterElement("", false, t5.getName(), t5.getType(), t5.getColor(), t5.isSelected(), "", -1, "", false, -1);
message.addParameterElement("", false, t6.getName(), t6.getType(), t6.getColor(), t6.isSelected(), "Shuffle", -1, clip.isShuffleEnabled() ? "On" : "Off", this.isKnobTouched[6], -1);
message.addParameterElement("Select color", false, t7.getName(), t7.getType(), t7.getColor(), t7.isSelected(), "Accent", -1, clip.getFormattedAccent(), this.isKnobTouched[7], -1);
display.send(message);
}
use of de.mossgrabers.framework.daw.ICursorClip in project DrivenByMoss by git-moss.
the class ClipMode method updateDisplay1.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay1() {
final Display d = this.surface.getDisplay();
final ICursorClip clip = this.model.getCursorClip();
d.setCell(0, 0, "PlayStrt").setCell(1, 0, this.formatMeasures(clip.getPlayStart(), 1));
d.setCell(0, 1, "Play End").setCell(1, 1, this.formatMeasures(clip.getPlayEnd(), 1));
d.setCell(0, 2, "LoopStrt").setCell(1, 2, this.formatMeasures(clip.getLoopStart(), 1));
d.setCell(0, 3, "LopLngth").setCell(1, 3, this.formatMeasures(clip.getLoopLength(), 0));
d.setCell(0, 4, "Loop").setCell(1, 4, clip.isLoopEnabled() ? "On" : "Off").clearCell(0, 5).clearCell(1, 5);
d.setCell(0, 6, "Shuffle").setCell(1, 6, clip.isShuffleEnabled() ? "On" : "Off");
d.setCell(0, 7, "Accent").setCell(1, 7, clip.getFormattedAccent()).done(0).done(1).clearRow(2).done(2);
this.drawRow4();
}
use of de.mossgrabers.framework.daw.ICursorClip in project DrivenByMoss by git-moss.
the class ClipView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final ICursorClip clip = this.model.getCursorClip();
// Clip length/loop area
final int step = clip.getCurrentStep();
final double quartersPerPad = this.getQuartersPerPad();
final int stepsPerMeasure = (int) Math.round(quartersPerPad / RESOLUTIONS[this.selectedIndex]);
final int currentMeasure = step / stepsPerMeasure;
final double maxQuarters = quartersPerPad * 64;
final double start = clip.getLoopStart();
final int loopStartPad = (int) Math.floor(Math.max(0, start) / quartersPerPad);
final int loopEndPad = (int) Math.ceil(Math.min(maxQuarters, start + clip.getLoopLength()) / quartersPerPad);
final boolean isPush2 = this.surface.getConfiguration().isPush2();
final int white = isPush2 ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH1_COLOR2_WHITE;
final int green = isPush2 ? PushColors.PUSH2_COLOR2_GREEN : PushColors.PUSH1_COLOR2_GREEN;
final int off = isPush2 ? PushColors.PUSH2_COLOR_BLACK : PushColors.PUSH1_COLOR_BLACK;
for (int pad = 0; pad < 64; pad++) this.surface.getPadGrid().lightEx(pad % 8, pad / 8, pad >= loopStartPad && pad < loopEndPad ? pad == currentMeasure ? green : white : off, -1, false);
}
use of de.mossgrabers.framework.daw.ICursorClip in project DrivenByMoss by git-moss.
the class ColorView method onGridNote.
/**
* {@inheritDoc}
*/
@Override
public void onGridNote(final int note, final int velocity) {
if (velocity == 0)
return;
final int color = note - 36;
if (color < BitwigColors.BITWIG_COLORS.length) {
final double[] entry = BitwigColors.getColorEntry(BitwigColors.BITWIG_COLORS[color]);
switch(this.mode) {
case MODE_TRACK:
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack t = tb.getSelectedTrack();
if (t == null) {
final IMasterTrack master = this.model.getMasterTrack();
if (master.isSelected())
master.setColor(entry[0], entry[1], entry[2]);
} else
t.setColor(entry[0], entry[1], entry[2]);
break;
case MODE_LAYER:
final ICursorDevice cd = this.model.getCursorDevice();
final IChannel deviceChain = cd.getSelectedLayerOrDrumPad();
cd.setLayerOrDrumPadColor(deviceChain.getIndex(), entry[0], entry[1], entry[2]);
break;
case MODE_CLIP:
final ICursorClip clip = this.model.getCursorClip();
if (clip != null)
clip.setColor(entry[0], entry[1], entry[2]);
break;
}
}
this.surface.getViewManager().restoreView();
}
use of de.mossgrabers.framework.daw.ICursorClip in project DrivenByMoss by git-moss.
the class DrumView4 method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
if (!this.model.canSelectedTrackHoldNotes()) {
this.surface.getPadGrid().turnOff();
return;
}
// Clip length/loop area
final ICursorClip clip = this.getClip();
final int step = clip.getCurrentStep();
// Paint the sequencer steps
final boolean isPush2 = this.surface.getConfiguration().isPush2();
final int blueHi = isPush2 ? PushColors.PUSH2_COLOR2_BLUE_HI : PushColors.PUSH1_COLOR2_BLUE_HI;
final int greenLo = isPush2 ? PushColors.PUSH2_COLOR2_GREEN_LO : PushColors.PUSH1_COLOR2_GREEN_LO;
final int greenHi = isPush2 ? PushColors.PUSH2_COLOR2_GREEN_HI : PushColors.PUSH1_COLOR2_GREEN_HI;
final int off = isPush2 ? PushColors.PUSH2_COLOR2_BLACK : PushColors.PUSH1_COLOR2_BLACK;
final int hiStep = this.isInXRange(step) ? step % DrumView4.NUM_DISPLAY_COLS : -1;
for (int sound = 0; sound < 4; sound++) {
for (int col = 0; col < DrumView4.NUM_DISPLAY_COLS; col++) {
final int isSet = clip.getStep(col, this.offsetY + this.selectedPad + sound + this.soundOffset);
final boolean hilite = col == hiStep;
final int x = col % 8;
int y = col / 8;
if (col < 8)
y += 5;
y += sound;
this.surface.getPadGrid().lightEx(x, 8 - y, isSet > 0 ? hilite ? greenLo : blueHi : hilite ? greenHi : off, -1, false);
}
}
}
Aggregations