Search in sources :

Example 21 with ITrackBank

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

the class SendModeCommand method handleExecute.

private void handleExecute(final ButtonEvent event, final int index) {
    // No Sends on FX tracks
    if (event != ButtonEvent.DOWN || this.model.isEffectTrackBankActive())
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    modeManager.setActive(Modes.get(Modes.SEND1, index));
    String modeName = "Send " + (index + 1) + ": ";
    final ITrackBank trackBank = this.model.getTrackBank();
    Optional<ITrack> selectedTrack = trackBank.getSelectedItem();
    if (selectedTrack.isEmpty()) {
        final ITrack item = trackBank.getItem(0);
        selectedTrack = item.doesExist() ? Optional.of(item) : Optional.empty();
    }
    if (selectedTrack.isPresent())
        modeName += selectedTrack.get().getSendBank().getItem(index).getName();
    else
        modeName += "-";
    this.model.getHost().showNotification(modeName);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 22 with ITrackBank

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

the class Kontrol1ControllerSetup method createObservers.

/**
 * {@inheritDoc}
 */
@Override
protected void createObservers() {
    super.createObservers();
    this.createScaleObservers(this.configuration);
    this.configuration.addSettingObserver(Kontrol1Configuration.SCALE_IS_ACTIVE, this::updateViewNoteMapping);
    final ITrackBank trackBank = this.model.getTrackBank();
    trackBank.addSelectionObserver((index, isSelected) -> this.handleTrackChange(isSelected));
    final ITrackBank effectTrackBank = this.model.getEffectTrackBank();
    if (effectTrackBank != null)
        effectTrackBank.addSelectionObserver((index, isSelected) -> this.handleTrackChange(isSelected));
    this.configuration.registerDeactivatedItemsHandler(this.model);
    this.activateBrowserObserver(Modes.BROWSER);
}
Also used : EnterButtonCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.EnterButtonCommand) MetronomeCommand(de.mossgrabers.framework.command.trigger.transport.MetronomeCommand) TwosComplementValueChanger(de.mossgrabers.framework.controller.valuechanger.TwosComplementValueChanger) Kontrol1PlayCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.Kontrol1PlayCommand) OutputID(de.mossgrabers.framework.controller.OutputID) AbstractControllerSetup(de.mossgrabers.framework.controller.AbstractControllerSetup) ModeMultiSelectCommand(de.mossgrabers.framework.command.trigger.mode.ModeMultiSelectCommand) BackButtonCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.BackButtonCommand) Views(de.mossgrabers.framework.view.Views) BrowseMode(de.mossgrabers.controller.ni.kontrol.mki.mode.device.BrowseMode) MainEncoderButtonCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.MainEncoderButtonCommand) WindCommand(de.mossgrabers.framework.command.trigger.transport.WindCommand) ToggleLoopCommand(de.mossgrabers.framework.command.trigger.transport.ToggleLoopCommand) KnobRowModeCommand(de.mossgrabers.framework.command.continuous.KnobRowModeCommand) Modes(de.mossgrabers.framework.mode.Modes) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager) Direction(de.mossgrabers.framework.command.trigger.Direction) BindType(de.mossgrabers.framework.controller.hardware.BindType) Kontrol1CursorCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.Kontrol1CursorCommand) ISettingsUI(de.mossgrabers.framework.configuration.ISettingsUI) TrackMode(de.mossgrabers.controller.ni.kontrol.mki.mode.track.TrackMode) VolumeMode(de.mossgrabers.controller.ni.kontrol.mki.mode.track.VolumeMode) IMidiInput(de.mossgrabers.framework.daw.midi.IMidiInput) ScaleButtonCommand(de.mossgrabers.controller.ni.kontrol.mki.command.trigger.ScaleButtonCommand) ControlView(de.mossgrabers.controller.ni.kontrol.mki.view.ControlView) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ISetupFactory(de.mossgrabers.framework.controller.ISetupFactory) IDrumDevice(de.mossgrabers.framework.daw.data.IDrumDevice) ModelSetup(de.mossgrabers.framework.daw.ModelSetup) Scales(de.mossgrabers.framework.scale.Scales) ButtonID(de.mossgrabers.framework.controller.ButtonID) MainEncoderCommand(de.mossgrabers.controller.ni.kontrol.mki.command.continuous.MainEncoderCommand) ScaleMode(de.mossgrabers.controller.ni.kontrol.mki.mode.ScaleMode) Kontrol1UsbDevice(de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1UsbDevice) ITransport(de.mossgrabers.framework.daw.ITransport) Kontrol1Display(de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display) IHost(de.mossgrabers.framework.daw.IHost) NopCommand(de.mossgrabers.framework.command.core.NopCommand) Kontrol1ColorManager(de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ColorManager) RecordCommand(de.mossgrabers.framework.command.trigger.transport.RecordCommand) StopCommand(de.mossgrabers.framework.command.trigger.transport.StopCommand) ContinuousID(de.mossgrabers.framework.controller.ContinuousID) ParamsMode(de.mossgrabers.controller.ni.kontrol.mki.mode.device.ParamsMode) IMidiAccess(de.mossgrabers.framework.daw.midi.IMidiAccess) BrowserCommand(de.mossgrabers.framework.command.trigger.BrowserCommand) KnobRowTouchModeCommand(de.mossgrabers.framework.command.trigger.mode.KnobRowTouchModeCommand) IView(de.mossgrabers.framework.featuregroup.IView) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) Kontrol1ControlSurface(de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface) IHwRelativeKnob(de.mossgrabers.framework.controller.hardware.IHwRelativeKnob) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 23 with ITrackBank

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

the class BaseMode method getButtonColor.

/**
 * {@inheritDoc}
 */
@Override
public int getButtonColor(final ButtonID buttonID) {
    final ITrackBank tb = this.getTrackBank();
    final int extenderOffset = this.getExtenderOffset();
    for (int i = 0; i < 8; i++) {
        final ITrack track = tb.getItem(extenderOffset + i);
        final boolean exists = track.doesExist();
        if (buttonID == ButtonID.get(ButtonID.ROW_SELECT_1, i))
            return exists && track.isSelected() ? MCUControllerSetup.MCU_BUTTON_STATE_ON : MCUControllerSetup.MCU_BUTTON_STATE_OFF;
        if (buttonID == ButtonID.get(ButtonID.ROW2_1, i))
            return exists && track.isRecArm() ? MCUControllerSetup.MCU_BUTTON_STATE_ON : MCUControllerSetup.MCU_BUTTON_STATE_OFF;
        if (buttonID == ButtonID.get(ButtonID.ROW3_1, i))
            return exists && track.isSolo() ? MCUControllerSetup.MCU_BUTTON_STATE_ON : MCUControllerSetup.MCU_BUTTON_STATE_OFF;
        if (buttonID == ButtonID.get(ButtonID.ROW4_1, i))
            return exists && track.isMute() ? MCUControllerSetup.MCU_BUTTON_STATE_ON : MCUControllerSetup.MCU_BUTTON_STATE_OFF;
    }
    return MCUControllerSetup.MCU_BUTTON_STATE_OFF;
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 24 with ITrackBank

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

the class VolumeMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final Kontrol1Display d = (Kontrol1Display) this.surface.getDisplay();
    d.clear();
    d.setCell(0, 0, this.model.isEffectTrackBankActive() ? "VOL-FX" : "VOLUME").setCell(1, 0, this.formatPageRange("%d - %d"));
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final Optional<ITrack> selTrack = tb.getSelectedItem();
    final int selIndex = selTrack.isEmpty() ? -1 : selTrack.get().getIndex();
    for (int i = 0; i < 8; i++) {
        final boolean isSel = i == selIndex;
        final ITrack t = tb.getItem(i);
        final String n = StringUtils.shortenAndFixASCII(t.getName(), isSel ? 7 : 8).toUpperCase(Locale.US);
        d.setCell(0, 1 + i, isSel ? ">" + n : n).setCell(1, 1 + i, getSecondLineText(t));
        d.setBar(1 + i, this.surface.getContinuous(ContinuousID.get(ContinuousID.KNOB1, i)).isTouched() && t.doesExist(), t.getVolume());
    }
    d.allDone();
}
Also used : Kontrol1Display(de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 25 with ITrackBank

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

the class TrackMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final ITrackBank currentTrackBank = this.model.getCurrentTrackBank();
    final Optional<ITrack> t = currentTrackBank.getSelectedItem();
    final Kontrol1Display d = (Kontrol1Display) this.surface.getDisplay();
    d.clear();
    if (t.isEmpty()) {
        d.setCell(0, 3, "  PLEASE").setCell(0, 4, "SELECT A").setCell(0, 5, "TRACK").allDone();
        return;
    }
    final boolean isEffectTrackBankActive = this.model.isEffectTrackBankActive();
    final ITrack track = t.get();
    d.setCell(0, 0, (isEffectTrackBankActive ? "TR-FX " : "TRACK ") + (track.getPosition() + 1)).setCell(1, 0, StringUtils.shortenAndFixASCII(track.getName(), 8).toUpperCase(Locale.US));
    d.setCell(0, 1, "VOLUME").setCell(1, 1, getSecondLineText(track)).setCell(0, 2, "PAN").setCell(1, 2, track.getPanStr(8));
    d.setBar(1, this.surface.getContinuous(ContinuousID.KNOB1).isTouched(), track.getVolume());
    d.setPanBar(2, this.surface.getContinuous(ContinuousID.KNOB2).isTouched(), track.getPan());
    if (!isEffectTrackBankActive) {
        final ISendBank sendBank = track.getSendBank();
        for (int i = 0; i < 6; i++) {
            final int pos = 3 + i;
            final ISend sendData = sendBank.getItem(i);
            d.setCell(0, pos, StringUtils.shortenAndFixASCII(sendData.getName(8), 8).toUpperCase(Locale.US)).setCell(1, pos, sendData.getDisplayedValue(8));
            d.setBar(pos, this.surface.getContinuous(ContinuousID.get(ContinuousID.KNOB3, i)).isTouched() && sendData.doesExist(), sendData.getValue());
        }
    }
    d.allDone();
}
Also used : Kontrol1Display(de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Aggregations

ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)121 ITrack (de.mossgrabers.framework.daw.data.ITrack)85 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)17 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)16 Modes (de.mossgrabers.framework.mode.Modes)15 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)10 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)10 ISend (de.mossgrabers.framework.daw.data.ISend)10 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)8 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)7 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)7 ICursorTrack (de.mossgrabers.framework.daw.data.ICursorTrack)6 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)5 ITransport (de.mossgrabers.framework.daw.ITransport)5 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)5 ISceneBank (de.mossgrabers.framework.daw.data.bank.ISceneBank)5 SLMkIIIDisplay (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)4 ColorEx (de.mossgrabers.framework.controller.color.ColorEx)4 Kontrol1Display (de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display)3 IHost (de.mossgrabers.framework.daw.IHost)3