Search in sources :

Example 71 with ITrack

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

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

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

the class TouchstripCommand method updateValue.

/**
 * Update the LED value of the ribbon strip.
 */
public void updateValue() {
    final RibbonMode ribbonMode = this.surface.getConfiguration().getRibbonMode();
    switch(ribbonMode) {
        case PITCH_DOWN:
        case PITCH_UP:
        case PITCH_DOWN_UP:
        case CC_1:
        case CC_11:
            this.surface.setRibbonValue(this.ribbonValue);
            break;
        case MASTER_VOLUME:
            final ITrack t = this.model.getMasterTrack();
            this.surface.setRibbonValue(t == null ? 0 : this.model.getValueChanger().toMidiValue(t.getVolume()));
            break;
        case NOTE_REPEAT_PERIOD:
        case NOTE_REPEAT_LENGTH:
            final Resolution[] values = Resolution.values();
            final INoteRepeat noteRepeat = this.surface.getMidiInput().getDefaultNoteInput().getNoteRepeat();
            final double value = ribbonMode == RibbonMode.NOTE_REPEAT_PERIOD ? noteRepeat.getPeriod() : noteRepeat.getNoteLength();
            final int index = Resolution.getMatch(value);
            this.surface.setRibbonValue((int) Math.round(index * 127.0 / (values.length - 1)));
            break;
        default:
            // Not used
            break;
    }
}
Also used : RibbonMode(de.mossgrabers.controller.ni.maschine.core.RibbonMode) ITrack(de.mossgrabers.framework.daw.data.ITrack) INoteRepeat(de.mossgrabers.framework.daw.midi.INoteRepeat) Resolution(de.mossgrabers.framework.daw.constants.Resolution)

Example 74 with ITrack

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

the class MidiModule method getNoteColor.

/**
 * Get the color for a note.
 *
 * @param note The note
 * @return The color
 */
private ColorEx getNoteColor(final int note) {
    final ColorManager colorManager = this.model.getColorManager();
    final boolean isKeyboardEnabled = this.model.canSelectedTrackHoldNotes();
    if (!isKeyboardEnabled)
        return ColorEx.BLACK;
    if (this.keyManager.isKeyPressed(note))
        return this.model.hasRecordingState() ? ColorEx.RED : ColorEx.GREEN;
    final ITrack cursorTrack = this.model.getCursorTrack();
    final String colorID = AbstractView.replaceOctaveColorWithTrackColor(cursorTrack, this.keyManager.getColor(note));
    final int colorIndex = colorManager.getColorIndex(colorID);
    return colorManager.getColor(colorIndex, null);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ColorManager(de.mossgrabers.framework.controller.color.ColorManager)

Example 75 with ITrack

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

the class AutoColor method updateTracks.

/**
 * Updates all tracks (in the page) for a color.
 *
 * @param color The color to match for
 * @param patterns The patterns to match
 */
private void updateTracks(final DAWColor color, final List<Pattern> patterns) {
    for (int i = 0; i < this.trackBank.getPageSize(); i++) {
        final ITrack track = this.trackBank.getItem(i);
        matchColorToTrack(track, track.getName(), color, patterns);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack)

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