loop option is done
authorVlad <vlad@gas.by>
Thu, 29 Jul 2010 12:41:13 +0000 (15:41 +0300)
committerVlad <vlad@gas.by>
Thu, 29 Jul 2010 12:41:13 +0000 (15:41 +0300)
applet/src/livewp-scene.c
applet/src/livewp-settings.c

index 6b79953..6661014 100644 (file)
@@ -95,8 +95,22 @@ bus_call (GstBus *bus, GstMessage *msg, AWallpaperPlugin *desktop_plugin)
            fprintf(stderr,"GST_MESSAGE_EOS:\n");
            if (desktop_plugin->priv->rich_animation){
                 fprintf(stderr,"GST_MESSAGE_EOS222222222222222222222222\n");
-                gst_element_set_start_time(desktop_plugin->priv->pipeline, 0);
+                GstClockTime nach   = (GstClockTime)(10 * GST_MSECOND);
+                if (!gst_element_seek(desktop_plugin->priv->pipeline, 1.0, GST_FORMAT_TIME, (GstSeekFlags) (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT), GST_SEEK_TYPE_SET, nach, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE))
+                    fprintf(stderr,"ERROR in seek\n");
+
+
+
+
+
+//                gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_READY);
+
+//                gst_element_set_start_time(desktop_plugin->priv->pipeline, 0);
                 gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_PLAYING);
+           }else{
+                   fprintf(stderr,"GST_MESSAGE_EOS33333333333333333333\n");
+                   if (desktop_plugin->priv->pipeline){                                                                                                                                                                                                                                             gst_element_set_state (desktop_plugin->priv->pipeline, GST_STATE_NULL);                                                                                                                                                                                                        gst_object_unref (GST_OBJECT (desktop_plugin->priv->pipeline));                                                                                                                                                                                          
+                   } 
            }
            break;
        case GST_MESSAGE_ERROR: break;
index 1ae2ec2..e08eca6 100644 (file)
@@ -185,11 +185,11 @@ create_themes_button (gchar *theme){
 
 /*******************************************************************************/
 GtkWidget *
-create_rich_animation_button (gboolean active)
+create_rich_animation_button (gboolean active, gchar *name)
 {
     GtkWidget *button;
     button = hildon_check_button_new (HILDON_SIZE_AUTO);
-    gtk_button_set_label (GTK_BUTTON (button), _("Rich Animation"));
+    gtk_button_set_label (GTK_BUTTON (button), name);
     hildon_check_button_set_active(HILDON_CHECK_BUTTON(button), active);
     return button;
 }
@@ -310,7 +310,7 @@ void
 rich_animation_additional_parametr(GtkWidget *vbox, Animation_WallpaperPrivate *priv){
     GtkWidget *rich_animation_button;
     /* Create rich animation button */  
-    rich_animation_button = create_rich_animation_button(priv->rich_animation);
+    rich_animation_button = create_rich_animation_button(priv->rich_animation, _("Rich Animation"));
     gtk_box_pack_start(GTK_BOX(vbox),
                                    rich_animation_button, TRUE, TRUE, 5);
     g_object_set_data(G_OBJECT(priv->window), "rich_animation_button", rich_animation_button);
@@ -321,6 +321,7 @@ void
 additional_parametr_for_theme_video(GtkWidget *vbox, Animation_WallpaperPrivate *priv){
 
     GtkWidget *file_button;
+    GtkWidget *rich_animation_button;
 
     if (priv->theme_string_parametr1)
         file_button = hildon_button_new_with_text (HILDON_SIZE_FINGER_HEIGHT, HILDON_BUTTON_ARRANGEMENT_VERTICAL,
@@ -333,8 +334,14 @@ additional_parametr_for_theme_video(GtkWidget *vbox, Animation_WallpaperPrivate
 
     gtk_box_pack_start(GTK_BOX(vbox),
                                    file_button, TRUE, TRUE, 5);
-    g_object_set_data(G_OBJECT(priv->window), "filename_button", file_button);
+    g_object_set_data(G_OBJECT(priv->window), "filename_button", file_button);    /* Create rich animation button */  
+    rich_animation_button = create_rich_animation_button(priv->rich_animation, _("Loop"));
+    gtk_box_pack_start(GTK_BOX(vbox),
+                                   rich_animation_button, TRUE, TRUE, 5);
+    g_object_set_data(G_OBJECT(priv->window), "rich_animation_button", rich_animation_button);
+
     gtk_widget_show (file_button);
+    gtk_widget_show (rich_animation_button);
 
 }
 /*******************************************************************************/
@@ -415,7 +422,7 @@ lw_theme_settings(GtkWidget *button, Animation_WallpaperPrivate *priv) {
 
             }
 
-            rich_animation_button = g_object_get_data(G_OBJECT(priv->window), "filename_button");
+            rich_animation_button = g_object_get_data(G_OBJECT(priv->window), "rich_animation_button");
             if (rich_animation_button){
                 /* Check rich animation */
                 if (hildon_check_button_get_active (HILDON_CHECK_BUTTON(rich_animation_button)))