Search in sources :

Example 66 with ModeManager

use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.

the class TrackKnobRowCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final int value) {
    final ModeManager modeManager = this.surface.getModeManager();
    Integer cm = modeManager.getActiveModeId();
    if (cm != Modes.MODE_TRACK && cm != Modes.MODE_MASTER) {
        modeManager.setActiveMode(Modes.MODE_TRACK);
        cm = Modes.MODE_TRACK;
    }
    if (cm == Modes.MODE_MASTER) {
        if (this.index == 0)
            this.model.getMasterTrack().setVolume(value);
        else if (this.index == 1)
            this.model.getMasterTrack().setPan(value);
        return;
    }
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack track = tb.getSelectedTrack();
    if (track == null)
        return;
    switch(this.index) {
        // Volume
        case 0:
            track.setVolume(value);
            break;
        // Pan
        case 1:
            track.setPan(value);
            break;
        case 2:
            if (this.surface.getConfiguration().isDisplayCrossfader())
                track.setCrossfadeModeAsNumber(value == 0 ? 0 : value == 127 ? 2 : 1);
            else if (tb instanceof ITrackBank)
                track.getSend(0).setValue(value);
            break;
        // Send 1 - 5
        default:
            if (tb instanceof ITrackBank)
                track.getSend(this.index - (this.surface.getConfiguration().isDisplayCrossfader() ? 3 : 2)).setValue(value);
            break;
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 67 with ModeManager

use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.

the class ButtonRowSelectCommand method onSliderRowSelect.

private void onSliderRowSelect() {
    final ModeManager modeManager = this.surface.getModeManager();
    if (!modeManager.isActiveMode(Modes.MODE_VOLUME)) {
        modeManager.setActiveMode(Modes.MODE_VOLUME);
        this.activateTrackMode(false, false);
        return;
    }
    if (this.model.getMasterTrack().isSelected())
        this.activateTrackMode(false, false);
    else if (this.model.isEffectTrackBankActive())
        this.activateMasterMode(false);
    else
        this.activateTrackMode(false, true);
}
Also used : ModeManager(de.mossgrabers.framework.mode.ModeManager)

Aggregations

ModeManager (de.mossgrabers.framework.mode.ModeManager)67 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)20 ITrack (de.mossgrabers.framework.daw.data.ITrack)18 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)9 ViewManager (de.mossgrabers.framework.view.ViewManager)7 PushConfiguration (de.mossgrabers.push.PushConfiguration)7 View (de.mossgrabers.framework.view.View)6 SceneView (de.mossgrabers.framework.view.SceneView)5 PushControlSurface (de.mossgrabers.push.controller.PushControlSurface)5 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)4 IChannel (de.mossgrabers.framework.daw.data.IChannel)4 ITransport (de.mossgrabers.framework.daw.ITransport)3 DeviceBrowserMode (de.mossgrabers.push.mode.device.DeviceBrowserMode)3 DeviceParamsMode (de.mossgrabers.push.mode.device.DeviceParamsMode)3 APCControlSurface (de.mossgrabers.apc.controller.APCControlSurface)2 APCminiControlSurface (de.mossgrabers.apcmini.controller.APCminiControlSurface)2 ICursorClip (de.mossgrabers.framework.daw.ICursorClip)2 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)2 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)2 LaunchpadControlSurface (de.mossgrabers.launchpad.controller.LaunchpadControlSurface)2