Commit 4a484a39 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

ALL: the slider updates the video while it slides.

parent 0a8f461f
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf.h: MacOS X interface plugin * intf.h: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: intf.h,v 1.13 2003/01/16 13:49:44 hartman Exp $ * $Id: intf.h,v 1.14 2003/01/21 17:08:16 hartman Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -91,7 +91,6 @@ struct intf_sys_t ...@@ -91,7 +91,6 @@ struct intf_sys_t
IBOutlet id o_window; /* main window */ IBOutlet id o_window; /* main window */
IBOutlet id o_timefield; /* time field */ IBOutlet id o_timefield; /* time field */
IBOutlet id o_timeslider; /* time slider */ IBOutlet id o_timeslider; /* time slider */
NSLock * o_slider_lock; /* slider lock */
float f_slider; /* slider value */ float f_slider; /* slider value */
float f_slider_old; /* old slider val */ float f_slider_old; /* old slider val */
IBOutlet id o_volumeslider; /* volume slider */ IBOutlet id o_volumeslider; /* volume slider */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf.m: MacOS X interface plugin * intf.m: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: intf.m,v 1.27 2003/01/20 03:45:06 hartman Exp $ * $Id: intf.m,v 1.28 2003/01/21 17:08:16 hartman Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -286,7 +286,6 @@ static void Run( intf_thread_t *p_intf ) ...@@ -286,7 +286,6 @@ static void Run( intf_thread_t *p_intf )
intf_thread_t * p_intf = [NSApp getIntf]; intf_thread_t * p_intf = [NSApp getIntf];
f_slider_old = f_slider = 0.0; f_slider_old = f_slider = 0.0;
o_slider_lock = [[NSLock alloc] init];
[NSThread detachNewThreadSelector: @selector(manage) [NSThread detachNewThreadSelector: @selector(manage)
toTarget: self withObject: nil]; toTarget: self withObject: nil];
...@@ -565,8 +564,6 @@ static void Run( intf_thread_t *p_intf ) ...@@ -565,8 +564,6 @@ static void Run( intf_thread_t *p_intf )
vout_Destroy( p_vout ); vout_Destroy( p_vout );
} }
[o_slider_lock release];
if( o_prefs != nil ) if( o_prefs != nil )
{ {
[o_prefs release]; [o_prefs release];
...@@ -1043,13 +1040,17 @@ static void Run( intf_thread_t *p_intf ) ...@@ -1043,13 +1040,17 @@ static void Run( intf_thread_t *p_intf )
{ {
switch( [[NSApp currentEvent] type] ) switch( [[NSApp currentEvent] type] )
{ {
case NSLeftMouseDown: case NSLeftMouseDragged:
[o_slider_lock lock]; f_slider = [sender floatValue];
[self displayTime];
break; break;
case NSLeftMouseUp: case NSLeftMouseUp:
f_slider = [sender floatValue]; f_slider = [sender floatValue];
[o_slider_lock unlock]; [self displayTime];
intf_thread_t * p_intf = [NSApp getIntf];
input_thread_t * p_input = p_intf->p_sys->p_input;
vlc_mutex_unlock( &p_input->stream.stream_lock );
break; break;
default: default:
...@@ -1094,10 +1095,9 @@ static void Run( intf_thread_t *p_intf ) ...@@ -1094,10 +1095,9 @@ static void Run( intf_thread_t *p_intf )
float f_updated = ( 100. * p_area->i_tell ) / float f_updated = ( 100. * p_area->i_tell ) /
p_area->i_size; p_area->i_size;
if( f_slider != f_updated && [o_slider_lock tryLock] ) if( f_slider != f_updated )
{ {
[o_timeslider setFloatValue: f_updated]; [o_timeslider setFloatValue: f_updated];
[o_slider_lock unlock];
} }
} }
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment