project: Add a signal to notify when a new timeline is starting to load

This commit is contained in:
Thibault Saunier 2019-05-01 18:20:42 -04:00
parent 92fdae7cf0
commit 85e966963e
2 changed files with 20 additions and 3 deletions

View file

@ -80,6 +80,7 @@ typedef struct EmitLoadedInIdle
enum
{
LOADING_SIGNAL,
LOADED_SIGNAL,
ERROR_LOADING_ASSET,
ASSET_ADDED_SIGNAL,
@ -179,6 +180,7 @@ _load_project (GESProject * project, GESTimeline * timeline, GError ** error)
priv = GES_PROJECT (project)->priv;
g_signal_emit (project, _signals[LOADING_SIGNAL], 0, timeline);
if (priv->uri == NULL) {
EmitLoadedInIdle *data = g_slice_new (EmitLoadedInIdle);
@ -481,10 +483,23 @@ ges_project_class_init (GESProjectClass * klass)
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GESProjectClass, asset_removed),
NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE, 1, GES_TYPE_ASSET);
/**
* GESProject::loading:
* @project: the #GESProject that is starting to load a timeline
* @timeline: The #GESTimeline that started loading
*
* Since: 1.18
*/
_signals[LOADING_SIGNAL] =
g_signal_new ("loading", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (GESProjectClass, loading),
NULL, NULL, g_cclosure_marshal_generic, G_TYPE_NONE,
1, GES_TYPE_TIMELINE);
/**
* GESProject::loaded:
* @project: the #GESProject that is done loading a project.
* @timeline: The #GESTimeline that complete loading
* @project: the #GESProject that is done loading a timeline.
* @timeline: The #GESTimeline that completed loading
*/
_signals[LOADED_SIGNAL] =
g_signal_new ("loaded", G_TYPE_FROM_CLASS (klass),

View file

@ -71,8 +71,10 @@ struct _GESProjectClass
GType extractable_type);
gboolean (*loaded) (GESProject * self,
GESTimeline * timeline);
gboolean (*loading) (GESProject * self,
GESTimeline * timeline);
gpointer _ges_reserved[GES_PADDING];
gpointer _ges_reserved[GES_PADDING - 1];
};
GES_API