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);
}
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()));
}
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);
}
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);
}
Aggregations