Search in sources :

Example 76 with ITrack

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

the class AbstractTrackMode method onButton.

/**
 * {@inheritDoc}
 */
@Override
public void onButton(final int row, final int index, final ButtonEvent event) {
    if (event != ButtonEvent.UP || row != 0)
        return;
    // Combination with Shift
    if (this.surface.isShiftPressed()) {
        this.onButtonShifted(index);
        return;
    }
    // Combination with Arrow Down
    if (this.surface.isLongPressed(ButtonID.ARROW_DOWN)) {
        this.surface.getModeManager().setActive(MODES[index]);
        this.surface.setTriggerConsumed(ButtonID.ARROW_DOWN);
        return;
    }
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final ITrack track = tb.getItem(index);
    // Combination with Duplicate
    if (this.surface.isPressed(ButtonID.DUPLICATE)) {
        this.surface.setTriggerConsumed(ButtonID.DUPLICATE);
        track.duplicate();
        return;
    }
    // Combination with Delete
    if (this.surface.isPressed(ButtonID.DELETE)) {
        this.surface.setTriggerConsumed(ButtonID.DELETE);
        track.remove();
        return;
    }
    // Select track or expand group
    track.selectOrExpandGroup();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 77 with ITrack

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

the class SLMkIIIVolumeMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final SLMkIIIDisplay d = this.surface.getDisplay();
    d.clear();
    d.setCell(0, 8, "Volume");
    final ITrackBank tb = this.model.getCurrentTrackBank();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getItem(i);
        if (t.doesExist())
            d.setCell(0, i, "Volume").setCell(1, i, t.getVolumeStr(9));
        this.setColumnColors(d, i, t, SLMkIIIColorManager.SLMKIII_BLUE);
    }
    final ITrack cursorTrack = this.model.getCursorTrack();
    d.setCell(1, 8, cursorTrack.doesExist() ? StringUtils.fixASCII(cursorTrack.getName(9)) : "");
    this.drawRow4();
    this.setButtonInfo(d);
    d.allDone();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) SLMkIIIDisplay(de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)

Example 78 with ITrack

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

the class SLTrackMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITrack cursorTrack = this.model.getCursorTrack();
    final ITextDisplay d = this.surface.getTextDisplay().clearRow(0).clearRow(1);
    if (!cursorTrack.doesExist()) {
        d.setRow(0, "                        Please select a track...                       ").done(0).done(1);
        return;
    }
    d.setCell(0, 0, "Volume").setCell(1, 0, cursorTrack.getVolumeStr(8)).setCell(0, 1, "Pan").setCell(1, 1, cursorTrack.getPanStr(8));
    final int sendStart = 2;
    final int sendCount = 6;
    int pos;
    final ISendBank sendBank = cursorTrack.getSendBank();
    if (sendBank.getPageSize() > 0) {
        for (int i = 0; i < sendCount; i++) {
            pos = sendStart + i;
            final ISend send = sendBank.getItem(i);
            if (send.doesExist())
                d.setCell(0, pos, send.getName(8)).setCell(1, pos, send.getDisplayedValue(8));
        }
    }
    d.done(0).done(1);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 79 with ITrack

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

the class AutoColorSetup method createObservers.

/**
 * {@inheritDoc}
 */
@Override
protected void createObservers() {
    super.createObservers();
    // Update track colors if Auto Color is enabled in the settings
    this.configuration.addSettingObserver(AutoColorConfiguration.ENABLE_AUTO_COLOR, () -> {
        if (!this.configuration.isEnableAutoColor())
            return;
        final ITrackBank tb = this.model.getTrackBank();
        for (int i = 0; i < tb.getPageSize(); i++) this.autoColor.matchTrackName(i, tb.getItem(i).getName());
    });
    // Monitor all color regular expression settings
    final DAWColor[] colors = DAWColor.values();
    for (int i = 0; i < colors.length; i++) {
        final DAWColor color = colors[i];
        this.configuration.addSettingObserver(Integer.valueOf(AutoColorConfiguration.COLOR_REGEX.intValue() + i), () -> this.autoColor.handleRegExChange(color, this.configuration.getColorRegExValue(color)));
    }
    // Add name observers to all tracks
    final ITrackBank tb = this.model.getTrackBank();
    for (int index = 0; index < tb.getPageSize(); index++) {
        final int i = index;
        final ITrack track = tb.getItem(index);
        track.addNameObserver(name -> this.autoColor.matchTrackName(i, name));
        track.addColorObserver(name -> this.autoColor.matchTrackName(i, track.getName()));
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) DAWColor(de.mossgrabers.framework.daw.DAWColor)

Example 80 with ITrack

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

the class FaderAbsoluteCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final int value) {
    final ITrackBank currentTrackBank = this.model.getCurrentTrackBank();
    final ITrack track = currentTrackBank.getItem(this.index);
    if (!track.doesExist())
        return;
    if (this.surface.isShiftPressed()) {
        final int volume = track.getVolume();
        this.surface.getDisplay().notify(getNotificationText(value, volume));
    } else
        track.setVolume(value);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Aggregations

ITrack (de.mossgrabers.framework.daw.data.ITrack)312 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)92 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)84 ISend (de.mossgrabers.framework.daw.data.ISend)40 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)25 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)19 ISlot (de.mossgrabers.framework.daw.data.ISlot)19 Display (de.mossgrabers.framework.controller.display.Display)18 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)18 ModeManager (de.mossgrabers.framework.mode.ModeManager)18 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)16 ViewManager (de.mossgrabers.framework.view.ViewManager)16 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)15 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)15 PushConfiguration (de.mossgrabers.push.PushConfiguration)14 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)12 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)11 PushDisplay (de.mossgrabers.push.controller.PushDisplay)11 ITransport (de.mossgrabers.framework.daw.ITransport)9 IParameter (de.mossgrabers.framework.daw.data.IParameter)9