Search in sources :

Example 11 with IDrumPadBank

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

IDrumPadBank (de.mossgrabers.framework.daw.data.bank.IDrumPadBank)11 IDrumDevice (de.mossgrabers.framework.daw.data.IDrumDevice)6 IChannel (de.mossgrabers.framework.daw.data.IChannel)5 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)3 IDrumPad (de.mossgrabers.framework.daw.data.IDrumPad)2 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)2 IDeviceBank (de.mossgrabers.framework.daw.data.bank.IDeviceBank)1 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)1