Search in sources :

Example 16 with ISceneBank

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

the class SessionView method getButtonColor.

/**
 * {@inheritDoc}
 */
@Override
public int getButtonColor(final ButtonID buttonID) {
    final ISceneBank sceneBank = this.model.getSceneBank();
    final ColorManager colorManager = this.model.getColorManager();
    if (buttonID == ButtonID.ARROW_UP || buttonID == ButtonID.ARROW_DOWN) {
        final boolean isOn = buttonID == ButtonID.ARROW_UP ? sceneBank.canScrollPageBackwards() : sceneBank.canScrollPageForwards();
        return isOn ? LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_GREEN : LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_GREY_LO;
    }
    if (!ButtonID.isSceneButton(buttonID))
        return LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK;
    if (buttonID == ButtonID.SCENE1)
        return colorManager.getColorIndex(getSceneColor(sceneBank.getItem(0)));
    if (this.padMode == null)
        return colorManager.getColorIndex(getSceneColor(sceneBank.getItem(1)));
    switch(this.padMode) {
        case REC_ARM:
            return LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_RED_HI;
        case TRACK_SELECT:
            return LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_WHITE;
        case MUTE:
            return LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_AMBER_HI;
        case SOLO:
            return LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_YELLOW_HI;
        case STOP_CLIP:
            return LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_ROSE;
        default:
            return LaunchkeyMk3ColorManager.LAUNCHKEY_COLOR_BLACK;
    }
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) LaunchkeyMk3ColorManager(de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ColorManager) ColorManager(de.mossgrabers.framework.controller.color.ColorManager)

Example 17 with ISceneBank

use of de.mossgrabers.framework.daw.data.bank.ISceneBank 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 18 with ISceneBank

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

Example 19 with ISceneBank

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

the class SceneView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final IPadGrid padGrid = this.surface.getPadGrid();
    final ISceneBank sceneBank = this.model.getSceneBank();
    for (int i = 0; i < 16; i++) {
        final IScene item = sceneBank.getItem(i);
        final int x = i % 4;
        final int y = 3 - i / 4;
        if (item.doesExist()) {
            if (item.isSelected())
                padGrid.lightEx(x, y, MaschineColorManager.COLOR_WHITE);
            else
                padGrid.lightEx(x, y, DAWColor.getColorIndex(item.getColor()));
        } else
            padGrid.lightEx(x, y, AbstractFeatureGroup.BUTTON_COLOR_OFF);
    }
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene)

Example 20 with ISceneBank

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

Aggregations

ISceneBank (de.mossgrabers.framework.daw.data.bank.ISceneBank)28 IScene (de.mossgrabers.framework.daw.data.IScene)20 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)5 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)2 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)2 ITrack (de.mossgrabers.framework.daw.data.ITrack)2 KontrolProtocolConfiguration (de.mossgrabers.controller.ni.kontrol.mkii.KontrolProtocolConfiguration)1 LaunchkeyMk3ColorManager (de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ColorManager)1 LaunchkeyMiniMk3ColorManager (de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ColorManager)1 UnknownCommandException (de.mossgrabers.controller.osc.exception.UnknownCommandException)1 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)1 LightInfo (de.mossgrabers.framework.controller.grid.LightInfo)1 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)1 ISlotBank (de.mossgrabers.framework.daw.data.bank.ISlotBank)1 IMode (de.mossgrabers.framework.featuregroup.IMode)1 Modes (de.mossgrabers.framework.mode.Modes)1