]> git.sesse.net Git - vlc/commitdiff
* added a "Go To Specific Position" feature (closes #377)
authorFelix Paul Kühne <fkuehne@videolan.org>
Sun, 26 Feb 2006 12:35:30 +0000 (12:35 +0000)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sun, 26 Feb 2006 12:35:30 +0000 (12:35 +0000)
- accessible by double-clicking on the time-counters and through a menu-item in "Playback"
- the class of the time-counters is VLCTimeField now, because we need to fetch the mouseDown-event. There are no further changes compared to NSTextField.

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/keyedobjects.nib
modules/gui/macosx/controls.h
modules/gui/macosx/controls.m

index ea70647344530c483ee0e1b94632f5e65731b524..08685836945ec5b4658b6fd5524feeb1f569ded0 100644 (file)
@@ -12,6 +12,7 @@
                 backward = id; 
                 faster = id; 
                 forward = id; 
+                goToSpecificTime = id; 
                 loop = id; 
                 mute = id; 
                 next = id; 
             }; 
             CLASS = VLCControls; 
             LANGUAGE = ObjC; 
-            OUTLETS = {"o_main" = id; "o_volumeslider" = id; }; 
+            OUTLETS = {
+                "o_main" = id; 
+                "o_specificTime_cancel_btn" = id; 
+                "o_specificTime_enter_fld" = id; 
+                "o_specificTime_goTo_lbl" = id; 
+                "o_specificTime_mi" = id; 
+                "o_specificTime_ok_btn" = id; 
+                "o_specificTime_sec_lbl" = id; 
+                "o_specificTime_stepper" = id; 
+                "o_specificTime_win" = id; 
+                "o_volumeslider" = id; 
+            }; 
             SUPERCLASS = NSObject; 
         }, 
         {
             SUPERCLASS = NSObject; 
         }, 
         {CLASS = VLCPlaylistView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; }, 
+        {CLASS = VLCTimeField; LANGUAGE = ObjC; SUPERCLASS = NSTextField; }, 
         {CLASS = VLCVoutView; LANGUAGE = ObjC; SUPERCLASS = NSView; }
     ); 
     IBVersion = 1; 
index 5088df28d15cf927214f032afc5fa3d94953af16..b431e1440724f08b6be1fbcc2ffe2fb9433957d8 100644 (file)
@@ -11,7 +11,7 @@
                <key>2197</key>
                <string>422 532 596 143 0 0 1440 878 </string>
                <key>29</key>
-               <string>393 311 438 44 0 0 1440 878 </string>
+               <string>356 400 438 44 0 0 1440 878 </string>
                <key>915</key>
                <string>678 573 187 249 0 0 1280 1002 </string>
        </dict>
        <array/>
        <key>IBOpenObjects</key>
        <array>
-               <integer>2197</integer>
                <integer>29</integer>
                <integer>21</integer>
+               <integer>2197</integer>
+               <integer>2460</integer>
+               <integer>2416</integer>
        </array>
        <key>IBSystem Version</key>
        <string>8H14</string>
index 87d50b9ad2742948971c2c8312c37a3c6e1d2e2c..affc2dd2217685a5edbcf969189d2fcb188c9512 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib differ
index ea0dff1f86e8a2f8f819c1622e6d845ae60ff85e..a56313d66652307e47629366ba3ec398fc9b6153 100644 (file)
 
     IBOutlet id o_btn_fullscreen;
     IBOutlet id o_volumeslider;
+
+    IBOutlet id o_specificTime_cancel_btn;
+    IBOutlet id o_specificTime_enter_fld;
+    IBOutlet id o_specificTime_goTo_lbl;
+    IBOutlet id o_specificTime_ok_btn;
+    IBOutlet id o_specificTime_win;
+    IBOutlet id o_specificTime_sec_lbl;
+    IBOutlet id o_specificTime_stepper;
+    IBOutlet id o_specificTime_mi;
 }
 
 - (IBAction)play:(id)sender;
@@ -67,6 +76,8 @@
 - (IBAction)toggleVar:(id)sender;
 - (int)toggleVarThread:(id)_o_data;
 
+- (IBAction)goToSpecificTime:(id)sender;
+
 @end
 
 /*****************************************************************************
 - (int)type;
 
 @end
+
+/*****************************************************************************
+ * VLCTimeField interface 
+ *****************************************************************************
+ * we need the implementation to catch our click-event in the controller window
+ *****************************************************************************/
+
+@interface VLCTimeField : NSTextField
+{
+}
+@end
+
index 9cb2b2dea33d5e8bc741c9805dcd509447875ec8..ffecbac7691be84bf919d0a7be726f6797f87ee7 100644 (file)
  *****************************************************************************/
 @implementation VLCControls
 
+- (void)awakeFromNib
+{
+    [o_specificTime_mi setTitle: _NS("Go To Position")];
+    [o_specificTime_cancel_btn setTitle: _NS("Cancel")];
+    [o_specificTime_ok_btn setTitle: _NS("OK")];
+    [o_specificTime_sec_lbl setStringValue: _NS("sec.")];
+    [o_specificTime_goTo_lbl setStringValue: _NS("Go to specific position")];
+}
+
 - (IBAction)play:(id)sender
 {
     vlc_value_t val;
     return VLC_EGENERIC;
 }
 
+- (IBAction)goToSpecificTime:(id)sender
+{
+    if( sender == o_specificTime_cancel_btn )
+    {
+        [NSApp endSheet: o_specificTime_win];
+        [o_specificTime_win close];
+    }
+    else if( sender == o_specificTime_ok_btn )
+    {
+        input_thread_t * p_input = (input_thread_t *)vlc_object_find( VLCIntf, \
+            VLC_OBJECT_INPUT, FIND_ANYWHERE );
+        if( p_input )
+        {
+            input_Control( p_input, INPUT_SET_TIME, \
+                (int64_t)([o_specificTime_enter_fld intValue] * 1000000));
+            vlc_object_release( p_input );
+        }
+    
+        [NSApp endSheet: o_specificTime_win];
+        [o_specificTime_win close];
+    }
+    else
+    {
+        input_thread_t * p_input = (input_thread_t *)vlc_object_find( VLCIntf, \
+            VLC_OBJECT_INPUT, FIND_ANYWHERE );
+        if( p_input )
+        {
+            /* we can obviously only do that if an input is available */
+            vlc_value_t pos, length;
+            var_Get( p_input, "time", &pos );
+            [o_specificTime_enter_fld setIntValue: (pos.i_time / 1000000)];
+            var_Get( p_input, "length", &length );
+            [o_specificTime_stepper setMaxValue: (length.i_time / 1000000)];
+
+            [NSApp beginSheet: o_specificTime_win modalForWindow: \
+                [NSApp mainWindow] modalDelegate: self didEndSelector: nil \
+                contextInfo: nil];
+            [o_specificTime_win makeKeyWindow];
+            vlc_object_release( p_input );
+        }
+    }
+}
+
 @end
 
 @implementation VLCControls (NSMenuValidation)
 }
 
 @end
+
+
+/*****************************************************************************
+ * VLCTimeField implementation 
+ *****************************************************************************
+ * we need this to catch our click-event in the controller window
+ *****************************************************************************/
+
+@implementation VLCTimeField
+- (void)mouseDown: (NSEvent *)ourEvent
+{
+    if( [ourEvent clickCount] > 1 )
+        [[[VLCMain sharedInstance] getControls] goToSpecificTime: nil];
+}
+@end