Search in sources :

Example 6 with IDeviceBank

use of de.mossgrabers.framework.daw.data.bank.IDeviceBank 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 7 with IDeviceBank

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

the class AbstractConfiguration method registerDeactivatedItemsHandler.

/**
 * Register a handler for the 'exclude deactivated items' setting.
 *
 * @param model The model for getting the banks to configure
 */
public void registerDeactivatedItemsHandler(final IModel model) {
    this.addSettingObserver(AbstractConfiguration.EXCLUDE_DEACTIVATED_ITEMS, () -> {
        final boolean exclude = this.areDeactivatedItemsExcluded();
        final ITrackBank trackBank = model.getTrackBank();
        trackBank.setSkipDisabledItems(exclude);
        for (int i = 0; i < trackBank.getPageSize(); i++) trackBank.getItem(i).getSendBank().setSkipDisabledItems(exclude);
        final ITrackBank effectTrackBank = model.getEffectTrackBank();
        if (effectTrackBank != null)
            effectTrackBank.setSkipDisabledItems(exclude);
        final ICursorDevice cursorDevice = model.getCursorDevice();
        final IDeviceBank deviceBank = cursorDevice.getDeviceBank();
        deviceBank.setSkipDisabledItems(exclude);
        cursorDevice.getLayerBank().setSkipDisabledItems(exclude);
        final IDrumPadBank drumPadBank = cursorDevice.getDrumPadBank();
        if (drumPadBank != null)
            drumPadBank.setSkipDisabledItems(exclude);
    });
}
Also used : ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) IDeviceBank(de.mossgrabers.framework.daw.data.bank.IDeviceBank) IDrumPadBank(de.mossgrabers.framework.daw.data.bank.IDrumPadBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Aggregations

IDeviceBank (de.mossgrabers.framework.daw.data.bank.IDeviceBank)7 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)5 IDevice (de.mossgrabers.framework.daw.data.IDevice)4 IParameterPageBank (de.mossgrabers.framework.daw.data.bank.IParameterPageBank)4 IParameter (de.mossgrabers.framework.daw.data.IParameter)3 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)2 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)2 KontrolProtocolConfiguration (de.mossgrabers.controller.ni.kontrol.mkii.KontrolProtocolConfiguration)1 ColorEx (de.mossgrabers.framework.controller.color.ColorEx)1 IDrumPadBank (de.mossgrabers.framework.daw.data.bank.IDrumPadBank)1 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)1