Search in sources :

Example 11 with IChannelBank

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

the class AbstractPlayView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final boolean isKeyboardEnabled = this.model.canSelectedTrackHoldNotes();
    final boolean isRecording = this.model.hasRecordingState();
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack selectedTrack = tb.getSelectedTrack();
    final PadGrid gridPad = this.surface.getPadGrid();
    for (int i = this.scales.getStartNote(); i < this.scales.getEndNote(); i++) gridPad.light(i, this.getGridColor(isKeyboardEnabled, isRecording, selectedTrack, i));
}
Also used : PadGrid(de.mossgrabers.framework.controller.grid.PadGrid) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 12 with IChannelBank

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

the class CursorCommand method scrollTracksRight.

protected void scrollTracksRight() {
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack sel = tb.getSelectedTrack();
    final int index = sel == null ? 0 : sel.getIndex() + 1;
    if (index == 8 || this.surface.isShiftPressed()) {
        this.scrollTrackBankRight(sel, index);
        return;
    }
    this.selectTrack(index);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 13 with IChannelBank

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

the class DuplicateCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.UP)
        return;
    // Is there a selected track?
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack track = tb.getSelectedTrack();
    if (track == null || !track.doesExist())
        return;
    // Is there a selected slot?
    final ISlot slot = track.getSelectedSlot();
    if (slot == null)
        return;
    final boolean isPlaying = slot.isPlaying();
    // Duplicate the clip in the selected slot
    slot.duplicate();
    if (!isPlaying)
        return;
    // Need to wait a bit with starting the duplicated clip until it is selected
    this.model.getHost().scheduleTask(() -> {
        final ISlot slotNew = track.getSelectedSlot();
        if (slotNew != null) {
            slotNew.launch();
            return;
        }
        // Try to find the clip in the next page...
        track.scrollClipPageForwards();
        this.model.getHost().scheduleTask(() -> {
            final ISlot slotNew2 = track.getSelectedSlot();
            if (slotNew2 != null)
                slotNew2.launch();
        }, 200);
    }, 200);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ISlot(de.mossgrabers.framework.daw.data.ISlot)

Example 14 with IChannelBank

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

the class FootswitchCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    switch(this.getSetting()) {
        case AbstractConfiguration.FOOTSWITCH_2_TOGGLE_PLAY:
            this.surface.getViewManager().getActiveView().executeTriggerCommand(Commands.COMMAND_PLAY, event);
            break;
        case AbstractConfiguration.FOOTSWITCH_2_TOGGLE_RECORD:
            this.surface.getViewManager().getActiveView().executeTriggerCommand(Commands.COMMAND_RECORD, event);
            break;
        case AbstractConfiguration.FOOTSWITCH_2_STOP_ALL_CLIPS:
            if (event == ButtonEvent.DOWN)
                this.model.getCurrentTrackBank().stop();
            break;
        case AbstractConfiguration.FOOTSWITCH_2_TOGGLE_CLIP_OVERDUB:
            if (event == ButtonEvent.DOWN)
                this.model.getTransport().toggleLauncherOverdub();
            break;
        case AbstractConfiguration.FOOTSWITCH_2_UNDO:
            this.surface.getViewManager().getActiveView().executeTriggerCommand(Commands.COMMAND_UNDO, event);
            break;
        case AbstractConfiguration.FOOTSWITCH_2_TAP_TEMPO:
            this.surface.getViewManager().getActiveView().executeTriggerCommand(Commands.COMMAND_TAP_TEMPO, event);
            break;
        case AbstractConfiguration.FOOTSWITCH_2_NEW_BUTTON:
            this.surface.getViewManager().getActiveView().executeTriggerCommand(Commands.COMMAND_NEW, event);
            break;
        case AbstractConfiguration.FOOTSWITCH_2_CLIP_BASED_LOOPER:
            final IChannelBank tb = this.model.getCurrentTrackBank();
            final ITrack track = tb.getSelectedTrack();
            if (track == null) {
                this.surface.getDisplay().notify("Please select an Instrument track first.", true, true);
                return;
            }
            final ISlot selectedSlot = track.getSelectedSlot();
            final ISlot slot = selectedSlot == null ? track.getSlot(0) : selectedSlot;
            if (event == ButtonEvent.DOWN) {
                if (slot.hasContent()) {
                    // If there is a clip in the selected slot, enable (not toggle)
                    // LauncherOverdub.
                    this.model.getTransport().setLauncherOverdub(true);
                } else {
                    // If there is no clip in the selected slot, create a clip and begin record
                    // mode. Releasing it ends record mode.
                    this.surface.getViewManager().getActiveView().executeTriggerCommand(Commands.COMMAND_NEW, event);
                    slot.select();
                    this.model.getTransport().setLauncherOverdub(true);
                }
            } else {
                // Releasing it would turn off LauncherOverdub.
                this.model.getTransport().setLauncherOverdub(false);
            }
            // Start transport if not already playing
            slot.launch();
            break;
        case AbstractConfiguration.FOOTSWITCH_2_PANEL_LAYOUT_ARRANGE:
            if (event == ButtonEvent.DOWN)
                this.model.getApplication().setPanelLayout(IApplication.PANEL_LAYOUT_ARRANGE);
            break;
        case AbstractConfiguration.FOOTSWITCH_2_PANEL_LAYOUT_MIX:
            if (event == ButtonEvent.DOWN)
                this.model.getApplication().setPanelLayout(IApplication.PANEL_LAYOUT_MIX);
            break;
        case AbstractConfiguration.FOOTSWITCH_2_PANEL_LAYOUT_EDIT:
            if (event == ButtonEvent.DOWN)
                this.model.getApplication().setPanelLayout(IApplication.PANEL_LAYOUT_EDIT);
            break;
        case AbstractConfiguration.FOOTSWITCH_2_ADD_INSTRUMENT_TRACK:
            if (event == ButtonEvent.DOWN)
                this.model.getApplication().addInstrumentTrack();
            break;
        case AbstractConfiguration.FOOTSWITCH_2_ADD_AUDIO_TRACK:
            if (event == ButtonEvent.DOWN)
                this.model.getApplication().addAudioTrack();
            break;
        case AbstractConfiguration.FOOTSWITCH_2_ADD_EFFECT_TRACK:
            if (event == ButtonEvent.DOWN)
                this.model.getApplication().addEffectTrack();
            break;
        case AbstractConfiguration.FOOTSWITCH_2_QUANTIZE:
            if (event == ButtonEvent.DOWN)
                this.model.getCursorClip().quantize(this.surface.getConfiguration().getQuantizeAmount() / 100.0);
            break;
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ISlot(de.mossgrabers.framework.daw.data.ISlot)

Example 15 with IChannelBank

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

the class ToggleTrackBanksCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    this.model.toggleCurrentTrackBank();
    final IChannelBank currentTrackBank = this.model.getCurrentTrackBank();
    if (currentTrackBank.getSelectedTrack() == null)
        currentTrackBank.getTrack(0).select();
}
Also used : IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Aggregations

IChannelBank (de.mossgrabers.framework.daw.IChannelBank)114 ITrack (de.mossgrabers.framework.daw.data.ITrack)92 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)22 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)20 ModeManager (de.mossgrabers.framework.mode.ModeManager)20 PushConfiguration (de.mossgrabers.push.PushConfiguration)19 Display (de.mossgrabers.framework.controller.display.Display)18 ISend (de.mossgrabers.framework.daw.data.ISend)11 ViewManager (de.mossgrabers.framework.view.ViewManager)10 PushDisplay (de.mossgrabers.push.controller.PushDisplay)10 IChannel (de.mossgrabers.framework.daw.data.IChannel)9 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)7 ISlot (de.mossgrabers.framework.daw.data.ISlot)7 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)5 View (de.mossgrabers.framework.view.View)5 DisplayMessage (de.mossgrabers.push.controller.DisplayMessage)5 ITransport (de.mossgrabers.framework.daw.ITransport)4 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)4 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)3 PadGrid (de.mossgrabers.framework.controller.grid.PadGrid)3