[Xfce4-commits] <parole:master> Corrected functionality of previous and next buttons.

Sean Davis noreply at xfce.org
Mon Jul 23 01:24:37 CEST 2012


Updating branch refs/heads/master
         to c1e8e2234d9b58d1308364de5d7f89fa1ef9145c (commit)
       from 4b2fb26cc04bc9c454563b5f68d6c0647c363336 (commit)

commit c1e8e2234d9b58d1308364de5d7f89fa1ef9145c
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Fri Jul 13 16:00:14 2012 -0400

    Corrected functionality of previous and next buttons.

 data/interfaces/parole.ui |    5 +++--
 src/parole-player.c       |   43 +++++++++++++++++--------------------------
 2 files changed, 20 insertions(+), 28 deletions(-)

diff --git a/data/interfaces/parole.ui b/data/interfaces/parole.ui
index 1921679..5297019 100644
--- a/data/interfaces/parole.ui
+++ b/data/interfaces/parole.ui
@@ -712,7 +712,7 @@
                                                             <property name="image">image6</property>
                                                             <property name="relief">none</property>
                                                             <property name="focus_on_click">False</property>
-                                                            <signal name="clicked" handler="parole_player_seekb_cb" swapped="no"/>
+                                                            <signal name="clicked" handler="parole_player_back_cb" swapped="no"/>
                                                           </object>
                                                           <packing>
                                                             <property name="expand">False</property>
@@ -748,7 +748,7 @@
                                                             <property name="image">image9</property>
                                                             <property name="relief">none</property>
                                                             <property name="focus_on_click">False</property>
-                                                            <signal name="clicked" handler="parole_player_seekf_cb" swapped="no"/>
+                                                            <signal name="clicked" handler="parole_player_forward_cb" swapped="no"/>
                                                           </object>
                                                           <packing>
                                                             <property name="expand">False</property>
@@ -786,6 +786,7 @@
                                                             </object>
                                                             <packing>
                                                             <property name="expand">True</property>
+                                                            <property name="fill">True</property>
                                                             <property name="position">1</property>
                                                             </packing>
                                                             </child>
diff --git a/src/parole-player.c b/src/parole-player.c
index 9b80fee..7644055 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -51,6 +51,7 @@
 #include "parole-gst.h"
 #include "parole-dbus.h"
 #include "parole-mediachooser.h"
+#include "parole-medialist.h"
 #include "parole-filters.h"
 #include "parole-disc.h"
 #include "parole-disc-menu.h"
@@ -128,10 +129,10 @@ void            parole_player_play_pause_clicked        (GtkButton *button,
 void            parole_player_stop_clicked              (GtkButton *button, 
 							 ParolePlayer *player);
 
-void            parole_player_seekf_cb                  (GtkButton *button, 
+void            parole_player_forward_cb                  (GtkButton *button, 
 							 ParolePlayer *player);
 							 
-void            parole_player_seekb_cb                  (GtkButton *button, 
+void            parole_player_back_cb                  (GtkButton *button, 
 							 ParolePlayer *player);
 
 gboolean        parole_player_scroll_event_cb		(GtkWidget *widget,
@@ -936,26 +937,16 @@ parole_player_get_seek_value (ParolePlayer *player)
     return val;
 }
 
-void parole_player_seekf_cb (GtkButton *button, ParolePlayer *player)
+void parole_player_forward_cb (GtkButton *button, ParolePlayer *player)
 {
-    gdouble seek;
-    
-    seek =  parole_gst_get_stream_position (PAROLE_GST (player->priv->gst) )
-	    +
-	    parole_player_get_seek_value (player);
-	    
-    parole_gst_seek (PAROLE_GST (player->priv->gst), seek);
+	if ( !parole_disc_menu_seek_next (player->priv->disc_menu))
+	parole_player_play_next (player, FALSE);
 }
 							 
-void parole_player_seekb_cb (GtkButton *button, ParolePlayer *player)
+void parole_player_back_cb (GtkButton *button, ParolePlayer *player)
 {
-    gdouble seek;
-    
-    seek =  parole_gst_get_stream_position (PAROLE_GST (player->priv->gst) )
-	    -
-	    parole_player_get_seek_value (player);
-	    
-    parole_gst_seek (PAROLE_GST (player->priv->gst), seek);
+	if ( !parole_disc_menu_seek_prev (player->priv->disc_menu))
+	parole_player_play_prev (player);
 }
 
 gboolean parole_player_scroll_event_cb (GtkWidget *widget, GdkEventScroll *ev, ParolePlayer *player)
@@ -964,12 +955,12 @@ gboolean parole_player_scroll_event_cb (GtkWidget *widget, GdkEventScroll *ev, P
     
     if ( ev->direction == GDK_SCROLL_UP )
     {
-	parole_player_seekf_cb (NULL, player);
+	parole_player_forward_cb (NULL, player);
         ret_val = TRUE;
     }
     else if ( ev->direction == GDK_SCROLL_DOWN )
     {
-	parole_player_seekb_cb (NULL, player);
+	parole_player_back_cb (NULL, player);
         ret_val = TRUE;
     }
 
@@ -1224,7 +1215,7 @@ parole_player_show_menu (ParolePlayer *player, guint button, guint activate_time
     gtk_widget_set_sensitive (mi, (player->priv->state >= PAROLE_STATE_PAUSED));
     gtk_widget_show (mi);
     g_signal_connect (mi, "activate",
-		      G_CALLBACK (parole_player_seekf_cb), player);
+		      G_CALLBACK (parole_player_forward_cb), player);
     gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
     
     /*
@@ -1235,7 +1226,7 @@ parole_player_show_menu (ParolePlayer *player, guint button, guint activate_time
     gtk_widget_set_sensitive (mi, (player->priv->state >= PAROLE_STATE_PAUSED));
     gtk_widget_show (mi);
     g_signal_connect (mi, "activate",
-		      G_CALLBACK (parole_player_seekb_cb), player);
+		      G_CALLBACK (parole_player_back_cb), player);
     gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
     
     /*
@@ -1591,12 +1582,12 @@ parole_player_handle_key_press (GdkEventKey *ev, ParolePlayer *player)
 	case GDK_Right:
 	    /* Media seekable ?*/
 	    if ( GTK_WIDGET_SENSITIVE (player->priv->range) )
-		parole_player_seekf_cb (NULL, player);
+		parole_player_forward_cb (NULL, player);
 	    ret_val = TRUE;
 	    break;
 	case GDK_Left:
 	    if ( GTK_WIDGET_SENSITIVE (player->priv->range) )
-		parole_player_seekb_cb (NULL, player);
+		parole_player_back_cb (NULL, player);
 	    ret_val = TRUE;
 	    break;
 	case GDK_s:
@@ -2200,14 +2191,14 @@ static gboolean	parole_player_dbus_prev_track (ParolePlayer *player,
 static gboolean	parole_player_dbus_seek_forward (ParolePlayer *player,
 					         GError *error)
 {
-    parole_player_seekf_cb (NULL, player);
+    parole_player_forward_cb (NULL, player);
     return TRUE;
 }
 
 static gboolean	parole_player_dbus_seek_backward (ParolePlayer *player,
 					          GError *error)
 {
-    parole_player_seekb_cb (NULL, player);
+    parole_player_back_cb (NULL, player);
     return TRUE;
 }
 					 


More information about the Xfce4-commits mailing list