Commit 3dea2eae authored by Felix Paul Kühne's avatar Felix Paul Kühne

* finished the time slider

For the records: please don't re-invent the wheel, also if there are only 2 places which already do the exact same thing and you're going to add the 3rd place!!
parent 65abf030
......@@ -136,7 +136,7 @@ Rudolf Cornelissen <rag.cornelissen at inter.nl.net> - BeOS fixes
Scott Caudle <dorkmanzcot at gmail dot com> - Visualization, WX
improvements
Sebastien Chaumat <Sebastien.Chaumat at ens-lyon.fr> - YOPY port tests
Simon Damkjr Andersen <simondamkjaer at gmail.com> - playmode icons for the OSX GUI (v0.8.6)
Simon Damkjr Andersen <simondamkjaer at gmail.com> - playmode icons and the entire Fullscreen Panel design for the OSX GUI (v0.9.0)
Steve Lhomme <steve dot lhomme at free dot fr> - MSVC fixes and Matroska enhancements
Steve Brown <sbrown at cortland.com> - fix for optional PES size bug
Steven M. Schultz <sms at TO.GD-ES.COM> - BSD/OS port
......
......@@ -42,7 +42,8 @@
- (void)setPlay;
- (void)setPause;
- (void)setStreamTitle:(NSString *)o_title;
- (void)setStreamPos:(float) f_pos setSeconds:(int)i_seconds;
- (void)setStreamPos:(float) f_pos andTime:(NSString *)o_time;
- (void)setSeekable:(BOOL) b_seekable;
- (void)focus:(NSTimer *)timer;
- (void)unfocus:(NSTimer *)timer;
......@@ -67,20 +68,22 @@
NSColor *fillColor;
NSButton *o_prev, *o_next, *o_slow, *o_fast, *o_play, *o_fullscreen;
NSTextField *o_textfield, *o_textPos;
NSSlider *o_time_slider;
NSSlider *o_fs_timeSlider;
}
- (id)initWithFrame:(NSRect)frameRect;
- (void)drawRect:(NSRect)rect;
- (void) setPlay;
- (void) setPause;
- (void) setStreamTitle: (NSString *)o_title;
- (void) setStreamPos:(float) f_pos setSeconds:(int)i_seconds;
- (void)setPlay;
- (void)setPause;
- (void)setStreamTitle: (NSString *)o_title;
- (void)setStreamPos:(float) f_pos andTime:(NSString *)o_time;
- (void)setSeekable: (BOOL)b_seekable;
- (IBAction)play:(id)sender;
- (IBAction)prev:(id)sender;
- (IBAction)next:(id)sender;
- (IBAction)faster:(id)sender;
- (IBAction)slower:(id)sender;
- (IBAction)fsTimeSliderUpdate:(id)sender;
@end
......
......@@ -69,6 +69,11 @@
return YES;
}
- (BOOL)mouseDownCanMoveWindow
{
return YES;
}
-(void)dealloc
{
if( hideAgainTimer )
......@@ -92,9 +97,14 @@
[[self contentView] setStreamTitle: o_title];
}
- (void)setStreamPos:(float) f_pos setSeconds:(int)i_seconds;
- (void)setStreamPos:(float) f_pos andTime:(NSString *)o_time
{
[[self contentView] setStreamPos:f_pos andTime: o_time];
}
- (void)setSeekable:(BOOL) b_seekable;
{
[[self contentView] setStreamPos:f_pos setSeconds:i_seconds];
[[self contentView] setSeekable: b_seekable];
}
/* This routine is called repeatedly when the mouse enters the window from outside it. */
......@@ -309,12 +319,14 @@
s_rc.origin.y = 53;
s_rc.size.width = 518;
s_rc.size.height = 9;
o_time_slider = [[[VLCFSTimeSlider alloc] initWithFrame: s_rc] retain];
[o_time_slider setMinValue:0];
[o_time_slider setMaxValue:1];
[o_time_slider setFloatValue: 0];
[o_time_slider setAction: @selector(timesliderUpdate:)];
[self addSubview: o_time_slider];
o_fs_timeSlider = [[VLCFSTimeSlider alloc] initWithFrame: s_rc];
[o_fs_timeSlider setMinValue:0];
[o_fs_timeSlider setMaxValue:10000];
[o_fs_timeSlider setFloatValue: 0];
[o_fs_timeSlider setContinuous: YES];
[o_fs_timeSlider setTarget: self];
[o_fs_timeSlider setAction: @selector(fsTimeSliderUpdate:)];
[self addSubview: o_fs_timeSlider];
s_rc = [self frame];
s_rc.origin.x = 98;
......@@ -330,6 +342,12 @@
return view;
}
- (void)dealloc
{
[o_fs_timeSlider release];
[super dealloc];
}
- (void)setPlay
{
NSBundle *bundle = [NSBundle mainBundle];
......@@ -359,15 +377,17 @@
[o_textfield setStringValue: o_title];
}
- (void)setStreamPos:(float) f_pos setSeconds:(int)i_seconds
- (void)setStreamPos:(float) f_pos andTime:(NSString *)o_time
{
NSString *o_pos = [NSString stringWithFormat: @"%d:%02d:%02d",
(int) (i_seconds / (60 * 60)),
(int) (i_seconds / 60 % 60),
(int) (i_seconds % 60)];
[o_textPos setStringValue: o_time];
[o_fs_timeSlider setFloatValue: f_pos];
}
[o_textPos setStringValue: o_pos];
[o_time_slider setFloatValue: f_pos];
- (void)setSeekable:(BOOL)b_seekable
{
[o_slow setEnabled: b_seekable];
[o_fast setEnabled: b_seekable];
[o_fs_timeSlider setEnabled: b_seekable];
}
- (IBAction)play:(id)sender
......@@ -400,7 +420,7 @@
[[[VLCMain sharedInstance] getControls] windowAction: sender];
}
- (IBAction)timesliderUpdate:(id)sender
- (IBAction)fsTimeSliderUpdate:(id)sender
{
[[VLCMain sharedInstance] timesliderUpdate: sender];
}
......
......@@ -1094,7 +1094,8 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_timeslider setFloatValue: 0.0];
[o_timeslider setEnabled: b_seekable];
[o_timefield setStringValue: @"0:00:00"];
[[[self getControls] getFSPanel] setStreamPos: 0 setSeconds: 0];
[[[self getControls] getFSPanel] setStreamPos: 0 andTime: @"0:00:00"];
[[[self getControls] getFSPanel] setSeekable: b_seekable];
[o_embedded_window setSeekable: b_seekable];
......@@ -1197,7 +1198,7 @@ static VLCMain *_o_sharedMainInstance = nil;
(int) (i_seconds / 60 % 60),
(int) (i_seconds % 60)];
[o_timefield setStringValue: o_time];
[[[self getControls] getFSPanel] setStreamPos: pos.f_float setSeconds: i_seconds];
[[[self getControls] getFSPanel] setStreamPos: f_updated andTime: o_time];
[o_embedded_window setTime: o_time position: f_updated];
}
......@@ -1503,7 +1504,7 @@ static VLCMain *_o_sharedMainInstance = nil;
(int) (i_seconds / 60 % 60),
(int) (i_seconds % 60)];
[o_timefield setStringValue: o_time];
[[[self getControls] getFSPanel] setStreamPos: pos.f_float setSeconds: i_seconds];
[[[self getControls] getFSPanel] setStreamPos: f_updated andTime: o_time];
[o_embedded_window setTime: o_time position: f_updated];
}
#undef p_input
......
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