Search in sources :

Example 6 with ICursorClip

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);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ICursorClip(de.mossgrabers.framework.daw.ICursorClip) PushDisplay(de.mossgrabers.push.controller.PushDisplay) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage)

Example 7 with ICursorClip

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();
}
Also used : ICursorClip(de.mossgrabers.framework.daw.ICursorClip) Display(de.mossgrabers.framework.controller.display.Display) PushDisplay(de.mossgrabers.push.controller.PushDisplay)

Example 8 with ICursorClip

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);
}
Also used : ICursorClip(de.mossgrabers.framework.daw.ICursorClip)

Example 9 with ICursorClip

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();
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorClip(de.mossgrabers.framework.daw.ICursorClip) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 10 with ICursorClip

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);
        }
    }
}
Also used : ICursorClip(de.mossgrabers.framework.daw.ICursorClip)

Aggregations

ICursorClip (de.mossgrabers.framework.daw.ICursorClip)19 PadGrid (de.mossgrabers.framework.controller.grid.PadGrid)5 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)4 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)3 ITrack (de.mossgrabers.framework.daw.data.ITrack)3 IChannel (de.mossgrabers.framework.daw.data.IChannel)2 ModeManager (de.mossgrabers.framework.mode.ModeManager)2 PushDisplay (de.mossgrabers.push.controller.PushDisplay)2 Display (de.mossgrabers.framework.controller.display.Display)1 ITransport (de.mossgrabers.framework.daw.ITransport)1 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)1 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)1 SceneView (de.mossgrabers.framework.view.SceneView)1 View (de.mossgrabers.framework.view.View)1 ViewManager (de.mossgrabers.framework.view.ViewManager)1 PushCursorCommand (de.mossgrabers.push.command.trigger.PushCursorCommand)1 DisplayMessage (de.mossgrabers.push.controller.DisplayMessage)1 PushControlSurface (de.mossgrabers.push.controller.PushControlSurface)1 NoteMode (de.mossgrabers.push.mode.NoteMode)1 ClipView (de.mossgrabers.push.view.ClipView)1