use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class AbstractTrackParameterProvider method removeParametersObserver.
/**
* {@inheritDoc}
*/
@Override
public void removeParametersObserver(final IParametersAdjustObserver observer) {
super.removeParametersObserver(observer);
if (this.hasObservers())
return;
if (this.model == null) {
this.bank.removePageObserver(this);
return;
}
this.model.getTrackBank().removePageObserver(this);
final ITrackBank effectTrackBank = this.model.getEffectTrackBank();
if (effectTrackBank != null)
effectTrackBank.removePageObserver(this);
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class LaunchkeyMk3PanoramaMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITextDisplay d = this.surface.getTextDisplay();
d.setCell(LaunchkeyMk3Display.SCREEN_ROW_BASE, 0, "Pan " + this.formatPageRange(" %d - %d"));
final ICursorTrack cursorTrack = this.model.getCursorTrack();
final String trackText = cursorTrack.doesExist() ? String.format("%d: %s", Integer.valueOf(cursorTrack.getPosition() + 1), cursorTrack.getName()) : "No sel. track";
d.setCell(LaunchkeyMk3Display.SCREEN_ROW_BASE + 1, 0, trackText);
// Format track names
final ITrackBank tb = this.model.getCurrentTrackBank();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(i);
final boolean exists = t.doesExist();
final int offset = i * 2;
d.setCell(LaunchkeyMk3Display.SCREEN_ROW_POTS + offset, 0, exists ? String.format("%d: %s", Integer.valueOf(t.getPosition() + 1), t.getName()) : "No track");
d.setCell(LaunchkeyMk3Display.SCREEN_ROW_POTS + offset + 1, 0, exists ? "Pan: " + t.getPanStr() : "");
}
d.allDone();
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class MuteView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final IPadGrid padGrid = this.surface.getPadGrid();
final ITrackBank tb = this.model.getCurrentTrackBank();
for (int i = 0; i < 16; i++) {
final ITrack item = tb.getItem(i);
final int x = i % 4;
final int y = 3 - i / 4;
if (item.doesExist()) {
final int colorIndex = this.colorManager.getColorIndex(DAWColor.getColorIndex(item.getColor()));
if (item.isMute())
padGrid.lightEx(x, y, colorIndex, MaschineColorManager.COLOR_DARK_GREY, false);
else
padGrid.lightEx(x, y, colorIndex);
} else
padGrid.lightEx(x, y, AbstractFeatureGroup.BUTTON_COLOR_OFF);
}
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class SessionView method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
final ITrackBank tb = this.model.getCurrentTrackBank();
for (int x = 0; x < 8; x++) {
final ITrack t = tb.getItem(x);
final ISlotBank slotBank = t.getSlotBank();
for (int y = 0; y < 8; y++) this.drawPad(slotBank.getItem(y), x, y, t.isRecArm());
}
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class TrackButtons method getTrackButtonColor.
/**
* Update track button LEDs.
*
* @param index The index of the button
* @return The color
*/
public int getTrackButtonColor(final int index) {
final ITrackBank tb = this.model.getCurrentTrackBank();
final int trackState = this.surface.getTrackState();
switch(trackState) {
case APCminiControlSurface.TRACK_STATE_CLIP_STOP:
return this.surface.isPressed(ButtonID.get(ButtonID.ROW_SELECT_1, index)) ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
case APCminiControlSurface.TRACK_STATE_SOLO:
return tb.getItem(index).isSolo() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
case APCminiControlSurface.TRACK_STATE_REC_ARM:
return tb.getItem(index).isRecArm() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
case APCminiControlSurface.TRACK_STATE_MUTE:
return !tb.getItem(index).isMute() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
case APCminiControlSurface.TRACK_STATE_SELECT:
return tb.getItem(index).isSelected() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
default:
// Not used
return APCminiControlSurface.APC_BUTTON_STATE_OFF;
}
}
Aggregations