]> git.sesse.net Git - vlc/commitdiff
Fix time update and slider movement on PDA interface. Patch from fredyd (http://forum...
authorJean-Paul Saman <jpsaman@videolan.org>
Tue, 4 Apr 2006 20:11:39 +0000 (20:11 +0000)
committerJean-Paul Saman <jpsaman@videolan.org>
Tue, 4 Apr 2006 20:11:39 +0000 (20:11 +0000)
modules/gui/pda/pda.c
modules/gui/pda/pda_callbacks.c

index 6182caa8ceb2e8394ff44d046d68023edaf48d90..fe42eeb4fcf606ac27373ea80ab644833fb6122a 100644 (file)
@@ -418,35 +418,35 @@ static int Manage( intf_thread_t *p_intf )
     if( p_intf->p_sys->p_input )
     {
         input_thread_t *p_input = p_intf->p_sys->p_input;
+        int64_t i_time = 0, i_length = 0;
 
         vlc_mutex_lock( &p_input->object_lock );
         if( !p_input->b_die )
         {
-            {
-                playlist_t *p_playlist;
+            playlist_t *p_playlist;
 
-                E_(GtkModeManage)( p_intf );
-                p_intf->p_sys->b_playing = 1;
+            E_(GtkModeManage)( p_intf );
+            p_intf->p_sys->b_playing = 1;
 
-                /* update playlist interface */
-                p_playlist = (playlist_t *) vlc_object_find(
-                        p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
-                if (p_playlist != NULL)
-                {
-                    p_liststore = gtk_list_store_new (3,
-                                               G_TYPE_STRING,
-                                               G_TYPE_STRING,
-                                               G_TYPE_UINT);  /* Hidden index */
-                    PlaylistRebuildListStore(p_liststore, p_playlist);
-                    gtk_tree_view_set_model(p_intf->p_sys->p_tvplaylist, (GtkTreeModel*) p_liststore);
-                    g_object_unref(p_liststore);
-                    vlc_object_release( p_playlist );
-                }
+            /* update playlist interface */
+            p_playlist = (playlist_t *) vlc_object_find(
+                    p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+            if (p_playlist != NULL)
+            {
+                p_liststore = gtk_list_store_new (3,
+                                            G_TYPE_STRING,
+                                            G_TYPE_STRING,
+                                            G_TYPE_UINT);  /* Hidden index */
+                PlaylistRebuildListStore(p_liststore, p_playlist);
+                gtk_tree_view_set_model(p_intf->p_sys->p_tvplaylist, (GtkTreeModel*) p_liststore);
+                g_object_unref(p_liststore);
+                vlc_object_release( p_playlist );
             }
 
             /* Manage the slider */
-#if 0
-#define p_area p_input->p_selected_area
+            i_time = var_GetTime( p_intf->p_sys->p_input, "time" );
+            i_length = var_GetTime( p_intf->p_sys->p_input, "length" );
+
             if (p_intf->p_libvlc->i_cpu & CPU_CAPABILITY_FPU)
             {
                 /* Manage the slider for CPU_CAPABILITY_FPU hardware */
@@ -461,7 +461,7 @@ static int Manage( intf_thread_t *p_intf )
                         /* Update the value */
                         p_intf->p_sys->p_adj->value =
                         p_intf->p_sys->f_adj_oldvalue =
-                            ( 100. * p_area->i_tell ) / p_area->i_size;
+                            ( 100 * i_time ) / i_length;
                         g_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
                                                  "value_changed" );
                     }
@@ -495,7 +495,7 @@ static int Manage( intf_thread_t *p_intf )
                         /* Update the value */
                         p_intf->p_sys->p_adj->value =
                         p_intf->p_sys->i_adj_oldvalue =
-                            ( 100 * p_area->i_tell ) / p_area->i_size;
+                            ( 100 * i_time ) / i_length;
                         g_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
                                                  "value_changed" );
                     }
@@ -515,8 +515,6 @@ static int Manage( intf_thread_t *p_intf )
                     }
                 }
             }
-#undef p_area
-#endif
         }
         vlc_mutex_unlock( &p_input->object_lock );
     }
index ed903b3dd69a469db4bbd3c0a6d4cae41f0e4904..f3bdf14ed58713285504e4f7da48c4f0e0738d46 100644 (file)
@@ -349,7 +349,6 @@ gboolean onPDADeleteEvent(GtkWidget *widget, GdkEvent *event, gpointer user_data
     return TRUE;
 }
 
-
 void onRewind(GtkButton *button, gpointer user_data)
 {
     intf_thread_t *p_intf = GtkGetIntf( button );
@@ -360,7 +359,6 @@ void onRewind(GtkButton *button, gpointer user_data)
     }
 }
 
-
 void onPause(GtkButton *button, gpointer user_data)
 {
     intf_thread_t *p_intf = GtkGetIntf( button );
@@ -394,7 +392,6 @@ void onPlay(GtkButton *button, gpointer user_data)
     }
 }
 
-
 void onStop(GtkButton *button, gpointer user_data)
 {
     intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET( button ) );
@@ -408,7 +405,6 @@ void onStop(GtkButton *button, gpointer user_data)
     }
 }
 
-
 void onForward(GtkButton *button, gpointer user_data)
 {
     intf_thread_t *p_intf = GtkGetIntf( button );
@@ -432,7 +428,6 @@ void onAbout(GtkButton *button, gpointer user_data)
     }
 }
 
-
 gboolean SliderRelease(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
 {
     intf_thread_t *p_intf = GtkGetIntf( widget );
@@ -445,7 +440,6 @@ gboolean SliderRelease(GtkWidget *widget, GdkEventButton *event, gpointer user_d
     return TRUE;
 }
 
-
 gboolean SliderPress(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
 {
     intf_thread_t *p_intf = GtkGetIntf( widget );
@@ -455,7 +449,7 @@ gboolean SliderPress(GtkWidget *widget, GdkEventButton *event, gpointer user_dat
     p_intf->p_sys->b_slider_free = 0;
     vlc_mutex_unlock( &p_intf->change_lock );
 
-    return TRUE;
+    return FALSE;
 }
 
 void SliderMove(GtkRange *range, GtkScrollType scroll, gpointer user_data)