Search in sources :

Example 1 with ISceneBank

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

the class SessionView method onGridNote.

/**
 * {@inheritDoc}
 */
@Override
public void onGridNote(final int note, final int velocity) {
    if (velocity == 0)
        return;
    final ISceneBank sceneBank = this.model.getCurrentTrackBank().getSceneBank();
    final int index = note - 36;
    switch(index) {
        case 0:
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
            // Not used
            break;
        case 6:
            sceneBank.selectPreviousPage();
            break;
        case 7:
            sceneBank.selectNextPage();
            break;
        case 8:
        case 9:
        case 10:
        case 11:
        case 12:
        case 13:
        case 14:
        case 15:
            sceneBank.getItem(index - 8).launch();
            break;
        default:
            // Not used
            break;
    }
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank)

Example 2 with ISceneBank

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

the class SessionView method getButtonColorID.

/**
 * {@inheritDoc}
 */
@Override
public String getButtonColorID(final ButtonID buttonID) {
    final int index = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
    if (index >= 0 || index < 8) {
        final ITrackBank tb = this.model.getCurrentTrackBank();
        final ISceneBank sceneBank = tb.getSceneBank();
        final IScene s = sceneBank.getItem(index);
        if (s.doesExist())
            return DAWColor.getColorIndex(s.getColor());
    }
    return AbstractFeatureGroup.BUTTON_COLOR_OFF;
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 3 with ISceneBank

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

the class StartSceneCommand method getScene.

/**
 * Get the related scene.
 *
 * @return The scene
 */
public IScene getScene() {
    final ISceneBank sceneBank = this.model.getSceneBank();
    if (this.index >= 0)
        return sceneBank.getItem(this.index);
    final Optional<IScene> sceneOptional = sceneBank.getSelectedItem();
    return sceneOptional.isEmpty() ? EmptyScene.INSTANCE : sceneOptional.get();
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene)

Example 4 with ISceneBank

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

the class ShiftView method getTrackButtonColor.

/**
 * {@inheritDoc}
 */
@Override
public int getTrackButtonColor(final int index) {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final ISceneBank sceneBank = tb.getSceneBank();
    final Modes mode = this.surface.getModeManager().getActiveID();
    switch(index) {
        case 0:
            return sceneBank.canScrollPageBackwards() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
        case 1:
            return sceneBank.canScrollPageForwards() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
        case 2:
            return tb.canScrollPageBackwards() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
        case 3:
            return tb.canScrollPageForwards() ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
        case 4:
            return Modes.VOLUME.equals(mode) ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
        case 5:
            return Modes.PAN.equals(mode) ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
        case 6:
            return Modes.isSendMode(mode) ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
        case 7:
            return Modes.DEVICE_PARAMS.equals(mode) ? APCminiControlSurface.APC_BUTTON_STATE_ON : APCminiControlSurface.APC_BUTTON_STATE_OFF;
        default:
            // Never reached
            break;
    }
    return APCminiColorManager.APC_COLOR_BLACK;
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) Modes(de.mossgrabers.framework.mode.Modes) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 5 with ISceneBank

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

the class SessionView method getButtonColorID.

/**
 * {@inheritDoc}
 */
@Override
public String getButtonColorID(final ButtonID buttonID) {
    final int scene = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
    if (scene < 0 || scene >= 8)
        return AbstractFeatureGroup.BUTTON_COLOR_OFF;
    final ISceneBank sceneBank = this.model.getSceneBank();
    final IScene s = sceneBank.getItem(scene);
    if (!s.doesExist())
        return AbstractSessionView.COLOR_SCENE_OFF;
    if (s.isSelected())
        return AbstractSessionView.COLOR_SELECTED_SCENE;
    return this.useClipColor ? DAWColor.getColorIndex(s.getColor()) : AbstractSessionView.COLOR_SCENE;
}
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