use of de.mossgrabers.framework.controller.color.ColorManager in project DrivenByMoss by git-moss.
the class SendsView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final ColorManager cm = this.model.getColorManager();
final IChannelBank tb = this.model.getCurrentTrackBank();
final IMidiOutput output = this.surface.getOutput();
for (int i = 0; i < 8; i++) {
final ITrack track = tb.getTrack(i);
final ISend send = track.getSend(this.selectedSend);
final int color = cm.getColor(BitwigColors.getColorIndex(track.getColor()));
if (this.trackColors[i] != color || !track.doesExist() || send.getName().isEmpty())
this.setupFader(i);
this.trackColors[i] = color;
output.sendCC(LaunchpadControlSurface.LAUNCHPAD_FADER_1 + i, send.getValue());
}
}
use of de.mossgrabers.framework.controller.color.ColorManager in project DrivenByMoss by git-moss.
the class VolumeView method updateSceneButtons.
/**
* {@inheritDoc}
*/
@Override
public void updateSceneButtons() {
final ColorManager cm = this.model.getColorManager();
final IMasterTrack track = this.model.getMasterTrack();
final int sceneMax = 9 * track.getVolume() / this.model.getValueChanger().getUpperBound();
for (int i = 0; i < 8; i++) {
final int color = cm.getColor(BitwigColors.getColorIndex(track.getColor()));
this.surface.setButton(LaunchpadControlSurface.LAUNCHPAD_BUTTON_SCENE8 + 10 * i, i < sceneMax ? color : LaunchpadColors.LAUNCHPAD_COLOR_BLACK);
}
}
use of de.mossgrabers.framework.controller.color.ColorManager in project DrivenByMoss by git-moss.
the class VolumeView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final ColorManager cm = this.model.getColorManager();
final IChannelBank tb = this.model.getCurrentTrackBank();
final IMidiOutput output = this.surface.getOutput();
for (int i = 0; i < 8; i++) {
final ITrack track = tb.getTrack(i);
final int color = cm.getColor(BitwigColors.getColorIndex(track.getColor()));
if (this.trackColors[i] != color || !track.doesExist())
this.setupFader(i);
this.trackColors[i] = color;
output.sendCC(LaunchpadControlSurface.LAUNCHPAD_FADER_1 + i, track.getVolume());
}
}
use of de.mossgrabers.framework.controller.color.ColorManager in project DrivenByMoss by git-moss.
the class NoteViewSelectMode method updateFirstRow.
/**
* {@inheritDoc}
*/
@Override
public void updateFirstRow() {
final ColorManager colorManager = this.model.getColorManager();
final ViewManager viewManager = this.surface.getViewManager();
for (int i = 0; i < 8; i++) this.surface.updateButton(20 + i, colorManager.getColor(VIEWS[i] == null ? AbstractMode.BUTTON_COLOR_OFF : viewManager.isActiveView(VIEWS[i]) ? AbstractMode.BUTTON_COLOR_HI : AbstractMode.BUTTON_COLOR_ON));
}
use of de.mossgrabers.framework.controller.color.ColorManager in project DrivenByMoss by git-moss.
the class NoteViewSelectMode method updateSecondRow.
/**
* {@inheritDoc}
*/
@Override
public void updateSecondRow() {
final ColorManager colorManager = this.model.getColorManager();
final ViewManager viewManager = this.surface.getViewManager();
for (int i = 0; i < 8; i++) this.surface.updateButton(102 + i, colorManager.getColor(VIEWS_TOP[i] == null ? AbstractMode.BUTTON_COLOR_OFF : viewManager.isActiveView(VIEWS_TOP[i]) ? AbstractMode.BUTTON_COLOR_HI : AbstractMode.BUTTON_COLOR_ON));
}
Aggregations