]> git.sesse.net Git - vlc/blobdiff - plugins/gnome/gnome_callbacks.c
* Mandatory step for video output IV and the audio output quality
[vlc] / plugins / gnome / gnome_callbacks.c
index d0ae746fc5d81d0cc2454acff8d5e4cc28d8cd1a..e3f6a635bb0e6c485262136cf38ff75ef67e551a 100644 (file)
@@ -2,7 +2,7 @@
  * gnome_callbacks.c : Callbacks for the Gnome plugin.
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: gnome_callbacks.c,v 1.23 2001/04/20 05:40:03 stef Exp $
+ * $Id: gnome_callbacks.c,v 1.25 2001/05/01 04:18:18 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -408,6 +408,25 @@ on_menubar_chapter_toggle              (GtkCheckMenuItem     *menuitem,
 
 }
 
+
+void
+on_menubar_angle_toggle                (GtkCheckMenuItem     *menuitem,
+                                        gpointer             user_data)
+{
+    intf_thread_t * p_intf    = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
+    input_area_t *  p_area    = p_intf->p_input->stream.p_selected_area;
+    gint            i_angle   = (gint)user_data;
+
+    if( menuitem->active && !p_intf->p_sys->b_angle_update )
+    {
+        p_area->i_angle = i_angle;
+        p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
+
+        p_intf->p_sys->b_angle_update = 1;
+    }
+}
+
+
 void
 on_menubar_modules_activate            (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
@@ -745,6 +764,24 @@ on_popup_navigation_toggle             (GtkCheckMenuItem     *menuitem,
 }
 
 
+void
+on_popup_angle_toggle                  (GtkCheckMenuItem     *menuitem,
+                                        gpointer             user_data)
+{
+    intf_thread_t * p_intf    = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
+    input_area_t *  p_area    = p_intf->p_input->stream.p_selected_area;
+    gint            i_angle   = (gint)user_data;
+
+    if( menuitem->active && !p_intf->p_sys->b_angle_update )
+    {
+        p_area->i_angle = i_angle;
+        p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
+
+        p_intf->p_sys->b_angle_update = 1;
+    }
+}
+
+
 void
 on_popup_open_activate                 (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
@@ -846,11 +883,10 @@ on_fileopen_ok_clicked                 (GtkButton       *button,
     intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, (char*)filename );
 
     /* Select added item and switch to file interface */
-    intf_PlaylistJumpto( p_main->p_playlist, p_main->p_playlist->i_size-2 );
     if( p_intf->p_input != NULL )
         p_intf->p_input->b_eof = 1;
-    p_intf->p_sys->i_intf_mode = FILE_MODE;
-    p_intf->p_sys->b_mode_changed = 1;
+
+//    p_intf->p_sys->b_mode_changed = 1;
 }
 
 
@@ -975,7 +1011,8 @@ on_disc_ok_clicked                     (GtkButton       *button,
                                          GTK_WIDGET(button), "disc_name" ) ) );
 
     /* "dvd:foo" has size 5 + strlen(foo) */
-    psz_source = malloc( 5 + strlen( psz_device ) );
+    psz_source = malloc( 3 /* "dvd" */ + 1 /* ":" */
+                           + strlen( psz_device ) + 1 /* "\0" */ );
     if( psz_source == NULL )
     {
         return;
@@ -1018,7 +1055,7 @@ on_disc_ok_clicked                     (GtkButton       *button,
     intf_PlaylistJumpto( p_main->p_playlist, p_main->p_playlist->i_size-2 );
     if( p_intf->p_input != NULL )
         p_intf->p_input->b_eof = 1;
-    p_intf->p_sys->b_mode_changed = 1;
+//    p_intf->p_sys->b_mode_changed = 1;
 
     gtk_widget_hide( p_intf->p_sys->p_disc );
 }
@@ -1074,7 +1111,9 @@ on_network_ok_clicked                  (GtkButton       *button,
     }
 
     /* Allocate room for "protocol://server:port" */
-    psz_source = malloc( strlen( psz_protocol ) + strlen( psz_server ) + 10 );
+    psz_source = malloc( strlen( psz_protocol ) + 3 /* "://" */
+                           + strlen( psz_server ) + 1 /* ":" */
+                           + 5 /* 0-65535 */ + 1 /* "\0" */ );
     if( psz_source == NULL )
     {
         return;
@@ -1089,8 +1128,7 @@ on_network_ok_clicked                  (GtkButton       *button,
     intf_PlaylistJumpto( p_main->p_playlist, p_main->p_playlist->i_size-2 );
     if( p_intf->p_input != NULL )
         p_intf->p_input->b_eof = 1;
-    p_intf->p_sys->b_mode_changed = 1;
-    p_intf->p_sys->i_intf_mode = NET_MODE;
+//    p_intf->p_sys->b_mode_changed = 1;
 
     gtk_widget_hide( p_intf->p_sys->p_network );
 }