Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivia Nikolaidou <vivia@ahiru.eu>2022-08-18 15:04:15 +0300
committerVivia Nikolaidou <vivia@ahiru.eu>2022-08-22 17:58:43 +0300
commit560611134588f63270a569e92160ecac5ceabc37 (patch)
treeac5f4447c55c1e5dd4d8f15f92c335c36aa5bab8 /audio/csound
parent84f6484140098826b3f074d806e0eb052198df43 (diff)
plugins: Simplify code using ParamSpecBuilder
Diffstat (limited to 'audio/csound')
-rw-r--r--audio/csound/src/filter/imp.rs57
1 files changed, 25 insertions, 32 deletions
diff --git a/audio/csound/src/filter/imp.rs b/audio/csound/src/filter/imp.rs
index acf795643..502ebf33b 100644
--- a/audio/csound/src/filter/imp.rs
+++ b/audio/csound/src/filter/imp.rs
@@ -336,38 +336,31 @@ impl ObjectImpl for CsoundFilter {
fn properties() -> &'static [glib::ParamSpec] {
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| {
vec![
- glib::ParamSpecBoolean::new(
- "loop",
- "Loop",
- "loop over the score (can be changed in PLAYING or PAUSED state)",
- DEFAULT_LOOP,
- glib::ParamFlags::READWRITE | gst::PARAM_FLAG_MUTABLE_PLAYING,
- ),
- glib::ParamSpecString::new(
- "location",
- "Location",
- "Location of the csd file to be used by csound.
- Use either location or CSD-text but not both at the same time, if so and error would be triggered",
- None,
- glib::ParamFlags::READWRITE | gst::PARAM_FLAG_MUTABLE_READY,
- ),
- glib::ParamSpecString::new(
- "csd-text",
- "CSD-text",
- "The content of a csd file passed as a String.
- Use either location or csd-text but not both at the same time, if so and error would be triggered",
- None,
- glib::ParamFlags::READWRITE | gst::PARAM_FLAG_MUTABLE_READY,
- ),
- glib::ParamSpecDouble::new(
- "score-offset",
- "Score Offset",
- "Score offset in seconds to start the performance",
- 0.0,
- f64::MAX,
- SCORE_OFFSET_DEFAULT,
- glib::ParamFlags::READWRITE | gst::PARAM_FLAG_MUTABLE_READY,
- ),
+ glib::ParamSpecBoolean::builder("loop")
+ .nick("Loop")
+ .blurb("loop over the score (can be changed in PLAYING or PAUSED state)")
+ .default_value(DEFAULT_LOOP)
+ .mutable_playing()
+ .build(),
+ glib::ParamSpecString::builder("location")
+ .nick("Location")
+ .blurb("Location of the csd file to be used by csound.
+ Use either location or CSD-text but not both at the same time, if so and error would be triggered")
+ .mutable_ready()
+ .build(),
+ glib::ParamSpecString::builder("csd-text")
+ .nick("CSD-text")
+ .blurb("The content of a csd file passed as a String.
+ Use either location or csd-text but not both at the same time, if so and error would be triggered")
+ .mutable_ready()
+ .build(),
+ glib::ParamSpecDouble::builder("score-offset")
+ .nick("Score Offset")
+ .blurb("Score offset in seconds to start the performance")
+ .minimum(0.0)
+ .default_value(SCORE_OFFSET_DEFAULT)
+ .mutable_ready()
+ .build(),
]
});