]> git.sesse.net Git - vlc/commitdiff
* modules/gui/wxwindows/preferences.cpp: fixes some alignment issues in the config...
authorGildas Bazin <gbazin@videolan.org>
Fri, 17 Oct 2003 16:40:09 +0000 (16:40 +0000)
committerGildas Bazin <gbazin@videolan.org>
Fri, 17 Oct 2003 16:40:09 +0000 (16:40 +0000)
* modules/gui/skins/src/*: use (AOUT_VOLUME_DEFAULT * 2) as max volume.
* modules/video_output/directx/*: use inheritance for the direct-always-on-top object var.
   Added Ctrl+left/right arrows as shortcuts for seeking in 1 min chunks.
* modules/mux/mp4.c: fixed the audio/video sync.

modules/gui/skins/src/event.cpp
modules/gui/skins/src/skin_main.cpp
modules/gui/skins/src/theme.cpp
modules/gui/skins/src/vlcproc.cpp
modules/gui/wxwindows/preferences.cpp
modules/mux/mp4.c
modules/video_output/directx/directx.c
modules/video_output/directx/events.c

index 1831e8560e8a94eb400a27c46f8d89358681875c..e77a512e9c71af047ffb45380c2f9c3ba2eaffa9 100644 (file)
@@ -2,7 +2,7 @@
  * event.cpp: Event class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: event.cpp,v 1.21 2003/09/05 15:55:30 asmax Exp $
+ * $Id: event.cpp,v 1.22 2003/10/17 16:40:09 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -271,7 +271,7 @@ void Event::CreateEvent()
             else if( strcmp( para1, "SET" ) == 0 )
             {
                 Param1 = VLC_VOLUME_SET;
-                Param2 = atoi( para2 ) * AOUT_VOLUME_MAX / 100;
+                Param2 = atoi( para2 ) * (AOUT_VOLUME_MAX * 2) / 100;
             }
             break;
 
index 2a885e1c436611e41a223dc7e0588d83cd586385..7784dcc74d709f64bd9c5c6368ee5a3e3fc4f9ca 100644 (file)
@@ -2,7 +2,7 @@
  * skin-main.cpp: skins plugin for VLC
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: skin_main.cpp,v 1.49 2003/10/15 12:24:14 gbazin Exp $
+ * $Id: skin_main.cpp,v 1.50 2003/10/17 16:40:09 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -358,7 +358,7 @@ int SkinManage( intf_thread_t *p_intf )
         OSAPI_PostMessage( NULL, CTRL_SET_SLIDER,
             (unsigned int)
             p_intf->p_sys->p_theme->EvtBank->Get( "volume_refresh" ),
-            (long)( volume * SLIDER_RANGE / AOUT_VOLUME_MAX ) );
+            (long)( volume * SLIDER_RANGE / (AOUT_VOLUME_DEFAULT * 2) ) );
 
         // Refresh slider
         // if( p_input->stream.b_seekable && p_intf->p_sys->b_playing )
index 33a9e41051b1233d950a2b253cd9b3439b4a2703..6d4e04d6dc421e3140c482b0aded07612b1f159f 100644 (file)
@@ -2,7 +2,7 @@
  * theme.cpp: Theme class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: theme.cpp,v 1.16 2003/06/22 12:46:49 asmax Exp $
+ * $Id: theme.cpp,v 1.17 2003/10/17 16:40:09 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -115,7 +115,7 @@ void Theme::CreateSystemMenu()
 {
     AddSystemMenu( "Open file...", EvtBank->Get( "open" ) );
     AddSystemMenu( "Change skin...", EvtBank->Get( "load_skin" ) );
-    AddSystemMenu( "Preferences...", NULL );
+    AddSystemMenu( "Preferences...", EvtBank->Get( "show_prefs" ) );
     AddSystemMenu( "SEPARATOR", 0 );
     AddSystemMenu( "Exit", EvtBank->Get( "quit" ) );
 }
index 76dfae040a4c5c18b8d4e08709908aa93f0eac64..053a65a2af5e90225f51da0bb3c7a61a0bab192c 100644 (file)
@@ -2,7 +2,7 @@
  * vlcproc.cpp: VlcProc class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: vlcproc.cpp,v 1.46 2003/10/16 16:04:25 gbazin Exp $
+ * $Id: vlcproc.cpp,v 1.47 2003/10/17 16:40:09 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -569,7 +569,8 @@ void VlcProc::ChangeVolume( unsigned int msg, long param )
             aout_VolumeDown( p_intf, 1, NULL );
             break;
         case VLC_VOLUME_SET:
-            aout_VolumeSet( p_intf, param * AOUT_VOLUME_MAX / SLIDER_RANGE );
+            aout_VolumeSet( p_intf, param * (AOUT_VOLUME_DEFAULT * 2) /
+                            SLIDER_RANGE );
             break;
     }
     aout_VolumeGet( p_intf, &volume );
index 4f8d24f0aa63855646b41ef669dee9c4612011c3..bd6bbfa4d928749ff8a833877bc05086cbc203aa 100644 (file)
@@ -2,7 +2,7 @@
  * preferences.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: preferences.cpp,v 1.34 2003/10/08 19:40:42 gbazin Exp $
+ * $Id: preferences.cpp,v 1.35 2003/10/17 16:40:09 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -980,9 +980,9 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
                                        -16000, 16000, p_item->i_value);
                 spin->SetToolTip( wxU(p_item->psz_longtext) );
                 config_data->control.spinctrl = spin;
-                panel_sizer->Add( label, 3, wxALIGN_CENTER_VERTICAL 
+                panel_sizer->Add( label, 1, wxALIGN_CENTER_VERTICAL 
                                   | wxALL, 5 );
-                panel_sizer->Add( spin, 1, wxALIGN_CENTER_VERTICAL 
+                panel_sizer->Add( spin, 0, wxALIGN_CENTER_VERTICAL 
                                   | wxALL, 5 );
 
                 spin->SetClientData((void *)config_data);
@@ -1028,9 +1028,9 @@ PrefsPanel::PrefsPanel( wxWindow* parent, intf_thread_t *_p_intf,
                                            wxTE_PROCESS_ENTER );
                 textctrl->SetToolTip( wxU(p_item->psz_longtext) );
                 config_data->control.textctrl = textctrl;
-                panel_sizer->Add( label, 3, wxALIGN_CENTER_VERTICAL 
-                                  | wxALL | wxEXPAND, 5 );
-                panel_sizer->Add( textctrl, 1, wxALIGN_CENTER_VERTICAL 
+                panel_sizer->Add( label, 1, wxALIGN_CENTER_VERTICAL 
+                                  | wxALL, 5 );
+                panel_sizer->Add( textctrl, 0, wxALIGN_CENTER_VERTICAL 
                                   | wxALL, 5);
                 if( p_item->b_advanced ) b_has_advanced = VLC_TRUE;
                 break;
index 96b12f133fc7fd9323eece19d2363a8f20f8a2a8..5006cfb4264d6d8a3510fcdc8af21449b09ab3dc 100644 (file)
@@ -2,7 +2,7 @@
  * mp4.c: mp4/mov muxer
  *****************************************************************************
  * Copyright (C) 2001, 2002, 2003 VideoLAN
- * $Id: mp4.c,v 1.5 2003/10/07 14:59:10 gbazin Exp $
+ * $Id: mp4.c,v 1.6 2003/10/17 16:40:08 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -92,6 +92,8 @@ struct sout_mux_sys_t
     uint64_t i_mdat_pos;
     uint64_t i_pos;
 
+    mtime_t  i_start_dts;
+
     int          i_nb_streams;
     mp4_stream_t **pp_streams;
 };
@@ -148,6 +150,7 @@ static int Open( vlc_object_t *p_this )
     p_sys->pp_streams   = NULL;
     p_sys->i_mdat_pos   = 0;
     p_sys->b_mov        = p_mux->psz_mux && !strcmp( p_mux->psz_mux, "mov" );
+    p_sys->i_start_dts  = 0;
 
     msg_Info( p_mux, "Open" );
 
@@ -1047,6 +1050,8 @@ static int Mux( sout_mux_t *p_mux )
             return( VLC_SUCCESS );
         }
 
+        if( !p_sys->i_start_dts )
+            p_sys->i_start_dts = i_dts;
 
         p_input  = p_mux->pp_inputs[i_stream];
         p_stream = (mp4_stream_t*)p_input->p_sys;
@@ -1062,6 +1067,16 @@ static int Mux( sout_mux_t *p_mux )
         p_stream->entry[p_stream->i_entry_count].i_length=
             __MAX( p_data->i_length, 0 );
 
+        if( p_stream->i_entry_count == 0 )
+        {
+            /* Here is another bad hack.
+             * To make sure audio/video are in sync, we report a corrected
+             * length for the 1st sample. */
+            p_stream->entry[p_stream->i_entry_count].i_length =
+                __MAX( p_data->i_length, 0 ) +
+                p_data->i_pts - p_sys->i_start_dts;
+        }
+
         p_stream->i_entry_count++;
         if( p_stream->i_entry_count >= p_stream->i_entry_max )
         {
index 81f7ee705306bc0dfbb9ce4d1175572bdf254098..c34186cf624f58866530dcecaf0fc5c35ebdd880 100644 (file)
@@ -2,7 +2,7 @@
  * vout.c: Windows DirectX video output display method
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: directx.c,v 1.22 2003/09/26 16:03:21 gbazin Exp $
+ * $Id: directx.c,v 1.23 2003/10/17 16:40:09 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -221,11 +221,10 @@ static int OpenVideo( vlc_object_t *p_this )
     }
 
     /* Add a variable to indicate if the window should be on top of others */
-    var_Create( p_vout, "directx-on-top", VLC_VAR_BOOL );
+    var_Create( p_vout, "directx-on-top", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
     text.psz_string = _("Always on top");
     var_Change( p_vout, "directx-on-top", VLC_VAR_SETTEXT, &text, NULL );
-    val.b_bool = config_GetInt( p_vout, "directx-on-top" );
-    var_Set( p_vout, "directx-on-top", val );
+    var_Get( p_vout, "directx-on-top", &val );
     p_vout->p_sys->b_on_top_change = val.b_bool; 
     var_AddCallback( p_vout, "directx-on-top", OnTopCallback, NULL );
 
index a11a488578d7cbad93985f9c0eefc0993103f027..72d9b37e8e98b496bb83d715d46db85d3017922a 100644 (file)
@@ -2,7 +2,7 @@
  * events.c: Windows DirectX video output events handler
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: events.c,v 1.23 2003/09/24 16:10:02 gbazin Exp $
+ * $Id: events.c,v 1.24 2003/10/17 16:40:09 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -224,26 +224,34 @@ void DirectXEventThread( event_thread_t *p_event )
                 break;
 
             case VK_LEFT:
-                /* input_Seek( p_event->p_vout, -5,
-                   INPUT_SEEK_SECONDS | INPUT_SEEK_CUR ); */
-                val.psz_string = "LEFT";
-                var_Set( p_event->p_vout, "key-pressed", val );
+                if( GetKeyState(VK_CONTROL) & 0x8000 )
+                {
+                    input_Seek( p_event->p_vout, -60,
+                                INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
+                }
+                else
+                {
+                    val.psz_string = "LEFT";
+                    var_Set( p_event->p_vout, "key-pressed", val );
+                }
                 break;
             case VK_RIGHT:
-                /* input_Seek( p_event->p_vout, 5,
-                   INPUT_SEEK_SECONDS | INPUT_SEEK_CUR ); */
-                val.psz_string = "RIGHT";
-                var_Set( p_event->p_vout, "key-pressed", val );
+                if( GetKeyState(VK_CONTROL) & 0x8000 )
+                {
+                   input_Seek( p_event->p_vout, 60,
+                               INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
+                }
+                else
+                {
+                    val.psz_string = "RIGHT";
+                    var_Set( p_event->p_vout, "key-pressed", val );
+                }
                 break;
             case VK_UP:
-                /* input_Seek( p_event->p_vout, 60,
-                   INPUT_SEEK_SECONDS | INPUT_SEEK_CUR ); */
                 val.psz_string = "UP";
                 var_Set( p_event->p_vout, "key-pressed", val );
                 break;
             case VK_DOWN:
-                /* input_Seek( p_event->p_vout, -60,
-                   INPUT_SEEK_SECONDS | INPUT_SEEK_CUR ); */
                 val.psz_string = "DOWN";
                 var_Set( p_event->p_vout, "key-pressed", val );
                 break;