* modules/gui/macosx/controls.m: fixed race condition in prev/next commands.
authorGildas Bazin <gbazin@videolan.org>
Tue, 29 Jul 2003 21:14:10 +0000 (21:14 +0000)
committerGildas Bazin <gbazin@videolan.org>
Tue, 29 Jul 2003 21:14:10 +0000 (21:14 +0000)
* modules/gui/wxwindows/wxwindows.cpp: raised the priority of the wxwin interface so it is now the default.
    We also lower the priority if there is no DISPLAY env variable.
* modules/gui/wxwindows/interface.cpp: prev/next buttons are also used to navigate through titles.
* modules/video_output/directx/events.c: use arrow keys for DVD navigation.
* modules/video_output/x11/xcommon.c: page up/down now seek -10/10 secs.
* share/vlc_win32_rc.rc: compilation fix.

modules/gui/macosx/controls.m
modules/gui/wxwindows/interface.cpp
modules/gui/wxwindows/wxwindows.cpp
modules/video_output/directx/events.c
modules/video_output/x11/xcommon.c
share/vlc_win32_rc.rc

index 24b8b03..f8f46d3 100644 (file)
@@ -2,7 +2,7 @@
  * controls.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
  * controls.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: controls.m,v 1.46 2003/07/27 14:10:02 massiot Exp $
+ * $Id: controls.m,v 1.47 2003/07/29 21:14:10 gbazin Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
     }
 
     vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock );
     }
 
     vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock );
+    val.b_bool = VLC_TRUE;
 
 #define p_area p_playlist->p_input->stream.p_selected_area
     if( p_area->i_part > 0 && p_area->i_part_nb > 1)
     {
         vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
 
 #define p_area p_playlist->p_input->stream.p_selected_area
     if( p_area->i_part > 0 && p_area->i_part_nb > 1)
     {
         vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
-        vlc_mutex_unlock( &p_playlist->object_lock );
-        var_Get( p_playlist->p_input, "prev-chapter", &val );
         var_Set( p_playlist->p_input, "prev-chapter", val );
         var_Set( p_playlist->p_input, "prev-chapter", val );
+        vlc_mutex_unlock( &p_playlist->object_lock );
     }
     else if( p_area->i_id > 1 )
     {
         vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
     }
     else if( p_area->i_id > 1 )
     {
         vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
-        vlc_mutex_unlock( &p_playlist->object_lock );
-        var_Get( p_playlist->p_input, "prev-title", &val );
         var_Set( p_playlist->p_input, "prev-title", val );
         var_Set( p_playlist->p_input, "prev-title", val );
+        vlc_mutex_unlock( &p_playlist->object_lock );
     }
     else
     {
     }
     else
     {
     }
 
     vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock );
     }
 
     vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock );
+    val.b_bool = VLC_TRUE;
 
 #define p_area p_playlist->p_input->stream.p_selected_area
 
 #define p_area p_playlist->p_input->stream.p_selected_area
-    if( p_area->i_part < p_area->i_part_nb && p_area->i_part_nb > 1 )
+    if( p_area->i_part < p_area->i_part_nb - 1 && p_area->i_part_nb > 1 )
     {
         vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
     {
         vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
-        vlc_mutex_unlock( &p_playlist->object_lock );
-        var_Get( p_playlist->p_input, "next-chapter", &val );
         var_Set( p_playlist->p_input, "next-chapter", val );
         var_Set( p_playlist->p_input, "next-chapter", val );
+        vlc_mutex_unlock( &p_playlist->object_lock );
     }
     else if( p_area->i_id < p_playlist->p_input->stream.i_area_nb && p_playlist->p_input->stream.i_area_nb > 1 )
     {
         vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
     }
     else if( p_area->i_id < p_playlist->p_input->stream.i_area_nb && p_playlist->p_input->stream.i_area_nb > 1 )
     {
         vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
-        vlc_mutex_unlock( &p_playlist->object_lock );
-        var_Get( p_playlist->p_input, "next-title", &val );
         var_Set( p_playlist->p_input, "next-title", val );
         var_Set( p_playlist->p_input, "next-title", val );
+        vlc_mutex_unlock( &p_playlist->object_lock );
     }
     else
     {
     }
     else
     {
index 0d953a8..ebf7db7 100644 (file)
@@ -2,7 +2,7 @@
  * interface.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
  * interface.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: interface.cpp,v 1.53 2003/07/23 01:13:47 gbazin Exp $
+ * $Id: interface.cpp,v 1.54 2003/07/29 21:14:10 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -743,6 +743,23 @@ void Interface::OnPrevStream( wxCommandEvent& WXUNUSED(event) )
         return;
     }
 
         return;
     }
 
+    vlc_mutex_lock( &p_playlist->object_lock );
+    if( p_playlist->p_input != NULL )
+    {
+        vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock );
+        if( p_playlist->p_input->stream.p_selected_area->i_id > 1 )
+        {
+            vlc_value_t val; val.b_bool = VLC_TRUE;
+            vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
+            var_Set( p_playlist->p_input, "prev-title", val );
+            vlc_mutex_unlock( &p_playlist->object_lock );
+            vlc_object_release( p_playlist );  
+            return;
+        }
+        vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
+    }
+    vlc_mutex_unlock( &p_playlist->object_lock );
+
     playlist_Prev( p_playlist );
     vlc_object_release( p_playlist );
 }
     playlist_Prev( p_playlist );
     vlc_object_release( p_playlist );
 }
@@ -757,6 +774,25 @@ void Interface::OnNextStream( wxCommandEvent& WXUNUSED(event) )
         return;
     }
 
         return;
     }
 
+    vlc_mutex_lock( &p_playlist->object_lock );
+    if( p_playlist->p_input != NULL )
+    {
+        vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock );
+        if( p_playlist->p_input->stream.i_area_nb > 1 &&
+            p_playlist->p_input->stream.p_selected_area->i_id <
+              p_playlist->p_input->stream.i_area_nb - 1 )
+        {
+            vlc_value_t val; val.b_bool = VLC_TRUE;
+            vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
+            var_Set( p_playlist->p_input, "next-title", val );
+            vlc_mutex_unlock( &p_playlist->object_lock );
+            vlc_object_release( p_playlist );  
+            return;
+        }
+        vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
+    }
+    vlc_mutex_unlock( &p_playlist->object_lock );
+
     playlist_Next( p_playlist );
     vlc_object_release( p_playlist );
 }
     playlist_Next( p_playlist );
     vlc_object_release( p_playlist );
 }
index 6827540..1ec8fbc 100644 (file)
@@ -2,7 +2,7 @@
  * wxwindows.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
  * wxwindows.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: wxwindows.cpp,v 1.27 2003/07/25 22:50:12 gbazin Exp $
+ * $Id: wxwindows.cpp,v 1.28 2003/07/29 21:14:10 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -88,8 +88,13 @@ private:
  * Module descriptor
  *****************************************************************************/
 vlc_module_begin();
  * Module descriptor
  *****************************************************************************/
 vlc_module_begin();
+#ifdef WIN32
+    int i_score = 150;
+#else
+    int i_score = getenv( "DISPLAY" ) == NULL ? 15 : 150;
+#endif
     set_description( (char *) _("wxWindows interface module") );
     set_description( (char *) _("wxWindows interface module") );
-    set_capability( "interface", 50 );
+    set_capability( "interface", i_score );
     set_callbacks( Open, Close );
     add_shortcut( "wxwindows" );
     add_shortcut( "wxwin" );
     set_callbacks( Open, Close );
     add_shortcut( "wxwindows" );
     add_shortcut( "wxwin" );
index 707a84e..24985dd 100644 (file)
@@ -2,7 +2,7 @@
  * events.c: Windows DirectX video output events handler
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
  * events.c: Windows DirectX video output events handler
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: events.c,v 1.19 2003/07/25 11:37:22 gbazin Exp $
+ * $Id: events.c,v 1.20 2003/07/29 21:14:10 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -217,20 +217,32 @@ void DirectXEventThread( event_thread_t *p_event )
                 break;
 
             case VK_LEFT:
                 break;
 
             case VK_LEFT:
-                input_Seek( p_event->p_vout, -5,
-                            INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
+                /* input_Seek( p_event->p_vout, -5,
+                   INPUT_SEEK_SECONDS | INPUT_SEEK_CUR ); */
+                val.psz_string = "LEFT";
+                var_Set( p_vout, "key-pressed", val );
                 break;
             case VK_RIGHT:
                 break;
             case VK_RIGHT:
-                input_Seek( p_event->p_vout, 5,
-                            INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
+                /* input_Seek( p_event->p_vout, 5,
+                   INPUT_SEEK_SECONDS | INPUT_SEEK_CUR ); */
+                val.psz_string = "RIGHT";
+                var_Set( p_vout, "key-pressed", val );
                 break;
             case VK_UP:
                 break;
             case VK_UP:
-                input_Seek( p_event->p_vout, 60,
-                            INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
+                /* input_Seek( p_event->p_vout, 60,
+                   INPUT_SEEK_SECONDS | INPUT_SEEK_CUR ); */
+                val.psz_string = "UP";
+                var_Set( p_vout, "key-pressed", val );
                 break;
             case VK_DOWN:
                 break;
             case VK_DOWN:
-                input_Seek( p_event->p_vout, -60,
-                            INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
+                /* input_Seek( p_event->p_vout, -60,
+                   INPUT_SEEK_SECONDS | INPUT_SEEK_CUR ); */
+                val.psz_string = "DOWN";
+                var_Set( p_vout, "key-pressed", val );
+                break;
+            case VK_RETURN:
+                val.psz_string = "ENTER";
+                var_Set( p_vout, "key-pressed", val );
                 break;
             case VK_HOME:
                 input_Seek( p_event->p_vout, 0,
                 break;
             case VK_HOME:
                 input_Seek( p_event->p_vout, 0,
@@ -241,11 +253,11 @@ void DirectXEventThread( event_thread_t *p_event )
                             INPUT_SEEK_BYTES | INPUT_SEEK_END );
                 break;
             case VK_PRIOR:
                             INPUT_SEEK_BYTES | INPUT_SEEK_END );
                 break;
             case VK_PRIOR:
-                input_Seek( p_event->p_vout, 900,
+                input_Seek( p_event->p_vout, 10,
                             INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
                 break;
             case VK_NEXT:
                             INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
                 break;
             case VK_NEXT:
-                input_Seek( p_event->p_vout, -900,
+                input_Seek( p_event->p_vout, -10,
                             INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
                 break;
             case VK_SPACE:
                             INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
                 break;
             case VK_SPACE:
index f4c5524..8c7a360 100644 (file)
@@ -2,7 +2,7 @@
  * xcommon.c: Functions common to the X11 and XVideo plugins
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
  * xcommon.c: Functions common to the X11 and XVideo plugins
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: xcommon.c,v 1.25 2003/07/29 09:32:14 sam Exp $
+ * $Id: xcommon.c,v 1.26 2003/07/29 21:14:10 gbazin Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -583,10 +583,10 @@ static int ManageVideo( vout_thread_t *p_vout )
                 input_Seek( p_vout, 0, INPUT_SEEK_BYTES | INPUT_SEEK_END );
                 break;
             case XK_Page_Up:
                 input_Seek( p_vout, 0, INPUT_SEEK_BYTES | INPUT_SEEK_END );
                 break;
             case XK_Page_Up:
-                input_Seek( p_vout, 5, INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
+                input_Seek( p_vout, 10, INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
                 break;
             case XK_Page_Down:
                 break;
             case XK_Page_Down:
-                input_Seek( p_vout, -5, INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
+                input_Seek( p_vout, -10, INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
                 break;
             case XK_space:
                 input_SetStatus( p_vout, INPUT_STATUS_PAUSE );
                 break;
             case XK_space:
                 input_SetStatus( p_vout, INPUT_STATUS_PAUSE );
index 8f08464..1512b23 100644 (file)
@@ -17,7 +17,7 @@ BEGIN
     BLOCK "040904E4"
     BEGIN
       VALUE "CompanyName", "VideoLAN"
     BLOCK "040904E4"
     BEGIN
       VALUE "CompanyName", "VideoLAN"
-      VALUE "FileVersion", "VERSION"
+      VALUE "FileVersion", "0.6.1"
       VALUE "FileDescription", "VLC media player"
       VALUE "LegalCopyright", "(c) 1996-2003 VideoLAN"
     END
       VALUE "FileDescription", "VLC media player"
       VALUE "LegalCopyright", "(c) 1996-2003 VideoLAN"
     END