[vlc-devel] commit: macosx: display the remaining time if the field was clicked once ( Felix Paul Kühne )

git version control git at videolan.org
Mon Feb 23 14:33:18 CET 2009


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Feb 23 13:25:46 2009 +0100| [c3ce15c7c94fabcb37911641d32c977c60f64a03] | committer: Felix Paul Kühne 

macosx: display the remaining time if the field was clicked once

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c3ce15c7c94fabcb37911641d32c977c60f64a03
---

 .../English.lproj/MainMenu.nib/classes.nib         |    1 +
 .../Resources/English.lproj/MainMenu.nib/info.nib  |    2 +
 .../English.lproj/MainMenu.nib/keyedobjects.nib    |  Bin 120713 -> 120930 bytes
 modules/gui/macosx/controls.m                      |    2 +
 modules/gui/macosx/intf.h                          |   20 +++++++++-------
 modules/gui/macosx/intf.m                          |   23 ++++++++++++++++++-
 6 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/classes.nib b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/classes.nib
index 5300ea1..9d7fe85 100644
--- a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/classes.nib
+++ b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/classes.nib
@@ -172,6 +172,7 @@
                 showMessagesPanel = id;
                 showVLM = id;
                 showWizard = id;
+                timeFieldWasClicked = id;
                 timesliderUpdate = id;
                 togglePlaylist = id;
                 viewAbout = id;
diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/info.nib b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/info.nib
index d73eefb..10c0949 100644
--- a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/info.nib
+++ b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/info.nib
@@ -21,6 +21,8 @@
 	<integer>4</integer>
 	<key>IBOpenObjects</key>
 	<array>
+		<integer>21</integer>
+		<integer>2416</integer>
 		<integer>3568</integer>
 		<integer>29</integer>
 	</array>
diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
index 97feeb1..84dda51 100644
Binary files a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib and b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib differ
diff --git a/modules/gui/macosx/controls.m b/modules/gui/macosx/controls.m
index 4164e3d..b2a0e5f 100644
--- a/modules/gui/macosx/controls.m
+++ b/modules/gui/macosx/controls.m
@@ -1180,5 +1180,7 @@
 {
     if( [ourEvent clickCount] > 1 )
         [[[VLCMain sharedInstance] getControls] goToSpecificTime: nil];
+    else
+        [[VLCMain sharedInstance] timeFieldWasClicked: self];
 }
 @end
diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h
index 3c65afe..d27fb28 100644
--- a/modules/gui/macosx/intf.h
+++ b/modules/gui/macosx/intf.h
@@ -123,15 +123,16 @@ static void MsgCallback( msg_cb_data_t *, msg_item_t *, unsigned );
     BOOL nib_info_loaded;       /* information panel nibfile */
     BOOL nib_vlm_loaded;        /* VLM Panel nibfile */
 
-    IBOutlet VLControllerWindow * o_window;       /* main window    */
-    IBOutlet NSView * o_playlist_view;/* playlist view  */
-    IBOutlet id o_scrollfield;  /* info field     */
-    IBOutlet NSTextField * o_timefield;    /* time field     */
-    IBOutlet NSSlider * o_timeslider;   /* time slider    */
-    IBOutlet VLCEmbeddedWindow * o_embedded_window; /* Embedded Vout Window */
-    float f_slider;             /* slider value   */
-    float f_slider_old;         /* old slider val */
-    IBOutlet NSSlider * o_volumeslider; /* volume slider  */
+    IBOutlet VLControllerWindow * o_window;                     /* main window */
+    IBOutlet NSView * o_playlist_view;                          /* playlist view  */
+    IBOutlet id o_scrollfield;                                  /* info field */
+    IBOutlet NSTextField * o_timefield;                         /* time field */
+    IBOutlet NSSlider * o_timeslider;                           /* time slider */
+    BOOL b_time_remaining;                                      /* show remaining time or playtime ? */
+    IBOutlet VLCEmbeddedWindow * o_embedded_window;             /* Embedded Vout Window */
+    float f_slider;                                             /* slider value */
+    float f_slider_old;                                         /* old slider val */
+    IBOutlet NSSlider * o_volumeslider;                         /* volume slider */
 
     IBOutlet NSView * toolbarMediaControl;   /* view with the controls */
 
@@ -378,6 +379,7 @@ static void MsgCallback( msg_cb_data_t *, msg_item_t *, unsigned );
 - (void)setSubmenusEnabled:(BOOL)b_enabled;
 - (void)manageVolumeSlider;
 - (IBAction)timesliderUpdate:(id)sender;
+- (IBAction)timeFieldWasClicked:(id)sender;
 
 - (IBAction)clearRecentItems:(id)sender;
 - (void)openRecentItem:(id)sender;
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 01bdef0..48d2a8c 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -1672,7 +1672,13 @@ static void * manage_cleanup( void * args )
 
             var_Get( p_input, "time", &time );
 
-            o_time = [NSString stringWithUTF8String: secstotimestr( psz_time, (time.i_time / 1000000) )];
+            mtime_t dur = input_item_GetDuration( input_GetItem( p_input ) );
+            if( b_time_remaining && dur != -1 )
+            {
+                o_time = [NSString stringWithFormat: @"-%s", secstotimestr( psz_time, ((dur - time.i_time) / 1000000))];
+            }
+            else
+                o_time = [NSString stringWithUTF8String: secstotimestr( psz_time, (time.i_time / 1000000) )];
 
             [o_timefield setStringValue: o_time];
             [[[self getControls] getFSPanel] setStreamPos: f_updated andTime: o_time];
@@ -1950,7 +1956,14 @@ end:
 
         var_Get( p_input, "time", &time );
 
-        o_time = [NSString stringWithUTF8String: secstotimestr( psz_time, (time.i_time / 1000000) )];
+        mtime_t dur = input_item_GetDuration( input_GetItem( p_input ) );
+        if( b_time_remaining && dur != -1 )
+        {
+            o_time = [NSString stringWithFormat: @"-%s", secstotimestr( psz_time, ((dur - time.i_time) / 1000000) )];
+        }
+        else
+            o_time = [NSString stringWithUTF8String: secstotimestr( psz_time, (time.i_time / 1000000) )];
+
         [o_timefield setStringValue: o_time];
         [[[self getControls] getFSPanel] setStreamPos: f_updated andTime: o_time];
         [o_embedded_window setTime: o_time position: f_updated];
@@ -1959,6 +1972,12 @@ end:
     pl_Release( p_intf );
 }
 
+- (IBAction)timeFieldWasClicked:(id)sender
+{
+    b_time_remaining = !b_time_remaining;
+}
+    
+
 #pragma mark -
 #pragma mark Recent Items
 




More information about the vlc-devel mailing list