Search in sources :

Example 11 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 12 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 boolean isTouched = event == ButtonEvent.DOWN;
    // Avoid accidentally leaving the browser
    final ModeManager modeManager = this.surface.getModeManager();
    if (modeManager.isActiveMode(Modes.MODE_BROWSER))
        return;
    final IMasterTrack masterTrack = this.model.getMasterTrack();
    masterTrack.touchVolume(isTouched);
    if (this.surface.isDeletePressed()) {
        this.surface.setButtonConsumed(PushControlSurface.PUSH_BUTTON_DELETE);
        masterTrack.resetVolume();
        return;
    }
    final boolean isMasterMode = modeManager.isActiveMode(Modes.MODE_MASTER);
    if (isTouched && isMasterMode)
        return;
    if (isTouched)
        modeManager.setActiveMode(Modes.MODE_MASTER_TEMP);
    else if (!isMasterMode)
        modeManager.restoreMode();
}
Also used : IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 13 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 color = note - 36;
    if (color < BitwigColors.BITWIG_COLORS.length) {
        final double[] entry = BitwigColors.getColorEntry(BitwigColors.BITWIG_COLORS[color]);
        switch(this.mode) {
            case MODE_TRACK:
                final IChannelBank tb = this.model.getCurrentTrackBank();
                final ITrack t = tb.getSelectedTrack();
                if (t == null) {
                    final IMasterTrack master = this.model.getMasterTrack();
                    if (master.isSelected())
                        master.setColor(entry[0], entry[1], entry[2]);
                } else
                    t.setColor(entry[0], entry[1], entry[2]);
                break;
            case MODE_LAYER:
                final ICursorDevice cd = this.model.getCursorDevice();
                final IChannel deviceChain = cd.getSelectedLayerOrDrumPad();
                cd.setLayerOrDrumPadColor(deviceChain.getIndex(), entry[0], entry[1], entry[2]);
                break;
            case MODE_CLIP:
                final ICursorClip clip = this.model.getCursorClip();
                if (clip != null)
                    clip.setColor(entry[0], entry[1], entry[2]);
                break;
        }
    }
    this.surface.getViewManager().restoreView();
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorClip(de.mossgrabers.framework.daw.ICursorClip) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 14 with IMasterTrack

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

the class MasterMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    final IMasterTrack master = this.model.getMasterTrack();
    this.surface.getDisplay().setRow(0, MasterMode.PARAM_NAMES).clearRow(2).setCell(2, 0, master.getVolumeStr(8)).setCell(2, 1, master.getPanStr(8)).done(2);
}
Also used : IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Example 15 with IMasterTrack

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

the class MasterMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1(final ITextDisplay display) {
    final IMasterTrack master = this.model.getMasterTrack();
    final IProject project = this.model.getProject();
    final boolean canEditCueVolume = this.model.getHost().supports(Capability.CUE_VOLUME);
    display.setCell(0, 0, TAG_VOLUME).setCell(0, 1, "Pan");
    if (canEditCueVolume)
        display.setCell(0, 2, TAG_VOLUME).setCell(0, 3, "Mix");
    display.setCell(0, 6, "Project:");
    display.setCell(1, 0, master.getVolumeStr(8)).setCell(1, 1, master.getPanStr(8));
    if (canEditCueVolume)
        display.setCell(1, 2, project.getCueVolumeStr(8)).setCell(1, 3, project.getCueMixStr(8));
    display.setBlock(1, 2, "Audio Engine").setBlock(1, 3, this.model.getProject().getName());
    display.setCell(2, 0, this.surface.getConfiguration().isEnableVUMeters() ? master.getVu() : master.getVolume(), Format.FORMAT_VALUE);
    display.setCell(2, 1, master.getPan(), Format.FORMAT_PAN);
    if (canEditCueVolume) {
        display.setCell(2, 2, project.getCueVolume(), Format.FORMAT_VALUE);
        display.setCell(2, 3, project.getCueMix(), Format.FORMAT_VALUE);
        display.setCell(3, 0, master.getName()).setCell(3, 2, "Cue");
    }
    display.setCell(3, 4, this.model.getApplication().isEngineActive() ? "Active" : "Off");
    display.setCell(3, 6, "Previous").setCell(3, 7, "Next");
}
Also used : IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) IProject(de.mossgrabers.framework.daw.IProject)

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