]> git.sesse.net Git - vlc/commitdiff
* ./modules/gui/macosx/controls.m
authorDerk-Jan Hartman <hartman@videolan.org>
Thu, 23 Jan 2003 22:25:32 +0000 (22:25 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Thu, 23 Jan 2003 22:25:32 +0000 (22:25 +0000)
  - changed the slower button into a slowmotion button
  - fixed a forgotten mutex_unlock
* ./modules/gui/macosx/intf.m
  - added the slowmotion button
  - some windows shouldn't register in the "Window" menu
* ./modules/gui/macosx/open.m
  - allow multiple file selection

modules/gui/macosx/controls.m
modules/gui/macosx/intf.h
modules/gui/macosx/intf.m
modules/gui/macosx/open.m

index 77fca87ffc5adcccf6365295edee1981beac5528..ebce2af8d811a244e987156b324d0d14b1224e32 100644 (file)
@@ -2,7 +2,7 @@
  * controls.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: controls.m,v 1.10 2003/01/22 01:48:06 hartman Exp $
+ * $Id: controls.m,v 1.11 2003/01/23 22:25:32 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -56,6 +56,7 @@
 - (IBAction)stop:(id)sender;
 - (IBAction)faster:(id)sender;
 - (IBAction)slower:(id)sender;
+- (IBAction)slowMotion:(id)sender;
 - (IBAction)fastForward:(id)sender;
 
 - (IBAction)prev:(id)sender;
     input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_SLOWER );
 }
 
+- (IBAction)slowMotion:(id)sender
+{
+    i_ff++;
+    switch( [[NSApp currentEvent] type] )
+    {
+        case NSPeriodic:
+            if ( i_ff == 1 )
+            {
+                [self slower:sender];
+            }
+            break;
+    
+        case NSLeftMouseUp:
+            if ( i_ff > 1 )
+            {
+                intf_thread_t * p_intf = [NSApp getIntf];
+                
+                [self faster:sender];
+                if ( p_intf->p_sys->p_input != NULL &&
+                            p_intf->p_sys->p_input->stream.control.i_status != PAUSE_S)
+                {
+                    input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PAUSE );
+                }
+            }
+            i_ff = 0;
+            break;
+
+        default:
+            break;
+    }
+}
+
 - (IBAction)fastForward:(id)sender
 {
     playlist_t * p_playlist = vlc_object_find( [NSApp getIntf], VLC_OBJECT_PLAYLIST,
          * You can set this value in intf.m (hartman)
          */
         case NSPeriodic:
-            if (i_ff == 1)
+            if ( i_ff == 1 )
             {
                 [self faster:self];
             }
             vlc_mutex_lock( &p_playlist->object_lock );
             if( p_playlist->i_size )
             {
-                vlc_mutex_unlock( &p_playlist->object_lock );
                 playlist_Play( p_playlist );
             }
+            vlc_mutex_unlock( &p_playlist->object_lock );
             break;
 
         default:
index ded4a970e5f76a9264908f3a51c3b84c4d470e1b..328f81053710931c2728ca9f78d4d82ecd09a718 100644 (file)
@@ -2,7 +2,7 @@
  * intf.h: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: intf.h,v 1.15 2003/01/22 01:48:06 hartman Exp $
+ * $Id: intf.h,v 1.16 2003/01/23 22:25:32 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -97,7 +97,7 @@ struct intf_sys_t
 
     IBOutlet id o_btn_playlist; /* btn playlist   */
     IBOutlet id o_btn_prev;     /* btn previous   */
-    IBOutlet id o_btn_slower;   /* btn slower     */
+    IBOutlet id o_btn_slowmotion;   /* btn slowmotion     */
     IBOutlet id o_btn_play;     /* btn play       */
     IBOutlet id o_btn_stop;     /* btn stop       */
     IBOutlet id o_btn_fastforward;   /* btn fastforward     */
index 4b15f728a7eaa66736116c398493ab290f29aac6..892750e6954493f95859060f33ade00b2f91c828 100644 (file)
@@ -2,7 +2,7 @@
  * intf.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: intf.m,v 1.31 2003/01/23 21:47:59 massiot Exp $
+ * $Id: intf.m,v 1.32 2003/01/23 22:25:32 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -191,11 +191,12 @@ static void Run( intf_thread_t *p_intf )
     pTitle = _NS("VLC - Controller");
 
     [o_window setTitle: pTitle];
+    [o_window setExcludedFromWindowsMenu: TRUE];
 
     /* button controls */
     [o_btn_playlist setToolTip: _NS("Playlist")];
     [o_btn_prev setToolTip: _NS("Previous")];
-    [o_btn_slower setToolTip: _NS("Slowmotion")];
+    [o_btn_slowmotion setToolTip: _NS("Slowmotion")];
     [o_btn_play setToolTip: _NS("Play")];
     [o_btn_stop setToolTip: _NS("Stop")];
     [o_btn_fastforward setToolTip: _NS("Fast Forward")];
@@ -207,6 +208,7 @@ static void Run( intf_thread_t *p_intf )
     
     /* messages panel */ 
     [o_msgs_panel setTitle: _NS("Messages")];
+    [o_msgs_panel setExcludedFromWindowsMenu: TRUE];
     [o_msgs_btn_ok setTitle: _NS("Close")];
 
     /* main menu */
@@ -642,7 +644,7 @@ static void Run( intf_thread_t *p_intf )
     /* set control items */
     [o_btn_stop setEnabled: b_input];
     [o_btn_fastforward setEnabled: b_control];
-    [o_btn_slower setEnabled: b_control];
+    [o_btn_slowmotion setEnabled: b_control];
     [o_btn_prev setEnabled: b_plmul];
     [o_btn_next setEnabled: b_plmul];
     [o_controls setVolumeSlider];
index 62aa9da025e5e892f97137268ce5a51f41767fd0..ee88534588fb8edaaec9bd07c21e65f0f977b571 100644 (file)
@@ -2,7 +2,7 @@
  * open.m: MacOS X plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: open.m,v 1.13 2003/01/23 21:47:59 massiot Exp $
+ * $Id: open.m,v 1.14 2003/01/23 22:25:32 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> 
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -844,17 +844,17 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
 - (IBAction)openFile:(id)sender
 {
     NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
-
-    [o_open_panel setAllowsMultipleSelection: NO];
+    
+    [o_open_panel setAllowsMultipleSelection: YES];
     [o_open_panel setTitle: _NS("Open File")];
     [o_open_panel setPrompt: _NS("Open")];
-
+    
     if( [o_open_panel runModalForDirectory: nil
             file: nil types: nil] == NSOKButton )
     {
         intf_thread_t * p_intf = [NSApp getIntf];
         config_PutPsz( p_intf, "sout", NULL );
-        [o_playlist appendArray: [o_open_panel filenames] atPos: -1 enqueue: 0];
+        [o_playlist appendArray: [o_open_panel filenames] atPos: -1 enqueue:VLC_FALSE];
     }
 }