Search in sources :

Example 91 with ITrack

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

the class EqHandler method handle.

/**
 * {@inheritDoc}
 */
@Override
public void handle(final FlexiCommand command, final KnobMode knobMode, final MidiValue value) {
    final IEqualizerDevice equalizer = (IEqualizerDevice) this.model.getSpecificDevice(DeviceID.EQ);
    if (!equalizer.doesExist()) {
        final ITrack cursorTrack = this.model.getCursorTrack();
        if (cursorTrack.doesExist() && !this.eqRequested) {
            cursorTrack.addEqualizerDevice();
            this.eqRequested = true;
        }
        return;
    }
    this.eqRequested = false;
    switch(command) {
        case EQ_SET_TYPE_1:
        case EQ_SET_TYPE_2:
        case EQ_SET_TYPE_3:
        case EQ_SET_TYPE_4:
        case EQ_SET_TYPE_5:
        case EQ_SET_TYPE_6:
        case EQ_SET_TYPE_7:
        case EQ_SET_TYPE_8:
            final int bandIndex1 = command.ordinal() - FlexiCommand.EQ_SET_TYPE_1.ordinal();
            final IParameter type = equalizer.getType(bandIndex1);
            this.handleParameter(knobMode, type, value);
            return;
        case EQ_SET_FREQ_1:
        case EQ_SET_FREQ_2:
        case EQ_SET_FREQ_3:
        case EQ_SET_FREQ_4:
        case EQ_SET_FREQ_5:
        case EQ_SET_FREQ_6:
        case EQ_SET_FREQ_7:
        case EQ_SET_FREQ_8:
            final int bandIndex2 = command.ordinal() - FlexiCommand.EQ_SET_FREQ_1.ordinal();
            ensureBandIsOn(equalizer, bandIndex2);
            final IParameter frequency = equalizer.getFrequency(bandIndex2);
            this.handleParameter(knobMode, frequency, value);
            return;
        case EQ_SET_GAIN_1:
        case EQ_SET_GAIN_2:
        case EQ_SET_GAIN_3:
        case EQ_SET_GAIN_4:
        case EQ_SET_GAIN_5:
        case EQ_SET_GAIN_6:
        case EQ_SET_GAIN_7:
        case EQ_SET_GAIN_8:
            final int bandIndex3 = command.ordinal() - FlexiCommand.EQ_SET_GAIN_1.ordinal();
            ensureBandIsOn(equalizer, bandIndex3);
            final IParameter gain = equalizer.getGain(bandIndex3);
            this.handleParameter(knobMode, gain, value);
            return;
        case EQ_SET_Q_1:
        case EQ_SET_Q_2:
        case EQ_SET_Q_3:
        case EQ_SET_Q_4:
        case EQ_SET_Q_5:
        case EQ_SET_Q_6:
        case EQ_SET_Q_7:
        case EQ_SET_Q_8:
            final int bandIndex4 = command.ordinal() - FlexiCommand.EQ_SET_Q_1.ordinal();
            ensureBandIsOn(equalizer, bandIndex4);
            final IParameter q = equalizer.getQ(bandIndex4);
            this.handleParameter(knobMode, q, value);
            return;
        default:
            throw new FlexiHandlerException(command);
    }
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) FlexiHandlerException(de.mossgrabers.controller.generic.flexihandler.utils.FlexiHandlerException) ITrack(de.mossgrabers.framework.daw.data.ITrack) IEqualizerDevice(de.mossgrabers.framework.daw.data.IEqualizerDevice)

Example 92 with ITrack

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

the class TrackHandler method changeTrackPanorama.

private void changeTrackPanorama(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 panParameter = track.get().getPanParameter();
    if (isAbsolute(knobMode))
        panParameter.setValue(this.getAbsoluteValueChanger(value), val);
    else
        panParameter.changeValue(this.getRelativeValueChanger(knobMode), val);
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ITrack(de.mossgrabers.framework.daw.data.ITrack)

Example 93 with ITrack

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

the class TrackHandler 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 94 with ITrack

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

the class TrackHandler 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 95 with ITrack

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

the class FireTrackMixerMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    this.updateMode();
    final IGraphicDisplay display = this.surface.getGraphicsDisplay();
    final ITrackBank trackBank = this.model.getCurrentTrackBank();
    final Optional<ITrack> trackOptional = trackBank.getSelectedItem();
    String label = "None";
    if (trackOptional.isPresent()) {
        final ITrack track = trackOptional.get();
        label = track.getPosition() + 1 + ": " + track.getName(9);
    }
    final int size = trackBank.getPageSize();
    final boolean[] selected = new boolean[size];
    final int[] values = new int[size];
    final boolean isMode = this.isAnyKnobTouched() || !this.model.getTransport().isPlaying();
    if (isMode) {
        switch(this.selectedParameter) {
            case VOLUME:
                for (int i = 0; i < size; i++) {
                    final IChannel channel = trackBank.getItem(i);
                    selected[i] = channel.isSelected();
                    values[i] = channel.getVolume();
                }
                break;
            case PAN:
                for (int i = 0; i < size; i++) {
                    final IChannel channel = trackBank.getItem(i);
                    selected[i] = channel.isSelected();
                    values[i] = channel.getPan();
                }
                break;
            case SEND1:
            case SEND2:
            case SEND3:
            case SEND4:
            case SEND5:
            case SEND6:
                final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
                for (int i = 0; i < size; i++) {
                    final IChannel channel = trackBank.getItem(i);
                    selected[i] = channel.isSelected();
                    final ISendBank sendBank = channel.getSendBank();
                    if (sendBank != null) {
                        final ISend send = sendBank.getItem(sendIndex);
                        if (send.doesExist())
                            values[i] = send.getValue();
                    }
                }
                break;
            default:
                // Not used
                break;
        }
    } else {
        for (int i = 0; i < size; i++) {
            final IChannel channel = trackBank.getItem(i);
            selected[i] = channel.isSelected();
            values[i] = channel.getVu();
        }
    }
    display.addElement(new TitleChannelsComponent(label, selected, values, this.selectedParameter == Modes.PAN && isMode));
    display.send();
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) IGraphicDisplay(de.mossgrabers.framework.controller.display.IGraphicDisplay) TitleChannelsComponent(de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleChannelsComponent) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

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