Search in sources :

Example 11 with IScene

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

the class Drum64View 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();
    if (this.surface.isPressed(ButtonID.REPEAT)) {
        NoteRepeatSceneHelper.handleNoteRepeatSelection(this.surface, 7 - index);
        return;
    }
    final IScene scene = this.model.getCurrentTrackBank().getSceneBank().getItem(index);
    if (this.isButtonCombination(ButtonID.DELETE)) {
        scene.remove();
        return;
    }
    if (this.isButtonCombination(ButtonID.DUPLICATE)) {
        scene.duplicate();
        return;
    }
    scene.select();
    scene.launch();
}
Also used : IScene(de.mossgrabers.framework.daw.data.IScene)

Example 12 with IScene

use of de.mossgrabers.framework.daw.data.IScene 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 s.isSelected() ? AbstractSessionView.COLOR_SELECTED_SCENE : AbstractSessionView.COLOR_SCENE;
    return AbstractSessionView.COLOR_SCENE_OFF;
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene)

Example 13 with IScene

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

the class SceneModule method flush.

/**
 * {@inheritDoc}
 */
@Override
public void flush(final boolean dump) {
    final ISceneBank sceneBank = this.model.getSceneBank();
    for (int i = 0; i < sceneBank.getPageSize(); i++) {
        final IScene scene = sceneBank.getItem(i);
        final String sceneAddress = "/scene/" + (i + 1) + "/";
        this.writer.sendOSC(sceneAddress + TAG_EXISTS, scene.doesExist(), dump);
        this.writer.sendOSC(sceneAddress + TAG_NAME, scene.getName(), dump);
        this.writer.sendOSC(sceneAddress + TAG_SELECTED, scene.isSelected(), dump);
    }
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene)

Example 14 with IScene

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

the class SessionMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITextDisplay d = this.surface.getTextDisplay().clearRow(0).clearRow(1);
    final ISceneBank sceneBank = this.model.getSceneBank();
    for (int i = 0; i < 8; i++) {
        final IScene scene = sceneBank.getItem(i);
        final String name = StringUtils.fixASCII(scene.getName());
        d.setCell(1, i, name.isEmpty() ? "Scene " + (i + 1) : name);
    }
    d.done(0).done(1);
}
Also used : ISceneBank(de.mossgrabers.framework.daw.data.bank.ISceneBank) IScene(de.mossgrabers.framework.daw.data.IScene) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay)

Example 15 with IScene

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

the class SceneHandler method handle.

/**
 * {@inheritDoc}
 */
@Override
public void handle(final FlexiCommand command, final KnobMode knobMode, final MidiValue value) {
    final boolean isButtonPressed = this.isButtonPressed(knobMode, value);
    switch(command) {
        // Scene 1-8: Launch Scene
        case SCENE_1_LAUNCH_SCENE:
        case SCENE_2_LAUNCH_SCENE:
        case SCENE_3_LAUNCH_SCENE:
        case SCENE_4_LAUNCH_SCENE:
        case SCENE_5_LAUNCH_SCENE:
        case SCENE_6_LAUNCH_SCENE:
        case SCENE_7_LAUNCH_SCENE:
        case SCENE_8_LAUNCH_SCENE:
            if (isButtonPressed) {
                final IScene scene = this.model.getSceneBank().getItem(command.ordinal() - FlexiCommand.SCENE_1_LAUNCH_SCENE.ordinal());
                scene.select();
                scene.launch();
            }
            break;
        // Scene: Select Previous Bank
        case SCENE_SELECT_PREVIOUS_BANK:
            if (isButtonPressed)
                this.model.getSceneBank().selectPreviousPage();
            break;
        // Scene: Select Next Bank
        case SCENE_SELECT_NEXT_BANK:
            if (isButtonPressed)
                this.model.getSceneBank().selectNextPage();
            break;
        // Scene: Create Scene
        case SCENE_CREATE_SCENE:
            if (isButtonPressed)
                this.model.getProject().createScene();
            break;
        // Scene: Create Scene from playing Clips
        case SCENE_CREATE_SCENE_FROM_PLAYING_CLIPS:
            if (isButtonPressed)
                this.model.getProject().createSceneFromPlayingLauncherClips();
            break;
        default:
            throw new FlexiHandlerException(command);
    }
}
Also used : IScene(de.mossgrabers.framework.daw.data.IScene) FlexiHandlerException(de.mossgrabers.controller.generic.flexihandler.utils.FlexiHandlerException)

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