Search in sources :

Example 21 with IMasterTrack

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

the class GenericFlexiControllerSetup method updateIndication.

protected void updateIndication() {
    final Set<FlexiCommand> commands = this.configuration.getMappedCommands();
    final FlexiCommand[] allCommands = FlexiCommand.values();
    final ITrackBank trackBank = this.model.getTrackBank();
    final Optional<ITrack> selectedTrack = trackBank.getSelectedItem();
    for (int i = 0; i < trackBank.getPageSize(); i++) {
        final boolean hasTrackSel = selectedTrack.isPresent() && selectedTrack.get().getIndex() == i;
        final ITrack track = trackBank.getItem(i);
        track.setVolumeIndication(this.testVolumeIndication(commands, allCommands, i, hasTrackSel));
        track.setPanIndication(this.testPanIndication(commands, allCommands, i, hasTrackSel));
        final ISendBank sendBank = track.getSendBank();
        final int sendPageSize = sendBank.getPageSize();
        for (int j = 0; j < sendPageSize; j++) sendBank.getItem(j).setIndication(this.testSendIndication(commands, allCommands, i, hasTrackSel, sendPageSize, j));
    }
    final IMasterTrack masterTrack = this.model.getMasterTrack();
    masterTrack.setVolumeIndication(commands.contains(FlexiCommand.MASTER_SET_VOLUME));
    masterTrack.setPanIndication(commands.contains(FlexiCommand.MASTER_SET_PANORAMA));
    final IParameterBank parameterBank = this.model.getCursorDevice().getParameterBank();
    for (int i = 0; i < parameterBank.getPageSize(); i++) parameterBank.getItem(i).setIndication(this.testParameterIndication(commands, allCommands, i));
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) FlexiCommand(de.mossgrabers.controller.generic.controller.FlexiCommand) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Example 22 with IMasterTrack

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

the class VolumeView method getButtonColor.

/**
 * {@inheritDoc}
 */
@Override
public int getButtonColor(final ButtonID buttonID) {
    final IMasterTrack track = this.model.getMasterTrack();
    final int color = track.doesExist() ? this.colorManager.getColorIndex(DAWColor.getColorIndex(track.getColor())) : 0;
    this.masterFader.setup(color, false);
    this.masterFader.setValue(track.getVolume());
    final int index = 7 - (buttonID.ordinal() - ButtonID.SCENE1.ordinal());
    return this.masterFader.getColorState(index);
}
Also used : IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Example 23 with IMasterTrack

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

the class BrowserCommand method activateBrowser.

/**
 * Activate the browser depending on the parameters and the currently active mode.
 *
 * @param insertDevice Insert a device if true otherwise select preset
 * @param beforeCurrent Insert the device before the current device if any
 * @return True if activated
 */
private boolean activateBrowser(final boolean insertDevice, final boolean beforeCurrent) {
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final boolean hasCursorDevice = cursorDevice.doesExist();
    final IBrowser browser = this.model.getBrowser();
    if (hasCursorDevice) {
        // Replace the cursor device
        if (!insertDevice) {
            browser.replace(cursorDevice);
            return true;
        }
        if (Modes.isLayerMode(this.surface.getModeManager().getActiveID())) {
            final Optional<ILayer> layer = cursorDevice.getLayerBank().getSelectedItem();
            if (layer.isEmpty())
                return false;
            browser.addDevice(layer.get());
            return true;
        }
        if (beforeCurrent)
            browser.insertBeforeCursorDevice();
        else
            browser.insertAfterCursorDevice();
        return true;
    }
    // No cursor device, add to the selected channel, if any
    final Optional<ITrack> channel = this.model.getCurrentTrackBank().getSelectedItem();
    if (channel.isPresent()) {
        browser.addDevice(channel.get());
        return true;
    }
    final IMasterTrack master = this.model.getMasterTrack();
    if (!master.isSelected())
        return false;
    browser.addDevice(master);
    return true;
}
Also used : IBrowser(de.mossgrabers.framework.daw.IBrowser) ITrack(de.mossgrabers.framework.daw.data.ITrack) ILayer(de.mossgrabers.framework.daw.data.ILayer) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

Example 24 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 25 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() {
    if (!this.surface.getConfiguration().hasDisplay1())
        return;
    this.drawDisplay2();
    final ITextDisplay d = this.surface.getTextDisplay().clear();
    final String projectName = StringUtils.fixASCII(this.model.getProject().getName());
    final IMasterTrack master = this.model.getMasterTrack();
    final IApplication application = this.model.getApplication();
    d.setCell(0, 0, "Volume").setCell(0, 1, "Pan").setBlock(0, 1, "Audio Engine:").setCell(0, 4, application.isEngineActive() ? " On" : " Off");
    d.setCell(0, 5, "Prjct:").setBlock(0, 3, projectName);
    d.setCell(1, 0, master.getVolumeStr(6)).setCell(1, 1, master.getPanStr(6)).setBlock(1, 1, application.isEngineActive() ? "  Turn off" : "  Turn on");
    d.setCell(1, 6, " <<").setCell(1, 7, " >>").allDone();
}
Also used : IApplication(de.mossgrabers.framework.daw.IApplication) ITextDisplay(de.mossgrabers.framework.controller.display.ITextDisplay) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

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