select_tracks_for_object


Description:

public signal GenericArray<Track> select_tracks_for_object (Clip clip, TrackElement track_element)

This will be emitted whenever the timeline needs to determine which tracks a clip's children should be added to.

The track element will be added to each of the tracks given in the return. If a track element is selected to go into multiple tracks, it will be copied into the additional tracks, under the same clip. Note that the copy will *not* keep its properties or state in sync with the original.

Connect to this signal once if you wish to control which element should be added to which track. Doing so will overwrite the default behaviour, which adds track_element to all tracks whose track_type includes the track_element's track_type.

Note that under the default track selection, if a clip would produce multiple core children of the same TrackType, it will choose one of the core children arbitrarily to place in the corresponding tracks, with a warning for the other core children that are not placed in the track. For example, this would happen for a UriClip that points to a file that contains multiple audio streams. If you wish to choose the stream, you could connect to this signal, and use, say, get_stream_info to choose which core source to add.

When a clip is first added to a timeline, its core elements will be created for the current tracks in the timeline if they have not already been created. Then this will be emitted for each of these core children to select which tracks, if any, they should be added to. It will then be called for any non-core children in the clip.

In addition, if a new track element is ever added to a clip in a timeline (and it is not already part of a track) this will be emitted to select which tracks the element should be added to.

Finally, as a special case, if a track is added to the timeline *after* it already contains clips, then it will request the creation of the clips' core elements of the corresponding type, if they have not already been created, and this signal will be emitted for each of these newly created elements. In addition, this will also be released for all other track elements in the timeline's clips that have not yet been assigned a track. However, in this final case, the timeline will only check whether the newly added track appears in the track list. If it does appear, the track element will be added to the newly added track. All other tracks in the returned track list are ignored.

In this latter case, track elements that are already part of a track will not be asked if they want to be copied into the new track. If you wish to do this, you can use add_child_to_track.

Note that the returned GenericArray should own a new reference to each of its contained Track. The timeline will set the DestroyNotify free function on the GenericArray to dereference the elements.

Parameters:

clip

The clip that track_element is being added to

track_element

The element being added

Returns:

An array of Track-s that track_element should be added to, or null to not add the element to any track.