Search in sources :

Example 31 with IScene

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

the class PadModeSelectView method onButton.

/**
 * {@inheritDoc}
 */
@Override
public void onButton(final ButtonID buttonID, final ButtonEvent event, final int velocity) {
    if (!ButtonID.isSceneButton(buttonID))
        return;
    if (event == ButtonEvent.UP) {
        this.surface.getViewManager().restore();
        if (this.isConsumed)
            return;
        final ISceneBank sceneBank = this.model.getCurrentTrackBank().getSceneBank();
        final int index = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
        final IScene scene = sceneBank.getItem(index);
        scene.select();
        scene.launch();
    } else if (event == ButtonEvent.LONG)
        this.isConsumed = true;
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene)

Example 32 with IScene

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

the class MaschineJamStartSceneCommand method getButtonColor.

/**
 * Get the index of the color to use for current state.
 *
 * @return The index of the button color
 */
public int getButtonColor() {
    final MaschineColorManager colorManager = (MaschineColorManager) this.model.getColorManager();
    if (this.surface.isPressed(ButtonID.SEQUENCER)) {
        if (SEQUENCER_VIEWS[this.index] == null)
            return colorManager.getColorIndex(ColorManager.BUTTON_STATE_OFF);
        return this.surface.getViewManager().isActive(SEQUENCER_VIEWS[this.index]) ? MaschineColorManager.COLOR_GREEN : MaschineColorManager.COLOR_GREY;
    }
    if (this.surface.isPressed(ButtonID.NOTE)) {
        if (PLAY_VIEWS[this.index] == null)
            return colorManager.getColorIndex(ColorManager.BUTTON_STATE_OFF);
        return this.surface.getViewManager().isActive(PLAY_VIEWS[this.index]) ? MaschineColorManager.COLOR_BLUE : MaschineColorManager.COLOR_GREY;
    }
    final IScene scene = this.getScene();
    if (scene.doesExist())
        return colorManager.dimOrHighlightColor(scene.getColor(), scene.isSelected());
    return 0;
}
Also used : IScene(de.mossgrabers.framework.daw.data.IScene) MaschineColorManager(de.mossgrabers.controller.ni.maschine.core.MaschineColorManager)

Example 33 with IScene

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

the class SessionView method onButton.

/**
 * {@inheritDoc}
 */
@Override
public void onButton(final ButtonID buttonID, final ButtonEvent event, final int velocity) {
    final ISceneBank sceneBank = this.model.getCurrentTrackBank().getSceneBank();
    if (buttonID == ButtonID.ARROW_UP || buttonID == ButtonID.ARROW_DOWN) {
        if (event != ButtonEvent.UP)
            return;
        if (buttonID == ButtonID.ARROW_UP)
            sceneBank.scrollBackwards();
        else
            sceneBank.scrollForwards();
        return;
    }
    if (!ButtonID.isSceneButton(buttonID))
        return;
    final int index = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
    if (event == ButtonEvent.DOWN) {
        if (index == 1)
            this.surface.getViewManager().setActive(Views.CONTROL);
        return;
    }
    if (event == ButtonEvent.UP) {
        final IScene scene = sceneBank.getItem(index);
        scene.select();
        scene.launch();
    }
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene)

Example 34 with IScene

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

the class SessionView method onButton.

/**
 * {@inheritDoc}
 */
@Override
public void onButton(final ButtonID buttonID, final ButtonEvent event, final int velocity) {
    if (!ButtonID.isSceneButton(buttonID))
        return;
    final int index = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
    final ISceneBank sceneBank = this.model.getCurrentTrackBank().getSceneBank();
    if (this.surface.isShiftPressed()) {
        if (event != ButtonEvent.UP)
            return;
        if (index == 0)
            sceneBank.selectPreviousPage();
        else
            sceneBank.selectNextPage();
        return;
    }
    if (event == ButtonEvent.DOWN) {
        if (index == 1)
            this.surface.getViewManager().setActive(Views.CONTROL);
        return;
    }
    if (event == ButtonEvent.UP) {
        final IScene scene = sceneBank.getItem(index);
        scene.select();
        scene.launch();
    }
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene)

Aggregations

IScene (de.mossgrabers.framework.daw.data.IScene)34 ISceneBank (de.mossgrabers.framework.daw.data.bank.ISceneBank)20 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)2 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)2 ISceneBank (de.mossgrabers.framework.daw.ISceneBank)2 FlexiHandlerException (de.mossgrabers.controller.generic.flexihandler.utils.FlexiHandlerException)1 MaschineColorManager (de.mossgrabers.controller.ni.maschine.core.MaschineColorManager)1 LaunchkeyMiniMk3ColorManager (de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ColorManager)1 SLMkIIIColorManager (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIColorManager)1 UnknownCommandException (de.mossgrabers.controller.osc.exception.UnknownCommandException)1 Display (de.mossgrabers.framework.controller.display.Display)1 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)1 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)1