Search in sources :

Example 56 with ModeManager

use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.

the class ControlView method onButtonRow1Select.

/**
 * {@inheritDoc}
 */
@Override
public void onButtonRow1Select() {
    final ModeManager modeManager = this.surface.getModeManager();
    modeManager.setActiveMode(modeManager.getActiveModeId() == Modes.MODE_FUNCTIONS ? Modes.MODE_FIXED : Modes.MODE_FUNCTIONS);
}
Also used : ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 57 with ModeManager

use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.

the class PlayView method onButtonRow1.

/**
 * {@inheritDoc}
 */
@Override
public void onButtonRow1(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    final Integer activeModeId = modeManager.getActiveModeId();
    if (activeModeId == Modes.MODE_VIEW_SELECT) {
        if (index == 0) {
            this.surface.getViewManager().setActiveView(Views.VIEW_CONTROL);
            if (modeManager.getPreviousModeId() == Modes.MODE_VOLUME)
                modeManager.restoreMode();
            else
                modeManager.setActiveMode(Modes.MODE_TRACK);
        } else
            modeManager.restoreMode();
        this.surface.turnOffTransport();
        return;
    }
    if (activeModeId != Modes.MODE_SESSION)
        modeManager.setActiveMode(Modes.MODE_SESSION);
    this.model.getSceneBank().launchScene(index);
}
Also used : ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 58 with ModeManager

use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.

the class PlayView method onButtonRow2.

/**
 * {@inheritDoc}
 */
@Override
public void onButtonRow2(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    final Integer cm = modeManager.getActiveModeId();
    if (cm != Modes.MODE_PLAY_OPTIONS)
        modeManager.setActiveMode(Modes.MODE_PLAY_OPTIONS);
    switch(index) {
        // Down
        case 0:
            this.clearPressedKeys();
            this.scales.decDrumOctave();
            this.model.getPrimaryDevice().scrollDrumPadsPageUp();
            this.offsetY = Scales.DRUM_NOTE_START + this.scales.getDrumOctave() * 16;
            this.updateNoteMapping();
            this.surface.getDisplay().notify(this.scales.getDrumRangeText());
            break;
        // Up
        case 1:
            this.clearPressedKeys();
            this.scales.incDrumOctave();
            this.model.getPrimaryDevice().scrollDrumPadsPageDown();
            this.offsetY = Scales.DRUM_NOTE_START + this.scales.getDrumOctave() * 16;
            this.updateNoteMapping();
            this.surface.getDisplay().notify(this.scales.getDrumRangeText());
            break;
        case 2:
            this.changeResolution(0);
            this.surface.getDisplay().notify(RESOLUTION_TEXTS[this.selectedIndex]);
            break;
        case 3:
            this.changeResolution(127);
            this.surface.getDisplay().notify(RESOLUTION_TEXTS[this.selectedIndex]);
            break;
        case 4:
            this.changeScrollPosition(0);
            break;
        case 5:
            this.changeScrollPosition(127);
            break;
        case 6:
            break;
        // Toggle play / sequencer
        case 7:
            this.isPlayMode = !this.isPlayMode;
            this.surface.getDisplay().notify(this.isPlayMode ? "Play/Select" : "Sequence");
            this.updateNoteMapping();
            break;
        default:
            // Intentionally empty
            break;
    }
}
Also used : ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 59 with ModeManager

use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.

the class PlayView method onButtonP1.

/**
 * {@inheritDoc}
 */
@Override
public void onButtonP1(final boolean isUp, final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final Integer activeModeId = this.surface.getModeManager().getActiveModeId();
    if (activeModeId == Modes.MODE_SESSION) {
        if (isUp)
            this.model.getSceneBank().scrollScenesPageDown();
        else
            this.model.getSceneBank().scrollScenesPageUp();
        return;
    }
    if (activeModeId == Modes.MODE_VOLUME) {
        new P2ButtonCommand(isUp, this.model, this.surface).execute(event);
        return;
    }
    if (activeModeId == Modes.MODE_TRACK || activeModeId == Modes.MODE_MASTER) {
        new ButtonRowSelectCommand<>(3, this.model, this.surface).execute(event);
        return;
    }
    if (activeModeId == Modes.MODE_PLAY_OPTIONS)
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    if (isUp)
        ((DeviceParamsMode) modeManager.getMode(Modes.MODE_PARAMS)).nextPage();
    else
        ((DeviceParamsMode) modeManager.getMode(Modes.MODE_PARAMS)).previousPage();
}
Also used : P2ButtonCommand(de.mossgrabers.sl.command.trigger.P2ButtonCommand) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 60 with ModeManager

use of de.mossgrabers.framework.mode.ModeManager in project DrivenByMoss by git-moss.

the class SequencerView method onGridNoteLongPress.

/**
 * {@inheritDoc}
 */
@Override
public void onGridNoteLongPress(final int note) {
    if (!this.model.canSelectedTrackHoldNotes())
        return;
    this.surface.setGridNoteConsumed(note);
    final int index = note - 36;
    final int y = index / 8;
    if (y >= this.numSequencerRows)
        return;
    // TODO Bugfix required - setStep makes Bitwig hang
    // https://github.com/teotigraphix/Framework4Bitwig/issues/124
    final int x = index % 8;
    final ICursorClip cursorClip = this.model.getCursorClip(8, 128);
    final int state = cursorClip.getStep(x, this.noteMap[y]);
    final ModeManager modeManager = this.surface.getModeManager();
    final NoteMode noteMode = (NoteMode) modeManager.getMode(Modes.MODE_NOTE);
    noteMode.setValues(cursorClip, x, note, state == 2 ? 1.0 : 0, 127);
    modeManager.setActiveMode(Modes.MODE_NOTE);
}
Also used : NoteMode(de.mossgrabers.push.mode.NoteMode) ICursorClip(de.mossgrabers.framework.daw.ICursorClip) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Aggregations

ModeManager (de.mossgrabers.framework.mode.ModeManager)67 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)20 ITrack (de.mossgrabers.framework.daw.data.ITrack)18 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)9 ViewManager (de.mossgrabers.framework.view.ViewManager)7 PushConfiguration (de.mossgrabers.push.PushConfiguration)7 View (de.mossgrabers.framework.view.View)6 SceneView (de.mossgrabers.framework.view.SceneView)5 PushControlSurface (de.mossgrabers.push.controller.PushControlSurface)5 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)4 IChannel (de.mossgrabers.framework.daw.data.IChannel)4 ITransport (de.mossgrabers.framework.daw.ITransport)3 DeviceBrowserMode (de.mossgrabers.push.mode.device.DeviceBrowserMode)3 DeviceParamsMode (de.mossgrabers.push.mode.device.DeviceParamsMode)3 APCControlSurface (de.mossgrabers.apc.controller.APCControlSurface)2 APCminiControlSurface (de.mossgrabers.apcmini.controller.APCminiControlSurface)2 ICursorClip (de.mossgrabers.framework.daw.ICursorClip)2 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)2 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)2 LaunchpadControlSurface (de.mossgrabers.launchpad.controller.LaunchpadControlSurface)2