* Added Step forward/Step backward feature.
authorChristophe Massiot <massiot@videolan.org>
Sun, 9 Feb 2003 01:50:35 +0000 (01:50 +0000)
committerChristophe Massiot <massiot@videolan.org>
Sun, 9 Feb 2003 01:50:35 +0000 (01:50 +0000)
extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib
modules/gui/macosx/controls.m
modules/gui/macosx/intf.h
modules/gui/macosx/intf.m

index c82772e..9127ae6 100644 (file)
@@ -4,9 +4,11 @@
         {CLASS = VLCApplication; LANGUAGE = ObjC; SUPERCLASS = NSApplication; }, 
         {
             ACTIONS = {
+                backward = id; 
                 deinterlace = id; 
                 doubleWindow = id; 
                 faster = id; 
+                forward = id; 
                 fullscreen = id; 
                 halfWindow = id; 
                 loop = id; 
@@ -71,6 +73,7 @@
                 "o_messages" = id; 
                 "o_mi_about" = id; 
                 "o_mi_bring_atf" = id; 
+                "o_mi_bwd" = id; 
                 "o_mi_channels" = id; 
                 "o_mi_chapter" = id; 
                 "o_mi_clear" = id; 
@@ -83,6 +86,7 @@
                 "o_mi_double_window" = id; 
                 "o_mi_faster" = id; 
                 "o_mi_fullscreen" = id; 
+                "o_mi_fwd" = id; 
                 "o_mi_half_window" = id; 
                 "o_mi_hide" = id; 
                 "o_mi_hide_others" = id; 
                 "o_mi_vol_down" = id; 
                 "o_mi_vol_up" = id; 
                 "o_mi_website" = id; 
-                "o_msgs_btn_crashog" = id; 
+                "o_msgs_btn_crashlog" = id; 
                 "o_msgs_btn_ok" = id; 
                 "o_msgs_panel" = id; 
                 "o_mu_audio" = id; 
index ffd7615..a919b65 100644 (file)
@@ -3,11 +3,11 @@
 <plist version="1.0">
 <dict>
        <key>IBDocumentLocation</key>
-       <string>590 112 365 441 0 0 1280 1002 </string>
+       <string>469 64 365 441 0 0 1152 746 </string>
        <key>IBEditorPositions</key>
        <dict>
                <key>29</key>
-               <string>16 822 419 44 0 0 1280 1002 </string>
+               <string>14 602 419 44 0 0 1152 746 </string>
                <key>303</key>
                <string>60 509 104 114 0 0 1280 1002 </string>
                <key>909</key>
@@ -24,7 +24,6 @@
        <key>IBOpenObjects</key>
        <array>
                <integer>29</integer>
-               <integer>21</integer>
        </array>
        <key>IBSystem Version</key>
        <string>6G30</string>
index bb006f3..740a5bf 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib differ
index 6e91dc4..00aa465 100644 (file)
@@ -2,7 +2,7 @@
  * controls.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: controls.m,v 1.24 2003/02/09 01:13:43 massiot Exp $
+ * $Id: controls.m,v 1.25 2003/02/09 01:50:35 massiot Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -53,6 +53,9 @@
 - (IBAction)next:(id)sender;
 - (IBAction)loop:(id)sender;
 
+- (IBAction)forward:(id)sender;
+- (IBAction)backward:(id)sender;
+
 - (IBAction)volumeUp:(id)sender;
 - (IBAction)volumeDown:(id)sender;
 - (IBAction)mute:(id)sender;
     vlc_object_release( p_playlist );
 }
 
+- (IBAction)forward:(id)sender
+{
+    intf_thread_t * p_intf = [NSApp getIntf];
+    playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+                                                       FIND_ANYWHERE );
+    if( p_playlist == NULL || p_playlist->p_input == NULL )
+    {
+        if ( p_playlist != NULL ) vlc_object_release( p_playlist );
+        return;
+    }
+
+    input_Seek( p_playlist->p_input, 5, INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
+    vlc_object_release( p_playlist );
+}
+
+- (IBAction)backward:(id)sender
+{
+    intf_thread_t * p_intf = [NSApp getIntf];
+    playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+                                                       FIND_ANYWHERE );
+    if( p_playlist == NULL || p_playlist->p_input == NULL )
+    {
+        if ( p_playlist != NULL ) vlc_object_release( p_playlist );
+        return;
+    }
+
+    input_Seek( p_playlist->p_input, -5, INPUT_SEEK_SECONDS | INPUT_SEEK_CUR );
+    vlc_object_release( p_playlist );
+}
+
 - (IBAction)volumeUp:(id)sender
 {
     intf_thread_t * p_intf = [NSApp getIntf];
 
         [o_mi setState: i_state];
     }
+    else if( [[o_mi title] isEqualToString: _NS("Step Forward")] ||
+             [[o_mi title] isEqualToString: _NS("Step Backward")] )
+    {
+        if( p_playlist != NULL && p_input != NULL )
+        {
+            vlc_mutex_lock( &p_input->stream.stream_lock );
+            bEnabled = p_input->stream.b_seekable;
+            vlc_mutex_unlock( &p_input->stream.stream_lock );
+        }
+        else
+        {
+            bEnabled = FALSE;
+        }
+    }
     else if( [[o_mi title] isEqualToString: _NS("Mute")] ) 
     {
         [o_mi setState: p_intf->p_sys->b_mute ? NSOnState : NSOffState];
index 3a943ce..0b0cf01 100644 (file)
@@ -2,7 +2,7 @@
  * intf.h: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: intf.h,v 1.24 2003/02/08 17:26:00 massiot Exp $
+ * $Id: intf.h,v 1.25 2003/02/09 01:50:35 massiot Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -159,6 +159,8 @@ struct intf_sys_t
     IBOutlet id o_mi_previous;
     IBOutlet id o_mi_next;
     IBOutlet id o_mi_loop;
+    IBOutlet id o_mi_fwd;
+    IBOutlet id o_mi_bwd;
     IBOutlet id o_mi_program;
     IBOutlet id o_mi_title;
     IBOutlet id o_mi_chapter;
@@ -237,6 +239,7 @@ struct intf_sys_t
 - (IBAction)reportABug:(id)sender;
 - (IBAction)openWebsite:(id)sender;
 - (IBAction)openLicense:(id)sender;
+- (IBAction)openCrashLog:(id)sender;
 
 - (void)windowDidBecomeKey:(NSNotification *)o_notification;
 
index 380d9b4..dc74bf3 100644 (file)
@@ -2,7 +2,7 @@
  * intf.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: intf.m,v 1.51 2003/02/09 01:13:43 massiot Exp $
+ * $Id: intf.m,v 1.52 2003/02/09 01:50:35 massiot Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -321,6 +321,8 @@ int ExecuteOnMainThread( id target, SEL sel, void * p_arg )
     [o_mi_previous setTitle: _NS("Previous")];
     [o_mi_next setTitle: _NS("Next")];
     [o_mi_loop setTitle: _NS("Loop")];
+    [o_mi_fwd setTitle: _NS("Step Forward")];
+    [o_mi_bwd setTitle: _NS("Step Backward")];
     [o_mi_program setTitle: _NS("Program")];
     [o_mi_title setTitle: _NS("Title")];
     [o_mi_chapter setTitle: _NS("Chapter")];