Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
f1ee099e
Commit
f1ee099e
authored
Apr 26, 2014
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx/StringUtility: add helper to format time strings
parent
407acf38
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
3 deletions
+25
-3
modules/gui/macosx/StringUtility.h
modules/gui/macosx/StringUtility.h
+1
-0
modules/gui/macosx/StringUtility.m
modules/gui/macosx/StringUtility.m
+24
-3
No files found.
modules/gui/macosx/StringUtility.h
View file @
f1ee099e
...
...
@@ -48,6 +48,7 @@ unsigned int CocoaKeyToVLC(unichar i_key);
-
(
NSString
*
)
localizedString
:(
const
char
*
)
psz
;
-
(
NSString
*
)
wrapString
:
(
NSString
*
)
o_in_string
toWidth
:
(
int
)
i_width
;
-
(
NSString
*
)
getCurrentTimeAsString
:(
input_thread_t
*
)
p_input
negative
:(
BOOL
)
b_negative
;
-
(
NSString
*
)
stringForTime
:(
long
long
int
)
time
;
-
(
NSString
*
)
OSXStringKeyToString
:(
NSString
*
)
theString
;
-
(
NSString
*
)
VLCKeyToString
:(
NSString
*
)
theString
;
...
...
modules/gui/macosx/StringUtility.m
View file @
f1ee099e
...
...
@@ -133,6 +133,27 @@ static VLCStringUtility *_o_sharedInstance = nil;
return
[
NSString
stringWithUTF8String
:
secstotimestr
(
psz_time
,
(
time
.
i_time
/
1000000
))];
}
-
(
NSString
*
)
stringForTime
:(
long
long
int
)
time
{
if
(
time
>
0
)
{
long
long
positiveDuration
=
llabs
(
time
);
if
(
positiveDuration
>
3600
)
return
[
NSString
stringWithFormat
:
@"%s%01ld:%02ld:%02ld"
,
time
<
0
?
"-"
:
""
,
(
long
)
(
positiveDuration
/
3600
),
(
long
)((
positiveDuration
/
60
)
%
60
),
(
long
)
(
positiveDuration
%
60
)];
else
return
[
NSString
stringWithFormat
:
@"%s%02ld:%02ld"
,
time
<
0
?
"-"
:
""
,
(
long
)((
positiveDuration
/
60
)
%
60
),
(
long
)
(
positiveDuration
%
60
)];
}
else
{
// Return a string that represents an undefined time.
return
@"--:--"
;
}
}
#pragma mark -
#pragma mark Key Shortcuts
...
...
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