From: Dan Dennedy Date: Sat, 13 Nov 2010 22:07:06 +0000 (-0800) Subject: Change playlist editing from current to selected. X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=015a189138f13c3a2729f447153f204e4db05de3;p=rugen Change playlist editing from current to selected. --- diff --git a/src/interface.c b/src/interface.c index ab586fb..fdabe07 100644 --- a/src/interface.c +++ b/src/interface.c @@ -86,7 +86,7 @@ create_gdv1394d (void) GtkWidget *statusbar; gdv1394d = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_window_set_title (GTK_WINDOW (gdv1394d), _("Rugen")); + gtk_window_set_title (GTK_WINDOW (gdv1394d), _("Melted Client")); gtk_window_set_default_size (GTK_WINDOW (gdv1394d), 640, 480); vbox1 = gtk_vbox_new (FALSE, 0); @@ -1131,7 +1131,7 @@ create_page_clips (void) GTK_WIDGET_UNSET_FLAGS (button_up, GTK_CAN_FOCUS); GTK_WIDGET_SET_FLAGS (button_up, GTK_CAN_DEFAULT); gtk_button_set_relief (GTK_BUTTON (button_up), GTK_RELIEF_NONE); - gtk_widget_set_tooltip_text (button_up, _("Move current clip up")); + gtk_widget_set_tooltip_text (button_up, _("Move clip up")); image21 = gtk_image_new_from_stock ("gtk-go-up", GTK_ICON_SIZE_MENU); gtk_widget_show (image21); @@ -1143,7 +1143,7 @@ create_page_clips (void) GTK_WIDGET_UNSET_FLAGS (button_down, GTK_CAN_FOCUS); GTK_WIDGET_SET_FLAGS (button_down, GTK_CAN_DEFAULT); gtk_button_set_relief (GTK_BUTTON (button_down), GTK_RELIEF_NONE); - gtk_widget_set_tooltip_text (button_down, _("Move current clip down")); + gtk_widget_set_tooltip_text (button_down, _("Move clip down")); image22 = gtk_image_new_from_stock ("gtk-go-down", GTK_ICON_SIZE_MENU); gtk_widget_show (image22); @@ -1155,7 +1155,7 @@ create_page_clips (void) GTK_WIDGET_UNSET_FLAGS (button_remove, GTK_CAN_FOCUS); GTK_WIDGET_SET_FLAGS (button_remove, GTK_CAN_DEFAULT); gtk_button_set_relief (GTK_BUTTON (button_remove), GTK_RELIEF_NONE); - gtk_widget_set_tooltip_text (button_remove, _("Remove current clip")); + gtk_widget_set_tooltip_text (button_remove, _("Remove clip")); image23 = gtk_image_new_from_stock ("gtk-delete", GTK_ICON_SIZE_MENU); gtk_widget_show (image23); diff --git a/src/page_clips.c b/src/page_clips.c index d4251c6..50b8912 100644 --- a/src/page_clips.c +++ b/src/page_clips.c @@ -262,8 +262,20 @@ static gboolean on_ok( GtkWidget *dummy, gpointer data ) mvcp_unit_append( this->dv, dv1394app_get_selected_unit( this->app ), temp, -1, -1 ); break; case 3: - mvcp_unit_clip_insert( this->dv, dv1394app_get_selected_unit( this->app ), mvcp_relative, 1, temp, -1, -1 ); + { + GtkWidget *widget = lookup_widget( this_page_get_widget( this ), "treeview1" ); + GtkTreeSelection *select = gtk_tree_view_get_selection( GTK_TREE_VIEW( widget ) ); + GtkTreeModel *model; + GtkTreeIter iter; + int clip; + + if ( gtk_tree_selection_get_selected( select, &model, &iter ) ) + { + gtk_tree_model_get( model, &iter, 5, &clip, -1 ); + mvcp_unit_clip_insert( this->dv, dv1394app_get_selected_unit( this->app ), mvcp_absolute, clip, temp, -1, -1 ); + } break; + } } free( temp ); @@ -392,21 +404,51 @@ static gboolean on_refresh( GtkWidget *button, gpointer data ) static gboolean on_up( GtkWidget *dummy, gpointer data ) { page_clips this = data; - mvcp_unit_clip_move( this->dv, dv1394app_get_selected_unit( this->app ), mvcp_relative, 0, mvcp_relative, -1 ); + GtkWidget *widget = lookup_widget( this_page_get_widget( this ), "treeview1" ); + GtkTreeSelection *select = gtk_tree_view_get_selection( GTK_TREE_VIEW( widget ) ); + GtkTreeModel *model; + GtkTreeIter iter; + int clip; + + if ( gtk_tree_selection_get_selected( select, &model, &iter ) ) + { + gtk_tree_model_get( model, &iter, 5, &clip, -1 ); + mvcp_unit_clip_move( this->dv, dv1394app_get_selected_unit( this->app ), mvcp_absolute, clip, mvcp_absolute, clip - 1 < 0 ? 0 : clip - 1 ); + } return TRUE; } static gboolean on_down( GtkWidget *dummy, gpointer data ) { page_clips this = data; - mvcp_unit_clip_move( this->dv, dv1394app_get_selected_unit( this->app ), mvcp_relative, 0, mvcp_relative, 1 ); + GtkWidget *widget = lookup_widget( this_page_get_widget( this ), "treeview1" ); + GtkTreeSelection *select = gtk_tree_view_get_selection( GTK_TREE_VIEW( widget ) ); + GtkTreeModel *model; + GtkTreeIter iter; + int clip; + + if ( gtk_tree_selection_get_selected( select, &model, &iter ) ) + { + gtk_tree_model_get( model, &iter, 5, &clip, -1 ); + mvcp_unit_clip_move( this->dv, dv1394app_get_selected_unit( this->app ), mvcp_absolute, clip, mvcp_absolute, clip + 1 ); + } return TRUE; } static gboolean on_remove( GtkWidget *dummy, gpointer data ) { page_clips this = data; - mvcp_unit_remove_current_clip( this->dv, dv1394app_get_selected_unit( this->app ) ); + GtkWidget *widget = lookup_widget( this_page_get_widget( this ), "treeview1" ); + GtkTreeSelection *select = gtk_tree_view_get_selection( GTK_TREE_VIEW( widget ) ); + GtkTreeModel *model; + GtkTreeIter iter; + int clip; + + if ( gtk_tree_selection_get_selected( select, &model, &iter ) ) + { + gtk_tree_model_get( model, &iter, 5, &clip, -1 ); + mvcp_unit_clip_remove( this->dv, dv1394app_get_selected_unit( this->app ), mvcp_absolute, clip ); + } return TRUE; }