Search in sources :

Example 1 with RecordQuantization

use of de.mossgrabers.framework.daw.constants.RecordQuantization in project DrivenByMoss by git-moss.

the class QuantizeMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2(final IGraphicDisplay display) {
    final ITrack cursorTrack = this.model.getCursorTrack();
    final RecordQuantization recQuant = cursorTrack.doesExist() ? cursorTrack.getRecordQuantizationGrid() : RecordQuantization.RES_OFF;
    final RecordQuantization[] values = RecordQuantization.values();
    for (int i = 0; i < values.length; i++) display.addOptionElement("", MENU[i], i == 0, i == 0 ? "Record Quantization" : "", values[i].getName(), values[i] == recQuant, true);
    if (this.model.getHost().supports(Capability.QUANTIZE_INPUT_NOTE_LENGTH)) {
        display.addOptionElement("", " ", false, null, "Quantize Note Length", "", false, null, true);
        final boolean isQuantLength = cursorTrack.doesExist() && cursorTrack.isRecordQuantizationNoteLength();
        display.addOptionElement("", " ", false, "", isQuantLength ? "On" : "Off", isQuantLength, true);
    } else {
        display.addEmptyElement(true);
        display.addEmptyElement(true);
    }
    if (this.model.getHost().supports(Capability.QUANTIZE_AMOUNT)) {
        final int quantizeAmount = this.surface.getConfiguration().getQuantizeAmount();
        display.addParameterElement(" ", false, "", (ChannelType) null, null, false, "Qunt Amnt", quantizeAmount * 1023 / 100, quantizeAmount + "%", this.isKnobTouched[0], -1);
    } else
        display.addEmptyElement(true);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) RecordQuantization(de.mossgrabers.framework.daw.constants.RecordQuantization)

Example 2 with RecordQuantization

use of de.mossgrabers.framework.daw.constants.RecordQuantization in project DrivenByMoss by git-moss.

the class PlaySelectCommand method executeShifted.

/**
 * {@inheritDoc}}
 */
@Override
public void executeShifted(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ITrack cursorTrack = this.model.getCursorTrack();
    if (!cursorTrack.doesExist())
        return;
    // Toggle through all record quantization settings...
    final RecordQuantization[] values = RecordQuantization.values();
    final RecordQuantization recordQuantization = cursorTrack.getRecordQuantizationGrid();
    int index = 0;
    for (int i = 0; i < values.length; i++) {
        if (recordQuantization == values[i]) {
            index = i + 1;
            if (index >= values.length)
                index = 0;
            break;
        }
    }
    cursorTrack.setRecordQuantizationGrid(values[index]);
    this.surface.getDisplay().notify("Rec. Quant.: " + values[index].getName());
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) RecordQuantization(de.mossgrabers.framework.daw.constants.RecordQuantization)

Example 3 with RecordQuantization

use of de.mossgrabers.framework.daw.constants.RecordQuantization in project DrivenByMoss by git-moss.

the class QuantizeMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1(final ITextDisplay display) {
    display.setCell(0, 0, Push1Display.SELECT_ARROW + "Quantize");
    display.setCell(0, 1, "Groove");
    final ITrack cursorTrack = this.model.getCursorTrack();
    final RecordQuantization recQuant = cursorTrack.doesExist() ? cursorTrack.getRecordQuantizationGrid() : RecordQuantization.RES_OFF;
    final RecordQuantization[] values = RecordQuantization.values();
    display.setBlock(2, 0, "Record Quantize:");
    for (int i = 0; i < values.length; i++) display.setCell(3, i, (values[i] == recQuant ? Push1Display.SELECT_ARROW : "") + values[i].getName());
    if (this.model.getHost().supports(Capability.QUANTIZE_INPUT_NOTE_LENGTH)) {
        display.setBlock(2, 2, "       Quant Note");
        display.setCell(2, 6, "Length:");
        display.setCell(3, 6, cursorTrack.doesExist() && cursorTrack.isRecordQuantizationNoteLength() ? "On" : "Off");
    }
    final int quantizeAmount = this.surface.getConfiguration().getQuantizeAmount();
    display.setCell(0, 7, "Quant Amnt").setCell(1, 7, quantizeAmount + "%").setCell(2, 7, quantizeAmount * 1023 / 100, Format.FORMAT_VALUE);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) RecordQuantization(de.mossgrabers.framework.daw.constants.RecordQuantization)

Example 4 with RecordQuantization

use of de.mossgrabers.framework.daw.constants.RecordQuantization in project DrivenByMoss by git-moss.

the class QuantizeMode method getButtonColorID.

/**
 * {@inheritDoc}
 */
@Override
public String getButtonColorID(final ButtonID buttonID) {
    int index = this.isButtonRow(0, buttonID);
    if (index >= 0) {
        final RecordQuantization[] values = RecordQuantization.values();
        final ITrack cursorTrack = this.model.getCursorTrack();
        final RecordQuantization recQuant = cursorTrack.doesExist() ? cursorTrack.getRecordQuantizationGrid() : RecordQuantization.RES_OFF;
        if (index < values.length)
            return values[index] == recQuant ? AbstractMode.BUTTON_COLOR_HI : AbstractFeatureGroup.BUTTON_COLOR_ON;
        if (index == 6)
            return cursorTrack.isRecordQuantizationNoteLength() ? AbstractMode.BUTTON_COLOR_HI : AbstractFeatureGroup.BUTTON_COLOR_ON;
        return AbstractFeatureGroup.BUTTON_COLOR_OFF;
    }
    index = this.isButtonRow(1, buttonID);
    if (index >= 0) {
        if (index == 0)
            return AbstractMode.BUTTON_COLOR_HI;
        if (index == 1)
            return AbstractFeatureGroup.BUTTON_COLOR_ON;
        return AbstractFeatureGroup.BUTTON_COLOR_OFF;
    }
    return AbstractFeatureGroup.BUTTON_COLOR_OFF;
}
Also used : RecordQuantization(de.mossgrabers.framework.daw.constants.RecordQuantization) ITrack(de.mossgrabers.framework.daw.data.ITrack)

Example 5 with RecordQuantization

use of de.mossgrabers.framework.daw.constants.RecordQuantization in project DrivenByMoss by git-moss.

the class ITrack method nextRecordQuantization.

/**
 * Select the next automation write mode.
 */
default void nextRecordQuantization() {
    final RecordQuantization[] recordQuantizations = RecordQuantization.values();
    final RecordQuantization recordQuantization = this.getRecordQuantizationGrid();
    int pos = Arrays.asList(recordQuantizations).indexOf(recordQuantization) + 1;
    if (pos >= recordQuantizations.length)
        pos = 0;
    this.setRecordQuantizationGrid(recordQuantizations[pos]);
}
Also used : RecordQuantization(de.mossgrabers.framework.daw.constants.RecordQuantization)

Aggregations

RecordQuantization (de.mossgrabers.framework.daw.constants.RecordQuantization)6 ITrack (de.mossgrabers.framework.daw.data.ITrack)4