Search in sources :

Example 51 with ITrack

use of de.mossgrabers.framework.daw.data.ITrack 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 ITrack

use of de.mossgrabers.framework.daw.data.ITrack 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 ITrack

use of de.mossgrabers.framework.daw.data.ITrack 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 ITrack

use of de.mossgrabers.framework.daw.data.ITrack 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)

Example 55 with ITrack

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

the class MastertrackCommand method handleButtonUp.

private void handleButtonUp(final ModeManager modeManager) {
    if (this.quitMasterMode) {
        modeManager.restoreMode();
        return;
    }
    if (modeManager.getActiveModeId() == Modes.MODE_MASTER) {
        if (this.selectedTrackBeforeMasterMode >= 0)
            this.model.getCurrentTrackBank().getTrack(this.selectedTrackBeforeMasterMode).select();
        return;
    }
    modeManager.setActiveMode(Modes.MODE_MASTER);
    this.model.getMasterTrack().select();
    final ITrack track = this.model.getCurrentTrackBank().getSelectedTrack();
    this.selectedTrackBeforeMasterMode = track == null ? -1 : track.getIndex();
}
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