Search in sources :

Example 11 with ICursorTrack

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

the class LaunchkeyMk3ParameterMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITextDisplay d = this.surface.getTextDisplay();
    if (this.areKnobs) {
        // Display device and current parameter page
        final StringBuilder sb = new StringBuilder();
        if (this.cursorDevice.doesExist())
            sb.append(this.cursorDevice.getName(8)).append(' ').append(this.cursorDevice.getParameterPageBank().getSelectedItem());
        else
            sb.append("No device");
        d.setCell(LaunchkeyMk3Display.SCREEN_ROW_BASE, 0, sb.toString());
        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);
    }
    final int row = this.areKnobs ? LaunchkeyMk3Display.SCREEN_ROW_POTS : LaunchkeyMk3Display.SCREEN_ROW_FADERS;
    // Format track names
    final IParameterBank parameterBank = this.cursorDevice.getParameterBank();
    for (int i = 0; i < 8; i++) {
        final IParameter item = parameterBank.getItem(i);
        final boolean exists = item.doesExist();
        final int offset = i * 2;
        d.setCell(row + offset, 0, exists ? item.getName() : "No parameter");
        d.setCell(row + offset + 1, 0, exists ? item.getDisplayedValue() : "");
    }
    // Add master fader
    if (!this.areKnobs) {
        final IMasterTrack masterTrack = this.model.getMasterTrack();
        d.setCell(row + 16, 0, "Master");
        d.setCell(row + 16 + 1, 0, "Vol: " + masterTrack.getVolumeStr());
    }
    d.allDone();
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ICursorTrack(de.mossgrabers.framework.daw.data.ICursorTrack) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Example 12 with ICursorTrack

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

the class LaunchkeyMk3VolumeMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITextDisplay d = this.surface.getTextDisplay();
    if (this.areKnobs) {
        d.setCell(LaunchkeyMk3Display.SCREEN_ROW_BASE, 0, "Volume" + 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);
    }
    final int row = this.areKnobs ? LaunchkeyMk3Display.SCREEN_ROW_POTS : LaunchkeyMk3Display.SCREEN_ROW_FADERS;
    // 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(row + offset, 0, exists ? String.format("%d: %s", Integer.valueOf(t.getPosition() + 1), t.getName()) : "No track");
        d.setCell(row + offset + 1, 0, exists ? "Vol: " + t.getVolumeStr() : "");
    }
    // Add master fader
    if (!this.areKnobs) {
        final IMasterTrack masterTrack = this.model.getMasterTrack();
        d.setCell(row + 16, 0, "Master");
        d.setCell(row + 16 + 1, 0, "Vol: " + masterTrack.getVolumeStr());
    }
    d.allDone();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ICursorTrack(de.mossgrabers.framework.daw.data.ICursorTrack) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Aggregations

ICursorTrack (de.mossgrabers.framework.daw.data.ICursorTrack)12 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)7 ITrack (de.mossgrabers.framework.daw.data.ITrack)5 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)4 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)4 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)3 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)2 ISend (de.mossgrabers.framework.daw.data.ISend)2 FlexiHandlerException (de.mossgrabers.controller.generic.flexihandler.utils.FlexiHandlerException)1 UnknownCommandException (de.mossgrabers.controller.osc.exception.UnknownCommandException)1 ColorEx (de.mossgrabers.framework.controller.color.ColorEx)1 INoteClip (de.mossgrabers.framework.daw.INoteClip)1 IProject (de.mossgrabers.framework.daw.IProject)1 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)1 IParameter (de.mossgrabers.framework.daw.data.IParameter)1 ISlot (de.mossgrabers.framework.daw.data.ISlot)1 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)1 ISlotBank (de.mossgrabers.framework.daw.data.bank.ISlotBank)1 SendData (de.mossgrabers.framework.graphics.canvas.utils.SendData)1