use of de.mossgrabers.framework.configuration.IStringSetting in project DrivenByMoss by git-moss.
the class OSCConfiguration method init.
/**
* {@inheritDoc}
*/
@Override
public void init(final ISettingsUI settingsUI) {
// /////////////////////////
// Network
final IIntegerSetting receivePortSetting = settingsUI.getRangeSetting("Port", "Receive from (Script restart required)", 0, 65535, 1, "", 8000);
receivePortSetting.addValueObserver(value -> {
this.receivePort = value.intValue();
this.notifyObservers(OSCConfiguration.RECEIVE_PORT);
});
final IStringSetting sendHostSetting = settingsUI.getStringSetting("Host", "Send to", 15, DEFAULT_SERVER);
sendHostSetting.addValueObserver(value -> {
this.sendHost = value;
this.notifyObservers(OSCConfiguration.SEND_HOST);
});
final IIntegerSetting sendPortSetting = settingsUI.getRangeSetting("Port", "Send to", 0, 65535, 1, "", 9000);
sendPortSetting.addValueObserver(value -> {
this.sendPort = value.intValue();
this.notifyObservers(SEND_PORT);
});
// /////////////////////////
// Accent
this.activateAccentActiveSetting(settingsUI);
this.activateAccentValueSetting(settingsUI);
// /////////////////////////
// Workflow
this.activateEnableVUMetersSetting(settingsUI);
// /////////////////////////
// Debug
final IEnumSetting debugCommandsSetting = settingsUI.getEnumSetting("Debug commands", "Debug", ON_OFF_OPTIONS, ON_OFF_OPTIONS[0]);
debugCommandsSetting.addValueObserver(value -> {
this.debugCommands = "On".equals(value);
this.notifyObservers(DEBUG_COMMANDS);
});
}
use of de.mossgrabers.framework.configuration.IStringSetting in project DrivenByMoss by git-moss.
the class AutoColorConfiguration method init.
/**
* {@inheritDoc}
*/
@Override
public void init(final ISettingsUI globalSettings, final ISettingsUI documentSettings) {
// /////////////////////////
// Auto Color
final IEnumSetting enableAutoColorSetting = globalSettings.getEnumSetting(CATEGORY_AUTO_COLOR, CATEGORY_AUTO_COLOR, ON_OFF_OPTIONS, ON_OFF_OPTIONS[1]);
enableAutoColorSetting.addValueObserver(value -> {
this.enableAutoColor = ON_OFF_OPTIONS[1].equals(value);
this.notifyObservers(ENABLE_AUTO_COLOR);
});
this.isSettingActive.add(ENABLE_AUTO_COLOR);
final DAWColor[] colors = DAWColor.values();
for (int i = 0; i < colors.length; i++) {
final DAWColor color = colors[i];
final IStringSetting setting = globalSettings.getStringSetting(color.getName(), CATEGORY_AUTO_COLOR, 256, "");
final int index = i;
final Integer colorRegexIndex = Integer.valueOf(COLOR_REGEX.intValue() + index);
setting.addValueObserver(value -> {
this.colorRegEx.put(color, value);
this.notifyObservers(colorRegexIndex);
});
this.isSettingActive.add(colorRegexIndex);
}
}
use of de.mossgrabers.framework.configuration.IStringSetting 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);
}
Aggregations