Changes
1 changed files (+40/-0)
-
-
@@ -55,6 +55,45 @@ namespace PlacGtkAdwaita {} private void on_preferences() { var fixed_discovery_udp_port_enabled = new Adw.SwitchRow(); fixed_discovery_udp_port_enabled.title = "Use fixed UDP port"; fixed_discovery_udp_port_enabled.subtitle = "Fix UDP port number to use for sending and receiving of Roon Server discovery. If this option is off, Plac will pick a random available UDP port. Requires restart to take effect."; settings.settings.bind_with_mapping(Settings.DISCOVERY_UDP_PORT, fixed_discovery_udp_port_enabled, "active", DEFAULT, (to, from) => { var port = from.get_uint32(); to.set_boolean(port != 0); return true; }, (from, variant) => { return new Variant("u", from.get_boolean() ? 9003 : 0); }, null, null); var discovery_udp_port = new Adw.EntryRow(); discovery_udp_port.title = "Port number"; discovery_udp_port.input_purpose = NUMBER; settings.settings.bind_with_mapping(Settings.DISCOVERY_UDP_PORT, discovery_udp_port, "text", DEFAULT, (to, from) => { var port = from.get_uint32(); to.set_string(port.to_string()); return true; }, (from, variant) => { var text = from.get_string(); var raw_val = uint.parse(text, 10); if (raw_val == 0 || raw_val > uint16.MAX) { // Vala's type definition wrongly defines return type signature of // "SettingsBindSetMappingShared" as non-null, despite it being nullable and // even documentation saying "return null in case of an error." // This cast suppress compiler warning. return (Variant) null; } return new Variant("u", raw_val); }, null, null); fixed_discovery_udp_port_enabled.bind_property("active", discovery_udp_port, "visible", SYNC_CREATE); var discovery = new Adw.PreferencesGroup(); discovery.add(fixed_discovery_udp_port_enabled); discovery.add(discovery_udp_port); discovery.title = "Server Discovery"; var label_parsing_enabled = new Adw.SwitchRow(); settings.settings.bind(Settings.LABEL_PARSING_ENABLED, label_parsing_enabled, "active", DEFAULT); label_parsing_enabled.title = "Parse labels";
-
@@ -86,6 +125,7 @@ namespace PlacGtkAdwaita {playback.title = "Playback"; var page = new Adw.PreferencesPage(); page.add(discovery); page.add(browse); page.add(playback);
-