Search in sources :

Example 1 with FaderConfig

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);
}
Also used : FaderConfig(de.mossgrabers.controller.ni.maschine.jam.controller.FaderConfig) ITrack(de.mossgrabers.framework.daw.data.ITrack)

Example 2 with FaderConfig

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);
}
Also used : FaderConfig(de.mossgrabers.controller.ni.maschine.jam.controller.FaderConfig) IParameter(de.mossgrabers.framework.daw.data.IParameter)

Example 3 with FaderConfig

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);
}
Also used : FaderConfig(de.mossgrabers.controller.ni.maschine.jam.controller.FaderConfig) IParameter(de.mossgrabers.framework.daw.data.IParameter) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 4 with FaderConfig

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);
}
Also used : FaderConfig(de.mossgrabers.controller.ni.maschine.jam.controller.FaderConfig) ITrack(de.mossgrabers.framework.daw.data.ITrack)

Example 5 with FaderConfig

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);
    }
}
Also used : FaderConfig(de.mossgrabers.controller.ni.maschine.jam.controller.FaderConfig) ITrack(de.mossgrabers.framework.daw.data.ITrack) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Aggregations

FaderConfig (de.mossgrabers.controller.ni.maschine.jam.controller.FaderConfig)6 ITrack (de.mossgrabers.framework.daw.data.ITrack)4 IParameter (de.mossgrabers.framework.daw.data.IParameter)2 ISend (de.mossgrabers.framework.daw.data.ISend)2 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)1 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)1