Search in sources :

Example 66 with ITrack

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

the class VolumeMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1(final ITextDisplay display) {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final PushConfiguration config = this.surface.getConfiguration();
    final int upperBound = this.model.getValueChanger().getUpperBound();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getItem(i);
        display.setCell(0, i, t.doesExist() ? "Volume" : "").setCell(1, i, t.getVolumeStr(8));
        if (t.doesExist())
            display.setCell(2, i, config.isEnableVUMeters() ? Push1Display.formatValue(t.getVolume(), t.getVu(), upperBound) : Push1Display.formatValue(t.getVolume(), upperBound));
    }
    this.drawRow4(display);
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 67 with ITrack

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

the class ACVSMasterCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event != ButtonEvent.DOWN)
        return;
    final IMasterTrack masterTrack = this.model.getMasterTrack();
    final ITrackBank trackBank = this.model.getTrackBank();
    if (masterTrack.isSelected())
        trackBank.selectItemAtPosition(this.position);
    else {
        final Optional<ITrack> selectedTrack = trackBank.getSelectedItem();
        this.position = selectedTrack.isPresent() ? selectedTrack.get().getPosition() : 0;
        masterTrack.select();
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Example 68 with ITrack

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

the class MaschineSendSelectCommand method executeShifted.

/**
 * {@inheritDoc}
 */
@Override
public void executeShifted(final ButtonEvent event) {
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes activeMode = modeManager.getActiveID();
    super.executeShifted(event);
    final Modes newMode = modeManager.getActiveID();
    if (activeMode == newMode)
        return;
    final int sendIndex = newMode.ordinal() - Modes.SEND1.ordinal();
    final Optional<ITrack> t = this.model.getCurrentTrackBank().getSelectedItem();
    if (t.isEmpty())
        return;
    final ISendBank sendBank = t.get().getSendBank();
    final ISend send = sendBank.getItem(sendIndex);
    if (send.doesExist())
        this.surface.getDisplay().notify("Send " + (sendIndex + 1) + ": " + send.getName());
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ITrack(de.mossgrabers.framework.daw.data.ITrack) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 69 with ITrack

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

the class KontrolProtocolControllerSetup method registerTriggerCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerTriggerCommands() {
    final KontrolProtocolControlSurface surface = this.getSurface();
    final ITransport t = this.model.getTransport();
    this.addButton(ButtonID.PLAY, "Play", new PlayCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_PLAY, t::isPlaying);
    this.addButton(ButtonID.NEW, "Shift+\nPlay", new NewCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_RESTART);
    final ConfiguredRecordCommand<KontrolProtocolControlSurface, KontrolProtocolConfiguration> recordCommand = new ConfiguredRecordCommand<>(false, this.model, surface);
    this.addButton(ButtonID.RECORD, "Record", recordCommand, 15, KontrolProtocolControlSurface.KONTROL_RECORD, recordCommand::isLit);
    final ConfiguredRecordCommand<KontrolProtocolControlSurface, KontrolProtocolConfiguration> shiftedRecordCommand = new ConfiguredRecordCommand<>(true, this.model, surface);
    this.addButton(ButtonID.REC_ARM, "Shift+\nRecord", shiftedRecordCommand, 15, KontrolProtocolControlSurface.KONTROL_COUNT_IN, shiftedRecordCommand::isLit);
    this.addButton(ButtonID.STOP, "Stop", new StopCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_STOP, () -> !t.isPlaying());
    this.addButton(ButtonID.LOOP, "Loop", new ToggleLoopCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_LOOP, t::isLoop);
    this.addButton(ButtonID.METRONOME, "Metronome", new MetronomeCommand<>(this.model, surface, false), 15, KontrolProtocolControlSurface.KONTROL_METRO, t::isMetronomeOn);
    this.addButton(ButtonID.TAP_TEMPO, "Tempo", new TapTempoCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_TAP_TEMPO);
    // Note: Since there is no pressed-state with this device, in the simulator-GUI the
    // following buttons are always on
    this.addButton(ButtonID.UNDO, "Undo", new UndoCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_UNDO, () -> this.model.getApplication().canUndo());
    this.addButton(ButtonID.REDO, "Redo", new RedoCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_REDO, () -> this.model.getApplication().canRedo());
    this.addButton(ButtonID.QUANTIZE, "Quantize", new QuantizeCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_QUANTIZE, () -> true);
    this.addButton(ButtonID.AUTOMATION, "Automation", new WriteArrangerAutomationCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_AUTOMATION, t::isWritingArrangerAutomation);
    this.addButton(ButtonID.DELETE, "Modes", new ModeMultiSelectCommand<>(this.model, surface, Modes.VOLUME, Modes.SEND, Modes.DEVICE_PARAMS), 15, KontrolProtocolControlSurface.KONTROL_CLEAR, () -> true);
    this.addButton(ButtonID.CLIP, "Start Clip", new StartClipOrSceneCommand(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_PLAY_SELECTED_CLIP);
    this.addButton(ButtonID.STOP_CLIP, "Stop Clip", new StopClipCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_STOP_CLIP);
    // Not implemented in NIHIA
    this.addButton(ButtonID.SCENE1, "Play Scene", new StartSceneCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_PLAY_SCENE);
    // KONTROL_RECORD_SESSION - Not implemented in NIHIA
    this.addButton(ButtonID.MUTE, "Mute", new MuteCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_SELECTED_TRACK_MUTE, () -> {
        final ITrackBank tb = this.model.getCurrentTrackBank();
        final Optional<ITrack> selectedTrack = tb.getSelectedItem();
        return selectedTrack.isPresent() && selectedTrack.get().isMute() ? 1 : 0;
    });
    this.addButton(ButtonID.SOLO, "Solo", new SoloCommand<>(this.model, surface), 15, KontrolProtocolControlSurface.KONTROL_SELECTED_TRACK_SOLO, () -> {
        final ITrackBank tb = this.model.getCurrentTrackBank();
        final Optional<ITrack> selectedTrack = tb.getSelectedItem();
        return selectedTrack.isPresent() && selectedTrack.get().isSolo() ? 1 : 0;
    });
    this.addButtons(surface, 0, 8, ButtonID.ROW_SELECT_1, "Select", (event, index) -> {
        if (event == ButtonEvent.DOWN)
            this.model.getCurrentTrackBank().getItem(index).selectOrExpandGroup();
    }, 15, KontrolProtocolControlSurface.KONTROL_TRACK_SELECTED, index -> this.model.getTrackBank().getItem(index).isSelected() ? 1 : 0);
    this.addButtons(surface, 0, 8, ButtonID.ROW1_1, "Mute", (event, index) -> {
        if (event == ButtonEvent.DOWN)
            this.model.getTrackBank().getItem(index).toggleMute();
    }, 15, KontrolProtocolControlSurface.KONTROL_TRACK_MUTE, index -> this.model.getTrackBank().getItem(index).isMute() ? 1 : 0);
    this.addButtons(surface, 0, 8, ButtonID.ROW2_1, "Solo", (event, index) -> {
        if (event == ButtonEvent.DOWN)
            this.model.getTrackBank().getItem(index).toggleSolo();
    }, 15, KontrolProtocolControlSurface.KONTROL_TRACK_SOLO, index -> this.model.getTrackBank().getItem(index).isSolo() ? 1 : 0);
    this.addButtons(surface, 0, 8, ButtonID.ROW3_1, "Arm", (event, index) -> {
        if (event == ButtonEvent.DOWN)
            this.model.getTrackBank().getItem(index).toggleRecArm();
    }, 15, KontrolProtocolControlSurface.KONTROL_TRACK_RECARM, index -> this.model.getTrackBank().getItem(index).isRecArm() ? 1 : 0);
    this.addButton(ButtonID.F1, "", NopCommand.INSTANCE, 15, KontrolProtocolControlSurface.KONTROL_SELECTED_TRACK_AVAILABLE);
    this.addButton(ButtonID.F2, "", NopCommand.INSTANCE, 15, KontrolProtocolControlSurface.KONTROL_SELECTED_TRACK_MUTED_BY_SOLO);
}
Also used : ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ITransport(de.mossgrabers.framework.daw.ITransport) StartClipOrSceneCommand(de.mossgrabers.controller.ni.kontrol.mkii.command.trigger.StartClipOrSceneCommand) ConfiguredRecordCommand(de.mossgrabers.framework.command.trigger.transport.ConfiguredRecordCommand) KontrolProtocolControlSurface(de.mossgrabers.controller.ni.kontrol.mkii.controller.KontrolProtocolControlSurface) ITrack(de.mossgrabers.framework.daw.data.ITrack) ButtonEvent(de.mossgrabers.framework.utils.ButtonEvent) List(java.util.List) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) ITransport(de.mossgrabers.framework.daw.ITransport) IHost(de.mossgrabers.framework.daw.IHost) IMidiOutput(de.mossgrabers.framework.daw.midi.IMidiOutput)

Example 70 with ITrack

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

the class KontrolProtocolControllerSetup method flush.

/**
 * {@inheritDoc}
 */
@Override
public void flush() {
    // Do not flush until handshake has finished
    if (!this.getSurface().isConnectedToNIHIA())
        return;
    final KontrolProtocolControlSurface surface = this.getSurface();
    final String kompleteInstanceNew = this.getKompleteInstance();
    if (!this.kompleteInstance.equals(kompleteInstanceNew)) {
        this.kompleteInstance = kompleteInstanceNew;
        surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_INSTANCE, 0, 0, kompleteInstanceNew);
    }
    final ITrackBank bank = this.model.getCurrentTrackBank();
    final boolean hasSolo = this.model.getProject().hasSolo();
    for (int i = 0; i < 8; i++) {
        final ITrack track = bank.getItem(i);
        surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_MUTE, track.isMute() ? 1 : 0, i);
        surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_SOLO, track.isSolo() ? 1 : 0, i);
        surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_MUTED_BY_SOLO, !track.isSolo() && hasSolo ? 1 : 0, i);
    }
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final Optional<ITrack> selectedTrack = tb.getSelectedItem();
    surface.sendCommand(KontrolProtocolControlSurface.KONTROL_SELECTED_TRACK_AVAILABLE, selectedTrack.isPresent() ? TrackType.toTrackType(selectedTrack.get().getType()) : 0);
    surface.sendCommand(KontrolProtocolControlSurface.KONTROL_SELECTED_TRACK_MUTED_BY_SOLO, selectedTrack.isPresent() && !selectedTrack.get().isSolo() && hasSolo ? 1 : 0);
    super.flush();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) KontrolProtocolControlSurface(de.mossgrabers.controller.ni.kontrol.mkii.controller.KontrolProtocolControlSurface)

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