Search in sources :

Example 6 with Configuration

use of de.mossgrabers.framework.configuration.Configuration in project DrivenByMoss by git-moss.

the class AbstractPlayView method initMaxVelocity.

/**
 * Updates the velocity transition table based on the fixed accent value.
 */
protected void initMaxVelocity() {
    final int[] maxVelocity = new int[128];
    final Configuration config = this.surface.getConfiguration();
    Arrays.fill(maxVelocity, Math.min(127, Math.max(0, config.getFixedAccentValue())));
    maxVelocity[0] = 0;
    this.surface.setVelocityTranslationTable(config.isAccentActive() ? maxVelocity : this.defaultVelocity);
}
Also used : Configuration(de.mossgrabers.framework.configuration.Configuration)

Example 7 with Configuration

use of de.mossgrabers.framework.configuration.Configuration in project DrivenByMoss by git-moss.

the class MaschineJamSessionViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    final ViewManager viewManager = this.surface.getViewManager();
    final SessionView sessionView = (SessionView) viewManager.get(Views.SESSION);
    final Configuration configuration = this.surface.getConfiguration();
    if (event == ButtonEvent.UP) {
        // Toggle Arrange and Mix panel layout
        if (this.surface.isShiftPressed()) {
            final IApplication application = this.model.getApplication();
            final boolean isArrange = IApplication.PANEL_LAYOUT_ARRANGE.equals(application.getPanelLayout());
            application.setPanelLayout(isArrange ? IApplication.PANEL_LAYOUT_MIX : IApplication.PANEL_LAYOUT_ARRANGE);
            return;
        }
        if (viewManager.isActive(Views.SESSION)) {
            // Disable birds-eye-view if active
            if (sessionView.isBirdsEyeActive()) {
                sessionView.setBirdsEyeActive(false);
                this.notifyViewName(false, configuration.isFlipSession());
                return;
            }
            // Flip clips
            final boolean flipped = !configuration.isFlipSession();
            configuration.setFlipSession(flipped);
            this.notifyViewName(false, flipped);
            return;
        }
        // Activate session view
        viewManager.setActive(Views.SESSION);
        this.notifyViewName(false, configuration.isFlipSession());
    } else if (event == ButtonEvent.LONG) {
        // Only trigger birds-eye-view if session view is already active
        this.surface.setTriggerConsumed(ButtonID.SESSION);
        sessionView.setBirdsEyeActive(true);
        this.notifyViewName(true, configuration.isFlipSession());
    }
}
Also used : IApplication(de.mossgrabers.framework.daw.IApplication) Configuration(de.mossgrabers.framework.configuration.Configuration) MaschineJamConfiguration(de.mossgrabers.controller.ni.maschine.jam.MaschineJamConfiguration) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) SessionView(de.mossgrabers.controller.ni.maschine.jam.view.SessionView)

Example 8 with Configuration

use of de.mossgrabers.framework.configuration.Configuration in project DrivenByMoss by git-moss.

the class SelectSessionViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    final ViewManager viewManager = this.surface.getViewManager();
    final SessionView sessionView = (SessionView) viewManager.get(Views.SESSION);
    final Configuration configuration = this.surface.getConfiguration();
    switch(event) {
        case DOWN:
            this.temporaryMode = TemporaryMode.OFF;
            // Display Mix view with Shift
            if (this.surface.isShiftPressed()) {
                this.surface.setTriggerConsumed(ButtonID.SESSION);
                viewManager.setActive(Views.MIX);
                this.notifyViewName(Views.MIX, false, false);
            }
            break;
        case LONG:
            // Only trigger birds-eye-view if session view is already active
            if (viewManager.isActive(Views.SESSION)) {
                if (this.temporaryMode != TemporaryMode.POSSIBLE) {
                    this.surface.setTriggerConsumed(ButtonID.SESSION);
                    sessionView.setBirdsEyeActive(true);
                    this.notifyViewName(Views.SESSION, true, configuration.isFlipSession());
                }
                return;
            }
            this.activatedView(viewManager, configuration);
            break;
        case UP:
            if (this.temporaryMode == TemporaryMode.ACTIVE) {
                this.surface.getViewManager().restore();
                return;
            }
            if (this.temporaryMode == TemporaryMode.POSSIBLE)
                return;
            if (viewManager.isActive(Views.SESSION)) {
                // Disable birds-eye-view if active
                if (sessionView.isBirdsEyeActive()) {
                    sessionView.setBirdsEyeActive(false);
                    this.notifyViewName(Views.SESSION, false, configuration.isFlipSession());
                    return;
                }
                // Flip clips
                final boolean flipped = !configuration.isFlipSession();
                configuration.setFlipSession(flipped);
                this.notifyViewName(Views.SESSION, false, flipped);
                return;
            }
            this.activatedView(viewManager, configuration);
            break;
    }
}
Also used : Configuration(de.mossgrabers.framework.configuration.Configuration) LaunchpadConfiguration(de.mossgrabers.controller.novation.launchpad.LaunchpadConfiguration) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) SessionView(de.mossgrabers.controller.novation.launchpad.view.SessionView)

Aggregations

Configuration (de.mossgrabers.framework.configuration.Configuration)8 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)2 IParameter (de.mossgrabers.framework.daw.data.IParameter)2 ArpeggiatorMode (de.mossgrabers.framework.daw.midi.ArpeggiatorMode)2 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)2 MaschineJamConfiguration (de.mossgrabers.controller.ni.maschine.jam.MaschineJamConfiguration)1 SessionView (de.mossgrabers.controller.ni.maschine.jam.view.SessionView)1 LaunchpadConfiguration (de.mossgrabers.controller.novation.launchpad.LaunchpadConfiguration)1 SessionView (de.mossgrabers.controller.novation.launchpad.view.SessionView)1 AbstractConfiguration (de.mossgrabers.framework.configuration.AbstractConfiguration)1 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)1 IApplication (de.mossgrabers.framework.daw.IApplication)1 IGroove (de.mossgrabers.framework.daw.IGroove)1 ViewManager (de.mossgrabers.framework.view.ViewManager)1 LaunchpadConfiguration (de.mossgrabers.launchpad.LaunchpadConfiguration)1