Search in sources :

Example 1 with IItem

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

the class AbstractItemBankImpl method enableObservers.

/**
 * {@inheritDoc}
 */
@Override
public void enableObservers(final boolean enable) {
    for (final IItem item : this.items) item.enableObservers(enable);
    if (this.bank.isEmpty())
        return;
    final B b = this.bank.get();
    Util.setIsSubscribed(b.scrollPosition(), enable);
    Util.setIsSubscribed(b.canScrollBackwards(), enable);
    Util.setIsSubscribed(b.canScrollForwards(), enable);
    Util.setIsSubscribed(b.itemCount(), enable);
}
Also used : IItem(de.mossgrabers.framework.daw.data.IItem)

Example 2 with IItem

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

the class ParametersMode method setShowDevices.

/**
 * Show devices or the parameter banks of the cursor device for selection.
 *
 * @param showDevices True to show devices otherwise parameters
 */
@SuppressWarnings("unchecked")
public final void setShowDevices(final boolean showDevices) {
    this.showDevices = showDevices;
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    this.switchBanks((IBank<IItem>) (this.showDevices ? cursorDevice.getDeviceBank() : cursorDevice.getParameterBank()));
}
Also used : IItem(de.mossgrabers.framework.daw.data.IItem) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 3 with IItem

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

the class ParameterBankImpl method enableObservers.

/**
 * {@inheritDoc}
 */
@Override
public void enableObservers(final boolean enable) {
    for (final IItem item : this.items) item.enableObservers(enable);
    Util.setIsSubscribed(this.remoteControls.hasPrevious(), enable);
    Util.setIsSubscribed(this.remoteControls.hasNext(), enable);
    Util.setIsSubscribed(this.remoteControls.selectedPageIndex(), enable);
    Util.setIsSubscribed(this.remoteControls.pageCount(), enable);
}
Also used : IItem(de.mossgrabers.framework.daw.data.IItem)

Example 4 with IItem

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

the class UserMode method getButtonColor.

/**
 * {@inheritDoc}
 */
@Override
public int getButtonColor(final ButtonID buttonID) {
    int index = this.isButtonRow(0, buttonID);
    if (index >= 0) {
        final int selectedColor = this.isPush2 ? PushColorManager.PUSH2_COLOR_ORANGE_HI : PushColorManager.PUSH1_COLOR_ORANGE_HI;
        final int existsColor = this.isPush2 ? PushColorManager.PUSH2_COLOR_YELLOW_LO : PushColorManager.PUSH1_COLOR_YELLOW_LO;
        final int selectedPage = this.bank.getScrollPosition() / this.bank.getPageSize();
        return index == selectedPage ? selectedColor : existsColor;
    }
    index = this.isButtonRow(1, buttonID);
    if (index >= 0) {
        final IItem param = this.bank.getItem(index);
        if (!param.doesExist())
            return super.getButtonColor(buttonID);
        final int max = this.model.getValueChanger().getUpperBound() - 1;
        return this.colorManager.getColorIndex(((IParameter) param).getValue() > max / 2 ? AbstractMode.BUTTON_COLOR_HI : AbstractFeatureGroup.BUTTON_COLOR_ON);
    }
    return super.getButtonColor(buttonID);
}
Also used : IItem(de.mossgrabers.framework.daw.data.IItem)

Aggregations

IItem (de.mossgrabers.framework.daw.data.IItem)4 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)1