mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:06:17 +00:00
update list store layer emits object-moved
This commit is contained in:
parent
4fd305cbec
commit
11bb201e9d
1 changed files with 26 additions and 0 deletions
|
@ -335,6 +335,30 @@ layer_object_removed_cb (GESTimelineLayer * layer, GESTimelineObject * object,
|
||||||
update_add_transition_sensitivity (app);
|
update_add_transition_sensitivity (app);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
layer_object_moved_cb (GESTimelineObject * layer, GESTimelineObject * object,
|
||||||
|
gint old, gint new, App * app)
|
||||||
|
{
|
||||||
|
GtkTreeIter a, b;
|
||||||
|
GtkTreePath *path;
|
||||||
|
|
||||||
|
/* we can take the old position as given, but the new position might have to
|
||||||
|
* be adjusted. */
|
||||||
|
new = new < 0 ? (app->n_objects - 1) : new;
|
||||||
|
|
||||||
|
path = gtk_tree_path_new_from_indices (old, -1);
|
||||||
|
gtk_tree_model_get_iter (GTK_TREE_MODEL (app->model), &a, path);
|
||||||
|
gtk_tree_path_free (path);
|
||||||
|
|
||||||
|
path = gtk_tree_path_new_from_indices (new, -1);
|
||||||
|
gtk_tree_model_get_iter (GTK_TREE_MODEL (app->model), &b, path);
|
||||||
|
gtk_tree_path_free (path);
|
||||||
|
|
||||||
|
gtk_list_store_swap (app->model, &a, &b);
|
||||||
|
app_selection_changed_cb (app->selection, app);
|
||||||
|
update_move_up_down_sensitivity (app);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pipeline_state_changed_cb (App * app)
|
pipeline_state_changed_cb (App * app)
|
||||||
{
|
{
|
||||||
|
@ -744,6 +768,8 @@ create_ui (App * app)
|
||||||
G_CALLBACK (layer_object_added_cb), app);
|
G_CALLBACK (layer_object_added_cb), app);
|
||||||
g_signal_connect (app->layer, "object-removed",
|
g_signal_connect (app->layer, "object-removed",
|
||||||
G_CALLBACK (layer_object_removed_cb), app);
|
G_CALLBACK (layer_object_removed_cb), app);
|
||||||
|
g_signal_connect (app->layer, "object-moved",
|
||||||
|
G_CALLBACK (layer_object_moved_cb), app);
|
||||||
|
|
||||||
bus = gst_pipeline_get_bus (GST_PIPELINE (app->pipeline));
|
bus = gst_pipeline_get_bus (GST_PIPELINE (app->pipeline));
|
||||||
gst_bus_add_signal_watch (bus);
|
gst_bus_add_signal_watch (bus);
|
||||||
|
|
Loading…
Reference in a new issue