Search in sources :

Example 11 with IParameter

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

the class MasterHandler method changeMasterCrossfader.

private void changeMasterCrossfader(final KnobMode knobMode, final MidiValue value) {
    final ITransport transport = this.model.getTransport();
    final int val = value.getValue();
    final IParameter crossfadeParameter = transport.getCrossfadeParameter();
    if (isAbsolute(knobMode))
        crossfadeParameter.setValue(this.getAbsoluteValueChanger(value), val);
    else
        crossfadeParameter.changeValue(this.getRelativeValueChanger(knobMode), val);
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) ITransport(de.mossgrabers.framework.daw.ITransport)

Example 12 with IParameter

use of de.mossgrabers.framework.daw.data.IParameter 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 13 with IParameter

use of de.mossgrabers.framework.daw.data.IParameter 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 14 with IParameter

use of de.mossgrabers.framework.daw.data.IParameter 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 15 with IParameter

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

the class UserHandler method handle.

/**
 * {@inheritDoc}
 */
@Override
public void handle(final FlexiCommand command, final KnobMode knobMode, final MidiValue value) {
    final IParameterBank userParameterBank = this.model.getUserParameterBank();
    if (userParameterBank == null)
        return;
    switch(command) {
        case USER_SET_PARAMETER_1:
        case USER_SET_PARAMETER_2:
        case USER_SET_PARAMETER_3:
        case USER_SET_PARAMETER_4:
        case USER_SET_PARAMETER_5:
        case USER_SET_PARAMETER_6:
        case USER_SET_PARAMETER_7:
        case USER_SET_PARAMETER_8:
            final int index = command.ordinal() - FlexiCommand.USER_SET_PARAMETER_1.ordinal();
            final IParameter userParam = userParameterBank.getItem(index);
            final int val = value.getValue();
            if (isAbsolute(knobMode))
                userParam.setValue(this.getAbsoluteValueChanger(value), val);
            else
                userParam.changeValue(this.getRelativeValueChanger(knobMode), val);
            break;
        case USER_TOGGLE_PARAMETER_1:
        case USER_TOGGLE_PARAMETER_2:
        case USER_TOGGLE_PARAMETER_3:
        case USER_TOGGLE_PARAMETER_4:
        case USER_TOGGLE_PARAMETER_5:
        case USER_TOGGLE_PARAMETER_6:
        case USER_TOGGLE_PARAMETER_7:
        case USER_TOGGLE_PARAMETER_8:
            final IParameter userToggleParam = userParameterBank.getItem(command.ordinal() - FlexiCommand.USER_TOGGLE_PARAMETER_1.ordinal());
            if (this.isButtonPressed(knobMode, value)) {
                final int v = userToggleParam.getValue();
                userToggleParam.setValue(v > 0 ? 0 : this.model.getValueChanger().getUpperBound() - 1);
            }
            break;
        case USER_SELECT_PREVIOUS_PAGE:
            userParameterBank.scrollBackwards();
            this.displaySelectedPage(userParameterBank);
            break;
        case USER_SELECT_NEXT_PAGE:
            userParameterBank.scrollForwards();
            this.displaySelectedPage(userParameterBank);
            break;
        default:
            throw new FlexiHandlerException(command);
    }
}
Also used : IParameter(de.mossgrabers.framework.daw.data.IParameter) FlexiHandlerException(de.mossgrabers.controller.generic.flexihandler.utils.FlexiHandlerException) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank)

Aggregations

IParameter (de.mossgrabers.framework.daw.data.IParameter)76 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)17 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)14 ITrack (de.mossgrabers.framework.daw.data.ITrack)9 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)6 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)6 IGroove (de.mossgrabers.framework.daw.IGroove)5 Display (de.mossgrabers.framework.controller.display.Display)4 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)4 IParameterPageBank (de.mossgrabers.framework.daw.data.bank.IParameterPageBank)4 PushDisplay (de.mossgrabers.push.controller.PushDisplay)4 ITransport (de.mossgrabers.framework.daw.ITransport)3 IDeviceBank (de.mossgrabers.framework.daw.data.bank.IDeviceBank)3 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)2 TitleValueComponent (de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent)2 FlexiHandlerException (de.mossgrabers.controller.generic.flexihandler.utils.FlexiHandlerException)2 FaderConfig (de.mossgrabers.controller.ni.maschine.jam.controller.FaderConfig)2 SLMkIIIDisplay (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)2 Configuration (de.mossgrabers.framework.configuration.Configuration)2 IGraphicDisplay (de.mossgrabers.framework.controller.display.IGraphicDisplay)2