use of de.mossgrabers.controller.ni.maschine.jam.controller.FaderConfig in project DrivenByMoss by git-moss.
the class MaschineJamPanMode method setupFader.
/**
* {@inheritDoc}
*/
@Override
public FaderConfig setupFader(final int index) {
final Optional<ITrack> optionalTrack = this.getTrack(index);
if (optionalTrack.isEmpty())
return FADER_OFF;
final ITrack track = optionalTrack.get();
if (!track.doesExist())
return FADER_OFF;
final String c = DAWColor.getColorIndex(track.getColor());
final int color = this.colorManager.getColorIndex(c);
final int value = this.model.getValueChanger().toMidiValue(track.getPan());
return new FaderConfig(FaderConfig.TYPE_PAN, color, value);
}
use of de.mossgrabers.controller.ni.maschine.jam.controller.FaderConfig in project DrivenByMoss by git-moss.
the class MaschineJamUserMode method setupFader.
/**
* {@inheritDoc}
*/
@Override
public FaderConfig setupFader(final int index) {
final IParameter parameter = this.model.getUserParameterBank().getItem(index);
if (!parameter.doesExist())
return FADER_OFF;
final int value = this.model.getValueChanger().toMidiValue(parameter.getValue());
return new FaderConfig(FaderConfig.TYPE_SINGLE, MaschineColorManager.COLOR_WHITE, value);
}
use of de.mossgrabers.controller.ni.maschine.jam.controller.FaderConfig in project DrivenByMoss by git-moss.
the class MaschineJamParameterMode method setupFader.
/**
* {@inheritDoc}
*/
@Override
public FaderConfig setupFader(final int index) {
final ICursorDevice cursorDevice = this.model.getCursorDevice();
if (!cursorDevice.doesExist())
return FADER_OFF;
final IParameter parameter = cursorDevice.getParameterBank().getItem(index);
if (!parameter.doesExist())
return FADER_OFF;
final int value = this.model.getValueChanger().toMidiValue(parameter.getValue());
return new FaderConfig(FaderConfig.TYPE_SINGLE, MaschineColorManager.PARAM_COLORS.get(index).intValue(), value);
}
use of de.mossgrabers.controller.ni.maschine.jam.controller.FaderConfig in project DrivenByMoss by git-moss.
the class MaschineJamVolumeMode method setupFader.
/**
* {@inheritDoc}
*/
@Override
public FaderConfig setupFader(final int index) {
final Optional<ITrack> optionalTrack = this.getTrack(index);
if (optionalTrack.isEmpty())
return FADER_OFF;
final ITrack track = optionalTrack.get();
if (!track.doesExist())
return FADER_OFF;
final String c = DAWColor.getColorIndex(track.getColor());
final int color = this.colorManager.getColorIndex(c);
final int value = this.model.getValueChanger().toMidiValue(track.getVolume());
if (!this.model.getTransport().isPlaying())
return new FaderConfig(FaderConfig.TYPE_SINGLE, color, value);
final int vu = this.model.getValueChanger().toMidiValue(track.getVu());
return new FaderConfig(FaderConfig.TYPE_DUAL, color, vu, value);
}
use of de.mossgrabers.controller.ni.maschine.jam.controller.FaderConfig in project DrivenByMoss by git-moss.
the class MaschineJamTrackMode method setupFader.
/**
* {@inheritDoc}
*/
@Override
public FaderConfig setupFader(final int index) {
final Optional<ITrack> optionalTrack = this.model.getCurrentTrackBank().getSelectedItem();
if (optionalTrack.isEmpty())
return FADER_OFF;
final ITrack track = optionalTrack.get();
if (!track.doesExist())
return FADER_OFF;
final String c = DAWColor.getColorIndex(track.getColor());
final int color = this.colorManager.getColorIndex(c);
switch(index) {
case 0:
final int value = this.model.getValueChanger().toMidiValue(track.getVolume());
if (!this.model.getTransport().isPlaying())
return new FaderConfig(FaderConfig.TYPE_SINGLE, color, value);
final int vu = this.model.getValueChanger().toMidiValue(track.getVu());
return new FaderConfig(FaderConfig.TYPE_DUAL, color, vu, value);
case 1:
final int panValue = this.model.getValueChanger().toMidiValue(track.getPan());
return new FaderConfig(FaderConfig.TYPE_PAN, color, panValue);
default:
final ISendBank sendBank = track.getSendBank();
if (!sendBank.hasExistingItems())
return FADER_OFF;
final int sendIndex = index - 2;
final ISend send = sendBank.getItem(sendIndex);
if (!send.doesExist())
return FADER_OFF;
final int sendValue = this.model.getValueChanger().toMidiValue(send.getValue());
return new FaderConfig(FaderConfig.TYPE_SINGLE, MaschineColorManager.COLOR_DARK_GREY, sendValue);
}
}
Aggregations