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);
}
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);
}
}
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);
}
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);
}
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);
}
}
Aggregations