Search in sources :

Example 36 with IParameter

use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.

the class MaschineUserMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITextDisplay d = this.surface.getTextDisplay().clear();
    // Row 1 & 2
    for (int i = 0; i < 8; i++) {
        final IParameter param = this.bank.getItem(i);
        String name = param.doesExist() ? StringUtils.shortenAndFixASCII(param.getName(), 6) : "";
        if (i == this.getSelectedParameter())
            name = ">" + name;
        d.setCell(0, i, name).setCell(1, i, param.getDisplayedValue(8));
    }
    d.allDone();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay)

Example 37 with IParameter

use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.

the class UserMode method onSecondRow.

/**
 * {@inheritDoc}
 */
@Override
public void onSecondRow(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.UP)
        return;
    final IParameter param = this.bank.getItem(index);
    if (!param.doesExist())
        return;
    // Toggle between the min and max value
    final int max = this.model.getValueChanger().getUpperBound() - 1;
    param.setValueImmediatly(param.getValue() < max / 2 ? max : 0);
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter)

Example 38 with IParameter

use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.

the class UserMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2(final IGraphicDisplay display) {
    final IValueChanger valueChanger = this.model.getValueChanger();
    final String[] userPageNames = this.surface.getConfiguration().getUserPageNames();
    final int pageSize = this.bank.getPageSize();
    final int selectedPage = this.bank.getScrollPosition() / pageSize;
    for (int i = 0; i < pageSize; i++) {
        final boolean isBottomMenuOn = i == selectedPage;
        final IParameter param = this.bank.getItem(i);
        final boolean exists = param.doesExist();
        final String parameterName = exists ? param.getName(9) : "";
        final int parameterValue = valueChanger.toDisplayValue(exists ? param.getValue() : 0);
        final String parameterValueStr = exists ? param.getDisplayedValue(8) : "";
        final boolean parameterIsActive = this.isKnobTouched[i];
        final int parameterModulatedValue = valueChanger.toDisplayValue(exists ? param.getModulatedValue() : -1);
        display.addParameterElement("", false, userPageNames[i], "USER", isBottomMenuOn ? ColorEx.WHITE : ColorEx.GRAY, isBottomMenuOn, parameterName, parameterValue, parameterValueStr, parameterIsActive, parameterModulatedValue);
    }
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) IValueChanger(de.mossgrabers.framework.controller.valuechanger.IValueChanger)

Example 39 with IParameter

use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.

the class NoteRepeatMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2(final IGraphicDisplay display) {
    if (this.noteRepeat == null)
        return;
    display.addOptionElement("Period", "", false, "", "", false, false);
    final int selPeriodIndex = this.getSelectedPeriodIndex();
    display.addListElement(6, Resolution.getNames(), selPeriodIndex);
    if (this.host.supports(Capability.NOTE_REPEAT_LENGTH)) {
        display.addOptionElement("  Length", "", false, "", "", false, false);
        final int selLengthIndex = this.getSelectedNoteLengthIndex();
        display.addListElement(6, Resolution.getNames(), selLengthIndex);
    } else {
        display.addEmptyElement();
        display.addEmptyElement();
    }
    display.addEmptyElement();
    final int upperBound = this.model.getValueChanger().getUpperBound();
    if (this.host.supports(Capability.NOTE_REPEAT_MODE)) {
        final String bottomMenu = this.host.supports(Capability.NOTE_REPEAT_USE_PRESSURE_TO_VELOCITY) ? "Use Pressure" : "";
        final boolean isBottomMenuEnabled = this.noteRepeat.usePressure();
        final ArpeggiatorMode mode = this.noteRepeat.getMode();
        final Configuration configuration = this.surface.getConfiguration();
        final List<ArpeggiatorMode> arpeggiatorModes = configuration.getArpeggiatorModes();
        final int modeIndex = configuration.lookupArpeggiatorModeIndex(mode);
        final int value = modeIndex * upperBound / (arpeggiatorModes.size() - 1);
        display.addParameterElementWithPlainMenu("", false, bottomMenu, null, isBottomMenuEnabled, "Mode", value, StringUtils.optimizeName(mode.getName(), 8), this.isKnobTouched[5], -1);
    } else
        display.addEmptyElement();
    if (this.host.supports(Capability.NOTE_REPEAT_OCTAVES)) {
        final String bottomMenu = this.host.supports(Capability.NOTE_REPEAT_IS_FREE_RUNNING) ? "Sync" : "";
        final boolean isBottomMenuEnabled = !this.noteRepeat.isFreeRunning();
        final int octaves = this.noteRepeat.getOctaves();
        final int value = octaves * upperBound / 8;
        display.addParameterElementWithPlainMenu("", false, bottomMenu, null, isBottomMenuEnabled, "Octaves", value, Integer.toString(octaves), this.isKnobTouched[6], -1);
    } else
        display.addEmptyElement();
    if (this.host.supports(Capability.NOTE_REPEAT_SWING)) {
        final IGroove groove = this.model.getGroove();
        final IParameter shuffleParam = groove.getParameter(GrooveParameterID.SHUFFLE_AMOUNT);
        final IParameter enabledParam = groove.getParameter(GrooveParameterID.ENABLED);
        final int value = enabledParam.getValue();
        display.addParameterElementWithPlainMenu("Groove " + enabledParam.getDisplayedValue(8), value != 0, "Shuffle", null, this.noteRepeat.isShuffle(), shuffleParam.getName(10), shuffleParam.getValue(), shuffleParam.getDisplayedValue(8), this.isKnobTouched[7], -1);
    } else
        display.addEmptyElement();
}
Also used : ArpeggiatorMode(de.mossgrabers.framework.daw.midi.ArpeggiatorMode) IParameter(de.mossgrabers.framework.daw.data.IParameter) Configuration(de.mossgrabers.framework.configuration.Configuration) PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) IGroove(de.mossgrabers.framework.daw.IGroove)

Example 40 with IParameter

use of de.mossgrabers.framework.daw.data.IParameter in project DrivenByMoss by git-moss.

the class NoteRepeatMode method onSecondRow.

/**
 * {@inheritDoc}
 */
@Override
public void onSecondRow(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.UP || this.noteRepeat == null)
        return;
    if (index == 7 && this.host.supports(Capability.NOTE_REPEAT_SWING)) {
        final IParameter grooveEnabled = this.model.getGroove().getParameter(GrooveParameterID.ENABLED);
        grooveEnabled.setValue(grooveEnabled.getValue() == 0 ? this.model.getValueChanger().getUpperBound() : 0);
    }
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter)

Aggregations

IParameter (de.mossgrabers.framework.daw.data.IParameter)76 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)17 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)14 ITrack (de.mossgrabers.framework.daw.data.ITrack)9 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)6 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)6 IGroove (de.mossgrabers.framework.daw.IGroove)5 Display (de.mossgrabers.framework.controller.display.Display)4 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)4 IParameterPageBank (de.mossgrabers.framework.daw.data.bank.IParameterPageBank)4 PushDisplay (de.mossgrabers.push.controller.PushDisplay)4 ITransport (de.mossgrabers.framework.daw.ITransport)3 IDeviceBank (de.mossgrabers.framework.daw.data.bank.IDeviceBank)3 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)2 TitleValueComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)2 FlexiHandlerException (de.mossgrabers.controller.generic.flexihandler.utils.FlexiHandlerException)2 FaderConfig (de.mossgrabers.controller.ni.maschine.jam.controller.FaderConfig)2 SLMkIIIDisplay (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)2 Configuration (de.mossgrabers.framework.configuration.Configuration)2 IGraphicDisplay (de.mossgrabers.framework.controller.display.IGraphicDisplay)2