Search in sources :

Example 31 with ITrack

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

the class BaseMode method drawDisplay2.

protected void drawDisplay2() {
    if (!this.surface.getConfiguration().hasDisplay2())
        return;
    final IChannelBank tb = this.model.getCurrentTrackBank();
    // Format track names
    final Display d2 = this.surface.getSecondDisplay();
    final int extenderOffset = this.surface.getExtenderOffset();
    final boolean isMainDevice = this.surface.isMainDevice();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getTrack(extenderOffset + i);
        d2.setCell(0, i, StringUtils.shortenAndFixASCII(t.getName(), isMainDevice ? 6 : 7));
    }
    if (isMainDevice)
        d2.setCell(0, 8, "Maste");
    d2.done(0);
    d2.clearRow(1);
    if (isMainDevice) {
        final IMasterTrack masterTrack = this.model.getMasterTrack();
        final ICursorDevice cursorDevice = this.model.getCursorDevice();
        final ITrack selectedTrack = masterTrack.isSelected() ? masterTrack : tb.getSelectedTrack();
        d2.setBlock(1, 0, "Sel.track: ").setBlock(1, 1, selectedTrack == null ? "None" : StringUtils.fixASCII(selectedTrack.getName()));
        d2.setBlock(1, 2, "Sel.devce: ").setBlock(1, 3, cursorDevice.hasSelectedDevice() ? cursorDevice.getName() : "None");
    }
    d2.done(1);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice) Display(de.mossgrabers.framework.controller.display.Display)

Example 32 with ITrack

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

the class PanView method setupFader.

/**
 * {@inheritDoc}
 */
@Override
public void setupFader(final int index) {
    final ITrack track = this.model.getCurrentTrackBank().getTrack(index);
    this.surface.setupPanFader(index, this.model.getColorManager().getColor(BitwigColors.getColorIndex(track.getColor())));
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack)

Example 33 with ITrack

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

the class PitchbendVolumeCommand method handleTrack.

private void handleTrack(final int index, final double value) {
    final boolean effectTrackBankActive = this.model.isEffectTrackBankActive();
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack selectedTrack = tb.getSelectedTrack();
    switch(index) {
        case 0:
            selectedTrack.setVolume(value);
            return;
        case 1:
            selectedTrack.setPan(value);
            return;
    }
    final MCUConfiguration config = this.surface.getConfiguration();
    if (index == 2) {
        if (config.isDisplayCrossfader()) {
            final double range = this.model.getValueChanger().getUpperBound() / 3.0;
            selectedTrack.setCrossfadeModeAsNumber((int) Math.round(value / range));
        } else if (!effectTrackBankActive)
            selectedTrack.getSend(0).setValue(value);
    } else if (!effectTrackBankActive)
        selectedTrack.getSend(index - (config.isDisplayCrossfader() ? 3 : 2)).setValue(value);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) MCUConfiguration(de.mossgrabers.mcu.MCUConfiguration) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 34 with ITrack

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

the class PitchbendVolumeCommand method onPitchbend.

/**
 * {@inheritDoc}
 */
@Override
public void onPitchbend(final int channel, final int data1, final int data2) {
    final double value = Math.min(data2 * 127 + (double) data1, this.model.getValueChanger().getUpperBound() - 1);
    if (channel == 8) {
        if (this.surface.isShiftPressed())
            this.model.getTransport().setMetronomeVolume(value);
        else
            this.model.getMasterTrack().setVolume(value);
        return;
    }
    final int extenderOffset = this.surface.getExtenderOffset();
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack track = tb.getTrack(extenderOffset + channel);
    if (this.surface.getConfiguration().useFadersAsKnobs()) {
        final ModeManager modeManager = this.surface.getModeManager();
        if (modeManager.isActiveMode(Modes.MODE_VOLUME))
            track.setVolume(value);
        else if (modeManager.isActiveMode(Modes.MODE_PAN))
            track.setPan(value);
        else if (modeManager.isActiveMode(Modes.MODE_TRACK))
            this.handleTrack(channel, value);
        else if (modeManager.isActiveMode(Modes.MODE_SEND1))
            track.getSend(0).setValue(value);
        else if (modeManager.isActiveMode(Modes.MODE_SEND2))
            track.getSend(1).setValue(value);
        else if (modeManager.isActiveMode(Modes.MODE_SEND3))
            track.getSend(2).setValue(value);
        else if (modeManager.isActiveMode(Modes.MODE_SEND4))
            track.getSend(3).setValue(value);
        else if (modeManager.isActiveMode(Modes.MODE_SEND5))
            track.getSend(4).setValue(value);
        else if (modeManager.isActiveMode(Modes.MODE_SEND6))
            track.getSend(5).setValue(value);
        else if (modeManager.isActiveMode(Modes.MODE_SEND7))
            track.getSend(6).setValue(value);
        else if (modeManager.isActiveMode(Modes.MODE_SEND8))
            track.getSend(7).setValue(value);
        else if (modeManager.isActiveMode(Modes.MODE_DEVICE_PARAMS))
            this.model.getCursorDevice().setParameter(extenderOffset + channel, (int) value);
        return;
    }
    track.setVolume(value);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 35 with ITrack

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

the class SendSelectCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.UP)
        return;
    if (this.model.isEffectTrackBankActive())
        return;
    final Integer activeModeId = this.surface.getModeManager().getActiveModeId();
    int index = this.modeIds.indexOf(activeModeId) + 1;
    if (index < 0 || index >= this.modeIds.size())
        index = 0;
    final ITrack track = this.model.getCurrentTrackBank().getTrack(0);
    if (track.getSend(index).doesExist())
        this.surface.getModeManager().setActiveMode(this.modeIds.get(index));
    else if (track.getSend(0).doesExist())
        this.surface.getModeManager().setActiveMode(this.modeIds.get(0));
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack)

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