]> git.sesse.net Git - vlc/blobdiff - modules/gui/gtk/gtk.c
* include/configuration.h: added a new flag to the configuration stucture to
[vlc] / modules / gui / gtk / gtk.c
index ee46858047203de20f7ef820817398941d20a427..3e141baea88ebdd7502ed7b8c84f25f133158d22 100644 (file)
@@ -2,7 +2,7 @@
  * gtk.c : Gtk+ plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: gtk.c,v 1.11 2003/01/20 20:07:06 fenrir Exp $
+ * $Id: gtk.c,v 1.16 2003/02/20 01:52:46 sigmunau Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -68,11 +68,11 @@ vlc_module_begin();
 #else
     int i = getenv( "DISPLAY" ) == NULL ? 10 : 90;
 #endif
-    add_category_hint( N_("Gtk+"), NULL );
+    add_category_hint( N_("Gtk+"), NULL, VLC_FALSE );
     add_bool( "gtk-tooltips", 1, E_(GtkHideTooltips),
-              TOOLTIPS_TEXT, TOOLTIPS_LONGTEXT );
+              TOOLTIPS_TEXT, TOOLTIPS_LONGTEXT, VLC_FALSE );
     add_integer( "gtk-prefs-maxh", 480, NULL,
-                 PREFS_MAXH_TEXT, PREFS_MAXH_LONGTEXT );
+                 PREFS_MAXH_TEXT, PREFS_MAXH_LONGTEXT, VLC_TRUE );
 
     set_description( _("Gtk+ interface module") );
     set_capability( "interface", i );
@@ -110,28 +110,28 @@ static int Open( vlc_object_t *p_this )
     p_intf->p_sys->p_sub = msg_Subscribe( p_intf );
 
     /* Initialize Gtk+ thread */
-    p_intf->p_sys->b_playing = 0;
-    p_intf->p_sys->b_deinterlace_update = 0;
+    p_intf->p_sys->b_playing = VLC_FALSE;
+    p_intf->p_sys->b_deinterlace_update = VLC_FALSE;
 
-    p_intf->p_sys->b_aout_update = 0;
-    p_intf->p_sys->b_vout_update = 0;
+    p_intf->p_sys->b_aout_update = VLC_FALSE;
+    p_intf->p_sys->b_vout_update = VLC_FALSE;
 
-    p_intf->p_sys->b_popup_changed = 0;
-    p_intf->p_sys->b_window_changed = 0;
-    p_intf->p_sys->b_playlist_changed = 0;
-    p_intf->p_sys->b_program_update = 0;
-    p_intf->p_sys->b_title_update = 0;
-    p_intf->p_sys->b_chapter_update = 0;
-    p_intf->p_sys->b_spu_update = 0;
-    p_intf->p_sys->b_audio_update = 0;
+    p_intf->p_sys->b_popup_changed = VLC_FALSE;
+    p_intf->p_sys->b_window_changed = VLC_FALSE;
+    p_intf->p_sys->b_playlist_changed = VLC_FALSE;
+    p_intf->p_sys->b_program_update = VLC_FALSE;
+    p_intf->p_sys->b_title_update = VLC_FALSE;
+    p_intf->p_sys->b_chapter_update = VLC_FALSE;
+    p_intf->p_sys->b_spu_update = VLC_FALSE;
+    p_intf->p_sys->b_audio_update = VLC_FALSE;
 
     p_intf->p_sys->p_input = NULL;
     p_intf->p_sys->i_playing = -1;
-    p_intf->p_sys->b_slider_free = 1;
+    p_intf->p_sys->b_slider_free = VLC_TRUE;
 
     p_intf->p_sys->i_part = 0;
+    p_intf->p_sys->b_mute = VLC_FALSE;
 
-    p_intf->p_sys->b_mute = 0;
     return VLC_SUCCESS;
 }
 
@@ -172,6 +172,8 @@ static void Run( intf_thread_t *p_intf )
         { "text/uri-list", 0, DROP_ACCEPT_TEXT_URI_LIST },
         { "text/plain", 0, DROP_ACCEPT_TEXT_PLAIN }
     };
+    char *psz_sout;
+    GString *       p_target;
 
 #ifdef NEED_GTK_MAIN
     gdk_threads_enter();
@@ -192,6 +194,7 @@ static void Run( intf_thread_t *p_intf )
     p_intf->p_sys->p_playwin = create_intf_playlist();
     p_intf->p_sys->p_messages = create_intf_messages();
     p_intf->p_sys->p_tooltips = gtk_tooltips_new();
+    p_intf->p_sys->p_sout = create_intf_sout();
 
     /* Set the title of the main window */
     gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window),
@@ -235,6 +238,8 @@ static void Run( intf_thread_t *p_intf )
     p_intf->p_sys->f_adj_oldvalue = 0;
 #undef P_SLIDER
 
+
+
     /* We don't create these ones yet because we perhaps won't need them */
     p_intf->p_sys->p_about = NULL;
     p_intf->p_sys->p_modules = NULL;
@@ -253,6 +258,12 @@ static void Run( intf_thread_t *p_intf )
 
     gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_popup),
                          "p_intf", p_intf );
+    gtk_object_set_data( GTK_OBJECT( gtk_object_get_data(
+                             GTK_OBJECT(p_intf->p_sys->p_popup),
+                             "popup_audio" ) ), "p_intf", p_intf );
+    gtk_object_set_data( GTK_OBJECT( gtk_object_get_data(
+                             GTK_OBJECT(p_intf->p_sys->p_popup),
+                             "popup_video" ) ), "p_intf", p_intf );
 
     gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playwin ),
                          "p_intf", p_intf );
@@ -262,6 +273,22 @@ static void Run( intf_thread_t *p_intf )
 
     gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_adj),
                          "p_intf", p_intf );
+    gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_sout ),
+                         "p_intf", p_intf );
+
+    psz_sout = config_GetPsz( p_intf, "sout" );
+    p_target = g_string_new( psz_sout ? psz_sout : "" );
+    if( psz_sout ) free( psz_sout );
+
+    gtk_entry_set_text( gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_sout ), "sout_entry_target" ), p_target->str );
+    g_string_free( p_target, TRUE );
+
+    /* FIXME it's to be sure that only file entry is selected */
+    gtk_toggle_button_set_active(  gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_sout ),
+                                   "sout_access_udp" ), TRUE );
+
+    gtk_toggle_button_set_active(  gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_sout ),
+                                   "sout_access_file" ), TRUE );
 
     /* Show the control window */
     gtk_widget_show( p_intf->p_sys->p_window );
@@ -425,8 +452,10 @@ static int Manage( intf_thread_t *p_intf )
                                              "value_changed" );
                 }
                 /* Otherwise, send message to the input if the user has
-                 * finished dragging the slider */
-                else if( p_intf->p_sys->b_slider_free )
+                 * finished dragging the slider.
+                 * Beware, the hack below is needed by the dvdplay plugin! */
+                else if( p_intf->p_sys->b_slider_free
+                /* hack -> */ && (p_intf->p_sys->f_adj_oldvalue <= 100.) )
                 {
                     off_t i_seek = ( newvalue * p_area->i_size ) / 100;