Search in sources :

Example 51 with IChannelBank

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

the class VolumeMode method onValueKnobTouch.

/**
 * {@inheritDoc}
 */
@Override
public void onValueKnobTouch(final int index, final boolean isTouched) {
    this.isKnobTouched[index] = isTouched;
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack t = tb.getTrack(index);
    if (!t.doesExist())
        return;
    if (isTouched) {
        if (this.surface.isDeletePressed()) {
            this.surface.setButtonConsumed(this.surface.getDeleteButtonId());
            t.resetVolume();
        } else
            this.surface.getDisplay().notify("Volume: " + t.getVolumeStr(8));
    }
    t.touchVolume(isTouched);
    this.checkStopAutomationOnKnobRelease(isTouched);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 52 with IChannelBank

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

the class ColorView method onGridNote.

/**
 * {@inheritDoc}
 */
@Override
public void onGridNote(final int note, final int velocity) {
    if (velocity == 0)
        return;
    final int color = note - 36;
    if (color < BitwigColors.BITWIG_COLORS.length) {
        final double[] entry = BitwigColors.getColorEntry(BitwigColors.BITWIG_COLORS[color]);
        switch(this.mode) {
            case MODE_TRACK:
                final IChannelBank tb = this.model.getCurrentTrackBank();
                final ITrack t = tb.getSelectedTrack();
                if (t == null) {
                    final IMasterTrack master = this.model.getMasterTrack();
                    if (master.isSelected())
                        master.setColor(entry[0], entry[1], entry[2]);
                } else
                    t.setColor(entry[0], entry[1], entry[2]);
                break;
            case MODE_LAYER:
                final ICursorDevice cd = this.model.getCursorDevice();
                final IChannel deviceChain = cd.getSelectedLayerOrDrumPad();
                cd.setLayerOrDrumPadColor(deviceChain.getIndex(), entry[0], entry[1], entry[2]);
                break;
            case MODE_CLIP:
                final ICursorClip clip = this.model.getCursorClip();
                if (clip != null)
                    clip.setColor(entry[0], entry[1], entry[2]);
                break;
        }
    }
    this.surface.getViewManager().restoreView();
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorClip(de.mossgrabers.framework.daw.ICursorClip) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 53 with IChannelBank

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

the class DrumViewBase method onScene.

/**
 * {@inheritDoc}
 */
@Override
public void onScene(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.DOWN || !this.model.canSelectedTrackHoldNotes())
        return;
    if (!this.surface.isShiftPressed()) {
        super.onScene(index, event);
        return;
    }
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack selectedTrack = tb.getSelectedTrack();
    if (selectedTrack != null)
        this.onLowerScene(index);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 54 with IChannelBank

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

the class PanSendCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
    final ModeManager modeManager = this.surface.getModeManager();
    final Integer currentMode = modeManager.getActiveModeId();
    // Layer mode selection for Push 1
    Integer mode;
    final PushConfiguration config = this.surface.getConfiguration();
    if (!config.isPush2() && this.surface.isSelectPressed() && Modes.isLayerMode(currentMode)) {
        if (this.model.isEffectTrackBankActive()) {
            // No Sends on FX tracks
            mode = Modes.MODE_DEVICE_LAYER_PAN;
        } else {
            mode = Integer.valueOf(currentMode.intValue() + 1);
            // Wrap
            if (mode.intValue() < Modes.MODE_DEVICE_LAYER_PAN.intValue() || mode.intValue() > Modes.MODE_DEVICE_LAYER_SEND6.intValue())
                mode = Modes.MODE_DEVICE_LAYER_PAN;
            // Check if Send channel exists
            if (mode.intValue() >= Modes.MODE_DEVICE_LAYER_SEND1.intValue() && mode.intValue() <= Modes.MODE_DEVICE_LAYER_SEND6.intValue() && fxTrackBank != null && !fxTrackBank.getTrack(mode.intValue() - Modes.MODE_DEVICE_LAYER_SEND1.intValue()).doesExist())
                mode = Modes.MODE_DEVICE_LAYER_PAN;
        }
        modeManager.setActiveMode(mode);
        return;
    }
    if (this.model.isEffectTrackBankActive()) {
        // No Sends on FX tracks
        mode = Modes.MODE_PAN;
    } else {
        mode = Integer.valueOf(currentMode.intValue() + 1);
        // Wrap
        if (mode.intValue() < Modes.MODE_PAN.intValue() || mode.intValue() > Modes.MODE_SEND6.intValue())
            mode = Modes.MODE_PAN;
        // Check if Send channel exists
        if (mode.intValue() >= Modes.MODE_SEND1.intValue() && mode.intValue() <= Modes.MODE_SEND6.intValue() && fxTrackBank != null && !fxTrackBank.getTrack(mode.intValue() - Modes.MODE_SEND1.intValue()).doesExist())
            mode = Modes.MODE_PAN;
    }
    modeManager.setActiveMode(mode);
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 55 with IChannelBank

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

the class SelectPlayViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ViewManager viewManager = this.surface.getViewManager();
    if (Views.isSessionView(viewManager.getActiveViewId())) {
        final IChannelBank tb = this.model.getCurrentTrackBank();
        final ITrack selectedTrack = tb.getSelectedTrack();
        if (selectedTrack == null) {
            this.surface.getDisplay().notify("Please select a track first.");
            return;
        }
        final Integer preferredView = viewManager.getPreferredView(selectedTrack.getPosition());
        viewManager.setActiveView(preferredView == null ? Views.VIEW_PLAY : preferredView);
        return;
    }
    final ModeManager modeManager = this.surface.getModeManager();
    if (modeManager.isActiveMode(Modes.MODE_VIEW_SELECT))
        modeManager.restoreMode();
    else
        modeManager.setActiveMode(Modes.MODE_VIEW_SELECT);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ViewManager(de.mossgrabers.framework.view.ViewManager) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Aggregations

IChannelBank (de.mossgrabers.framework.daw.IChannelBank)114 ITrack (de.mossgrabers.framework.daw.data.ITrack)92 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)22 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)20 ModeManager (de.mossgrabers.framework.mode.ModeManager)20 PushConfiguration (de.mossgrabers.push.PushConfiguration)19 Display (de.mossgrabers.framework.controller.display.Display)18 ISend (de.mossgrabers.framework.daw.data.ISend)11 ViewManager (de.mossgrabers.framework.view.ViewManager)10 PushDisplay (de.mossgrabers.push.controller.PushDisplay)10 IChannel (de.mossgrabers.framework.daw.data.IChannel)9 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)7 ISlot (de.mossgrabers.framework.daw.data.ISlot)7 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)5 View (de.mossgrabers.framework.view.View)5 DisplayMessage (de.mossgrabers.push.controller.DisplayMessage)5 ITransport (de.mossgrabers.framework.daw.ITransport)4 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)4 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)3 PadGrid (de.mossgrabers.framework.controller.grid.PadGrid)3