Search in sources :

Example 16 with IParameterBank

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

the class DeviceHandler method scrollParameterPage.

private void scrollParameterPage(final KnobMode knobMode, final MidiValue value) {
    if (isAbsolute(knobMode) || !this.increaseKnobMovement())
        return;
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final IParameterBank parameterBank = cursorDevice.getParameterBank();
    if (this.isIncrease(knobMode, value))
        parameterBank.scrollForwards();
    else
        parameterBank.scrollBackwards();
    this.mvHelper.notifySelectedParameterPage();
}
Also used : IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 17 with IParameterBank

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

the class DeviceHandler method scrollParameterBank.

private void scrollParameterBank(final KnobMode knobMode, final MidiValue value) {
    if (isAbsolute(knobMode) || !this.increaseKnobMovement())
        return;
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final IParameterBank parameterBank = cursorDevice.getParameterBank();
    if (this.isIncrease(knobMode, value))
        parameterBank.selectNextPage();
    else
        parameterBank.selectPreviousPage();
    this.mvHelper.notifySelectedParameterPage();
}
Also used : IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 18 with IParameterBank

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

the class UserModule method flush.

/**
 * {@inheritDoc}
 */
@Override
public void flush(final boolean dump) {
    final String userAddress = "/user/";
    final IParameterBank parameterBank = this.model.getUserParameterBank();
    for (int i = 0; i < parameterBank.getPageSize(); i++) {
        final int oneplus = i + 1;
        this.flushParameterData(this.writer, userAddress + oneplus + "/", parameterBank.getItem(i), dump);
    }
    final int numPages = parameterBank.getItemCount() / parameterBank.getPageSize();
    final int selectedPage = parameterBank.getScrollPosition() / parameterBank.getPageSize();
    for (int i = 0; i < numPages; i++) {
        final int oneplus = i + 1;
        this.writer.sendOSC(userAddress + "page/" + oneplus + "/", "Page " + (i + 1), dump);
        this.writer.sendOSC(userAddress + "page/" + oneplus + "/selected", selectedPage == i, dump);
    }
    this.writer.sendOSC(userAddress + "page/selected/name", "Page " + (selectedPage + 1), dump);
}
Also used : IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank)

Example 19 with IParameterBank

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

the class DeviceParamsMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1(final ITextDisplay display) {
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!this.checkExists1(display, cd))
        return;
    // Row 1 & 2
    final IParameterBank parameterBank = cd.getParameterBank();
    for (int i = 0; i < 8; i++) {
        final IParameter param = parameterBank.getItem(i);
        display.setCell(0, i, param.doesExist() ? StringUtils.fixASCII(param.getName()) : "").setCell(1, i, StringUtils.fixASCII(param.getDisplayedValue(8)));
    }
    // Row 3
    display.setBlock(2, 0, "Selected Device:").setBlock(2, 1, cd.getName());
    // Row 4
    if (this.showDevices) {
        final IDeviceBank deviceBank = cd.getDeviceBank();
        for (int i = 0; i < 8; i++) {
            final IDevice device = deviceBank.getItem(i);
            final StringBuilder sb = new StringBuilder();
            if (device.doesExist()) {
                if (i == cd.getIndex())
                    sb.append(Push1Display.SELECT_ARROW);
                sb.append(device.getName());
            }
            display.setCell(3, i, sb.toString());
        }
        return;
    }
    final IParameterPageBank bank = cd.getParameterPageBank();
    final int selectedItemIndex = bank.getSelectedItemIndex();
    for (int i = 0; i < bank.getPageSize(); i++) {
        final String item = bank.getItem(i);
        final String selectedStr = i == selectedItemIndex ? Push1Display.SELECT_ARROW : "";
        display.setCell(3, i, item.isEmpty() ? "" : selectedStr + item);
    }
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) IParameterPageBank(de.mossgrabers.framework.daw.data.bank.IParameterPageBank) IDevice(de.mossgrabers.framework.daw.data.IDevice) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) IDeviceBank(de.mossgrabers.framework.daw.data.bank.IDeviceBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 20 with IParameterBank

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

the class DeviceParamsMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    this.drawDisplay2();
    final ITextDisplay d = this.surface.getTextDisplay().clear();
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!cd.doesExist()) {
        d.notify("Please select a device...");
        return;
    }
    // Row 1 & 2
    final int extenderOffset = this.surface.getExtenderOffset();
    final IParameterBank parameterBank = cd.getParameterBank();
    for (int i = 0; i < 8; i++) {
        final IParameter param = parameterBank.getItem(extenderOffset + i);
        d.setCell(0, i, param.doesExist() ? StringUtils.shortenAndFixASCII(param.getName(6), 6) : "").setCell(1, i, StringUtils.shortenAndFixASCII(param.getDisplayedValue(6), 6));
    }
    d.allDone();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Aggregations

IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)25 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)14 IParameter (de.mossgrabers.framework.daw.data.IParameter)14 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)5 ITrack (de.mossgrabers.framework.daw.data.ITrack)4 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)4 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)3 IParameterPageBank (de.mossgrabers.framework.daw.data.bank.IParameterPageBank)3 IDevice (de.mossgrabers.framework.daw.data.IDevice)2 IDeviceBank (de.mossgrabers.framework.daw.data.bank.IDeviceBank)2 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)2 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)2 Modes (de.mossgrabers.framework.mode.Modes)2 ACVSConfiguration (de.mossgrabers.controller.akai.acvs.ACVSConfiguration)1 ACVSDisplay (de.mossgrabers.controller.akai.acvs.controller.ACVSDisplay)1 TitleValueComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)1 BeatstepControlSurface (de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface)1 FlexiCommand (de.mossgrabers.controller.generic.controller.FlexiCommand)1 FlexiHandlerException (de.mossgrabers.controller.generic.flexihandler.utils.FlexiHandlerException)1 TapTempoInitMkICommand (de.mossgrabers.controller.novation.sl.command.continuous.TapTempoInitMkICommand)1