Search in sources :

Example 16 with ViewManager

use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.

the class SelectPlayViewCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ITrack cursorTrack = this.model.getCursorTrack();
    // Restore the previous play view if coming from one not on the list
    final ViewManager viewManager = this.surface.getViewManager();
    final Views activeViewId = viewManager.getActiveID();
    if (cursorTrack.doesExist() && !this.allViewIds.contains(activeViewId)) {
        final Views viewID = viewManager.getPreferredView(cursorTrack.getPosition());
        if (viewID != null) {
            viewManager.setActive(viewID);
            this.surface.getDisplay().notify(viewManager.get(viewID).getName());
            return;
        }
    }
    super.executeNormal(event);
    // Store the newly selected view for the current track
    if (cursorTrack.doesExist())
        viewManager.setPreferredView(cursorTrack.getPosition(), viewManager.getActiveID());
}
Also used : Views(de.mossgrabers.framework.view.Views) ITrack(de.mossgrabers.framework.daw.data.ITrack) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager)

Example 17 with ViewManager

use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.

the class PlaySelectCommand method executeNormal.

/**
 * {@inheritDoc}}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (this.surface.isPressed(ButtonID.ALT)) {
        this.model.getCursorClip().quantize(1);
        this.surface.getDisplay().notify("Quantize");
        return;
    }
    super.executeNormal(event);
    final ITrack cursorTrack = this.model.getCursorTrack();
    if (cursorTrack.doesExist()) {
        final ViewManager viewManager = this.surface.getViewManager();
        viewManager.setPreferredView(cursorTrack.getPosition(), viewManager.getActiveID());
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager)

Example 18 with ViewManager

use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.

the class StepSequencerSelectCommand method executeNormal.

/**
 * {@inheritDoc}}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    final ModeManager modeManager = this.surface.getModeManager();
    // Toggle note mode
    if (this.surface.isPressed(ButtonID.ALT)) {
        if (event == ButtonEvent.DOWN) {
            this.surface.setTriggerConsumed(ButtonID.ALT);
            if (modeManager.isActive(Modes.NOTE))
                modeManager.restore();
            else
                modeManager.setActive(Modes.NOTE);
            this.surface.getDisplay().notify("Edit Notes: " + (modeManager.isActive(Modes.NOTE) ? "On" : "Off"));
            ((INoteMode) modeManager.get(Modes.NOTE)).clearNotes();
        }
        return;
    }
    super.executeNormal(event);
    if (event == ButtonEvent.UP) {
        ((INoteMode) modeManager.get(Modes.NOTE)).clearNotes();
        final ITrack cursorTrack = this.model.getCursorTrack();
        if (cursorTrack.doesExist()) {
            final ViewManager viewManager = this.surface.getViewManager();
            viewManager.setPreferredView(cursorTrack.getPosition(), viewManager.getActiveID());
        }
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) INoteMode(de.mossgrabers.framework.mode.INoteMode) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 19 with ViewManager

use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.

the class ShiftView method onButton.

/**
 * {@inheritDoc}
 */
@Override
public void onButton(final ButtonID buttonID, final ButtonEvent event, final int velocity) {
    if (!ButtonID.isSceneButton(buttonID) || event != ButtonEvent.DOWN)
        return;
    final int index = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
    final ViewManager viewManager = this.surface.getViewManager();
    if (viewManager.getActiveIDIgnoreTemporary() == Views.SESSION && VIEW_IDS[index] == Views.SESSION)
        ((SessionView) viewManager.get(Views.SESSION)).toggleBirdsEyeView();
    else
        viewManager.setActive(VIEW_IDS[index]);
    this.surface.getDisplay().notify(viewManager.get(VIEW_IDS[index]).getName());
    if (Views.SESSION.equals(VIEW_IDS[index]))
        return;
    final ITrack cursorTrack = this.model.getCursorTrack();
    if (cursorTrack.doesExist())
        viewManager.setPreferredView(cursorTrack.getPosition(), VIEW_IDS[index]);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager)

Example 20 with ViewManager

use of de.mossgrabers.framework.featuregroup.ViewManager in project DrivenByMoss by git-moss.

the class DrumSequencerSelectCommand method executeNormal.

/**
 * {@inheritDoc}}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    final ModeManager modeManager = this.surface.getModeManager();
    // Toggle note mode
    if (this.surface.isPressed(ButtonID.ALT)) {
        if (event == ButtonEvent.DOWN) {
            this.surface.setTriggerConsumed(ButtonID.ALT);
            if (modeManager.isActive(Modes.NOTE))
                modeManager.restore();
            else
                modeManager.setActive(Modes.NOTE);
            this.surface.getDisplay().notify("Edit Notes: " + (modeManager.isActive(Modes.NOTE) ? "On" : "Off"));
            ((INoteMode) modeManager.get(Modes.NOTE)).clearNotes();
        }
        return;
    }
    super.executeNormal(event);
    if (event == ButtonEvent.UP) {
        ((INoteMode) modeManager.get(Modes.NOTE)).clearNotes();
        final ITrack cursorTrack = this.model.getCursorTrack();
        if (cursorTrack.doesExist()) {
            final ViewManager viewManager = this.surface.getViewManager();
            viewManager.setPreferredView(cursorTrack.getPosition(), viewManager.getActiveID());
        }
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) INoteMode(de.mossgrabers.framework.mode.INoteMode) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Aggregations

ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)58 ITrack (de.mossgrabers.framework.daw.data.ITrack)12 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)11 Views (de.mossgrabers.framework.view.Views)11 INoteMode (de.mossgrabers.framework.mode.INoteMode)5 BeatstepControlSurface (de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface)4 MaschineControlSurface (de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface)4 IView (de.mossgrabers.framework.featuregroup.IView)4 DrumView (de.mossgrabers.controller.ni.maschine.mk3.view.DrumView)3 ConfiguredRecordCommand (de.mossgrabers.framework.command.trigger.transport.ConfiguredRecordCommand)3 FeatureGroupButtonColorSupplier (de.mossgrabers.framework.command.trigger.view.FeatureGroupButtonColorSupplier)3 IHost (de.mossgrabers.framework.daw.IHost)3 ITransport (de.mossgrabers.framework.daw.ITransport)3 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)3 PlayView (de.mossgrabers.controller.arturia.beatstep.view.PlayView)2 LaunchkeyMk3ControlSurface (de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface)2 LaunchkeyMiniMk3ControlSurface (de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface)2 SLMkIIIControlSurface (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIControlSurface)2 DrumView (de.mossgrabers.controller.novation.slmkiii.view.DrumView)2 Configuration (de.mossgrabers.framework.configuration.Configuration)2