Search in sources :

Example 21 with IEnumSetting

use of de.mossgrabers.framework.configuration.IEnumSetting in project DrivenByMoss by git-moss.

the class MCUConfiguration method activateHardwareSettings.

private void activateHardwareSettings(final ISettingsUI settingsUI) {
    final IEnumSetting profileSetting = settingsUI.getEnumSetting("Profile", CATEGORY_HARDWARE_SETUP, DEVICE_OPTIONS, DEVICE_OPTIONS[0]);
    final IEnumSetting hasDisplay1Setting = settingsUI.getEnumSetting("Has a display", CATEGORY_HARDWARE_SETUP, ON_OFF_OPTIONS, ON_OFF_OPTIONS[1]);
    hasDisplay1Setting.addValueObserver(value -> {
        this.hasDisplay1 = "On".equals(value);
        this.notifyObservers(HAS_DISPLAY1);
    });
    this.isSettingActive.add(HAS_DISPLAY1);
    final IEnumSetting hasDisplay2Setting = settingsUI.getEnumSetting("Has a second display", CATEGORY_HARDWARE_SETUP, ON_OFF_OPTIONS, ON_OFF_OPTIONS[1]);
    hasDisplay2Setting.addValueObserver(value -> {
        this.hasDisplay2 = "On".equals(value);
        this.notifyObservers(HAS_DISPLAY2);
    });
    this.isSettingActive.add(HAS_DISPLAY2);
    final IEnumSetting hasSegmentDisplaySetting = settingsUI.getEnumSetting("Has a segment display", CATEGORY_HARDWARE_SETUP, ON_OFF_OPTIONS, ON_OFF_OPTIONS[1]);
    hasSegmentDisplaySetting.addValueObserver(value -> {
        this.hasSegmentDisplay = "On".equals(value);
        this.notifyObservers(HAS_SEGMENT_DISPLAY);
    });
    this.isSettingActive.add(HAS_SEGMENT_DISPLAY);
    final IEnumSetting hasAssignmentDisplaySetting = settingsUI.getEnumSetting("Has an assignment display", CATEGORY_HARDWARE_SETUP, ON_OFF_OPTIONS, ON_OFF_OPTIONS[1]);
    hasAssignmentDisplaySetting.addValueObserver(value -> {
        this.hasAssignmentDisplay = "On".equals(value);
        this.notifyObservers(HAS_ASSIGNMENT_DISPLAY);
    });
    this.isSettingActive.add(HAS_ASSIGNMENT_DISPLAY);
    this.hasMotorFadersSetting = settingsUI.getEnumSetting("Has motor faders", CATEGORY_HARDWARE_SETUP, ON_OFF_OPTIONS, ON_OFF_OPTIONS[1]);
    this.hasMotorFadersSetting.addValueObserver(value -> {
        this.hasMotorFaders = "On".equals(value);
        this.notifyObservers(HAS_MOTOR_FADERS);
    });
    this.isSettingActive.add(HAS_MOTOR_FADERS);
    final IEnumSetting hasOnly1FaderSetting = settingsUI.getEnumSetting("Has only 1 fader", CATEGORY_HARDWARE_SETUP, ON_OFF_OPTIONS, ON_OFF_OPTIONS[0]);
    hasOnly1FaderSetting.addValueObserver(value -> {
        this.hasOnly1Fader = "On".equals(value);
        this.notifyObservers(HAS_ONLY_1_FADER);
    });
    this.isSettingActive.add(HAS_ONLY_1_FADER);
    this.displayTrackNamesSetting = settingsUI.getEnumSetting("Display track names in 1st display", CATEGORY_HARDWARE_SETUP, ON_OFF_OPTIONS, ON_OFF_OPTIONS[0]);
    this.displayTrackNamesSetting.addValueObserver(value -> {
        this.displayTrackNames = "On".equals(value);
        this.notifyObservers(DISPLAY_TRACK_NAMES);
    });
    this.isSettingActive.add(DISPLAY_TRACK_NAMES);
    final IEnumSetting useVertZoomForModesSetting = settingsUI.getEnumSetting("Use vertical zoom to change modes", CATEGORY_HARDWARE_SETUP, ON_OFF_OPTIONS, ON_OFF_OPTIONS[0]);
    useVertZoomForModesSetting.addValueObserver(value -> {
        this.useVertZoomForModes = "On".equals(value);
        this.notifyObservers(USE_VERT_ZOOM_FOR_MODES);
    });
    this.isSettingActive.add(USE_VERT_ZOOM_FOR_MODES);
    this.useFadersAsKnobsSetting = settingsUI.getEnumSetting("Use faders like editing knobs", CATEGORY_HARDWARE_SETUP, ON_OFF_OPTIONS, ON_OFF_OPTIONS[0]);
    this.useFadersAsKnobsSetting.addValueObserver(value -> {
        this.useFadersAsKnobs = "On".equals(value);
        this.notifyObservers(USE_FADERS_AS_KNOBS);
    });
    this.isSettingActive.add(USE_FADERS_AS_KNOBS);
    this.activateEnableVUMetersSetting(settingsUI, CATEGORY_HARDWARE_SETUP);
    final IEnumSetting masterVuMeterSetting = settingsUI.getEnumSetting("Master VU Meter (iCON extension)", CATEGORY_HARDWARE_SETUP, ON_OFF_OPTIONS, ON_OFF_OPTIONS[0]);
    masterVuMeterSetting.addValueObserver(value -> {
        this.masterVuMeter = "On".equals(value);
        this.notifyObservers(MASTER_VU_METER);
    });
    this.isSettingActive.add(MASTER_VU_METER);
    // Activate at the end, so all settings are created
    profileSetting.addValueObserver(value -> {
        switch(value) {
            case DEVICE_MACKIE_MCU_PRO:
                hasDisplay1Setting.set(ON_OFF_OPTIONS[1]);
                hasDisplay2Setting.set(ON_OFF_OPTIONS[0]);
                hasSegmentDisplaySetting.set(ON_OFF_OPTIONS[1]);
                hasAssignmentDisplaySetting.set(ON_OFF_OPTIONS[1]);
                this.hasMotorFadersSetting.set(ON_OFF_OPTIONS[1]);
                hasOnly1FaderSetting.set(ON_OFF_OPTIONS[0]);
                this.displayTrackNamesSetting.set(ON_OFF_OPTIONS[1]);
                useVertZoomForModesSetting.set(ON_OFF_OPTIONS[0]);
                this.useFadersAsKnobsSetting.set(ON_OFF_OPTIONS[0]);
                this.setVUMetersEnabled(true);
                masterVuMeterSetting.set(ON_OFF_OPTIONS[0]);
                break;
            case DEVICE_BEHRINGER_X_TOUCH_ONE:
                hasDisplay1Setting.set(ON_OFF_OPTIONS[1]);
                hasDisplay2Setting.set(ON_OFF_OPTIONS[0]);
                hasSegmentDisplaySetting.set(ON_OFF_OPTIONS[1]);
                hasAssignmentDisplaySetting.set(ON_OFF_OPTIONS[1]);
                this.hasMotorFadersSetting.set(ON_OFF_OPTIONS[1]);
                hasOnly1FaderSetting.set(ON_OFF_OPTIONS[1]);
                this.displayTrackNamesSetting.set(ON_OFF_OPTIONS[1]);
                useVertZoomForModesSetting.set(ON_OFF_OPTIONS[0]);
                this.useFadersAsKnobsSetting.set(ON_OFF_OPTIONS[0]);
                this.setVUMetersEnabled(true);
                masterVuMeterSetting.set(ON_OFF_OPTIONS[0]);
                break;
            case DEVICE_ICON_PLATFORM_M:
                hasDisplay1Setting.set(ON_OFF_OPTIONS[0]);
                hasDisplay2Setting.set(ON_OFF_OPTIONS[0]);
                hasSegmentDisplaySetting.set(ON_OFF_OPTIONS[0]);
                hasAssignmentDisplaySetting.set(ON_OFF_OPTIONS[0]);
                this.hasMotorFadersSetting.set(ON_OFF_OPTIONS[1]);
                hasOnly1FaderSetting.set(ON_OFF_OPTIONS[0]);
                this.displayTrackNamesSetting.set(ON_OFF_OPTIONS[0]);
                useVertZoomForModesSetting.set(ON_OFF_OPTIONS[1]);
                this.useFadersAsKnobsSetting.set(ON_OFF_OPTIONS[0]);
                this.setVUMetersEnabled(false);
                masterVuMeterSetting.set(ON_OFF_OPTIONS[0]);
                break;
            case DEVICE_ICON_QCON_PRO_X:
                hasDisplay1Setting.set(ON_OFF_OPTIONS[1]);
                hasDisplay2Setting.set(ON_OFF_OPTIONS[1]);
                hasSegmentDisplaySetting.set(ON_OFF_OPTIONS[1]);
                hasAssignmentDisplaySetting.set(ON_OFF_OPTIONS[0]);
                this.hasMotorFadersSetting.set(ON_OFF_OPTIONS[1]);
                hasOnly1FaderSetting.set(ON_OFF_OPTIONS[0]);
                this.displayTrackNamesSetting.set(ON_OFF_OPTIONS[0]);
                useVertZoomForModesSetting.set(ON_OFF_OPTIONS[0]);
                this.useFadersAsKnobsSetting.set(ON_OFF_OPTIONS[0]);
                this.setVUMetersEnabled(true);
                masterVuMeterSetting.set(ON_OFF_OPTIONS[1]);
                break;
            case DEVICE_ZOOM_R16:
                hasDisplay1Setting.set(ON_OFF_OPTIONS[0]);
                hasDisplay2Setting.set(ON_OFF_OPTIONS[0]);
                hasSegmentDisplaySetting.set(ON_OFF_OPTIONS[0]);
                hasAssignmentDisplaySetting.set(ON_OFF_OPTIONS[0]);
                this.hasMotorFadersSetting.set(ON_OFF_OPTIONS[0]);
                hasOnly1FaderSetting.set(ON_OFF_OPTIONS[0]);
                this.displayTrackNamesSetting.set(ON_OFF_OPTIONS[0]);
                useVertZoomForModesSetting.set(ON_OFF_OPTIONS[0]);
                this.useFadersAsKnobsSetting.set(ON_OFF_OPTIONS[1]);
                this.setVUMetersEnabled(false);
                masterVuMeterSetting.set(ON_OFF_OPTIONS[0]);
                break;
            default:
                return;
        }
        profileSetting.set(DEVICE_SELECT);
    });
}
Also used : IEnumSetting(de.mossgrabers.framework.configuration.IEnumSetting)

Example 22 with IEnumSetting

use of de.mossgrabers.framework.configuration.IEnumSetting in project DrivenByMoss by git-moss.

the class MCUConfiguration method activateTracksSettings.

private void activateTracksSettings(final ISettingsUI settingsUI) {
    this.activateTrackNavigationSetting(settingsUI, CATEGORY_TRACKS);
    final IEnumSetting includeFXTracksSetting = settingsUI.getEnumSetting("Include FX and master tracks in track bank", CATEGORY_TRACKS, ON_OFF_OPTIONS, ON_OFF_OPTIONS[0]);
    this.includeFXTracksInTrackBank = "On".equals(includeFXTracksSetting.get());
    if (this.deviceTyes.length > 1 && this.host.supports(Capability.HAS_EFFECT_BANK)) {
        final IEnumSetting pinFXTracksToLastControllerSetting = settingsUI.getEnumSetting("Pin FX tracks to last device", CATEGORY_TRACKS, ON_OFF_OPTIONS, ON_OFF_OPTIONS[0]);
        pinFXTracksToLastControllerSetting.addValueObserver(value -> {
            this.pinFXTracksToLastController = "On".equals(value);
            this.notifyObservers(PIN_FXTRACKS_TO_LAST_CONTROLLER);
        });
        this.isSettingActive.add(PIN_FXTRACKS_TO_LAST_CONTROLLER);
    }
}
Also used : IEnumSetting(de.mossgrabers.framework.configuration.IEnumSetting)

Example 23 with IEnumSetting

use of de.mossgrabers.framework.configuration.IEnumSetting in project DrivenByMoss by git-moss.

the class HUIConfiguration method activateAssignableSettings.

private void activateAssignableSettings(final ISettingsUI settingsUI) {
    for (int i = 0; i < this.assignableFunctions.length; i++) {
        final int pos = i;
        final IEnumSetting setting = settingsUI.getEnumSetting(ASSIGNABLE_BUTTON_NAMES[i], "Assignable buttons", FOOTSWITCH_VALUES, FOOTSWITCH_VALUES[6]);
        setting.addValueObserver(value -> this.assignableFunctions[pos] = lookupIndex(FOOTSWITCH_VALUES, value));
    }
}
Also used : IEnumSetting(de.mossgrabers.framework.configuration.IEnumSetting)

Example 24 with IEnumSetting

use of de.mossgrabers.framework.configuration.IEnumSetting in project DrivenByMoss by git-moss.

the class OSCConfiguration method init.

/**
 * {@inheritDoc}
 */
@Override
public void init(final ISettingsUI globalSettings, final ISettingsUI documentSettings) {
    // /////////////////////////
    // Network
    final IIntegerSetting receivePortSetting = globalSettings.getRangeSetting("Port to receive on", CATEGORY_SETUP, 1024, 65535, 1, "", 8000);
    receivePortSetting.addValueObserver(value -> {
        this.receivePort = value.intValue();
        this.notifyObservers(RECEIVE_PORT);
    });
    this.isSettingActive.add(RECEIVE_PORT);
    final IStringSetting sendHostSetting = globalSettings.getStringSetting("Host to send to (requires restart)", CATEGORY_SETUP, 15, DEFAULT_SERVER);
    this.sendHost = sendHostSetting.get();
    final IIntegerSetting sendPortSetting = globalSettings.getRangeSetting("Port to send to (requires restart)", CATEGORY_SETUP, 1024, 65535, 1, "", 9000);
    this.sendPort = sendPortSetting.get().intValue();
    // /////////////////////////
    // Protocol
    final IEnumSetting valueResolutionSetting = globalSettings.getEnumSetting("Value resolution", CATEGORY_PROTOCOL, VALUE_RESOLUTION_OPTIONS, VALUE_RESOLUTION_OPTIONS[0]);
    valueResolutionSetting.addValueObserver(value -> {
        if (VALUE_RESOLUTION_OPTIONS[0].equals(value))
            this.valueResolution = ValueResolution.LOW;
        else if (VALUE_RESOLUTION_OPTIONS[1].equals(value))
            this.valueResolution = ValueResolution.MEDIUM;
        else if (VALUE_RESOLUTION_OPTIONS[2].equals(value))
            this.valueResolution = ValueResolution.HIGH;
        this.notifyObservers(VALUE_RESOLUTION);
    });
    this.isSettingActive.add(VALUE_RESOLUTION);
    final String[] pageSize = new String[200];
    for (int i = 0; i < pageSize.length; i++) pageSize[i] = Integer.toString(i + 1);
    final IEnumSetting bankPageSizeSetting = globalSettings.getEnumSetting("Bank Page Size (requires restart)", CATEGORY_PROTOCOL, pageSize, pageSize[7]);
    this.bankPageSize = Integer.parseInt(bankPageSizeSetting.get());
    // /////////////////////////
    // Transport
    this.activateBehaviourOnStopSetting(globalSettings);
    // /////////////////////////
    // Play and Sequence
    this.activateAccentActiveSetting(globalSettings);
    this.activateAccentValueSetting(globalSettings);
    // /////////////////////////
    // Workflow
    this.activateExcludeDeactivatedItemsSetting(globalSettings);
    this.activateEnableVUMetersSetting(globalSettings);
    for (int i = 0; i < this.assignableFunctionActions.length; i++) {
        final int pos = i;
        final IActionSetting actionSetting = globalSettings.getActionSetting("Action " + (i + 1), "Actions");
        actionSetting.addValueObserver(value -> this.assignableFunctionActions[pos] = actionSetting.get());
    }
    // /////////////////////////
    // Debug
    this.activateOSCLogging(globalSettings);
}
Also used : IStringSetting(de.mossgrabers.framework.configuration.IStringSetting) IIntegerSetting(de.mossgrabers.framework.configuration.IIntegerSetting) IActionSetting(de.mossgrabers.framework.configuration.IActionSetting) IEnumSetting(de.mossgrabers.framework.configuration.IEnumSetting)

Example 25 with IEnumSetting

use of de.mossgrabers.framework.configuration.IEnumSetting in project DrivenByMoss by git-moss.

the class KontrolProtocolConfiguration method init.

/**
 * {@inheritDoc}
 */
@Override
public void init(final ISettingsUI globalSettings, final ISettingsUI documentSettings) {
    // /////////////////////////
    // Transport
    this.activateBehaviourOnStopSetting(globalSettings);
    this.activateRecordButtonSetting(globalSettings);
    this.activateShiftedRecordButtonSetting(globalSettings);
    // /////////////////////////
    // Navigation
    final IEnumSetting flipTrackClipNavigationSetting = globalSettings.getEnumSetting("Flip track/clip navigation", CATEGORY_NAVIGATION, ON_OFF_OPTIONS, ON_OFF_OPTIONS[0]);
    flipTrackClipNavigationSetting.addValueObserver(value -> {
        this.flipTrackClipNavigation = ON_OFF_OPTIONS[1].equals(value);
        this.notifyObservers(FLIP_TRACK_CLIP_NAVIGATION);
    });
    this.isSettingActive.add(FLIP_TRACK_CLIP_NAVIGATION);
    final IEnumSetting flipClipSceneNavigationSetting = globalSettings.getEnumSetting("Flip clip/scene navigation", CATEGORY_NAVIGATION, ON_OFF_OPTIONS, ON_OFF_OPTIONS[0]);
    flipClipSceneNavigationSetting.addValueObserver(value -> {
        this.flipClipSceneNavigation = ON_OFF_OPTIONS[1].equals(value);
        this.notifyObservers(FLIP_CLIP_SCENE_NAVIGATION);
    });
    this.isSettingActive.add(FLIP_CLIP_SCENE_NAVIGATION);
    // /////////////////////////
    // Workflow
    this.activateExcludeDeactivatedItemsSetting(globalSettings);
    this.activateNewClipLengthSetting(globalSettings);
    this.activateKnobSpeedSetting(globalSettings);
}
Also used : IEnumSetting(de.mossgrabers.framework.configuration.IEnumSetting)

Aggregations

IEnumSetting (de.mossgrabers.framework.configuration.IEnumSetting)26 IIntegerSetting (de.mossgrabers.framework.configuration.IIntegerSetting)4 IActionSetting (de.mossgrabers.framework.configuration.IActionSetting)3 IStringSetting (de.mossgrabers.framework.configuration.IStringSetting)3 CommandCategory (de.mossgrabers.controller.generic.controller.CommandCategory)1 GenericFlexiControlSurface (de.mossgrabers.controller.generic.controller.GenericFlexiControlSurface)1 CommandSlot (de.mossgrabers.controller.generic.flexihandler.utils.CommandSlot)1 ProgramBank (de.mossgrabers.controller.generic.flexihandler.utils.ProgramBank)1 DAWColor (de.mossgrabers.framework.daw.DAWColor)1 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)1 FileEx (de.mossgrabers.framework.utils.FileEx)1 IOException (java.io.IOException)1 ParseException (java.text.ParseException)1