gstreamer_editing_services/auto/track_element.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5#![allow(deprecated)]
6
7use crate::{
8 Edge, EditMode, Extractable, Layer, MetaContainer, TimelineElement, Track, TrackType, ffi,
9};
10use glib::{
11 object::ObjectType as _,
12 prelude::*,
13 signal::{SignalHandlerId, connect_raw},
14 translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19 /// A [`TrackElement`][crate::TrackElement] is a [`TimelineElement`][crate::TimelineElement] that specifically belongs
20 /// to a single [`Track`][crate::Track] of its [`timeline`][struct@crate::TimelineElement#timeline]. Its
21 /// [`start`][struct@crate::TimelineElement#start] and [`duration`][struct@crate::TimelineElement#duration] specify its
22 /// temporal extent in the track. Specifically, a track element wraps some
23 /// nleobject, such as an `nlesource` or `nleoperation`, which can be
24 /// retrieved with [`TrackElementExt::nleobject()`][crate::prelude::TrackElementExt::nleobject()], and its
25 /// [`start`][struct@crate::TimelineElement#start], [`duration`][struct@crate::TimelineElement#duration],
26 /// [`in-point`][struct@crate::TimelineElement#in-point], [`priority`][struct@crate::TimelineElement#priority] and
27 /// [`active`][struct@crate::TrackElement#active] properties expose the corresponding nleobject
28 /// properties. When a track element is added to a track, its nleobject is
29 /// added to the corresponding `nlecomposition` that the track wraps.
30 ///
31 /// Most users will not have to work directly with track elements since a
32 /// [`Clip`][crate::Clip] will automatically create track elements for its timeline's
33 /// tracks and take responsibility for updating them. The only track
34 /// elements that are not automatically created by clips, but a user is
35 /// likely to want to create, are [`Effect`][crate::Effect]-s.
36 ///
37 /// ## Control Bindings for Children Properties
38 ///
39 /// You can set up control bindings for a track element child property
40 /// using [`TrackElementExt::set_control_source()`][crate::prelude::TrackElementExt::set_control_source()]. A
41 /// `GstTimedValueControlSource` should specify the timed values using the
42 /// internal source coordinates (see [`TimelineElement`][crate::TimelineElement]). By default,
43 /// these will be updated to lie between the [`in-point`][struct@crate::TimelineElement#in-point]
44 /// and out-point of the element. This can be switched off by setting
45 /// [`auto-clamp-control-sources`][struct@crate::TrackElement#auto-clamp-control-sources] to [`false`].
46 ///
47 /// This is an Abstract Base Class, you cannot instantiate it.
48 ///
49 /// ## Properties
50 ///
51 ///
52 /// #### `active`
53 /// Whether the effect of the element should be applied in its
54 /// [`track`][struct@crate::TrackElement#track]. If set to [`false`], it will not be used in
55 /// the output of the track.
56 ///
57 /// Readable | Writeable
58 ///
59 ///
60 /// #### `auto-clamp-control-sources`
61 /// Whether the control sources on the element (see
62 /// [`TrackElementExt::set_control_source()`][crate::prelude::TrackElementExt::set_control_source()]) will be automatically
63 /// updated whenever the [`in-point`][struct@crate::TimelineElement#in-point] or out-point of the
64 /// element change in value.
65 ///
66 /// See [`TrackElementExt::clamp_control_source()`][crate::prelude::TrackElementExt::clamp_control_source()] for how this is done
67 /// per control source.
68 ///
69 /// Default value: [`true`]
70 ///
71 /// Readable | Writeable
72 ///
73 ///
74 /// #### `has-internal-source`
75 /// This property is used to determine whether the 'internal time'
76 /// properties of the element have any meaning. In particular, unless
77 /// this is set to [`true`], the [`in-point`][struct@crate::TimelineElement#in-point] and
78 /// [`max-duration`][struct@crate::TimelineElement#max-duration] can not be set to any value other
79 /// than the default 0 and `GST_CLOCK_TIME_NONE`, respectively.
80 ///
81 /// If an element has some *internal* *timed* source [`gst::Element`][crate::gst::Element] that it
82 /// reads stream data from as part of its function in a [`Track`][crate::Track], then
83 /// you'll likely want to set this to [`true`] to allow the
84 /// [`in-point`][struct@crate::TimelineElement#in-point] and [`max-duration`][struct@crate::TimelineElement#max-duration] to
85 /// be set.
86 ///
87 /// The default value is determined by the `GESTrackElementClass`
88 /// `default_has_internal_source` class property. For most
89 /// `GESSourceClass`-es, this will be [`true`], with the exception of those
90 /// that have a potentially *static* source, such as `GESImageSourceClass`
91 /// and `GESTitleSourceClass`. Otherwise, this will usually be [`false`].
92 ///
93 /// For most [`Operation`][crate::Operation]-s you will likely want to leave this set to
94 /// [`false`]. The exception may be for an operation that reads some stream
95 /// data from some private internal source as part of manipulating the
96 /// input data from the usual linked upstream [`TrackElement`][crate::TrackElement].
97 ///
98 /// For example, you may want to set this to [`true`] for a
99 /// [`TrackType::VIDEO`][crate::TrackType::VIDEO] operation that wraps a `textoverlay` that reads
100 /// from a subtitle file and places its text on top of the received video
101 /// data. The [`in-point`][struct@crate::TimelineElement#in-point] of the element would be used
102 /// to shift the initial seek time on the `textoverlay` away from 0, and
103 /// the [`max-duration`][struct@crate::TimelineElement#max-duration] could be set to reflect the
104 /// time at which the subtitle file runs out of data.
105 ///
106 /// Note that GES can not support track elements that have both internal
107 /// content and manipulate the timing of their data streams (time
108 /// effects).
109 ///
110 /// Readable | Writeable
111 ///
112 ///
113 /// #### `track`
114 /// The track that this element belongs to, or [`None`] if it does not
115 /// belong to a track.
116 ///
117 /// Readable
118 ///
119 ///
120 /// #### `track-type`
121 /// The track type of the element, which determines the type of track the
122 /// element can be added to (see [`track-type`][struct@crate::Track#track-type]). This should
123 /// correspond to the type of data that the element can produce or
124 /// process.
125 ///
126 /// Readable | Writeable | Construct
127 /// <details><summary><h4>TimelineElement</h4></summary>
128 ///
129 ///
130 /// #### `duration`
131 /// The duration that the element is in effect for in the timeline (a
132 /// time difference in nanoseconds using the time coordinates of the
133 /// timeline). For example, for a source element, this would determine
134 /// for how long it should output its internal content for. For an
135 /// operation element, this would determine for how long its effect
136 /// should be applied to any source content.
137 ///
138 /// Readable | Writeable
139 ///
140 ///
141 /// #### `in-point`
142 /// The initial offset to use internally when outputting content (in
143 /// nanoseconds, but in the time coordinates of the internal content).
144 ///
145 /// For example, for a [`VideoUriSource`][crate::VideoUriSource] that references some media
146 /// file, the "internal content" is the media file data, and the
147 /// in-point would correspond to some timestamp in the media file.
148 /// When playing the timeline, and when the element is first reached at
149 /// timeline-time [`start`][struct@crate::TimelineElement#start], it will begin outputting the
150 /// data from the timestamp in-point **onwards**, until it reaches the
151 /// end of its [`duration`][struct@crate::TimelineElement#duration] in the timeline.
152 ///
153 /// For elements that have no internal content, this should be kept
154 /// as 0.
155 ///
156 /// Readable | Writeable
157 ///
158 ///
159 /// #### `max-duration`
160 /// The full duration of internal content that is available (a time
161 /// difference in nanoseconds using the time coordinates of the internal
162 /// content).
163 ///
164 /// This will act as a cap on the [`in-point`][struct@crate::TimelineElement#in-point] of the
165 /// element (which is in the same time coordinates), and will sometimes
166 /// be used to limit the [`duration`][struct@crate::TimelineElement#duration] of the element in
167 /// the timeline.
168 ///
169 /// For example, for a [`VideoUriSource`][crate::VideoUriSource] that references some media
170 /// file, this would be the length of the media file.
171 ///
172 /// For elements that have no internal content, or whose content is
173 /// indefinite, this should be kept as `GST_CLOCK_TIME_NONE`.
174 ///
175 /// Readable | Writeable | Construct
176 ///
177 ///
178 /// #### `name`
179 /// The name of the element. This should be unique within its timeline.
180 ///
181 /// Readable | Writeable | Construct
182 ///
183 ///
184 /// #### `parent`
185 /// The parent container of the element.
186 ///
187 /// Readable | Writeable
188 ///
189 ///
190 /// #### `priority`
191 /// The priority of the element.
192 ///
193 /// Readable | Writeable
194 ///
195 ///
196 /// #### `serialize`
197 /// Whether the element should be serialized.
198 ///
199 /// Readable | Writeable
200 ///
201 ///
202 /// #### `start`
203 /// The starting position of the element in the timeline (in nanoseconds
204 /// and in the time coordinates of the timeline). For example, for a
205 /// source element, this would determine the time at which it should
206 /// start outputting its internal content. For an operation element, this
207 /// would determine the time at which it should start applying its effect
208 /// to any source content.
209 ///
210 /// Readable | Writeable
211 ///
212 ///
213 /// #### `timeline`
214 /// The timeline that the element lies within.
215 ///
216 /// Readable | Writeable
217 /// </details>
218 ///
219 /// ## Signals
220 ///
221 ///
222 /// #### `control-binding-added`
223 /// This is emitted when a control binding is added to a child property
224 /// of the track element.
225 ///
226 ///
227 ///
228 ///
229 /// #### `control-binding-removed`
230 /// This is emitted when a control binding is removed from a child
231 /// property of the track element.
232 ///
233 ///
234 /// <details><summary><h4>TimelineElement</h4></summary>
235 ///
236 ///
237 /// #### `child-property-added`
238 /// Emitted when the element has a new child property registered. See
239 /// [`TimelineElementExt::add_child_property()`][crate::prelude::TimelineElementExt::add_child_property()].
240 ///
241 /// Note that some GES elements will be automatically created with
242 /// pre-registered children properties. You can use
243 /// [`TimelineElementExt::list_children_properties()`][crate::prelude::TimelineElementExt::list_children_properties()] to list these.
244 ///
245 ///
246 ///
247 ///
248 /// #### `child-property-removed`
249 /// Emitted when the element has a child property unregistered. See
250 /// [`TimelineElementExt::remove_child_property()`][crate::prelude::TimelineElementExt::remove_child_property()].
251 ///
252 ///
253 ///
254 ///
255 /// #### `deep-notify`
256 /// Emitted when a child of the element has one of its registered
257 /// properties set. See [`TimelineElementExt::add_child_property()`][crate::prelude::TimelineElementExt::add_child_property()].
258 /// Note that unlike [`notify`][struct@crate::glib::Object#notify], a child property name can not be
259 /// used as a signal detail.
260 ///
261 /// Detailed
262 /// </details>
263 /// <details><summary><h4>MetaContainer</h4></summary>
264 ///
265 ///
266 /// #### `notify-meta`
267 /// This is emitted for a meta container whenever the metadata under one
268 /// of its fields changes, is set for the first time, or is removed. In
269 /// the latter case, `value` will be [`None`].
270 ///
271 /// Detailed
272 /// </details>
273 ///
274 /// # Implements
275 ///
276 /// [`TrackElementExt`][trait@crate::prelude::TrackElementExt], [`TimelineElementExt`][trait@crate::prelude::TimelineElementExt], [`trait@glib::ObjectExt`], [`ExtractableExt`][trait@crate::prelude::ExtractableExt], [`MetaContainerExt`][trait@crate::prelude::MetaContainerExt], [`TimelineElementExtManual`][trait@crate::prelude::TimelineElementExtManual]
277 #[doc(alias = "GESTrackElement")]
278 pub struct TrackElement(Object<ffi::GESTrackElement, ffi::GESTrackElementClass>) @extends TimelineElement, @implements Extractable, MetaContainer;
279
280 match fn {
281 type_ => || ffi::ges_track_element_get_type(),
282 }
283}
284
285impl TrackElement {
286 pub const NONE: Option<&'static TrackElement> = None;
287}
288
289/// Trait containing all [`struct@TrackElement`] methods.
290///
291/// # Implementors
292///
293/// [`Operation`][struct@crate::Operation], [`Source`][struct@crate::Source], [`TrackElement`][struct@crate::TrackElement]
294pub trait TrackElementExt: IsA<TrackElement> + 'static {
295 /// Adds all the properties of a [`gst::Element`][crate::gst::Element] that match the criteria as
296 /// children properties of the track element. If the name of `element`'s
297 /// [`gst::ElementFactory`][crate::gst::ElementFactory] is not in `blacklist`, and the factory's
298 /// `GST_ELEMENT_METADATA_KLASS` contains at least one member of
299 /// `wanted_categories` (e.g. `GST_ELEMENT_FACTORY_KLASS_DECODER`), then
300 /// all the properties of `element` that are also in `whitelist` are added as
301 /// child properties of `self` using
302 /// [`TimelineElementExt::add_child_property()`][crate::prelude::TimelineElementExt::add_child_property()].
303 ///
304 /// This is intended to be used by subclasses when constructing.
305 /// ## `element`
306 /// The child object to retrieve properties from
307 /// ## `wanted_categories`
308 ///
309 /// An array of element factory "klass" categories to whitelist, or [`None`]
310 /// to accept all categories
311 /// ## `blacklist`
312 /// A
313 /// blacklist of element factory names, or [`None`] to not blacklist any
314 /// element factory
315 /// ## `whitelist`
316 /// A
317 /// whitelist of element property names, or [`None`] to whitelist all
318 /// writeable properties
319 #[doc(alias = "ges_track_element_add_children_props")]
320 fn add_children_props(
321 &self,
322 element: &impl IsA<gst::Element>,
323 wanted_categories: &[&str],
324 blacklist: &[&str],
325 whitelist: &[&str],
326 ) {
327 unsafe {
328 ffi::ges_track_element_add_children_props(
329 self.as_ref().to_glib_none().0,
330 element.as_ref().to_glib_none().0,
331 wanted_categories.to_glib_none().0,
332 blacklist.to_glib_none().0,
333 whitelist.to_glib_none().0,
334 );
335 }
336 }
337
338 /// Clamp the `GstTimedValueControlSource` for the specified child property
339 /// to lie between the [`in-point`][struct@crate::TimelineElement#in-point] and out-point of the
340 /// element. The out-point is the `GES_TIMELINE_ELEMENT_END` of the element
341 /// translated from the timeline coordinates to the internal source
342 /// coordinates of the element.
343 ///
344 /// If the property does not have a `GstTimedValueControlSource` set by
345 /// [`set_control_source()`][Self::set_control_source()], nothing happens. Otherwise, if
346 /// a timed value for the control source lies before the in-point of the
347 /// element, or after its out-point, then it will be removed. At the
348 /// in-point and out-point times, a new interpolated value will be placed.
349 /// ## `property_name`
350 /// The name of the child property to clamp the control
351 /// source of
352 #[cfg(feature = "v1_18")]
353 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
354 #[doc(alias = "ges_track_element_clamp_control_source")]
355 fn clamp_control_source(&self, property_name: &str) {
356 unsafe {
357 ffi::ges_track_element_clamp_control_source(
358 self.as_ref().to_glib_none().0,
359 property_name.to_glib_none().0,
360 );
361 }
362 }
363
364 /// Edits the element within its track.
365 ///
366 /// # Deprecated since 1.18
367 ///
368 /// use `ges_timeline_element_edit` instead.
369 /// ## `layers`
370 /// A whitelist of layers
371 /// where the edit can be performed, [`None`] allows all layers in the
372 /// timeline
373 /// ## `mode`
374 /// The edit mode
375 /// ## `edge`
376 /// The edge of `self` where the edit should occur
377 /// ## `position`
378 /// The edit position: a new location for the edge of `self`
379 /// (in nanoseconds)
380 ///
381 /// # Returns
382 ///
383 /// [`true`] if the edit of `self` completed, [`false`] on failure.
384 #[cfg_attr(feature = "v1_18", deprecated = "Since 1.18")]
385 #[allow(deprecated)]
386 #[doc(alias = "ges_track_element_edit")]
387 fn edit(
388 &self,
389 layers: &[Layer],
390 mode: EditMode,
391 edge: Edge,
392 position: u64,
393 ) -> Result<(), glib::error::BoolError> {
394 unsafe {
395 glib::result_from_gboolean!(
396 ffi::ges_track_element_edit(
397 self.as_ref().to_glib_none().0,
398 layers.to_glib_none().0,
399 mode.into_glib(),
400 edge.into_glib(),
401 position
402 ),
403 "Failed to edit"
404 )
405 }
406 }
407
408 //#[cfg_attr(feature = "v1_30", deprecated = "Since 1.30")]
409 //#[allow(deprecated)]
410 //#[doc(alias = "ges_track_element_get_all_control_bindings")]
411 //#[doc(alias = "get_all_control_bindings")]
412 //fn all_control_bindings(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 6, id: 92 } {
413 // unsafe { TODO: call ffi:ges_track_element_get_all_control_bindings() }
414 //}
415
416 //#[cfg(feature = "v1_30")]
417 //#[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
418 //#[doc(alias = "ges_track_element_get_all_control_bindings_full")]
419 //#[doc(alias = "get_all_control_bindings_full")]
420 //fn all_control_bindings_full(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 6, id: 92 } {
421 // unsafe { TODO: call ffi:ges_track_element_get_all_control_bindings_full() }
422 //}
423
424 /// Gets [`auto-clamp-control-sources`][struct@crate::TrackElement#auto-clamp-control-sources].
425 ///
426 /// # Returns
427 ///
428 /// Whether the control sources for the child properties of
429 /// `self` are automatically clamped.
430 #[cfg(feature = "v1_18")]
431 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
432 #[doc(alias = "ges_track_element_get_auto_clamp_control_sources")]
433 #[doc(alias = "get_auto_clamp_control_sources")]
434 #[doc(alias = "auto-clamp-control-sources")]
435 fn is_auto_clamp_control_sources(&self) -> bool {
436 unsafe {
437 from_glib(ffi::ges_track_element_get_auto_clamp_control_sources(
438 self.as_ref().to_glib_none().0,
439 ))
440 }
441 }
442
443 //#[doc(alias = "ges_track_element_get_child_properties")]
444 //#[doc(alias = "get_child_properties")]
445 //fn child_properties(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) {
446 // unsafe { TODO: call ffi:ges_track_element_get_child_properties() }
447 //}
448
449 /// In general, a copy is made of the property contents and
450 /// the caller is responsible for freeing the memory by calling
451 /// [`glib::Value::unset()`][crate::glib::Value::unset()].
452 ///
453 /// Gets a property of a GstElement contained in `self`.
454 ///
455 /// Note that `ges_track_element_get_child_property` is really
456 /// intended for language bindings, `ges_track_element_get_child_properties`
457 /// is much more convenient for C programming.
458 ///
459 /// # Deprecated
460 ///
461 /// Use `ges_timeline_element_get_child_property`
462 /// ## `property_name`
463 /// The name of the property
464 ///
465 /// # Returns
466 ///
467 /// [`true`] if the property was found, [`false`] otherwise.
468 ///
469 /// ## `value`
470 /// return location for the property value, it will
471 /// be initialized if it is initialized with 0
472 #[doc(alias = "ges_track_element_get_child_property")]
473 #[doc(alias = "get_child_property")]
474 fn child_property(&self, property_name: &str) -> Option<glib::Value> {
475 unsafe {
476 let mut value = glib::Value::uninitialized();
477 let ret = from_glib(ffi::ges_track_element_get_child_property(
478 self.as_ref().to_glib_none().0,
479 property_name.to_glib_none().0,
480 value.to_glib_none_mut().0,
481 ));
482 if ret { Some(value) } else { None }
483 }
484 }
485
486 /// Gets a property of a child of `self`.
487 ///
488 /// # Deprecated
489 ///
490 /// Use `ges_timeline_element_get_child_property_by_pspec`
491 /// ## `pspec`
492 /// The [`glib::ParamSpec`][crate::glib::ParamSpec] that specifies the property you want to get
493 ///
494 /// # Returns
495 ///
496 ///
497 /// ## `value`
498 /// return location for the value
499 #[doc(alias = "ges_track_element_get_child_property_by_pspec")]
500 #[doc(alias = "get_child_property_by_pspec")]
501 fn child_property_by_pspec(&self, pspec: impl AsRef<glib::ParamSpec>) -> glib::Value {
502 unsafe {
503 let mut value = glib::Value::uninitialized();
504 ffi::ges_track_element_get_child_property_by_pspec(
505 self.as_ref().to_glib_none().0,
506 pspec.as_ref().to_glib_none().0,
507 value.to_glib_none_mut().0,
508 );
509 value
510 }
511 }
512
513 //#[doc(alias = "ges_track_element_get_child_property_valist")]
514 //#[doc(alias = "get_child_property_valist")]
515 //fn child_property_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) {
516 // unsafe { TODO: call ffi:ges_track_element_get_child_property_valist() }
517 //}
518
519 /// Gets the control binding that was created for the specified child
520 /// property of the track element using
521 /// [`set_control_source()`][Self::set_control_source()]. The given `property_name` must
522 /// be the same name of the child property that was passed to
523 /// [`set_control_source()`][Self::set_control_source()].
524 ///
525 /// # Deprecated since 1.30
526 ///
527 /// Use [`control_binding_full()`][Self::control_binding_full()] instead for MT-safety.
528 /// ## `property_name`
529 /// The name of the child property to return the control
530 /// binding of
531 ///
532 /// # Returns
533 ///
534 /// The control binding that was
535 /// created for the specified child property of `self`, or [`None`] if
536 /// `property_name` does not correspond to any control binding.
537 #[cfg_attr(feature = "v1_30", deprecated = "Since 1.30")]
538 #[allow(deprecated)]
539 #[doc(alias = "ges_track_element_get_control_binding")]
540 #[doc(alias = "get_control_binding")]
541 fn control_binding(&self, property_name: &str) -> Option<gst::ControlBinding> {
542 unsafe {
543 from_glib_none(ffi::ges_track_element_get_control_binding(
544 self.as_ref().to_glib_none().0,
545 property_name.to_glib_none().0,
546 ))
547 }
548 }
549
550 /// Gets the control binding that was created for the specified child
551 /// property of the track element using
552 /// [`set_control_source()`][Self::set_control_source()]. The given `property_name` must
553 /// be the same name of the child property that was passed to
554 /// [`set_control_source()`][Self::set_control_source()].
555 /// ## `property_name`
556 /// The name of the child property to return the control
557 /// binding of
558 ///
559 /// # Returns
560 ///
561 /// The control binding that was
562 /// created for the specified child property of `self`, or [`None`] if
563 /// `property_name` does not correspond to any control binding.
564 #[cfg(feature = "v1_30")]
565 #[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
566 #[doc(alias = "ges_track_element_get_control_binding_full")]
567 #[doc(alias = "get_control_binding_full")]
568 fn control_binding_full(&self, property_name: &str) -> Option<gst::ControlBinding> {
569 unsafe {
570 from_glib_full(ffi::ges_track_element_get_control_binding_full(
571 self.as_ref().to_glib_none().0,
572 property_name.to_glib_none().0,
573 ))
574 }
575 }
576
577 /// Get the [`gst::Element`][crate::gst::Element] that the track element's underlying nleobject
578 /// controls.
579 ///
580 /// # Deprecated since 1.30
581 ///
582 /// Use [`element_full()`][Self::element_full()] instead for MT-safety.
583 ///
584 /// # Returns
585 ///
586 /// The [`gst::Element`][crate::gst::Element] being controlled by the
587 /// nleobject that `self` wraps.
588 #[cfg_attr(feature = "v1_30", deprecated = "Since 1.30")]
589 #[allow(deprecated)]
590 #[doc(alias = "ges_track_element_get_element")]
591 #[doc(alias = "get_element")]
592 fn element(&self) -> Option<gst::Element> {
593 unsafe {
594 from_glib_none(ffi::ges_track_element_get_element(
595 self.as_ref().to_glib_none().0,
596 ))
597 }
598 }
599
600 /// Get the [`gst::Element`][crate::gst::Element] that the track element's underlying nleobject
601 /// controls.
602 ///
603 /// # Returns
604 ///
605 /// The [`gst::Element`][crate::gst::Element] being controlled by the
606 /// nleobject that `self` wraps.
607 #[cfg(feature = "v1_30")]
608 #[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
609 #[doc(alias = "ges_track_element_get_element_full")]
610 #[doc(alias = "get_element_full")]
611 fn element_full(&self) -> Option<gst::Element> {
612 unsafe {
613 from_glib_full(ffi::ges_track_element_get_element_full(
614 self.as_ref().to_glib_none().0,
615 ))
616 }
617 }
618
619 /// Get the GNonLin object this object is controlling.
620 ///
621 /// # Deprecated
622 ///
623 /// use `ges_track_element_get_nleobject` instead.
624 ///
625 /// # Returns
626 ///
627 /// The GNonLin object this object is controlling.
628 #[doc(alias = "ges_track_element_get_gnlobject")]
629 #[doc(alias = "get_gnlobject")]
630 fn gnlobject(&self) -> gst::Element {
631 unsafe {
632 from_glib_none(ffi::ges_track_element_get_gnlobject(
633 self.as_ref().to_glib_none().0,
634 ))
635 }
636 }
637
638 /// Get the nleobject that this element wraps.
639 ///
640 /// # Deprecated since 1.30
641 ///
642 /// Use [`nleobject_full()`][Self::nleobject_full()] instead for MT-safety.
643 ///
644 /// # Returns
645 ///
646 /// The nleobject that `self` wraps.
647 #[cfg_attr(feature = "v1_30", deprecated = "Since 1.30")]
648 #[allow(deprecated)]
649 #[doc(alias = "ges_track_element_get_nleobject")]
650 #[doc(alias = "get_nleobject")]
651 fn nleobject(&self) -> gst::Element {
652 unsafe {
653 from_glib_none(ffi::ges_track_element_get_nleobject(
654 self.as_ref().to_glib_none().0,
655 ))
656 }
657 }
658
659 /// Get the nleobject that this element wraps.
660 ///
661 /// # Returns
662 ///
663 /// The nleobject that `self` wraps.
664 #[cfg(feature = "v1_30")]
665 #[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
666 #[doc(alias = "ges_track_element_get_nleobject_full")]
667 #[doc(alias = "get_nleobject_full")]
668 fn nleobject_full(&self) -> Option<gst::Element> {
669 unsafe {
670 from_glib_full(ffi::ges_track_element_get_nleobject_full(
671 self.as_ref().to_glib_none().0,
672 ))
673 }
674 }
675
676 /// Get the [`track`][struct@crate::TrackElement#track] for the element.
677 ///
678 /// # Deprecated since 1.30
679 ///
680 /// Use [`track_full()`][Self::track_full()] instead for MT-safety.
681 ///
682 /// # Returns
683 ///
684 /// The track that `self` belongs to,
685 /// or [`None`] if it does not belong to a track.
686 #[cfg_attr(feature = "v1_30", deprecated = "Since 1.30")]
687 #[allow(deprecated)]
688 #[doc(alias = "ges_track_element_get_track")]
689 #[doc(alias = "get_track")]
690 fn track(&self) -> Option<Track> {
691 unsafe {
692 from_glib_none(ffi::ges_track_element_get_track(
693 self.as_ref().to_glib_none().0,
694 ))
695 }
696 }
697
698 /// Get the [`track`][struct@crate::TrackElement#track] for the element.
699 ///
700 /// # Returns
701 ///
702 /// The track that `self` belongs to,
703 /// or [`None`] if it does not belong to a track.
704 #[cfg(feature = "v1_30")]
705 #[cfg_attr(docsrs, doc(cfg(feature = "v1_30")))]
706 #[doc(alias = "ges_track_element_get_track_full")]
707 #[doc(alias = "get_track_full")]
708 fn track_full(&self) -> Option<Track> {
709 unsafe {
710 from_glib_full(ffi::ges_track_element_get_track_full(
711 self.as_ref().to_glib_none().0,
712 ))
713 }
714 }
715
716 /// Gets the [`track-type`][struct@crate::TrackElement#track-type] for the element.
717 ///
718 /// # Returns
719 ///
720 /// The track-type of `self`.
721 #[doc(alias = "ges_track_element_get_track_type")]
722 #[doc(alias = "get_track_type")]
723 #[doc(alias = "track-type")]
724 fn track_type(&self) -> TrackType {
725 unsafe {
726 from_glib(ffi::ges_track_element_get_track_type(
727 self.as_ref().to_glib_none().0,
728 ))
729 }
730 }
731
732 /// Gets [`has-internal-source`][struct@crate::TrackElement#has-internal-source] for the element.
733 ///
734 /// # Returns
735 ///
736 /// [`true`] if `self` can have its 'internal time' properties set.
737 #[cfg(feature = "v1_18")]
738 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
739 #[doc(alias = "ges_track_element_has_internal_source")]
740 fn has_internal_source(&self) -> bool {
741 unsafe {
742 from_glib(ffi::ges_track_element_has_internal_source(
743 self.as_ref().to_glib_none().0,
744 ))
745 }
746 }
747
748 /// Gets [`active`][struct@crate::TrackElement#active] for the element.
749 ///
750 /// # Returns
751 ///
752 /// [`true`] if `self` is active in its track.
753 #[doc(alias = "ges_track_element_is_active")]
754 #[doc(alias = "active")]
755 fn is_active(&self) -> bool {
756 unsafe {
757 from_glib(ffi::ges_track_element_is_active(
758 self.as_ref().to_glib_none().0,
759 ))
760 }
761 }
762
763 /// Get whether the given track element is a core track element. That is,
764 /// it was created by the `create_track_elements` `GESClipClass` method for
765 /// some [`Clip`][crate::Clip].
766 ///
767 /// Note that such a track element can only be added to a clip that shares
768 /// the same [`Asset`][crate::Asset] as the clip that created it. For example, you are
769 /// allowed to move core children between clips that resulted from
770 /// [`GESContainerExt::ungroup()`][crate::prelude::GESContainerExt::ungroup()], but you could not move the core child from a
771 /// [`UriClip`][crate::UriClip] to a [`TitleClip`][crate::TitleClip] or another [`UriClip`][crate::UriClip] with a different
772 /// [`uri`][struct@crate::UriClip#uri].
773 ///
774 /// Moreover, if a core track element is added to a clip, it will always be
775 /// added as a core child. Therefore, if this returns [`true`], then `element`
776 /// will be a core child of its parent clip.
777 ///
778 /// # Returns
779 ///
780 /// [`true`] if `element` is a core track element.
781 #[cfg(feature = "v1_18")]
782 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
783 #[doc(alias = "ges_track_element_is_core")]
784 fn is_core(&self) -> bool {
785 unsafe {
786 from_glib(ffi::ges_track_element_is_core(
787 self.as_ref().to_glib_none().0,
788 ))
789 }
790 }
791
792 /// Gets an array of [`glib::ParamSpec`][crate::glib::ParamSpec]* for all configurable properties of the
793 /// children of `self`.
794 ///
795 /// # Deprecated
796 ///
797 /// Use `ges_timeline_element_list_children_properties`
798 ///
799 /// # Returns
800 ///
801 /// An array of [`glib::ParamSpec`][crate::glib::ParamSpec]* which should be freed after use or
802 /// [`None`] if something went wrong.
803 #[doc(alias = "ges_track_element_list_children_properties")]
804 fn list_children_properties(&self) -> Vec<glib::ParamSpec> {
805 unsafe {
806 let mut n_properties = std::mem::MaybeUninit::uninit();
807 let ret = FromGlibContainer::from_glib_full_num(
808 ffi::ges_track_element_list_children_properties(
809 self.as_ref().to_glib_none().0,
810 n_properties.as_mut_ptr(),
811 ),
812 n_properties.assume_init() as _,
813 );
814 ret
815 }
816 }
817
818 /// Looks up which `element` and `pspec` would be effected by the given `name`. If various
819 /// contained elements have this property name you will get the first one, unless you
820 /// specify the class name in `name`.
821 ///
822 /// # Deprecated
823 ///
824 /// Use `ges_timeline_element_lookup_child`
825 /// ## `prop_name`
826 /// Name of the property to look up. You can specify the name of the
827 /// class as such: "ClassName::property-name", to guarantee that you get the
828 /// proper GParamSpec in case various GstElement-s contain the same property
829 /// name. If you don't do so, you will get the first element found, having
830 /// this property and the and the corresponding GParamSpec.
831 ///
832 /// # Returns
833 ///
834 /// TRUE if `element` and `pspec` could be found. FALSE otherwise. In that
835 /// case the values for `pspec` and `element` are not modified. Unref `element` after
836 /// usage.
837 ///
838 /// ## `element`
839 /// pointer to a [`gst::Element`][crate::gst::Element] that
840 /// takes the real object to set property on
841 ///
842 /// ## `pspec`
843 /// pointer to take the specification
844 /// describing the property
845 #[doc(alias = "ges_track_element_lookup_child")]
846 fn lookup_child(&self, prop_name: &str) -> Option<(gst::Element, glib::ParamSpec)> {
847 unsafe {
848 let mut element = std::ptr::null_mut();
849 let mut pspec = std::ptr::null_mut();
850 let ret = from_glib(ffi::ges_track_element_lookup_child(
851 self.as_ref().to_glib_none().0,
852 prop_name.to_glib_none().0,
853 &mut element,
854 &mut pspec,
855 ));
856 if ret {
857 Some((from_glib_full(element), from_glib_full(pspec)))
858 } else {
859 None
860 }
861 }
862 }
863
864 /// Removes the [`gst::ControlBinding`][crate::gst::ControlBinding] that was created for the specified child
865 /// property of the track element using
866 /// [`set_control_source()`][Self::set_control_source()]. The given `property_name` must
867 /// be the same name of the child property that was passed to
868 /// [`set_control_source()`][Self::set_control_source()].
869 /// ## `property_name`
870 /// The name of the child property to remove the control
871 /// binding from
872 ///
873 /// # Returns
874 ///
875 /// [`true`] if the control binding was removed from the specified
876 /// child property of `self`, or [`false`] if an error occurred.
877 #[doc(alias = "ges_track_element_remove_control_binding")]
878 fn remove_control_binding(&self, property_name: &str) -> Result<(), glib::error::BoolError> {
879 unsafe {
880 glib::result_from_gboolean!(
881 ffi::ges_track_element_remove_control_binding(
882 self.as_ref().to_glib_none().0,
883 property_name.to_glib_none().0
884 ),
885 "Failed to remove control binding"
886 )
887 }
888 }
889
890 /// Sets [`active`][struct@crate::TrackElement#active] for the element.
891 /// ## `active`
892 /// Whether `self` should be active in its track
893 ///
894 /// # Returns
895 ///
896 /// [`true`] if the property was *toggled*.
897 #[doc(alias = "ges_track_element_set_active")]
898 #[doc(alias = "active")]
899 fn set_active(&self, active: bool) -> bool {
900 unsafe {
901 from_glib(ffi::ges_track_element_set_active(
902 self.as_ref().to_glib_none().0,
903 active.into_glib(),
904 ))
905 }
906 }
907
908 /// Sets [`auto-clamp-control-sources`][struct@crate::TrackElement#auto-clamp-control-sources]. If set to [`true`], this
909 /// will immediately clamp all the control sources.
910 /// ## `auto_clamp`
911 /// Whether to automatically clamp the control sources for the
912 /// child properties of `self`
913 #[cfg(feature = "v1_18")]
914 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
915 #[doc(alias = "ges_track_element_set_auto_clamp_control_sources")]
916 #[doc(alias = "auto-clamp-control-sources")]
917 fn set_auto_clamp_control_sources(&self, auto_clamp: bool) {
918 unsafe {
919 ffi::ges_track_element_set_auto_clamp_control_sources(
920 self.as_ref().to_glib_none().0,
921 auto_clamp.into_glib(),
922 );
923 }
924 }
925
926 //#[doc(alias = "ges_track_element_set_child_properties")]
927 //fn set_child_properties(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) {
928 // unsafe { TODO: call ffi:ges_track_element_set_child_properties() }
929 //}
930
931 /// Sets a property of a GstElement contained in `self`.
932 ///
933 /// Note that `ges_track_element_set_child_property` is really
934 /// intended for language bindings, `ges_track_element_set_child_properties`
935 /// is much more convenient for C programming.
936 ///
937 /// # Deprecated
938 ///
939 /// use `ges_timeline_element_set_child_property` instead
940 /// ## `property_name`
941 /// The name of the property
942 /// ## `value`
943 /// The value
944 ///
945 /// # Returns
946 ///
947 /// [`true`] if the property was set, [`false`] otherwise.
948 #[doc(alias = "ges_track_element_set_child_property")]
949 fn set_child_property(
950 &self,
951 property_name: &str,
952 value: &glib::Value,
953 ) -> Result<(), glib::error::BoolError> {
954 unsafe {
955 glib::result_from_gboolean!(
956 ffi::ges_track_element_set_child_property(
957 self.as_ref().to_glib_none().0,
958 property_name.to_glib_none().0,
959 mut_override(value.to_glib_none().0)
960 ),
961 "Failed to set child property"
962 )
963 }
964 }
965
966 /// Sets a property of a child of `self`.
967 ///
968 /// # Deprecated
969 ///
970 /// Use `ges_timeline_element_set_child_property_by_spec`
971 /// ## `pspec`
972 /// The [`glib::ParamSpec`][crate::glib::ParamSpec] that specifies the property you want to set
973 /// ## `value`
974 /// The value
975 #[doc(alias = "ges_track_element_set_child_property_by_pspec")]
976 fn set_child_property_by_pspec(&self, pspec: impl AsRef<glib::ParamSpec>, value: &glib::Value) {
977 unsafe {
978 ffi::ges_track_element_set_child_property_by_pspec(
979 self.as_ref().to_glib_none().0,
980 pspec.as_ref().to_glib_none().0,
981 mut_override(value.to_glib_none().0),
982 );
983 }
984 }
985
986 //#[doc(alias = "ges_track_element_set_child_property_valist")]
987 //fn set_child_property_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) {
988 // unsafe { TODO: call ffi:ges_track_element_set_child_property_valist() }
989 //}
990
991 /// Creates a [`gst::ControlBinding`][crate::gst::ControlBinding] for the specified child property of the
992 /// track element using the given control source. The given `property_name`
993 /// should refer to an existing child property of the track element, as
994 /// used in [`TimelineElementExt::lookup_child()`][crate::prelude::TimelineElementExt::lookup_child()].
995 ///
996 /// If `binding_type` is "direct", then the control binding is created with
997 /// `gst_direct_control_binding_new()` using the given control source. If
998 /// `binding_type` is "direct-absolute", it is created with
999 /// `gst_direct_control_binding_new_absolute()` instead.
1000 /// ## `source`
1001 /// The control source to bind the child property to
1002 /// ## `property_name`
1003 /// The name of the child property to control
1004 /// ## `binding_type`
1005 /// The type of binding to create ("direct" or
1006 /// "direct-absolute")
1007 ///
1008 /// # Returns
1009 ///
1010 /// [`true`] if the specified child property could be bound to
1011 /// `source`, or [`false`] if an error occurred.
1012 #[doc(alias = "ges_track_element_set_control_source")]
1013 fn set_control_source(
1014 &self,
1015 source: &impl IsA<gst::ControlSource>,
1016 property_name: &str,
1017 binding_type: &str,
1018 ) -> bool {
1019 unsafe {
1020 from_glib(ffi::ges_track_element_set_control_source(
1021 self.as_ref().to_glib_none().0,
1022 source.as_ref().to_glib_none().0,
1023 property_name.to_glib_none().0,
1024 binding_type.to_glib_none().0,
1025 ))
1026 }
1027 }
1028
1029 /// Sets [`has-internal-source`][struct@crate::TrackElement#has-internal-source] for the element. If this is
1030 /// set to [`false`], this method will also set the
1031 /// [`in-point`][struct@crate::TimelineElement#in-point] of the element to 0 and its
1032 /// [`max-duration`][struct@crate::TimelineElement#max-duration] to `GST_CLOCK_TIME_NONE`.
1033 /// ## `has_internal_source`
1034 /// Whether the `self` should be allowed to have its
1035 /// 'internal time' properties set.
1036 ///
1037 /// # Returns
1038 ///
1039 /// [`false`] if `has_internal_source` is forbidden for `self` and
1040 /// [`true`] in any other case.
1041 #[cfg(feature = "v1_18")]
1042 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1043 #[doc(alias = "ges_track_element_set_has_internal_source")]
1044 #[doc(alias = "has-internal-source")]
1045 fn set_has_internal_source(&self, has_internal_source: bool) -> bool {
1046 unsafe {
1047 from_glib(ffi::ges_track_element_set_has_internal_source(
1048 self.as_ref().to_glib_none().0,
1049 has_internal_source.into_glib(),
1050 ))
1051 }
1052 }
1053
1054 /// Sets the [`track-type`][struct@crate::TrackElement#track-type] for the element.
1055 /// ## `type_`
1056 /// The new track-type for `self`
1057 #[doc(alias = "ges_track_element_set_track_type")]
1058 #[doc(alias = "track-type")]
1059 fn set_track_type(&self, type_: TrackType) {
1060 unsafe {
1061 ffi::ges_track_element_set_track_type(
1062 self.as_ref().to_glib_none().0,
1063 type_.into_glib(),
1064 );
1065 }
1066 }
1067
1068 /// This is emitted when a control binding is added to a child property
1069 /// of the track element.
1070 /// ## `control_binding`
1071 /// The control binding that has been added
1072 #[doc(alias = "control-binding-added")]
1073 fn connect_control_binding_added<F: Fn(&Self, &gst::ControlBinding) + 'static>(
1074 &self,
1075 f: F,
1076 ) -> SignalHandlerId {
1077 unsafe extern "C" fn control_binding_added_trampoline<
1078 P: IsA<TrackElement>,
1079 F: Fn(&P, &gst::ControlBinding) + 'static,
1080 >(
1081 this: *mut ffi::GESTrackElement,
1082 control_binding: *mut gst::ffi::GstControlBinding,
1083 f: glib::ffi::gpointer,
1084 ) {
1085 unsafe {
1086 let f: &F = &*(f as *const F);
1087 f(
1088 TrackElement::from_glib_borrow(this).unsafe_cast_ref(),
1089 &from_glib_borrow(control_binding),
1090 )
1091 }
1092 }
1093 unsafe {
1094 let f: Box_<F> = Box_::new(f);
1095 connect_raw(
1096 self.as_ptr() as *mut _,
1097 c"control-binding-added".as_ptr(),
1098 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1099 control_binding_added_trampoline::<Self, F> as *const (),
1100 )),
1101 Box_::into_raw(f),
1102 )
1103 }
1104 }
1105
1106 /// This is emitted when a control binding is removed from a child
1107 /// property of the track element.
1108 /// ## `control_binding`
1109 /// The control binding that has been removed
1110 #[doc(alias = "control-binding-removed")]
1111 fn connect_control_binding_removed<F: Fn(&Self, &gst::ControlBinding) + 'static>(
1112 &self,
1113 f: F,
1114 ) -> SignalHandlerId {
1115 unsafe extern "C" fn control_binding_removed_trampoline<
1116 P: IsA<TrackElement>,
1117 F: Fn(&P, &gst::ControlBinding) + 'static,
1118 >(
1119 this: *mut ffi::GESTrackElement,
1120 control_binding: *mut gst::ffi::GstControlBinding,
1121 f: glib::ffi::gpointer,
1122 ) {
1123 unsafe {
1124 let f: &F = &*(f as *const F);
1125 f(
1126 TrackElement::from_glib_borrow(this).unsafe_cast_ref(),
1127 &from_glib_borrow(control_binding),
1128 )
1129 }
1130 }
1131 unsafe {
1132 let f: Box_<F> = Box_::new(f);
1133 connect_raw(
1134 self.as_ptr() as *mut _,
1135 c"control-binding-removed".as_ptr(),
1136 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1137 control_binding_removed_trampoline::<Self, F> as *const (),
1138 )),
1139 Box_::into_raw(f),
1140 )
1141 }
1142 }
1143
1144 #[doc(alias = "active")]
1145 fn connect_active_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1146 unsafe extern "C" fn notify_active_trampoline<P: IsA<TrackElement>, F: Fn(&P) + 'static>(
1147 this: *mut ffi::GESTrackElement,
1148 _param_spec: glib::ffi::gpointer,
1149 f: glib::ffi::gpointer,
1150 ) {
1151 unsafe {
1152 let f: &F = &*(f as *const F);
1153 f(TrackElement::from_glib_borrow(this).unsafe_cast_ref())
1154 }
1155 }
1156 unsafe {
1157 let f: Box_<F> = Box_::new(f);
1158 connect_raw(
1159 self.as_ptr() as *mut _,
1160 c"notify::active".as_ptr(),
1161 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1162 notify_active_trampoline::<Self, F> as *const (),
1163 )),
1164 Box_::into_raw(f),
1165 )
1166 }
1167 }
1168
1169 #[cfg(feature = "v1_18")]
1170 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1171 #[doc(alias = "auto-clamp-control-sources")]
1172 fn connect_auto_clamp_control_sources_notify<F: Fn(&Self) + 'static>(
1173 &self,
1174 f: F,
1175 ) -> SignalHandlerId {
1176 unsafe extern "C" fn notify_auto_clamp_control_sources_trampoline<
1177 P: IsA<TrackElement>,
1178 F: Fn(&P) + 'static,
1179 >(
1180 this: *mut ffi::GESTrackElement,
1181 _param_spec: glib::ffi::gpointer,
1182 f: glib::ffi::gpointer,
1183 ) {
1184 unsafe {
1185 let f: &F = &*(f as *const F);
1186 f(TrackElement::from_glib_borrow(this).unsafe_cast_ref())
1187 }
1188 }
1189 unsafe {
1190 let f: Box_<F> = Box_::new(f);
1191 connect_raw(
1192 self.as_ptr() as *mut _,
1193 c"notify::auto-clamp-control-sources".as_ptr(),
1194 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1195 notify_auto_clamp_control_sources_trampoline::<Self, F> as *const (),
1196 )),
1197 Box_::into_raw(f),
1198 )
1199 }
1200 }
1201
1202 #[cfg(feature = "v1_18")]
1203 #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
1204 #[doc(alias = "has-internal-source")]
1205 fn connect_has_internal_source_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1206 unsafe extern "C" fn notify_has_internal_source_trampoline<
1207 P: IsA<TrackElement>,
1208 F: Fn(&P) + 'static,
1209 >(
1210 this: *mut ffi::GESTrackElement,
1211 _param_spec: glib::ffi::gpointer,
1212 f: glib::ffi::gpointer,
1213 ) {
1214 unsafe {
1215 let f: &F = &*(f as *const F);
1216 f(TrackElement::from_glib_borrow(this).unsafe_cast_ref())
1217 }
1218 }
1219 unsafe {
1220 let f: Box_<F> = Box_::new(f);
1221 connect_raw(
1222 self.as_ptr() as *mut _,
1223 c"notify::has-internal-source".as_ptr(),
1224 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1225 notify_has_internal_source_trampoline::<Self, F> as *const (),
1226 )),
1227 Box_::into_raw(f),
1228 )
1229 }
1230 }
1231
1232 #[doc(alias = "track")]
1233 fn connect_track_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1234 unsafe extern "C" fn notify_track_trampoline<P: IsA<TrackElement>, F: Fn(&P) + 'static>(
1235 this: *mut ffi::GESTrackElement,
1236 _param_spec: glib::ffi::gpointer,
1237 f: glib::ffi::gpointer,
1238 ) {
1239 unsafe {
1240 let f: &F = &*(f as *const F);
1241 f(TrackElement::from_glib_borrow(this).unsafe_cast_ref())
1242 }
1243 }
1244 unsafe {
1245 let f: Box_<F> = Box_::new(f);
1246 connect_raw(
1247 self.as_ptr() as *mut _,
1248 c"notify::track".as_ptr(),
1249 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1250 notify_track_trampoline::<Self, F> as *const (),
1251 )),
1252 Box_::into_raw(f),
1253 )
1254 }
1255 }
1256
1257 #[doc(alias = "track-type")]
1258 fn connect_track_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1259 unsafe extern "C" fn notify_track_type_trampoline<
1260 P: IsA<TrackElement>,
1261 F: Fn(&P) + 'static,
1262 >(
1263 this: *mut ffi::GESTrackElement,
1264 _param_spec: glib::ffi::gpointer,
1265 f: glib::ffi::gpointer,
1266 ) {
1267 unsafe {
1268 let f: &F = &*(f as *const F);
1269 f(TrackElement::from_glib_borrow(this).unsafe_cast_ref())
1270 }
1271 }
1272 unsafe {
1273 let f: Box_<F> = Box_::new(f);
1274 connect_raw(
1275 self.as_ptr() as *mut _,
1276 c"notify::track-type".as_ptr(),
1277 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1278 notify_track_type_trampoline::<Self, F> as *const (),
1279 )),
1280 Box_::into_raw(f),
1281 )
1282 }
1283 }
1284}
1285
1286impl<O: IsA<TrackElement>> TrackElementExt for O {}