]> git.sesse.net Git - vlc/blob - modules/gui/pda/pda.c
configure: Set the proper werror variable when creating vlc-config.in
[vlc] / modules / gui / pda / pda.c
1 /*****************************************************************************
2  * pda.c : PDA Gtk2 plugin for vlc
3  *****************************************************************************
4  * Copyright (C) 2002 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Jean-Paul Saman <jpsaman  _at_ videolan _dot_ org>
8  *          Marc Ariberti <marcari@videolan.org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 /*****************************************************************************
26  * Preamble
27  *****************************************************************************/
28 #include <errno.h>                                                 /* ENOMEM */
29
30 #ifdef HAVE_CONFIG_H
31 # include "config.h"
32 #endif
33
34 #include <vlc_common.h>
35 #include <vlc_plugin.h>
36 #include <vlc_input.h>
37 #include <vlc_interface.h>
38 #include <vlc_playlist.h>
39
40 #include <gtk/gtk.h>
41
42 #include "pda_callbacks.h"
43 #include "pda_interface.h"
44 #include "pda_support.h"
45 #include "pda.h"
46
47 /*****************************************************************************
48  * Local prototypes.
49  *****************************************************************************/
50 static int  Open         ( vlc_object_t * );
51 static void Close        ( vlc_object_t * );
52 static void Run          ( intf_thread_t * );
53
54 static int Manage        ( intf_thread_t *p_intf );
55 void GtkDisplayDate  ( GtkAdjustment *p_adj, gpointer userdata );
56 gint GtkModeManage   ( intf_thread_t * p_intf );
57
58 /*****************************************************************************
59  * Module descriptor
60  *****************************************************************************/
61 #define AUTOPLAYFILE_TEXT  N_("Autoplay selected file")
62 #define AUTOPLAYFILE_LONGTEXT N_("Automatically play a file when selected in the "\
63         "file selection list")
64
65 /*****************************************************************************
66  * Module descriptor
67  *****************************************************************************/
68 vlc_module_begin ()
69     set_description( N_("PDA Linux Gtk2+ interface") )
70     set_category( CAT_INTERFACE )
71     set_subcategory( SUBCAT_INTERFACE_MAIN )
72     set_capability( "interface", 0 )
73     set_callbacks( Open, Close )
74     add_shortcut( "pda" )
75 vlc_module_end ()
76
77 /*****************************************************************************
78  * Open: initialize and create window
79  *****************************************************************************/
80 static int Open( vlc_object_t *p_this )
81 {
82     intf_thread_t *p_intf = (intf_thread_t *)p_this;
83
84     /* Allocate instance and initialize some members */
85     p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
86     if( p_intf->p_sys == NULL )
87         return VLC_ENOMEM;
88
89 #ifdef NEED_GTK2_MAIN
90     msg_Dbg( p_intf, "Using gui-helper" );
91     p_intf->p_sys->p_gtk_main =
92         module_need( p_this, "gui-helper", "gtk2", true );
93     if( p_intf->p_sys->p_gtk_main == NULL )
94     {
95         free( p_intf->p_sys );
96         return VLC_ENOMOD;
97     }
98 #endif
99
100     /* Initialize Gtk+ thread */
101     p_intf->p_sys->p_input = NULL;
102
103     p_intf->p_sys->b_autoplayfile = 1;
104     p_intf->p_sys->b_playing = 0;
105     p_intf->p_sys->b_slider_free = 1;
106
107     p_intf->pf_run = Run;
108
109     return VLC_SUCCESS;
110 }
111
112 /*****************************************************************************
113  * Close: destroy interface window
114  *****************************************************************************/
115 static void Close( vlc_object_t *p_this )
116 {
117     intf_thread_t *p_intf = (intf_thread_t *)p_this;
118
119     if( p_intf->p_sys->p_input )
120     {
121         vlc_object_release( p_intf->p_sys->p_input );
122     }
123
124 #ifdef NEED_GTK2_MAIN
125     msg_Dbg( p_intf, "Releasing gui-helper" );
126     module_unneed( p_intf, p_intf->p_sys->p_gtk_main );
127 #endif
128
129     /* Destroy structure */
130     free( p_intf->p_sys );
131 }
132
133 /*****************************************************************************
134  * Run: Gtk+ thread
135  *****************************************************************************
136  * this part of the interface is in a separate thread so that we can call
137  * gtk_main() from within it without annoying the rest of the program.
138  *****************************************************************************/
139 static void Run( intf_thread_t *p_intf )
140 {
141 #ifndef NEED_GTK2_MAIN
142     /* gtk_init needs to know the command line. We don't care, so we
143      * give it an empty one */
144     char  *p_args[] = { "", NULL };
145     char **pp_args  = p_args;
146     int    i_args   = 1;
147     int    i_dummy;
148 #endif
149     playlist_t        *p_playlist;
150     GtkCellRenderer   *p_renderer = NULL;
151     GtkTreeViewColumn *p_column   = NULL;
152     GtkListStore      *p_filelist = NULL;
153     GtkListStore      *p_playlist_store = NULL;
154     int canc = vlc_savecancel();
155
156 #ifndef NEED_GTK2_MAIN
157     gtk_set_locale ();
158     msg_Dbg( p_intf, "Starting pda GTK2+ interface" );
159     gtk_init( &i_args, &pp_args );
160 #else
161     /* Initialize Gtk+ */
162     msg_Dbg( p_intf, "Starting pda GTK2+ interface thread" );
163     gdk_threads_enter();
164 #endif
165
166     /* Create some useful widgets that will certainly be used */
167     add_pixmap_directory(config_GetDataDir());
168
169     p_intf->p_sys->p_window = create_pda();
170     if (p_intf->p_sys->p_window == NULL)
171     {
172         msg_Err( p_intf, "unable to create pda interface" );
173     }
174
175     /* Store p_intf to keep an eye on it */
176     gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window),
177                          "p_intf", p_intf );
178
179     /* Set the title of the main window */
180     gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window),
181                           VOUT_TITLE " (PDA Linux interface)");
182
183     /* Get the notebook object */
184     p_intf->p_sys->p_notebook = GTK_NOTEBOOK( gtk_object_get_data(
185         GTK_OBJECT( p_intf->p_sys->p_window ), "notebook" ) );
186
187     /* Get the slider object */
188     p_intf->p_sys->p_slider = (GtkHScale*) lookup_widget( p_intf->p_sys->p_window, "timeSlider" );
189     p_intf->p_sys->p_slider_label = (GtkLabel*) lookup_widget( p_intf->p_sys->p_window, "timeLabel" );
190     if (p_intf->p_sys->p_slider == NULL)
191         msg_Err( p_intf, "Time slider widget not found." );
192     if (p_intf->p_sys->p_slider_label == NULL)
193         msg_Err( p_intf, "Time label widget not found." );
194
195     /* Connect the date display to the slider */
196     p_intf->p_sys->p_adj = gtk_range_get_adjustment( GTK_RANGE(p_intf->p_sys->p_slider) );
197     if (p_intf->p_sys->p_adj == NULL)
198         msg_Err( p_intf, "Adjustment range not found." );
199     g_signal_connect( GTK_OBJECT( p_intf->p_sys->p_adj ), "value_changed",
200                          G_CALLBACK( GtkDisplayDate ), p_intf );
201     p_intf->p_sys->f_adj_oldvalue = 0;
202     p_intf->p_sys->i_adj_oldvalue = 0;
203
204     /* BEGIN OF FILEVIEW GTK_TREE_VIEW */
205     p_intf->p_sys->p_tvfile = NULL;
206     p_intf->p_sys->p_tvfile = (GtkTreeView *) lookup_widget( p_intf->p_sys->p_window,
207                                                              "tvFileList");
208     if (NULL == p_intf->p_sys->p_tvfile)
209        msg_Err(p_intf, "Error obtaining pointer to File List");
210
211     /* Insert columns 0 */
212     p_renderer = gtk_cell_renderer_text_new ();
213     gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 0, (gchar *) N_("Filename"), p_renderer, NULL);
214     p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 0 );
215     gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 0 );
216     gtk_tree_view_column_set_sort_column_id(p_column, 0);
217     /* Insert columns 1 */
218     p_renderer = gtk_cell_renderer_text_new ();
219     gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 1, (gchar *) N_("Permissions"), p_renderer, NULL);
220     p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 1 );
221     gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 1 );
222     gtk_tree_view_column_set_sort_column_id(p_column, 1);
223     /* Insert columns 2 */
224     p_renderer = gtk_cell_renderer_text_new ();
225     gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 2, (gchar *) N_("Size"), p_renderer, NULL);
226     p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 2 );
227     gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 2 );
228     gtk_tree_view_column_set_sort_column_id(p_column, 2);
229     /* Insert columns 3 */
230     p_renderer = gtk_cell_renderer_text_new ();
231     gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 3, (gchar *) N_("Owner"), p_renderer, NULL);
232     p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 3 );
233     gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 3 );
234     gtk_tree_view_column_set_sort_column_id(p_column, 3);
235     /* Insert columns 4 */
236     p_renderer = gtk_cell_renderer_text_new ();
237     gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvfile, 4, (gchar *) N_("Group"), p_renderer, NULL);
238     p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvfile, 4 );
239     gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 4 );
240     gtk_tree_view_column_set_sort_column_id(p_column, 4);
241
242     /* Get new directory listing */
243     p_filelist = gtk_list_store_new (5,
244                 G_TYPE_STRING, /* Filename */
245                 G_TYPE_STRING, /* permissions */
246                 G_TYPE_UINT64, /* File size */
247                 G_TYPE_STRING, /* Owner */
248                 G_TYPE_STRING);/* Group */
249     ReadDirectory(p_intf, p_filelist, (char*)".");
250     gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvfile), GTK_TREE_MODEL(p_filelist));
251     g_object_unref(p_filelist);     /* Model will be released by GtkTreeView */
252     gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(p_intf->p_sys->p_tvfile)),GTK_SELECTION_MULTIPLE);
253
254     /* Column properties */
255     gtk_tree_view_set_headers_visible(p_intf->p_sys->p_tvfile, TRUE);
256     gtk_tree_view_columns_autosize(p_intf->p_sys->p_tvfile);
257     gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(p_intf->p_sys->p_tvfile),TRUE);
258     /* END OF FILEVIEW GTK_TREE_VIEW */
259
260     /* BEGIN OF PLAYLIST GTK_TREE_VIEW */
261     p_intf->p_sys->p_tvplaylist = NULL;
262     p_intf->p_sys->p_tvplaylist = (GtkTreeView *) lookup_widget( p_intf->p_sys->p_window, "tvPlaylist");
263     if (NULL == p_intf->p_sys->p_tvplaylist)
264        msg_Err(p_intf, "Error obtaining pointer to Play List");
265
266     /* Columns 1 */
267     p_renderer = gtk_cell_renderer_text_new ();
268     gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 0, (gchar *) N_("Filename"), p_renderer, NULL);
269     p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 0 );
270     gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 0 );
271     gtk_tree_view_column_set_sort_column_id(p_column, 0);
272     /* Column 2 */
273     p_renderer = gtk_cell_renderer_text_new ();
274     gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 1, (gchar *) N_("Time"), p_renderer, NULL);
275     p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 1 );
276     gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 1 );
277     gtk_tree_view_column_set_sort_column_id(p_column, 1);
278 #if 0
279     /* Column 3 - is a hidden column used for reliable deleting items from the underlying playlist */
280     p_renderer = gtk_cell_renderer_text_new ();
281     gtk_tree_view_insert_column_with_attributes(p_intf->p_sys->p_tvplaylist, 2, (gchar *) N_("Index"), p_renderer, NULL);
282     p_column = gtk_tree_view_get_column(p_intf->p_sys->p_tvplaylist, 2 );
283     gtk_tree_view_column_add_attribute(p_column, p_renderer, "text", 2 );
284     gtk_tree_view_column_set_sort_column_id(p_column, 2);
285 #endif
286     /* update the playlist */
287     p_playlist = pl_Hold( p_intf );
288     p_playlist_store = gtk_list_store_new (3,
289                 G_TYPE_STRING, /* Filename */
290                 G_TYPE_STRING, /* Time */
291                 G_TYPE_UINT);  /* Hidden index */
292     PlaylistRebuildListStore(p_intf,p_playlist_store, p_playlist);
293     gtk_tree_view_set_model(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist), GTK_TREE_MODEL(p_playlist_store));
294     g_object_unref(p_playlist_store);
295     pl_Release( p_intf ); /* Free the playlist */
296     gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(p_intf->p_sys->p_tvplaylist)),GTK_SELECTION_MULTIPLE);
297
298     /* Column properties */
299     gtk_tree_view_set_headers_visible(p_intf->p_sys->p_tvplaylist, TRUE);
300     gtk_tree_view_columns_autosize(p_intf->p_sys->p_tvplaylist);
301     gtk_tree_view_set_headers_clickable(p_intf->p_sys->p_tvplaylist, TRUE);
302     /* END OF PLAYLIST GTK_TREE_VIEW */
303
304     /* Hide the Preference TAB for now. */
305     GtkWidget *p_preference_tab = NULL;
306     p_preference_tab = gtk_notebook_get_nth_page(p_intf->p_sys->p_notebook,5);
307     if (p_preference_tab != NULL)
308       gtk_widget_hide(p_preference_tab);
309
310     /* Show the control window */
311     gtk_widget_show( p_intf->p_sys->p_window );
312
313 #ifdef NEED_GTK2_MAIN
314     msg_Dbg( p_intf, "Manage GTK keyboard events using threads" );
315     while( vlc_object_alive( p_intf ) )
316     {
317         Manage( p_intf );
318
319         /* Sleep to avoid using all CPU - since some interfaces need to
320          * access keyboard events, a 100ms delay is a good compromise */
321         gdk_threads_leave();
322         if (vlc_CPU() & CPU_CAPABILITY_FPU)
323             msleep( INTF_IDLE_SLEEP );
324         else
325             msleep( 1000 );
326         gdk_threads_enter();
327     }
328 #else
329     msg_Dbg( p_intf, "Manage GTK keyboard events using timeouts" );
330     /* Sleep to avoid using all CPU - since some interfaces needs to access
331      * keyboard events, a 1000ms delay is a good compromise */
332     if (vlc_CPU() & CPU_CAPABILITY_FPU)
333         i_dummy = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, (GtkFunction)Manage, p_intf );
334     else
335         i_dummy = gtk_timeout_add( 1000, (GtkFunction)Manage, p_intf );
336
337     /* Enter Gtk mode */
338     gtk_main();
339     /* Remove the timeout */
340     gtk_timeout_remove( i_dummy );
341 #endif
342
343     gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_window) );
344 #ifdef NEED_GTK2_MAIN
345     gdk_threads_leave();
346 #endif
347     vlc_restorecancel(canc);
348 }
349
350 /* following functions are local */
351
352 /*****************************************************************************
353  * Manage: manage main thread messages
354  *****************************************************************************
355  * In this function, called approx. 10 times a second, we check what the
356  * main program wanted to tell us.
357  *****************************************************************************/
358 static int Manage( intf_thread_t *p_intf )
359 {
360     GtkListStore *p_liststore;
361
362     /* Update the input */
363     if( p_intf->p_sys->p_input == NULL )
364     {
365         p_intf->p_sys->p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT,
366                                                           FIND_ANYWHERE );
367     }
368     else if( p_intf->p_sys->p_input->b_dead )
369     {
370         vlc_object_release( p_intf->p_sys->p_input );
371         p_intf->p_sys->p_input = NULL;
372     }
373
374     if( p_intf->p_sys->p_input )
375     {
376         input_thread_t *p_input = p_intf->p_sys->p_input;
377         int64_t i_time = 0, i_length = 0;
378
379         if( vlc_object_alive (p_input) )
380         {
381             playlist_t *p_playlist;
382
383             GtkModeManage( p_intf );
384             p_intf->p_sys->b_playing = 1;
385
386             /* update playlist interface */
387             p_playlist = pl_Hold( p_intf );
388             if (p_playlist != NULL)
389             {
390                 p_liststore = gtk_list_store_new (3,
391                                             G_TYPE_STRING,
392                                             G_TYPE_STRING,
393                                             G_TYPE_UINT);  /* Hidden index */
394                 PlaylistRebuildListStore(p_intf, p_liststore, p_playlist);
395                 gtk_tree_view_set_model(p_intf->p_sys->p_tvplaylist, (GtkTreeModel*) p_liststore);
396                 g_object_unref(p_liststore);
397                 pl_Release( p_intf );
398             }
399
400             /* Manage the slider */
401             i_time = var_GetTime( p_intf->p_sys->p_input, "time" );
402             i_length = var_GetTime( p_intf->p_sys->p_input, "length" );
403
404             if (vlc_CPU() & CPU_CAPABILITY_FPU)
405             {
406                 /* Manage the slider for CPU_CAPABILITY_FPU hardware */
407                 if( p_intf->p_sys->b_playing )
408                 {
409                     float newvalue = p_intf->p_sys->p_adj->value;
410
411                     /* If the user hasn't touched the slider since the last time,
412                      * then the input can safely change it */
413                     if( newvalue == p_intf->p_sys->f_adj_oldvalue )
414                     {
415                         /* Update the value */
416                         p_intf->p_sys->p_adj->value =
417                         p_intf->p_sys->f_adj_oldvalue =
418                             ( 100 * i_time ) / i_length;
419                         g_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
420                                                  "value_changed" );
421                     }
422                     /* Otherwise, send message to the input if the user has
423                      * finished dragging the slider */
424                     else if( p_intf->p_sys->b_slider_free )
425                     {
426                         double f_pos = (double)newvalue / 100.0;
427
428                         /* release the lock to be able to seek */
429                         var_SetFloat( p_input, "position", f_pos );
430
431                         /* Update the old value */
432                         p_intf->p_sys->f_adj_oldvalue = newvalue;
433                     }
434                 }
435             }
436             else
437             {
438                 /* Manage the slider without CPU_CAPABILITY_FPU hardware */
439                 if( p_intf->p_sys->b_playing )
440                 {
441                     off_t newvalue = p_intf->p_sys->p_adj->value;
442
443                     /* If the user hasn't touched the slider since the last time,
444                      * then the input can safely change it */
445                     if( newvalue == p_intf->p_sys->i_adj_oldvalue )
446                     {
447                         /* Update the value */
448                         p_intf->p_sys->p_adj->value =
449                         p_intf->p_sys->i_adj_oldvalue =
450                             ( 100 * i_time ) / i_length;
451                         g_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
452                                                  "value_changed" );
453                     }
454                     /* Otherwise, send message to the input if the user has
455                      * finished dragging the slider */
456                     else if( p_intf->p_sys->b_slider_free )
457                     {
458                         double f_pos = (double)newvalue / 100.0;
459
460                         /* release the lock to be able to seek */
461                         var_SetFloat( p_input, "position", f_pos );
462
463                         /* Update the old value */
464                         p_intf->p_sys->i_adj_oldvalue = newvalue;
465                     }
466                 }
467             }
468         }
469     }
470     else if( p_intf->p_sys->b_playing && vlc_object_alive( p_intf ) )
471     {
472         GtkModeManage( p_intf );
473         p_intf->p_sys->b_playing = 0;
474     }
475
476 #ifndef NEED_GTK2_MAIN
477     if( !vlc_object_alive( p_intf ) )
478     {
479         /* Prepare to die, young Skywalker */
480         gtk_main_quit();
481
482         return FALSE;
483     }
484 #endif
485
486     return TRUE;
487 }
488
489 /*****************************************************************************
490  * GtkDisplayDate: display stream date
491  *****************************************************************************
492  * This function displays the current date related to the position in
493  * the stream. It is called whenever the slider changes its value.
494  * The lock has to be taken before you call the function.
495  *****************************************************************************/
496 void GtkDisplayDate( GtkAdjustment *p_adj, gpointer userdata )
497 {
498     (void)p_adj;
499
500     intf_thread_t *p_intf;
501
502     p_intf = (intf_thread_t*) userdata;
503     if (p_intf == NULL)
504         return;
505
506     if( p_intf->p_sys->p_input )
507     {
508         char psz_time[ MSTRTIME_MAX_SIZE ];
509         int64_t i_seconds;
510
511         i_seconds = var_GetTime( p_intf->p_sys->p_input, "time" ) / INT64_C(1000000 );
512         secstotimestr( psz_time, i_seconds );
513
514         gtk_label_set_text( GTK_LABEL( p_intf->p_sys->p_slider_label ),
515                             psz_time );
516      }
517 }
518
519 /*****************************************************************************
520  * GtkModeManage: actualize the aspect of the interface whenever the input
521  *                changes.
522  *****************************************************************************
523  * The lock has to be taken before you call the function.
524  *****************************************************************************/
525 gint GtkModeManage( intf_thread_t * p_intf )
526 {
527     GtkWidget *     p_slider = NULL;
528     bool      b_control;
529
530     if ( p_intf->p_sys->p_window == NULL )
531         msg_Err( p_intf, "Main widget not found" );
532
533     p_slider = lookup_widget( p_intf->p_sys->p_window, "timeSlider");
534     if (p_slider == NULL)
535         msg_Err( p_intf, "Slider widget not found" );
536
537     /* controls unavailable */
538     b_control = 0;
539
540     /* show the box related to current input mode */
541     if( p_intf->p_sys->p_input )
542     {
543         /* initialize and show slider for seekable streams */
544         {
545             gtk_widget_show( GTK_WIDGET( p_slider ) );
546         }
547
548         /* control buttons for free pace streams */
549         b_control = var_GetBool( p_intf->p_sys->p_input, "can-rate" );
550
551         msg_Dbg( p_intf, "stream has changed, refreshing interface" );
552     }
553
554     /* set control items */
555     gtk_widget_set_sensitive( lookup_widget( p_intf->p_sys->p_window, "tbRewind"), b_control );
556     gtk_widget_set_sensitive( lookup_widget( p_intf->p_sys->p_window, "tbPause"), b_control );
557     gtk_widget_set_sensitive( lookup_widget( p_intf->p_sys->p_window, "tbForward"), b_control );
558     return TRUE;
559 }