diff options
author | Vivia Nikolaidou <vivia@ahiru.eu> | 2022-08-18 15:04:15 +0300 |
---|---|---|
committer | Vivia Nikolaidou <vivia@ahiru.eu> | 2022-08-22 17:58:43 +0300 |
commit | 560611134588f63270a569e92160ecac5ceabc37 (patch) | |
tree | ac5f4447c55c1e5dd4d8f15f92c335c36aa5bab8 /text/regex | |
parent | 84f6484140098826b3f074d806e0eb052198df43 (diff) |
plugins: Simplify code using ParamSpecBuilder
Diffstat (limited to 'text/regex')
-rw-r--r-- | text/regex/src/gstregex/imp.rs | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/text/regex/src/gstregex/imp.rs b/text/regex/src/gstregex/imp.rs index 2ef24c1e..6a97bb4c 100644 --- a/text/regex/src/gstregex/imp.rs +++ b/text/regex/src/gstregex/imp.rs @@ -141,19 +141,17 @@ impl ObjectSubclass for RegEx { impl ObjectImpl for RegEx { fn properties() -> &'static [glib::ParamSpec] { static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| { - vec![gst::ParamSpecArray::new( - "commands", - "Commands", - "A set of commands to apply on input text", - Some(&glib::ParamSpecBoxed::new( - "command", - "Command", - "A command to apply on input text", - gst::Structure::static_type(), - glib::ParamFlags::READWRITE, - )), - glib::ParamFlags::READWRITE | gst::PARAM_FLAG_MUTABLE_PLAYING, - )] + vec![gst::ParamSpecArray::builder("commands") + .nick("Commands") + .blurb("A set of commands to apply on input text") + .element_spec( + &glib::ParamSpecBoxed::builder("command", gst::Structure::static_type()) + .nick("Command") + .blurb("A command to apply on input text") + .build(), + ) + .mutable_playing() + .build()] }); PROPERTIES.as_ref() |