Search in sources :

Example 1 with IArranger

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

the class ControlMode method sendAdditionalMPCParameters.

/**
 * Send additional parameters specific to the MPC models.
 *
 * @param d The display
 */
private void sendAdditionalMPCParameters(final ACVSDisplay d) {
    final ITransport transport = this.model.getTransport();
    final IApplication application = this.model.getApplication();
    final IArranger arranger = this.model.getArranger();
    final ICursorDevice device = this.model.getCursorDevice();
    d.setScreenItem(ScreenItem.MPC_METRONOME, transport.isMetronomeOn() ? 127 : 0);
    // ScreenItem.MPC_CAPTURE_MIDI - not supported
    // ScreenItem.MPC_ABLETON_LINK - not supported
    final boolean isOverdub = this.surface.isShiftPressed() ? transport.isLauncherOverdub() : transport.isArrangerOverdub();
    d.setScreenItem(ScreenItem.MPC_ARRANGE_OVERDUB, isOverdub ? 127 : 0);
    final boolean isAutomation = this.surface.isShiftPressed() ? transport.isWritingClipLauncherAutomation() : transport.isWritingArrangerAutomation();
    d.setScreenItem(ScreenItem.MPC_ARRANGER_AUTOMATION_ARM, isAutomation ? 127 : 0);
    d.setScreenItem(ScreenItem.MPC_LOOP_SWITCH, transport.isLoop() ? 127 : 0);
    d.setScreenItem(ScreenItem.MPC_LAUNCH_QUANTIZE, convertLaunchQuantization(transport.getDefaultLaunchQuantization()));
    d.setScreenItem(ScreenItem.MPC_ARRANGEMENT_SESSION, application.isArrangeLayout() ? 1 : 0);
    d.setScreenItem(ScreenItem.MPC_FOLLOW, arranger.isPlaybackFollowEnabled() ? 127 : 0);
    // ScreenItem.MPC_CLIP_DEVICE_VIEW - not supported
    d.setScreenItem(ScreenItem.MPC_DEVICE_LOCK, device.isPinned() ? 127 : 0);
    d.setScreenItem(ScreenItem.MPC_DETAIL_VIEW, device.isExpanded() ? 127 : 0);
    d.setScreenItem(ScreenItem.MPC_QUANTIZE_INTERVAL, Math.max(0, Math.min(7, 10 - this.surface.getConfiguration().getQuantizeAmount() / 10)));
    d.setScreenItem(ScreenItem.MPC_CLIP_SCENE_LAUNCH, this.surface.getConfiguration().isLaunchClips() ? 0 : 1);
}
Also used : IApplication(de.mossgrabers.framework.daw.IApplication) ITransport(de.mossgrabers.framework.daw.ITransport) IArranger(de.mossgrabers.framework.daw.IArranger) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 2 with IArranger

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

the class LayoutModule method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final String command, final LinkedList<String> path, final Object value) throws IllegalParameterException, UnknownCommandException, MissingCommandException {
    switch(command) {
        case "layout":
            this.model.getApplication().setPanelLayout(toString(value).toUpperCase(Locale.US));
            break;
        case "panel":
            final String subCommand = getSubCommand(path);
            final IApplication app = this.model.getApplication();
            switch(subCommand) {
                case "noteEditor":
                    app.toggleNoteEditor();
                    break;
                case "automationEditor":
                    app.toggleAutomationEditor();
                    break;
                case "devices":
                    app.toggleDevices();
                    break;
                case TAG_MIXER:
                    app.toggleMixer();
                    break;
                case "fullscreen":
                    app.toggleFullScreen();
                    break;
                default:
                    throw new UnknownCommandException(subCommand);
            }
            break;
        case "arranger":
            final String subCommand2 = getSubCommand(path);
            final IArranger arrange = this.model.getArranger();
            switch(subCommand2) {
                case "cueMarkerVisibility":
                    arrange.toggleCueMarkerVisibility();
                    break;
                case "playbackFollow":
                    arrange.togglePlaybackFollow();
                    break;
                case "trackRowHeight":
                    arrange.toggleTrackRowHeight();
                    break;
                case "clipLauncherSectionVisibility":
                    arrange.toggleClipLauncher();
                    break;
                case "timeLineVisibility":
                    arrange.toggleTimeLine();
                    break;
                case "ioSectionVisibility":
                    arrange.toggleIoSection();
                    break;
                case "effectTracksVisibility":
                    arrange.toggleEffectTracks();
                    break;
                default:
                    throw new UnknownCommandException(subCommand2);
            }
            break;
        case TAG_MIXER:
            final String subCommand3 = getSubCommand(path);
            final IMixer mix = this.model.getMixer();
            switch(subCommand3) {
                case "clipLauncherSectionVisibility":
                    mix.toggleClipLauncherSectionVisibility();
                    break;
                case "crossFadeSectionVisibility":
                    mix.toggleCrossFadeSectionVisibility();
                    break;
                case "deviceSectionVisibility":
                    mix.toggleDeviceSectionVisibility();
                    break;
                case "sendsSectionVisibility":
                    mix.toggleSendsSectionVisibility();
                    break;
                case "ioSectionVisibility":
                    mix.toggleIoSectionVisibility();
                    break;
                case "meterSectionVisibility":
                    mix.toggleMeterSectionVisibility();
                    break;
                default:
                    throw new UnknownCommandException(subCommand3);
            }
            break;
        default:
            throw new UnknownCommandException(command);
    }
}
Also used : IMixer(de.mossgrabers.framework.daw.IMixer) IApplication(de.mossgrabers.framework.daw.IApplication) IArranger(de.mossgrabers.framework.daw.IArranger) UnknownCommandException(de.mossgrabers.controller.osc.exception.UnknownCommandException)

Example 3 with IArranger

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

the class OSCParser method parsePanelCommands.

private boolean parsePanelCommands(final String command, final LinkedList<String> oscParts, final String value) {
    switch(command) {
        case "layout":
            if (value != null)
                this.model.getApplication().setPanelLayout(value.toUpperCase());
            return true;
        case "panel":
            if (oscParts.isEmpty()) {
                this.host.errorln("Missing Panel subcommand.");
                return true;
            }
            final IApplication app = this.model.getApplication();
            final String subCommand = oscParts.get(0);
            switch(subCommand) {
                case "noteEditor":
                    app.toggleNoteEditor();
                    break;
                case "automationEditor":
                    app.toggleAutomationEditor();
                    break;
                case "devices":
                    app.toggleDevices();
                    break;
                case "mixer":
                    app.toggleMixer();
                    break;
                case "fullscreen":
                    app.toggleFullScreen();
                    break;
                default:
                    this.host.errorln("Unknown Panel subcommand: " + subCommand);
            }
            return true;
        case "arranger":
            if (oscParts.isEmpty()) {
                this.host.errorln("Missing Arranger subcommand.");
                return true;
            }
            final IArranger arrange = this.model.getArranger();
            final String subCommand2 = oscParts.get(0);
            switch(subCommand2) {
                case "cueMarkerVisibility":
                    arrange.toggleCueMarkerVisibility();
                    break;
                case "playbackFollow":
                    arrange.togglePlaybackFollow();
                    break;
                case "trackRowHeight":
                    arrange.toggleTrackRowHeight();
                    break;
                case "clipLauncherSectionVisibility":
                    arrange.toggleClipLauncher();
                    break;
                case "timeLineVisibility":
                    arrange.toggleTimeLine();
                    break;
                case "ioSectionVisibility":
                    arrange.toggleIoSection();
                    break;
                case "effectTracksVisibility":
                    arrange.toggleEffectTracks();
                    break;
                default:
                    this.host.errorln("Unknown Arranger subcommand: " + subCommand2);
            }
            return true;
        case "mixer":
            if (oscParts.isEmpty()) {
                this.host.errorln("Missing Mixer subcommand.");
                return true;
            }
            final IMixer mix = this.model.getMixer();
            final String subCommand3 = oscParts.get(0);
            switch(subCommand3) {
                case "clipLauncherSectionVisibility":
                    mix.toggleClipLauncherSectionVisibility();
                    break;
                case "crossFadeSectionVisibility":
                    mix.toggleCrossFadeSectionVisibility();
                    break;
                case "deviceSectionVisibility":
                    mix.toggleDeviceSectionVisibility();
                    break;
                case "sendsSectionVisibility":
                    mix.toggleSendsSectionVisibility();
                    break;
                case "ioSectionVisibility":
                    mix.toggleIoSectionVisibility();
                    break;
                case "meterSectionVisibility":
                    mix.toggleMeterSectionVisibility();
                    break;
                default:
                    this.host.errorln("Unknown Mixer subcommand: " + subCommand3);
                    break;
            }
            return true;
        default:
            return false;
    }
}
Also used : IMixer(de.mossgrabers.framework.daw.IMixer) IApplication(de.mossgrabers.framework.daw.IApplication) IArranger(de.mossgrabers.framework.daw.IArranger)

Example 4 with IArranger

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

the class OSCWriter method flush.

/**
 * Flush out all values.
 *
 * @param dump Forces a flush if true otherwise only changed values are flushed
 */
public void flush(final boolean dump) {
    if (this.udpServer == null)
        return;
    // 
    // Transport
    // 
    final ITransport trans = this.model.getTransport();
    this.sendOSC("/play", trans.isPlaying(), dump);
    this.sendOSC("/record", trans.isRecording(), dump);
    this.sendOSC("/overdub", trans.isArrangerOverdub(), dump);
    this.sendOSC("/overdub/launcher", trans.isLauncherOverdub(), dump);
    this.sendOSC("/repeat", trans.isLoop(), dump);
    this.sendOSC("/punchIn", trans.isPunchInEnabled(), dump);
    this.sendOSC("/punchOut", trans.isPunchOutEnabled(), dump);
    this.sendOSC("/click", trans.isMetronomeOn(), dump);
    this.sendOSC("/click/ticks", trans.isMetronomeTicksOn(), dump);
    this.sendOSC("/click/volume", trans.getMetronomeVolume(), dump);
    this.sendOSC("/click/volumeStr", trans.getMetronomeVolumeStr(), dump);
    this.sendOSC("/click/preroll", trans.isPrerollMetronomeEnabled(), dump);
    this.sendOSC("/preroll", trans.getPrerollAsBars(), dump);
    this.sendOSC("/tempo/raw", trans.getTempo(), dump);
    this.sendOSC("/crossfade", trans.getCrossfade(), dump);
    this.sendOSC("/autowrite", trans.isWritingArrangerAutomation(), dump);
    this.sendOSC("/autowrite/launcher", trans.isWritingClipLauncherAutomation(), dump);
    this.sendOSC("/automationWriteMode", trans.getAutomationWriteMode(), dump);
    this.sendOSC("/time/str", trans.getPositionText(), dump);
    this.sendOSC("/time/signature", trans.getNumerator() + " / " + trans.getDenominator(), dump);
    this.sendOSC("/beat/str", trans.getBeatText(), dump);
    // 
    // Frames
    // 
    final IApplication app = this.model.getApplication();
    this.sendOSC("/layout", app.getPanelLayout().toLowerCase(), dump);
    final IArranger arrange = this.model.getArranger();
    this.sendOSC("/arranger/cueMarkerVisibility", arrange.areCueMarkersVisible(), dump);
    this.sendOSC("/arranger/playbackFollow", arrange.isPlaybackFollowEnabled(), dump);
    this.sendOSC("/arranger/trackRowHeight", arrange.hasDoubleRowTrackHeight(), dump);
    this.sendOSC("/arranger/clipLauncherSectionVisibility", arrange.isClipLauncherVisible(), dump);
    this.sendOSC("/arranger/timeLineVisibility", arrange.isTimelineVisible(), dump);
    this.sendOSC("/arranger/ioSectionVisibility", arrange.isIoSectionVisible(), dump);
    this.sendOSC("/arranger/effectTracksVisibility", arrange.areEffectTracksVisible(), dump);
    final IMixer mix = this.model.getMixer();
    this.sendOSC("/mixer/clipLauncherSectionVisibility", mix.isClipLauncherSectionVisible(), dump);
    this.sendOSC("/mixer/crossFadeSectionVisibility", mix.isCrossFadeSectionVisible(), dump);
    this.sendOSC("/mixer/deviceSectionVisibility", mix.isDeviceSectionVisible(), dump);
    this.sendOSC("/mixer/sendsSectionVisibility", mix.isSendSectionVisible(), dump);
    this.sendOSC("/mixer/ioSectionVisibility", mix.isIoSectionVisible(), dump);
    this.sendOSC("/mixer/meterSectionVisibility", mix.isMeterSectionVisible(), dump);
    // 
    // Project
    // 
    this.sendOSC("/project/name", this.model.getProject().getName(), dump);
    this.sendOSC("/project/engine", app.isEngineActive(), dump);
    // 
    // Master-/Track(-commands)
    // 
    final IChannelBank trackBank = this.model.getCurrentTrackBank();
    for (int i = 0; i < trackBank.getNumTracks(); i++) this.flushTrack("/track/" + (i + 1) + "/", trackBank.getTrack(i), dump);
    this.flushTrack("/master/", this.model.getMasterTrack(), dump);
    final ITrack selectedTrack = trackBank.getSelectedTrack();
    this.flushTrack("/track/selected/", selectedTrack == null ? EMPTY_TRACK : selectedTrack, dump);
    this.sendOSC("/track/toggleBank", this.model.isEffectTrackBankActive() ? 1 : 0, dump);
    // 
    // Scenes
    // 
    final ISceneBank sceneBank = this.model.getSceneBank();
    for (int i = 0; i < sceneBank.getNumScenes(); i++) this.flushScene("/scene/" + (i + 1) + "/", sceneBank.getScene(i), dump);
    // 
    // Device / Primary Device
    // 
    final ICursorDevice cd = this.model.getCursorDevice();
    this.flushDevice("/device/", cd, dump);
    if (cd.hasDrumPads()) {
        for (int i = 0; i < cd.getNumDrumPads(); i++) this.flushDeviceLayers("/device/drumpad/" + (i + 1) + "/", cd.getLayerOrDrumPad(i), dump);
    }
    for (int i = 0; i < cd.getNumLayers(); i++) this.flushDeviceLayers("/device/layer/" + (i + 1) + "/", cd.getLayerOrDrumPad(i), dump);
    this.flushDevice("/primary/", this.model.getPrimaryDevice(), dump);
    // 
    // Browser
    // 
    this.flushBrowser("/browser/", this.model.getBrowser(), dump);
    // 
    // Notes
    // 
    this.flushNotes("/vkb_midi/note/", dump);
    try {
        int pos = 0;
        this.udpServer.startBundle();
        for (final OscMessageData message : this.messages) {
            final String address = message.getAddress();
            final Object[] values = message.getValues();
            this.udpServer.sendMessage(address, values);
            pos++;
            if (pos > 1000) {
                pos = 0;
                this.udpServer.endBundle();
                this.udpServer.startBundle();
            }
        }
        this.udpServer.endBundle();
    } catch (final IOException ex) {
        this.model.getHost().error("Could not send UDP message.", ex);
    }
    this.messages.clear();
}
Also used : IMixer(de.mossgrabers.framework.daw.IMixer) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITransport(de.mossgrabers.framework.daw.ITransport) IArranger(de.mossgrabers.framework.daw.IArranger) IOException(java.io.IOException) ISceneBank(de.mossgrabers.framework.daw.ISceneBank) IApplication(de.mossgrabers.framework.daw.IApplication) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 5 with IArranger

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

the class LayoutModule method flush.

/**
 * {@inheritDoc}
 */
@Override
public void flush(final boolean dump) {
    final IApplication app = this.model.getApplication();
    this.writer.sendOSC("/layout", app.getPanelLayout().toLowerCase(Locale.US), dump);
    final IArranger arrange = this.model.getArranger();
    this.writer.sendOSC("/arranger/cueMarkerVisibility", arrange.areCueMarkersVisible(), dump);
    this.writer.sendOSC("/arranger/playbackFollow", arrange.isPlaybackFollowEnabled(), dump);
    this.writer.sendOSC("/arranger/trackRowHeight", arrange.hasDoubleRowTrackHeight(), dump);
    this.writer.sendOSC("/arranger/clipLauncherSectionVisibility", arrange.isClipLauncherVisible(), dump);
    this.writer.sendOSC("/arranger/timeLineVisibility", arrange.isTimelineVisible(), dump);
    this.writer.sendOSC("/arranger/ioSectionVisibility", arrange.isIoSectionVisible(), dump);
    this.writer.sendOSC("/arranger/effectTracksVisibility", arrange.areEffectTracksVisible(), dump);
    final IMixer mix = this.model.getMixer();
    this.writer.sendOSC("/mixer/clipLauncherSectionVisibility", mix.isClipLauncherSectionVisible(), dump);
    this.writer.sendOSC("/mixer/crossFadeSectionVisibility", mix.isCrossFadeSectionVisible(), dump);
    this.writer.sendOSC("/mixer/deviceSectionVisibility", mix.isDeviceSectionVisible(), dump);
    this.writer.sendOSC("/mixer/sendsSectionVisibility", mix.isSendSectionVisible(), dump);
    this.writer.sendOSC("/mixer/ioSectionVisibility", mix.isIoSectionVisible(), dump);
    this.writer.sendOSC("/mixer/meterSectionVisibility", mix.isMeterSectionVisible(), dump);
}
Also used : IMixer(de.mossgrabers.framework.daw.IMixer) IApplication(de.mossgrabers.framework.daw.IApplication) IArranger(de.mossgrabers.framework.daw.IArranger)

Aggregations

IApplication (de.mossgrabers.framework.daw.IApplication)5 IArranger (de.mossgrabers.framework.daw.IArranger)5 IMixer (de.mossgrabers.framework.daw.IMixer)4 ITransport (de.mossgrabers.framework.daw.ITransport)2 UnknownCommandException (de.mossgrabers.controller.osc.exception.UnknownCommandException)1 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)1 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)1 ISceneBank (de.mossgrabers.framework.daw.ISceneBank)1 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)1 ITrack (de.mossgrabers.framework.daw.data.ITrack)1 IOException (java.io.IOException)1