Search in sources :

Example 1 with IMasterTrack

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

the class BeatstepControllerSetup method updateIndication.

private void updateIndication() {
    final BeatstepControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    final boolean isTrack = viewManager.isActiveView(Views.VIEW_TRACK);
    final boolean isDevice = viewManager.isActiveView(Views.VIEW_DEVICE);
    final boolean isSession = viewManager.isActiveView(Views.VIEW_SESSION);
    final IMasterTrack mt = this.model.getMasterTrack();
    mt.setVolumeIndication(!isDevice);
    final ITrackBank tb = this.model.getTrackBank();
    final ITrack selectedTrack = tb.getSelectedTrack();
    final IChannelBank tbe = this.model.getEffectTrackBank();
    final ITrack selectedFXTrack = tbe.getSelectedTrack();
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final boolean isEffect = this.model.isEffectTrackBankActive();
    tb.setIndication(!isEffect && isSession);
    tbe.setIndication(isEffect && isSession);
    for (int i = 0; i < 8; i++) {
        final boolean hasTrackSel = selectedTrack != null && selectedTrack.getIndex() == i;
        final ITrack track = tb.getTrack(i);
        track.setVolumeIndication(!isEffect && hasTrackSel && !isDevice);
        track.setPanIndication(!isEffect && hasTrackSel && !isDevice);
        for (int j = 0; j < 6; j++) track.getSend(j).setIndication(!isEffect && hasTrackSel && isTrack);
        final boolean hasFXTrackSel = selectedFXTrack != null && selectedFXTrack.getIndex() == i;
        final ITrack fxTrack = tbe.getTrack(i);
        fxTrack.setVolumeIndication(isEffect && hasFXTrackSel && isTrack);
        fxTrack.setPanIndication(isEffect && hasFXTrackSel && isTrack);
        cursorDevice.indicateParameter(i, isDevice);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ViewManager(de.mossgrabers.framework.view.ViewManager) BeatstepControlSurface(de.mossgrabers.beatstep.controller.BeatstepControlSurface) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 2 with IMasterTrack

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

the class VolumeView method onScene.

/**
 * {@inheritDoc}
 */
@Override
public void onScene(final int scene, final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final IMasterTrack track = this.model.getMasterTrack();
    track.setVolume(Math.min(127, (7 - scene) * this.model.getValueChanger().getUpperBound() / 7));
}
Also used : IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Example 3 with IMasterTrack

use of de.mossgrabers.framework.daw.data.IMasterTrack 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);
    }
}
Also used : ColorManager(de.mossgrabers.framework.controller.color.ColorManager) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Example 4 with IMasterTrack

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

the class MCUControllerSetup method updateVUandFaders.

private void updateVUandFaders() {
    final double upperBound = this.valueChanger.getUpperBound();
    final boolean enableVUMeters = this.configuration.isEnableVUMeters();
    final boolean hasMotorFaders = this.configuration.hasMotorFaders();
    final IChannelBank tb = this.model.getCurrentTrackBank();
    IMidiOutput output;
    for (int index = 0; index < this.numMCUDevices; index++) {
        final MCUControlSurface surface = this.getSurface(index);
        output = surface.getOutput();
        final int extenderOffset = surface.getExtenderOffset();
        for (int i = 0; i < 8; i++) {
            final int channel = extenderOffset + i;
            final ITrack track = tb.getTrack(channel);
            // Update VU LEDs of channel
            if (enableVUMeters) {
                final int vu = track.getVu();
                if (vu != this.vuValues[channel]) {
                    this.vuValues[channel] = vu;
                    final int scaledValue = (int) Math.round(vu * 12 / upperBound);
                    output.sendChannelAftertouch(0x10 * i + scaledValue, 0);
                }
            }
            // Update motor fader of channel
            if (hasMotorFaders)
                this.updateFaders(output, i, channel, track);
        }
    }
    final IMasterTrack masterTrack = this.model.getMasterTrack();
    final MCUControlSurface surface = this.getSurface();
    output = surface.getOutput();
    // Stereo VU of master channel
    if (enableVUMeters) {
        int vu = masterTrack.getVuLeft();
        if (vu != this.masterVuValues[0]) {
            this.masterVuValues[0] = vu;
            final int scaledValue = (int) Math.round(vu * 12 / upperBound);
            output.sendChannelAftertouch(1, scaledValue, 0);
        }
        vu = masterTrack.getVuRight();
        if (vu != this.masterVuValues[1]) {
            this.masterVuValues[1] = vu;
            final int scaledValue = (int) Math.round(vu * 12 / upperBound);
            output.sendChannelAftertouch(1, 0x10 + scaledValue, 0);
        }
    }
    // Update motor fader of master channel
    if (hasMotorFaders) {
        final int volume = surface.isShiftPressed() ? this.model.getTransport().getMetronomeVolume() : masterTrack.getVolume();
        if (volume != this.masterFaderValue) {
            this.masterFaderValue = volume;
            output.sendPitchbend(8, volume % 127, volume / 127);
        }
    }
}
Also used : IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) MCUControlSurface(de.mossgrabers.mcu.controller.MCUControlSurface) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Example 5 with IMasterTrack

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

the class MasterMode method updateKnobLEDs.

/**
 * {@inheritDoc}
 */
@Override
protected void updateKnobLEDs() {
    final IMasterTrack masterTrack = this.model.getMasterTrack();
    final int upperBound = this.model.getValueChanger().getUpperBound();
    this.surface.setKnobLED(0, MCUControlSurface.KNOB_LED_MODE_WRAP, masterTrack.getVolume(), upperBound);
    this.surface.setKnobLED(1, MCUControlSurface.KNOB_LED_MODE_BOOST_CUT, masterTrack.getPan(), upperBound);
    for (int i = 0; i < 6; i++) this.surface.setKnobLED(2 + i, MCUControlSurface.KNOB_LED_MODE_WRAP, 0, upperBound);
}
Also used : IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Aggregations

IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)40 ITrack (de.mossgrabers.framework.daw.data.ITrack)15 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)7 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)6 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)5 Display (de.mossgrabers.framework.controller.display.Display)4 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)4 ICursorTrack (de.mossgrabers.framework.daw.data.ICursorTrack)4 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)3 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)3 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)2 IApplication (de.mossgrabers.framework.daw.IApplication)2 IProject (de.mossgrabers.framework.daw.IProject)2 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)2 ITransport (de.mossgrabers.framework.daw.ITransport)2 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)2 ModeManager (de.mossgrabers.framework.mode.ModeManager)2 PushDisplay (de.mossgrabers.push.controller.PushDisplay)2 BeatstepControlSurface (de.mossgrabers.beatstep.controller.BeatstepControlSurface)1 PushColorManager (de.mossgrabers.controller.ableton.push.controller.PushColorManager)1