Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
021b9f25
Commit
021b9f25
authored
Feb 24, 2013
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: show current pos and remaining or total time in fs controller
parent
18d11128
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
18 deletions
+62
-18
modules/gui/macosx/ControlsBar.h
modules/gui/macosx/ControlsBar.h
+0
-1
modules/gui/macosx/ControlsBar.m
modules/gui/macosx/ControlsBar.m
+0
-5
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindow.m
+1
-1
modules/gui/macosx/fspanel.h
modules/gui/macosx/fspanel.h
+4
-3
modules/gui/macosx/fspanel.m
modules/gui/macosx/fspanel.m
+57
-8
No files found.
modules/gui/macosx/ControlsBar.h
View file @
021b9f25
...
...
@@ -146,7 +146,6 @@
-
(
void
)
updateVolumeSlider
;
-
(
void
)
updateControls
;
-
(
void
)
updatePosAndTimeInFSPanel
:(
VLCFSPanel
*
)
o_fspanel
;
@end
modules/gui/macosx/ControlsBar.m
View file @
021b9f25
...
...
@@ -988,9 +988,4 @@ else \
[[
VLCMainMenu
sharedInstance
]
setRateControlsEnabled
:
b_control
];
}
-
(
void
)
updatePosAndTimeInFSPanel
:(
VLCFSPanel
*
)
o_fspanel
{
[
o_fspanel
setStreamPos
:[
o_time_sld
floatValue
]
andTime
:
[
o_time_fld
stringValue
]];
}
@end
modules/gui/macosx/MainWindow.m
View file @
021b9f25
...
...
@@ -608,7 +608,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
-
(
void
)
updateTimeSlider
{
[
o_controls_bar
updateTimeSlider
];
[
[
self
controlsBar
]
updatePosAndTimeInFSPanel
:
o_fspanel
];
[
o_fspanel
updatePositionAndTime
];
[[[
VLCMain
sharedInstance
]
voutController
]
updateWindowsControlsBarWithSelector
:
@selector
(
updateTimeSlider
)];
}
...
...
modules/gui/macosx/fspanel.h
View file @
021b9f25
...
...
@@ -52,7 +52,7 @@
-
(
void
)
setPlay
;
-
(
void
)
setPause
;
-
(
void
)
setStreamTitle
:
(
NSString
*
)
o_title
;
-
(
void
)
setStreamPos
:
(
float
)
f_pos
andTime
:
(
NSString
*
)
o_t
ime
;
-
(
void
)
updatePositionAndT
ime
;
-
(
void
)
setSeekable
:
(
BOOL
)
b_seekable
;
-
(
void
)
setVolumeLevel
:
(
int
)
i_volumeLevel
;
...
...
@@ -83,7 +83,8 @@
{
NSColor
*
fillColor
;
NSButton
*
o_prev
,
*
o_next
,
*
o_bwd
,
*
o_fwd
,
*
o_play
,
*
o_fullscreen
;
NSTextField
*
o_streamTitle_txt
,
*
o_streamPosition_txt
;
NSTextField
*
o_streamTitle_txt
;
VLCTimeField
*
o_streamPosition_txt
,
*
o_streamLength_txt
;
NSSlider
*
o_fs_timeSlider
,
*
o_fs_volumeSlider
;
VLCProgressView
*
o_progress_view
;
NSImage
*
o_background_img
,
*
o_vol_sld_img
,
*
o_vol_mute_img
,
*
o_vol_max_img
,
*
o_time_sld_img
;
...
...
@@ -96,7 +97,7 @@
-
(
void
)
setPlay
;
-
(
void
)
setPause
;
-
(
void
)
setStreamTitle
:
(
NSString
*
)
o_title
;
-
(
void
)
setStreamPos
:
(
float
)
f_pos
andTime
:
(
NSString
*
)
o_t
ime
;
-
(
void
)
updatePositionAndT
ime
;
-
(
void
)
setSeekable
:
(
BOOL
)
b_seekable
;
-
(
void
)
setVolumeLevel
:
(
int
)
i_volumeLevel
;
-
(
IBAction
)
play
:(
id
)
sender
;
...
...
modules/gui/macosx/fspanel.m
View file @
021b9f25
...
...
@@ -154,9 +154,9 @@
[[
self
contentView
]
setStreamTitle
:
o_title
];
}
-
(
void
)
setStreamPos
:(
float
)
f_pos
andTime
:
(
NSString
*
)
o_t
ime
-
(
void
)
updatePositionAndT
ime
{
[[
self
contentView
]
setStreamPos
:
f_pos
andTime
:
o_t
ime
];
[[
self
contentView
]
updatePositionAndT
ime
];
}
-
(
void
)
setSeekable
:(
BOOL
)
b_seekable
...
...
@@ -458,15 +458,20 @@
/* time counter and stream title output fields */
s_rc
=
[
self
frame
];
s_rc
.
origin
.
x
=
98
;
// 10 px gap between time fields
s_rc
.
origin
.
x
=
90
;
s_rc
.
origin
.
y
=
64
;
s_rc
.
size
.
width
=
3
52
;
s_rc
.
size
.
width
=
3
61
;
s_rc
.
size
.
height
=
14
;
addTextfield
(
NSTextField
,
o_streamTitle_txt
,
NSCenterTextAlignment
,
systemFontOfSize
,
whiteColor
);
s_rc
.
origin
.
x
=
15
;
s_rc
.
origin
.
y
=
64
;
s_rc
.
size
.
width
=
65
;
addTextfield
(
VLCTimeField
,
o_streamPosition_txt
,
NSLeftTextAlignment
,
systemFontOfSize
,
whiteColor
);
s_rc
.
origin
.
x
=
471
;
s_rc
.
origin
.
y
=
64
;
s_rc
.
size
.
width
=
65
;
addTextfield
(
VLCTimeField
,
o_stream
Position
_txt
,
NSRightTextAlignment
,
systemFontOfSize
,
whiteColor
);
addTextfield
(
VLCTimeField
,
o_stream
Length
_txt
,
NSRightTextAlignment
,
systemFontOfSize
,
whiteColor
);
o_background_img
=
[[
NSImage
imageNamed
:
@"fs_background"
]
retain
];
o_vol_sld_img
=
[[
NSImage
imageNamed
:
@"fs_volume_slider_bar"
]
retain
];
...
...
@@ -514,10 +519,54 @@
[
o_streamTitle_txt
setStringValue
:
o_title
];
}
-
(
void
)
setStreamPos
:(
float
)
f_pos
andTime
:
(
NSString
*
)
o_t
ime
-
(
void
)
updatePositionAndT
ime
{
[
o_streamPosition_txt
setStringValue
:
o_time
];
[
o_fs_timeSlider
setFloatValue
:
f_pos
];
input_thread_t
*
p_input
;
p_input
=
pl_CurrentInput
(
VLCIntf
);
if
(
p_input
)
{
vlc_value_t
pos
;
float
f_updated
;
var_Get
(
p_input
,
"position"
,
&
pos
);
f_updated
=
10000
.
*
pos
.
f_float
;
[
o_fs_timeSlider
setFloatValue
:
f_updated
];
vlc_value_t
time
;
char
psz_time
[
MSTRTIME_MAX_SIZE
];
var_Get
(
p_input
,
"time"
,
&
time
);
mtime_t
dur
=
input_item_GetDuration
(
input_GetItem
(
p_input
));
// update total duration (right field)
if
(
dur
<=
0
)
{
[
o_streamLength_txt
setHidden
:
YES
];
}
else
{
[
o_streamLength_txt
setHidden
:
NO
];
NSString
*
o_total_time
;
if
([
o_streamLength_txt
timeRemaining
])
{
mtime_t
remaining
=
0
;
if
(
dur
>
time
.
i_time
)
remaining
=
dur
-
time
.
i_time
;
o_total_time
=
[
NSString
stringWithFormat
:
@"-%s"
,
secstotimestr
(
psz_time
,
(
remaining
/
1000000
))];
}
else
o_total_time
=
[
NSString
stringWithUTF8String
:
secstotimestr
(
psz_time
,
(
dur
/
1000000
))];
[
o_streamLength_txt
setStringValue
:
o_total_time
];
}
// update current position (left field)
NSString
*
o_playback_pos
=
[
NSString
stringWithUTF8String
:
secstotimestr
(
psz_time
,
(
time
.
i_time
/
1000000
))];
[
o_streamPosition_txt
setStringValue
:
o_playback_pos
];
vlc_object_release
(
p_input
);
}
else
{
[
o_fs_timeSlider
setFloatValue
:
0
.
0
];
[
o_streamPosition_txt
setStringValue
:
@"00:00"
];
[
o_streamLength_txt
setHidden
:
YES
];
}
}
-
(
void
)
setSeekable
:(
BOOL
)
b_seekable
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment