Search in sources :

Example 86 with ITrack

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

the class GenericFlexiControllerSetup method updateIndication.

protected void updateIndication() {
    final Set<FlexiCommand> commands = this.configuration.getMappedCommands();
    final FlexiCommand[] allCommands = FlexiCommand.values();
    final ITrackBank trackBank = this.model.getTrackBank();
    final Optional<ITrack> selectedTrack = trackBank.getSelectedItem();
    for (int i = 0; i < trackBank.getPageSize(); i++) {
        final boolean hasTrackSel = selectedTrack.isPresent() && selectedTrack.get().getIndex() == i;
        final ITrack track = trackBank.getItem(i);
        track.setVolumeIndication(this.testVolumeIndication(commands, allCommands, i, hasTrackSel));
        track.setPanIndication(this.testPanIndication(commands, allCommands, i, hasTrackSel));
        final ISendBank sendBank = track.getSendBank();
        final int sendPageSize = sendBank.getPageSize();
        for (int j = 0; j < sendPageSize; j++) sendBank.getItem(j).setIndication(this.testSendIndication(commands, allCommands, i, hasTrackSel, sendPageSize, j));
    }
    final IMasterTrack masterTrack = this.model.getMasterTrack();
    masterTrack.setVolumeIndication(commands.contains(FlexiCommand.MASTER_SET_VOLUME));
    masterTrack.setPanIndication(commands.contains(FlexiCommand.MASTER_SET_PANORAMA));
    final IParameterBank parameterBank = this.model.getCursorDevice().getParameterBank();
    for (int i = 0; i < parameterBank.getPageSize(); i++) parameterBank.getItem(i).setIndication(this.testParameterIndication(commands, allCommands, i));
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) FlexiCommand(de.mossgrabers.controller.generic.controller.FlexiCommand) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Example 87 with ITrack

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

the class FxTrackHandler method handle.

/**
 * {@inheritDoc}
 */
@Override
public void handle(final FlexiCommand command, final KnobMode knobMode, final MidiValue value) {
    final ITrackBank effectTrackBank = this.model.getEffectTrackBank();
    if (effectTrackBank == null)
        return;
    final boolean isButtonPressed = this.isButtonPressed(knobMode, value);
    switch(command) {
        // Track: Select Previous Bank Page
        case FX_TRACK_SELECT_PREVIOUS_BANK_PAGE:
            if (isButtonPressed)
                this.scrollTrackLeft(true);
            break;
        // Track: Select Next Bank Page
        case FX_TRACK_SELECT_NEXT_BANK_PAGE:
            if (isButtonPressed)
                this.scrollTrackRight(true);
            break;
        // Track: Select Previous Track
        case FX_TRACK_SELECT_PREVIOUS_TRACK:
            if (isButtonPressed)
                this.scrollTrackLeft(false);
            break;
        // Track: Select Next Track
        case FX_TRACK_SELECT_NEXT_TRACK:
            if (isButtonPressed)
                this.scrollTrackRight(false);
            break;
        case FX_TRACK_SCROLL_TRACKS:
            this.scrollTrack(knobMode, value);
            break;
        // Track 1-8: Select
        case FX_TRACK_1_SELECT:
        case FX_TRACK_2_SELECT:
        case FX_TRACK_3_SELECT:
        case FX_TRACK_4_SELECT:
        case FX_TRACK_5_SELECT:
        case FX_TRACK_6_SELECT:
        case FX_TRACK_7_SELECT:
        case FX_TRACK_8_SELECT:
            if (isButtonPressed) {
                final ITrack track = effectTrackBank.getItem(command.ordinal() - FlexiCommand.FX_TRACK_1_SELECT.ordinal());
                track.select();
                this.mvHelper.notifySelectedTrack();
            }
            break;
        // Track 1-8: Toggle Active
        case FX_TRACK_1_TOGGLE_ACTIVE:
        case FX_TRACK_2_TOGGLE_ACTIVE:
        case FX_TRACK_3_TOGGLE_ACTIVE:
        case FX_TRACK_4_TOGGLE_ACTIVE:
        case FX_TRACK_5_TOGGLE_ACTIVE:
        case FX_TRACK_6_TOGGLE_ACTIVE:
        case FX_TRACK_7_TOGGLE_ACTIVE:
        case FX_TRACK_8_TOGGLE_ACTIVE:
            if (isButtonPressed)
                effectTrackBank.getItem(command.ordinal() - FlexiCommand.FX_TRACK_1_TOGGLE_ACTIVE.ordinal()).toggleIsActivated();
            break;
        // Track 1-8: Set Active
        case FX_TRACK_1_SET_ACTIVE:
        case FX_TRACK_2_SET_ACTIVE:
        case FX_TRACK_3_SET_ACTIVE:
        case FX_TRACK_4_SET_ACTIVE:
        case FX_TRACK_5_SET_ACTIVE:
        case FX_TRACK_6_SET_ACTIVE:
        case FX_TRACK_7_SET_ACTIVE:
        case FX_TRACK_8_SET_ACTIVE:
            if (isButtonPressed)
                effectTrackBank.getItem(command.ordinal() - FlexiCommand.FX_TRACK_1_SET_ACTIVE.ordinal()).setIsActivated(value.isPositive());
            break;
        // Track 1-8: Set Volume
        case FX_TRACK_1_SET_VOLUME:
        case FX_TRACK_2_SET_VOLUME:
        case FX_TRACK_3_SET_VOLUME:
        case FX_TRACK_4_SET_VOLUME:
        case FX_TRACK_5_SET_VOLUME:
        case FX_TRACK_6_SET_VOLUME:
        case FX_TRACK_7_SET_VOLUME:
        case FX_TRACK_8_SET_VOLUME:
            this.changeTrackVolume(knobMode, command.ordinal() - FlexiCommand.FX_TRACK_1_SET_VOLUME.ordinal(), value);
            break;
        // Track 1-8: Set Panorama
        case FX_TRACK_1_SET_PANORAMA:
        case FX_TRACK_2_SET_PANORAMA:
        case FX_TRACK_3_SET_PANORAMA:
        case FX_TRACK_4_SET_PANORAMA:
        case FX_TRACK_5_SET_PANORAMA:
        case FX_TRACK_6_SET_PANORAMA:
        case FX_TRACK_7_SET_PANORAMA:
        case FX_TRACK_8_SET_PANORAMA:
            this.changeTrackPanorama(knobMode, command.ordinal() - FlexiCommand.FX_TRACK_1_SET_PANORAMA.ordinal(), value);
            break;
        // Track 1-8: Toggle Mute
        case FX_TRACK_1_TOGGLE_MUTE:
        case FX_TRACK_2_TOGGLE_MUTE:
        case FX_TRACK_3_TOGGLE_MUTE:
        case FX_TRACK_4_TOGGLE_MUTE:
        case FX_TRACK_5_TOGGLE_MUTE:
        case FX_TRACK_6_TOGGLE_MUTE:
        case FX_TRACK_7_TOGGLE_MUTE:
        case FX_TRACK_8_TOGGLE_MUTE:
            if (isButtonPressed)
                effectTrackBank.getItem(command.ordinal() - FlexiCommand.FX_TRACK_1_TOGGLE_MUTE.ordinal()).toggleMute();
            break;
        // Track 1-8: Set Mute
        case FX_TRACK_1_SET_MUTE:
        case FX_TRACK_2_SET_MUTE:
        case FX_TRACK_3_SET_MUTE:
        case FX_TRACK_4_SET_MUTE:
        case FX_TRACK_5_SET_MUTE:
        case FX_TRACK_6_SET_MUTE:
        case FX_TRACK_7_SET_MUTE:
        case FX_TRACK_8_SET_MUTE:
            if (isButtonPressed)
                effectTrackBank.getItem(command.ordinal() - FlexiCommand.FX_TRACK_1_SET_MUTE.ordinal()).setMute(value.isPositive());
            break;
        // Track 1-8: Toggle Solo
        case FX_TRACK_1_TOGGLE_SOLO:
        case FX_TRACK_2_TOGGLE_SOLO:
        case FX_TRACK_3_TOGGLE_SOLO:
        case FX_TRACK_4_TOGGLE_SOLO:
        case FX_TRACK_5_TOGGLE_SOLO:
        case FX_TRACK_6_TOGGLE_SOLO:
        case FX_TRACK_7_TOGGLE_SOLO:
        case FX_TRACK_8_TOGGLE_SOLO:
            if (isButtonPressed)
                effectTrackBank.getItem(command.ordinal() - FlexiCommand.FX_TRACK_1_TOGGLE_SOLO.ordinal()).toggleSolo();
            break;
        // Track 1-8: Set Solo
        case FX_TRACK_1_SET_SOLO:
        case FX_TRACK_2_SET_SOLO:
        case FX_TRACK_3_SET_SOLO:
        case FX_TRACK_4_SET_SOLO:
        case FX_TRACK_5_SET_SOLO:
        case FX_TRACK_6_SET_SOLO:
        case FX_TRACK_7_SET_SOLO:
        case FX_TRACK_8_SET_SOLO:
            if (isButtonPressed)
                effectTrackBank.getItem(command.ordinal() - FlexiCommand.FX_TRACK_1_SET_SOLO.ordinal()).setSolo(value.isPositive());
            break;
        // Track 1-8: Toggle Arm
        case FX_TRACK_1_TOGGLE_ARM:
        case FX_TRACK_2_TOGGLE_ARM:
        case FX_TRACK_3_TOGGLE_ARM:
        case FX_TRACK_4_TOGGLE_ARM:
        case FX_TRACK_5_TOGGLE_ARM:
        case FX_TRACK_6_TOGGLE_ARM:
        case FX_TRACK_7_TOGGLE_ARM:
        case FX_TRACK_8_TOGGLE_ARM:
            if (isButtonPressed)
                effectTrackBank.getItem(command.ordinal() - FlexiCommand.FX_TRACK_1_TOGGLE_ARM.ordinal()).toggleRecArm();
            break;
        // Track 1-8: Set Arm
        case FX_TRACK_1_SET_ARM:
        case FX_TRACK_2_SET_ARM:
        case FX_TRACK_3_SET_ARM:
        case FX_TRACK_4_SET_ARM:
        case FX_TRACK_5_SET_ARM:
        case FX_TRACK_6_SET_ARM:
        case FX_TRACK_7_SET_ARM:
        case FX_TRACK_8_SET_ARM:
            if (isButtonPressed)
                effectTrackBank.getItem(command.ordinal() - FlexiCommand.FX_TRACK_1_SET_ARM.ordinal()).setRecArm(value.isPositive());
            break;
        // Track 1-8: Toggle Monitor
        case FX_TRACK_1_TOGGLE_MONITOR:
        case FX_TRACK_2_TOGGLE_MONITOR:
        case FX_TRACK_3_TOGGLE_MONITOR:
        case FX_TRACK_4_TOGGLE_MONITOR:
        case FX_TRACK_5_TOGGLE_MONITOR:
        case FX_TRACK_6_TOGGLE_MONITOR:
        case FX_TRACK_7_TOGGLE_MONITOR:
        case FX_TRACK_8_TOGGLE_MONITOR:
            if (isButtonPressed)
                effectTrackBank.getItem(command.ordinal() - FlexiCommand.FX_TRACK_1_TOGGLE_MONITOR.ordinal()).toggleMonitor();
            break;
        // Track 1-8: Set Monitor
        case FX_TRACK_1_SET_MONITOR:
        case FX_TRACK_2_SET_MONITOR:
        case FX_TRACK_3_SET_MONITOR:
        case FX_TRACK_4_SET_MONITOR:
        case FX_TRACK_5_SET_MONITOR:
        case FX_TRACK_6_SET_MONITOR:
        case FX_TRACK_7_SET_MONITOR:
        case FX_TRACK_8_SET_MONITOR:
            if (isButtonPressed)
                effectTrackBank.getItem(command.ordinal() - FlexiCommand.FX_TRACK_1_SET_MONITOR.ordinal()).setMonitor(value.isPositive());
            break;
        // Track 1: Toggle Auto Monitor
        case FX_TRACK_1_TOGGLE_AUTO_MONITOR:
        case FX_TRACK_2_TOGGLE_AUTO_MONITOR:
        case FX_TRACK_3_TOGGLE_AUTO_MONITOR:
        case FX_TRACK_4_TOGGLE_AUTO_MONITOR:
        case FX_TRACK_5_TOGGLE_AUTO_MONITOR:
        case FX_TRACK_6_TOGGLE_AUTO_MONITOR:
        case FX_TRACK_7_TOGGLE_AUTO_MONITOR:
        case FX_TRACK_8_TOGGLE_AUTO_MONITOR:
            if (isButtonPressed)
                effectTrackBank.getItem(command.ordinal() - FlexiCommand.FX_TRACK_1_TOGGLE_AUTO_MONITOR.ordinal()).toggleAutoMonitor();
            break;
        // Track 1: Set Auto Monitor
        case FX_TRACK_1_SET_AUTO_MONITOR:
        case FX_TRACK_2_SET_AUTO_MONITOR:
        case FX_TRACK_3_SET_AUTO_MONITOR:
        case FX_TRACK_4_SET_AUTO_MONITOR:
        case FX_TRACK_5_SET_AUTO_MONITOR:
        case FX_TRACK_6_SET_AUTO_MONITOR:
        case FX_TRACK_7_SET_AUTO_MONITOR:
        case FX_TRACK_8_SET_AUTO_MONITOR:
            if (isButtonPressed)
                effectTrackBank.getItem(command.ordinal() - FlexiCommand.FX_TRACK_1_SET_AUTO_MONITOR.ordinal()).setAutoMonitor(value.isPositive());
            break;
        default:
            throw new FlexiHandlerException(command);
    }
}
Also used : FlexiHandlerException(de.mossgrabers.controller.generic.flexihandler.utils.FlexiHandlerException) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 88 with ITrack

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

the class FxTrackHandler method scrollTrackLeft.

private void scrollTrackLeft(final boolean switchBank) {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final Optional<ITrack> sel = tb.getSelectedItem();
    final int index = sel.isEmpty() ? 0 : sel.get().getIndex() - 1;
    if (index == -1 || switchBank) {
        tb.selectPreviousPage();
        return;
    }
    tb.getItem(index).select();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 89 with ITrack

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

the class FxTrackHandler method changeTrackVolume.

private void changeTrackVolume(final KnobMode knobMode, final int trackIndex, final MidiValue value) {
    final Optional<ITrack> track = this.getTrack(trackIndex);
    if (track.isEmpty())
        return;
    final int val = value.getValue();
    final IParameter volumeParameter = track.get().getVolumeParameter();
    if (isAbsolute(knobMode))
        volumeParameter.setValue(this.getAbsoluteValueChanger(value), val);
    else
        volumeParameter.changeValue(this.getRelativeValueChanger(knobMode), val);
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ITrack(de.mossgrabers.framework.daw.data.ITrack)

Example 90 with ITrack

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

the class FxTrackHandler method scrollTrackRight.

private void scrollTrackRight(final boolean switchBank) {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final Optional<ITrack> sel = tb.getSelectedItem();
    final int index = sel.isEmpty() ? 0 : sel.get().getIndex() + 1;
    if (index == 8 || switchBank) {
        tb.selectNextPage();
        return;
    }
    tb.getItem(index).select();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Aggregations

ITrack (de.mossgrabers.framework.daw.data.ITrack)312 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)92 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)84 ISend (de.mossgrabers.framework.daw.data.ISend)40 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)25 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)19 ISlot (de.mossgrabers.framework.daw.data.ISlot)19 Display (de.mossgrabers.framework.controller.display.Display)18 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)18 ModeManager (de.mossgrabers.framework.mode.ModeManager)18 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)16 ViewManager (de.mossgrabers.framework.view.ViewManager)16 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)15 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)15 PushConfiguration (de.mossgrabers.push.PushConfiguration)14 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)12 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)11 PushDisplay (de.mossgrabers.push.controller.PushDisplay)11 ITransport (de.mossgrabers.framework.daw.ITransport)9 IParameter (de.mossgrabers.framework.daw.data.IParameter)9