GES.Project¶
- Subclasses:
None
Methods¶
- Inherited:
GES.Asset (13), GObject.Object (37), GES.MetaContainer (40), Gio.AsyncInitable (4), Gio.Initable (2)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
GES.Asset (5), GObject.Object (7), Gio.AsyncInitable (2), Gio.Initable (1)
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
uri of the project |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Informs you that a |
|
```c static |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class GES.Project(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
GES.Project
is used to control a set ofGES.Asset
and is aGES.Asset
withGES_TYPE_TIMELINE
as extractable_type itself. That means that you can extractGES.Timeline
from a project as followed:```c
GES.Project
*project;GES.Timeline
*timeline;project =
GES.Project.new
(“file:///path/to/a/valid/project/uri”);// Here you can connect to the various signal to get more infos about // what is happening and recover from errors if possible …
timeline =
GES.Asset.extract
(GES_ASSET (project)); ```The
GES.Project
class offers a higher level API to handleGES.Asset
-s. It lets you request new asset, and it informs you about new assets through a set of signals. Also it handles problem such as missing files/missingGst.Element
and lets you try to recover from those.- Subprojects
In order to add a subproject, the only thing to do is to add the subproject to the main project:
`` c ges_project_add_asset (project, GES_ASSET (subproject)); `` then the subproject will be serialized in the project files. To use the subproject in a timeline, you should use a
GES.UriClip
with the same subproject URI.When loading a project with subproject, subprojects URIs will be temporary writable local files. If you want to edit the subproject timeline, you should retrieve the subproject from the parent project asset list and extract the timeline with
GES.Asset.extract
() and save it at the same temporary location.- classmethod new(uri)[source]¶
- Parameters:
uri (
str
orNone
) – The uri to be set after creating the project.- Returns:
A newly created
GES.Project
MT safe.
- Return type:
Creates a new
GES.Project
and sets its uri to uri if provided. Note that if uri is not valid orNone
, the uri of the project will then be set the first time you save the project. If you then save the project to other locations, it will never be updated again and the first valid URI is the URI it will keep refering to.
- add_asset(asset)[source]¶
- Parameters:
- Returns:
True
if the asset could be addedFalse
it was already in the project.MT safe.
- Return type:
Adds a
GES.Asset
to self, the project will keep a reference on asset.
- add_encoding_profile(profile)[source]¶
- Parameters:
profile (
GstPbutils.EncodingProfile
) – AGstPbutils.EncodingProfile
to add to the project. If a profile with the same name already exists, it will be replaced.- Returns:
True
if profile could be added,False
otherwiseMT safe.
- Return type:
Adds profile to the project. It lets you save in what format the project will be rendered and keep a reference to those formats. Also, those formats will be saved to the project file when possible.
- add_formatter(formatter)[source]¶
- Parameters:
formatter (
GES.Formatter
) – A formatter used by self
Adds a formatter to be used to load self
New in version 1.18.
- create_asset(id, extractable_type)[source]¶
- Parameters:
id (
str
orNone
) – The id of the asset to create and add to selfextractable_type (
GObject.GType
) – TheGObject.GType
of the asset to create
- Returns:
True
if the asset was added and started loading,False
it was already in the project.MT safe.
- Return type:
Create and add a
GES.Asset
to self. You should connect to the “asset-added” signal to get the asset when it finally gets added to self
- create_asset_sync(id, extractable_type)[source]¶
- Parameters:
id (
str
orNone
) – The id of the asset to create and add to selfextractable_type (
GObject.GType
) – TheGObject.GType
of the asset to create
- Raises:
- Returns:
The newly created
GES.Asset
orNone
.MT safe.
- Return type:
Create and add a
GES.Asset
to self. You should connect to the “asset-added” signal to get the asset when it finally gets added to self
- get_loading_assets()[source]¶
- Returns:
A set of loading asset that will be added to self. Note that those Asset are *not* loaded yet, and thus can not be used.
MT safe.
- Return type:
Get the assets that are being loaded
- list_assets(filter)[source]¶
- Parameters:
filter (
GObject.GType
) – Type of assets to list,GES_TYPE_EXTRACTABLE
will list all assets- Returns:
The list of
GES.Asset
the object containsMT safe.
- Return type:
List all asset contained in self filtering per extractable_type as defined by filter. It copies the asset and thus will not be updated in time.
- list_encoding_profiles()[source]¶
- Returns:
The list of
GstPbutils.EncodingProfile
used in self- Return type:
Lists the encoding profile that have been set to self. The first one is the latest added.
- load(timeline)[source]¶
- Parameters:
timeline (
GES.Timeline
) – A blank timeline to load self into- Raises:
- Returns:
True
if the project could be loadedFalse
otherwise.MT safe.
- Return type:
Loads self into timeline
- remove_asset(asset)[source]¶
-
Remove asset from self.
- save(timeline, uri, formatter_asset, overwrite)[source]¶
- Parameters:
timeline (
GES.Timeline
) – TheGES.Timeline
to save, it must have been extracted from selfuri (
str
) – The uri where to save self and timelineformatter_asset (
GES.Asset
orNone
) – The formatter asset to use orNone
. IfNone
, will try to save in the same format as the one from which the timeline as been loaded or default to the best formatter as defined inGES.find_formatter_for_uri
- Raises:
- Returns:
True
if the project could be save,False
otherwiseMT safe.
- Return type:
Save the timeline of self to uri. You should make sure that timeline is one of the timelines that have been extracted from self (using
GES.Asset.extract
(self);)
- do_loaded(timeline) virtual¶
- Parameters:
timeline (
GES.Timeline
) –- Return type:
- do_loading(timeline) virtual¶
- Parameters:
timeline (
GES.Timeline
) – The loading timeline
New in version 1.18.
- do_loading_error(error, id, extractable_type) virtual¶
- Parameters:
error (
GLib.Error
) –id (
str
) –extractable_type (
GObject.GType
) –
- Return type:
- do_missing_uri(error, wrong_asset) virtual¶
- Parameters:
error (
GLib.Error
) –wrong_asset (
GES.Asset
) –
- Return type:
Signal Details¶
- GES.Project.signals.asset_added(project, asset)¶
- Signal Name:
asset-added
- Flags:
- Parameters:
project (
GES.Project
) – The object which received the signalasset (
GES.Asset
) – TheGES.Asset
that has been added to project
- GES.Project.signals.asset_loading(project, asset)¶
- Signal Name:
asset-loading
- Flags:
- Parameters:
project (
GES.Project
) – The object which received the signal
New in version 1.8.
- GES.Project.signals.asset_removed(project, asset)¶
- Signal Name:
asset-removed
- Flags:
- Parameters:
project (
GES.Project
) – The object which received the signalasset (
GES.Asset
) – TheGES.Asset
that has been removed from project
- GES.Project.signals.error_loading(project, timeline, error)¶
- Signal Name:
error-loading
- Flags:
- Parameters:
project (
GES.Project
) – The object which received the signaltimeline (
GES.Timeline
) – The timeline that failed loadingerror (
GLib.Error
) – TheGLib.Error
defining the error that occured
New in version 1.18.
- GES.Project.signals.error_loading_asset(project, error, id, extractable_type)¶
- Signal Name:
error-loading-asset
- Flags:
- Parameters:
project (
GES.Project
) – The object which received the signalerror (
GLib.Error
) – TheGLib.Error
defining the error that occured, might beNone
id (
str
) – The id of the asset that failed loadingextractable_type (
GObject.GType
) – The extractable_type of the asset that failed loading
Informs you that a
GES.Asset
could not be created. In case of missing GStreamer plugins, the error will be set to #GST_CORE_ERRORGst.CoreError.MISSING_PLUGIN
- GES.Project.signals.loaded(project, timeline)¶
- Signal Name:
loaded
- Flags:
- Parameters:
project (
GES.Project
) – The object which received the signaltimeline (
GES.Timeline
) – TheGES.Timeline
that completed loading
- GES.Project.signals.loading(project, timeline)¶
- Signal Name:
loading
- Flags:
- Parameters:
project (
GES.Project
) – The object which received the signaltimeline (
GES.Timeline
) – TheGES.Timeline
that started loading
New in version 1.18.
- GES.Project.signals.missing_uri(project, error, wrong_asset)¶
- Signal Name:
missing-uri
- Flags:
- Parameters:
project (
GES.Project
) – The object which received the signalerror (
GLib.Error
) – The error that happenedwrong_asset (
GES.Asset
) – The asset with the wrong ID, you should us it and its content only to find out what the new location is.
- Returns:
The new URI of wrong_asset
- Return type:
```c static
str
source_moved_cb (GES.Project
*project,GLib.Error
*error,GES.Asset
*asset_with_error) { returnGLib.strdup
(“file:///the/new/uri.ogg”); }static int main (int argc,
str
** argv) {GES.Timeline
*timeline;GES.Project
*project =GES.Project.new
(“file:///some/uri.xges”);g_signal_connect (project, “missing-uri”, source_moved_cb,
None
); timeline =GES.Asset.extract
(GES_ASSET (project)); } ```