Search in sources :

Example 16 with IMasterTrack

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

the class MasterMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2(final IGraphicDisplay display) {
    final IMasterTrack master = this.model.getMasterTrack();
    final IProject project = this.model.getProject();
    final IValueChanger valueChanger = this.model.getValueChanger();
    final boolean enableVUMeters = this.surface.getConfiguration().isEnableVUMeters();
    final int vuR = valueChanger.toDisplayValue(enableVUMeters ? master.getVuRight() : 0);
    final int vuL = valueChanger.toDisplayValue(enableVUMeters ? master.getVuLeft() : 0);
    final ICursorTrack cursorTrack = this.model.getCursorTrack();
    display.addChannelElement(TAG_VOLUME, false, master.getName(), ChannelType.MASTER, master.getColor(), master.isSelected(), valueChanger.toDisplayValue(master.getVolume()), valueChanger.toDisplayValue(master.getModulatedVolume()), this.isKnobTouched[0] ? master.getVolumeStr(8) : "", valueChanger.toDisplayValue(master.getPan()), valueChanger.toDisplayValue(master.getModulatedPan()), this.isKnobTouched[1] ? master.getPanStr(8) : "", vuL, vuR, master.isMute(), master.isSolo(), master.isRecArm(), master.isActivated(), 0, master.isSelected() && cursorTrack.isPinned());
    display.addChannelSelectorElement("Pan", false, "", null, ColorEx.BLACK, false, master.isActivated());
    if (this.model.getHost().supports(Capability.CUE_VOLUME)) {
        display.addChannelElement("Cue Volume", false, "Cue", ChannelType.MASTER, ColorEx.GRAY, false, valueChanger.toDisplayValue(project.getCueVolume()), -1, this.isKnobTouched[2] ? project.getCueVolumeStr(8) : "", valueChanger.toDisplayValue(project.getCueMix()), -1, this.isKnobTouched[3] ? project.getCueMixStr(8) : "", 0, 0, false, false, false, true, 0, false);
        display.addChannelSelectorElement("Cue Mix", false, "", null, ColorEx.BLACK, false, true);
    } else {
        display.addOptionElement("", "", false, "", "", false, false);
        display.addOptionElement("", "", false, "", "", false, false);
    }
    display.addOptionElement("", "", false, "Audio Engine", this.model.getApplication().isEngineActive() ? "Active" : "Off", false, false);
    display.addOptionElement("", "", false, "", "", false, false);
    display.addOptionElement("Project:", "", false, this.model.getProject().getName(), "Previous", false, false);
    display.addOptionElement("", "", false, "", "Next", false, false);
}
Also used : IValueChanger(de.mossgrabers.framework.controller.valuechanger.IValueChanger) ICursorTrack(de.mossgrabers.framework.daw.data.ICursorTrack) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) IProject(de.mossgrabers.framework.daw.IProject)

Example 17 with IMasterTrack

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

the class MasterMode method setActive.

private void setActive(final boolean enable) {
    final IMasterTrack mt = this.model.getMasterTrack();
    mt.setVolumeIndication(enable);
    mt.setPanIndication(enable);
}
Also used : IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Example 18 with IMasterTrack

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

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

the class ColorView method onGridNote.

/**
 * {@inheritDoc}
 */
@Override
public void onGridNote(final int note, final int velocity) {
    if (velocity > 0)
        return;
    final int offset = this.page * this.pageSize;
    final int color = offset + note - 36;
    final DAWColor[] dawColors = DAWColor.values();
    if (color < dawColors.length) {
        final ColorEx entry = dawColors[color].getColor();
        switch(this.mode) {
            case MODE_TRACK:
                final ITrack cursorTrack = this.model.getCursorTrack();
                if (cursorTrack.doesExist())
                    cursorTrack.setColor(entry);
                else {
                    final IMasterTrack master = this.model.getMasterTrack();
                    if (master.isSelected())
                        master.setColor(entry);
                }
                break;
            case MODE_LAYER:
                final IBank<? extends ILayer> layerBank = this.getLayerBank();
                final Optional<?> selectedItem = layerBank.getSelectedItem();
                if (selectedItem.isPresent())
                    ((ILayer) selectedItem.get()).setColor(entry);
                break;
            case MODE_CLIP:
                final IClip clip = this.model.getCursorClip();
                if (clip.doesExist())
                    clip.setColor(entry);
                break;
        }
    }
    this.surface.getViewManager().restore();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) DAWColor(de.mossgrabers.framework.daw.DAWColor) ColorEx(de.mossgrabers.framework.controller.color.ColorEx) IClip(de.mossgrabers.framework.daw.IClip) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Example 20 with IMasterTrack

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

the class MastertrackTouchCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    final boolean isTouched = event != ButtonEvent.UP;
    // Avoid accidentally leaving the browser
    final ModeManager modeManager = this.surface.getModeManager();
    if (modeManager.isActive(Modes.BROWSER))
        return;
    final IMasterTrack masterTrack = this.model.getMasterTrack();
    masterTrack.touchVolume(isTouched);
    if (this.surface.isDeletePressed()) {
        this.surface.setTriggerConsumed(ButtonID.DELETE);
        masterTrack.resetVolume();
        return;
    }
    final boolean isMasterMode = modeManager.isActive(Modes.MASTER);
    if (isTouched && isMasterMode)
        return;
    if (isTouched)
        modeManager.setTemporary(Modes.MASTER_TEMP);
    else if (!isMasterMode)
        modeManager.restore();
}
Also used : IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Aggregations

IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)40 ITrack (de.mossgrabers.framework.daw.data.ITrack)15 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)7 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)6 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)5 Display (de.mossgrabers.framework.controller.display.Display)4 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)4 ICursorTrack (de.mossgrabers.framework.daw.data.ICursorTrack)4 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)3 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)3 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)2 IApplication (de.mossgrabers.framework.daw.IApplication)2 IProject (de.mossgrabers.framework.daw.IProject)2 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)2 ITransport (de.mossgrabers.framework.daw.ITransport)2 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)2 ModeManager (de.mossgrabers.framework.mode.ModeManager)2 PushDisplay (de.mossgrabers.push.controller.PushDisplay)2 BeatstepControlSurface (de.mossgrabers.beatstep.controller.BeatstepControlSurface)1 PushColorManager (de.mossgrabers.controller.ableton.push.controller.PushColorManager)1