Commit 3c0e4d35 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Fix time update and slider movement on PDA interface. Patch from fredyd...

Fix time update and slider movement on PDA interface. Patch from fredyd (http://forum.videolan.org/viewtopic.php?t=19028) modified by me.
parent ac1de0c7
...@@ -418,35 +418,35 @@ static int Manage( intf_thread_t *p_intf ) ...@@ -418,35 +418,35 @@ static int Manage( intf_thread_t *p_intf )
if( p_intf->p_sys->p_input ) if( p_intf->p_sys->p_input )
{ {
input_thread_t *p_input = 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 ); vlc_mutex_lock( &p_input->object_lock );
if( !p_input->b_die ) if( !p_input->b_die )
{ {
{ playlist_t *p_playlist;
playlist_t *p_playlist;
E_(GtkModeManage)( p_intf ); E_(GtkModeManage)( p_intf );
p_intf->p_sys->b_playing = 1; p_intf->p_sys->b_playing = 1;
/* update playlist interface */ /* update playlist interface */
p_playlist = (playlist_t *) vlc_object_find( p_playlist = (playlist_t *) vlc_object_find(
p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
if (p_playlist != NULL) if (p_playlist != NULL)
{ {
p_liststore = gtk_list_store_new (3, p_liststore = gtk_list_store_new (3,
G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_UINT); /* Hidden index */ G_TYPE_UINT); /* Hidden index */
PlaylistRebuildListStore(p_liststore, p_playlist); PlaylistRebuildListStore(p_liststore, p_playlist);
gtk_tree_view_set_model(p_intf->p_sys->p_tvplaylist, (GtkTreeModel*) p_liststore); gtk_tree_view_set_model(p_intf->p_sys->p_tvplaylist, (GtkTreeModel*) p_liststore);
g_object_unref(p_liststore); g_object_unref(p_liststore);
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
}
} }
/* Manage the slider */ /* Manage the slider */
#if 0 i_time = var_GetTime( p_intf->p_sys->p_input, "time" );
#define p_area p_input->p_selected_area i_length = var_GetTime( p_intf->p_sys->p_input, "length" );
if (p_intf->p_libvlc->i_cpu & CPU_CAPABILITY_FPU) if (p_intf->p_libvlc->i_cpu & CPU_CAPABILITY_FPU)
{ {
/* Manage the slider for CPU_CAPABILITY_FPU hardware */ /* Manage the slider for CPU_CAPABILITY_FPU hardware */
...@@ -461,7 +461,7 @@ static int Manage( intf_thread_t *p_intf ) ...@@ -461,7 +461,7 @@ static int Manage( intf_thread_t *p_intf )
/* Update the value */ /* Update the value */
p_intf->p_sys->p_adj->value = p_intf->p_sys->p_adj->value =
p_intf->p_sys->f_adj_oldvalue = 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 ), g_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
"value_changed" ); "value_changed" );
} }
...@@ -495,7 +495,7 @@ static int Manage( intf_thread_t *p_intf ) ...@@ -495,7 +495,7 @@ static int Manage( intf_thread_t *p_intf )
/* Update the value */ /* Update the value */
p_intf->p_sys->p_adj->value = p_intf->p_sys->p_adj->value =
p_intf->p_sys->i_adj_oldvalue = 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 ), g_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
"value_changed" ); "value_changed" );
} }
...@@ -515,8 +515,6 @@ static int Manage( intf_thread_t *p_intf ) ...@@ -515,8 +515,6 @@ static int Manage( intf_thread_t *p_intf )
} }
} }
} }
#undef p_area
#endif
} }
vlc_mutex_unlock( &p_input->object_lock ); vlc_mutex_unlock( &p_input->object_lock );
} }
......
...@@ -349,7 +349,6 @@ gboolean onPDADeleteEvent(GtkWidget *widget, GdkEvent *event, gpointer user_data ...@@ -349,7 +349,6 @@ gboolean onPDADeleteEvent(GtkWidget *widget, GdkEvent *event, gpointer user_data
return TRUE; return TRUE;
} }
void onRewind(GtkButton *button, gpointer user_data) void onRewind(GtkButton *button, gpointer user_data)
{ {
intf_thread_t *p_intf = GtkGetIntf( button ); intf_thread_t *p_intf = GtkGetIntf( button );
...@@ -360,7 +359,6 @@ void onRewind(GtkButton *button, gpointer user_data) ...@@ -360,7 +359,6 @@ void onRewind(GtkButton *button, gpointer user_data)
} }
} }
void onPause(GtkButton *button, gpointer user_data) void onPause(GtkButton *button, gpointer user_data)
{ {
intf_thread_t *p_intf = GtkGetIntf( button ); intf_thread_t *p_intf = GtkGetIntf( button );
...@@ -394,7 +392,6 @@ void onPlay(GtkButton *button, gpointer user_data) ...@@ -394,7 +392,6 @@ void onPlay(GtkButton *button, gpointer user_data)
} }
} }
void onStop(GtkButton *button, gpointer user_data) void onStop(GtkButton *button, gpointer user_data)
{ {
intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET( button ) ); intf_thread_t *p_intf = GtkGetIntf( GTK_WIDGET( button ) );
...@@ -408,7 +405,6 @@ void onStop(GtkButton *button, gpointer user_data) ...@@ -408,7 +405,6 @@ void onStop(GtkButton *button, gpointer user_data)
} }
} }
void onForward(GtkButton *button, gpointer user_data) void onForward(GtkButton *button, gpointer user_data)
{ {
intf_thread_t *p_intf = GtkGetIntf( button ); intf_thread_t *p_intf = GtkGetIntf( button );
...@@ -432,7 +428,6 @@ void onAbout(GtkButton *button, gpointer user_data) ...@@ -432,7 +428,6 @@ void onAbout(GtkButton *button, gpointer user_data)
} }
} }
gboolean SliderRelease(GtkWidget *widget, GdkEventButton *event, gpointer user_data) gboolean SliderRelease(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
{ {
intf_thread_t *p_intf = GtkGetIntf( widget ); intf_thread_t *p_intf = GtkGetIntf( widget );
...@@ -445,7 +440,6 @@ gboolean SliderRelease(GtkWidget *widget, GdkEventButton *event, gpointer user_d ...@@ -445,7 +440,6 @@ gboolean SliderRelease(GtkWidget *widget, GdkEventButton *event, gpointer user_d
return TRUE; return TRUE;
} }
gboolean SliderPress(GtkWidget *widget, GdkEventButton *event, gpointer user_data) gboolean SliderPress(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
{ {
intf_thread_t *p_intf = GtkGetIntf( widget ); intf_thread_t *p_intf = GtkGetIntf( widget );
...@@ -455,7 +449,7 @@ gboolean SliderPress(GtkWidget *widget, GdkEventButton *event, gpointer user_dat ...@@ -455,7 +449,7 @@ gboolean SliderPress(GtkWidget *widget, GdkEventButton *event, gpointer user_dat
p_intf->p_sys->b_slider_free = 0; p_intf->p_sys->b_slider_free = 0;
vlc_mutex_unlock( &p_intf->change_lock ); vlc_mutex_unlock( &p_intf->change_lock );
return TRUE; return FALSE;
} }
void SliderMove(GtkRange *range, GtkScrollType scroll, gpointer user_data) void SliderMove(GtkRange *range, GtkScrollType scroll, gpointer user_data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment