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
3e5fe8b6
Commit
3e5fe8b6
authored
Dec 07, 2009
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx/framework: Export -[VLCMediaPlayer remainingTime] and -[VLCTime verboseStringValue].
parent
6aca0a67
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
0 deletions
+36
-0
projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
+2
-0
projects/macosx/framework/Headers/Public/VLCTime.h
projects/macosx/framework/Headers/Public/VLCTime.h
+1
-0
projects/macosx/framework/Sources/VLCMediaPlayer.m
projects/macosx/framework/Sources/VLCMediaPlayer.m
+9
-0
projects/macosx/framework/Sources/VLCTime.m
projects/macosx/framework/Sources/VLCTime.m
+24
-0
No files found.
projects/macosx/framework/Headers/Public/VLCMediaPlayer.h
View file @
3e5fe8b6
...
...
@@ -153,6 +153,8 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
*/
-
(
VLCTime
*
)
time
;
@property
(
readonly
)
VLCTime
*
remainingTime
;
-
(
void
)
setChapter
:(
int
)
value
;
-
(
int
)
chapter
;
-
(
int
)
countOfChapters
;
...
...
projects/macosx/framework/Headers/Public/VLCTime.h
View file @
3e5fe8b6
...
...
@@ -44,6 +44,7 @@
/* Properties */
@property
(
readonly
)
NSNumber
*
numberValue
;
@property
(
readonly
)
NSString
*
stringValue
;
@property
(
readonly
)
NSString
*
verboseStringValue
;
@property
(
readonly
)
int
intValue
;
/* Comparitors */
...
...
projects/macosx/framework/Sources/VLCMediaPlayer.m
View file @
3e5fe8b6
...
...
@@ -384,6 +384,13 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
return
cachedTime
;
}
-
(
VLCTime
*
)
remainingTime
{
double
currentTime
=
[[
cachedTime
numberValue
]
doubleValue
];
double
remaining
=
currentTime
/
position
*
(
1
-
position
);
return
[
VLCTime
timeWithNumber
:[
NSNumber
numberWithDouble
:
-
remaining
]];
}
-
(
void
)
setChapter
:(
int
)
value
;
{
libvlc_media_player_set_chapter
(
instance
,
value
,
NULL
);
...
...
@@ -726,9 +733,11 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
-
(
void
)
mediaPlayerTimeChanged
:(
NSNumber
*
)
newTime
{
[
self
willChangeValueForKey
:
@"time"
];
[
self
willChangeValueForKey
:
@"remainingTime"
];
[
cachedTime
release
];
cachedTime
=
[[
VLCTime
timeWithNumber
:
newTime
]
retain
];
[
self
didChangeValueForKey
:
@"remainingTime"
];
[
self
didChangeValueForKey
:
@"time"
];
}
...
...
projects/macosx/framework/Sources/VLCTime.m
View file @
3e5fe8b6
...
...
@@ -117,6 +117,30 @@
}
}
-
(
NSString
*
)
verboseStringValue
{
if
(
value
)
{
long
long
duration
=
[
value
longLongValue
]
/
1000000
;
long
long
positiveDuration
=
llabs
(
duration
);
long
hours
=
positiveDuration
/
3600
;
long
mins
=
(
positiveDuration
/
60
)
%
60
;
long
seconds
=
positiveDuration
%
60
;
const
char
*
remaining
=
duration
<
0
?
" remaining"
:
""
;
if
(
hours
>
0
)
return
[
NSString
stringWithFormat
:
@"%d hours %d minutes%s"
,
hours
,
mins
,
remaining
];
else
if
(
mins
>
5
)
return
[
NSString
stringWithFormat
:
@"%d minutes%s"
,
mins
,
remaining
];
else
return
[
NSString
stringWithFormat
:
@"%d seconds%s"
,
seconds
,
remaining
];
}
else
{
// Return a string that represents an undefined time.
return
@""
;
}
}
-
(
int
)
intValue
{
if
(
value
)
...
...
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