Commit fda213d6 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* use secstotimestr to reduce code duplication and use the format logic...

* use secstotimestr to reduce code duplication and use the format logic introduced by [22835]. The main controller will get a layout fix later on, while the embedded vout and the fspanel don't need one.
parent 07b2c47a
...@@ -1224,8 +1224,8 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1224,8 +1224,8 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_timeslider setFloatValue: 0.0]; [o_timeslider setFloatValue: 0.0];
[o_timeslider setEnabled: b_seekable]; [o_timeslider setEnabled: b_seekable];
[o_timefield setStringValue: @"0:00:00"]; [o_timefield setStringValue: @"00:00"];
[[[self getControls] getFSPanel] setStreamPos: 0 andTime: @"0:00:00"]; [[[self getControls] getFSPanel] setStreamPos: 0 andTime: @"00:00"];
[[[self getControls] getFSPanel] setSeekable: b_seekable]; [[[self getControls] getFSPanel] setSeekable: b_seekable];
[o_embedded_window setSeekable: b_seekable]; [o_embedded_window setSeekable: b_seekable];
...@@ -1293,8 +1293,8 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1293,8 +1293,8 @@ static VLCMain *_o_sharedMainInstance = nil;
/* Update the slider */ /* Update the slider */
vlc_value_t time; vlc_value_t time;
NSString * o_time; NSString * o_time;
mtime_t i_seconds;
vlc_value_t pos; vlc_value_t pos;
char psz_time[MSTRTIME_MAX_SIZE];
float f_updated; float f_updated;
var_Get( p_input, "position", &pos ); var_Get( p_input, "position", &pos );
...@@ -1302,12 +1302,9 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1302,12 +1302,9 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_timeslider setFloatValue: f_updated]; [o_timeslider setFloatValue: f_updated];
var_Get( p_input, "time", &time ); var_Get( p_input, "time", &time );
i_seconds = time.i_time / 1000000;
o_time = [NSString stringWithFormat: @"%d:%02d:%02d", o_time = [NSString stringWithUTF8String: secstotimestr( psz_time, (time.i_time / 1000000) )];
(int) (i_seconds / (60 * 60)),
(int) (i_seconds / 60 % 60),
(int) (i_seconds % 60)];
[o_timefield setStringValue: o_time]; [o_timefield setStringValue: o_time];
[[[self getControls] getFSPanel] setStreamPos: f_updated andTime: o_time]; [[[self getControls] getFSPanel] setStreamPos: f_updated andTime: o_time];
[o_embedded_window setTime: o_time position: f_updated]; [o_embedded_window setTime: o_time position: f_updated];
...@@ -1637,8 +1634,8 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1637,8 +1634,8 @@ static VLCMain *_o_sharedMainInstance = nil;
{ {
vlc_value_t time; vlc_value_t time;
vlc_value_t pos; vlc_value_t pos;
mtime_t i_seconds;
NSString * o_time; NSString * o_time;
char psz_time[MSTRTIME_MAX_SIZE];
vlc_object_yield( p_input ); vlc_object_yield( p_input );
pos.f_float = f_updated / 10000.; pos.f_float = f_updated / 10000.;
...@@ -1646,12 +1643,8 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1646,12 +1643,8 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_timeslider setFloatValue: f_updated]; [o_timeslider setFloatValue: f_updated];
var_Get( p_input, "time", &time ); var_Get( p_input, "time", &time );
i_seconds = time.i_time / 1000000;
o_time = [NSString stringWithFormat: @"%d:%02d:%02d", o_time = [NSString stringWithUTF8String: secstotimestr( psz_time, (time.i_time / 1000000) )];
(int) (i_seconds / (60 * 60)),
(int) (i_seconds / 60 % 60),
(int) (i_seconds % 60)];
[o_timefield setStringValue: o_time]; [o_timefield setStringValue: o_time];
[[[self getControls] getFSPanel] setStreamPos: f_updated andTime: o_time]; [[[self getControls] getFSPanel] setStreamPos: f_updated andTime: o_time];
[o_embedded_window setTime: o_time position: f_updated]; [o_embedded_window setTime: o_time position: f_updated];
......
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