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
096ebc37
Commit
096ebc37
authored
Jan 07, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MacOSX/Framework: Implement -canPause and the various setRate related functions.
parent
79179c9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
13 deletions
+46
-13
extras/MacOSX/Framework/Headers/Public/VLCMediaPlayer.h
extras/MacOSX/Framework/Headers/Public/VLCMediaPlayer.h
+7
-6
extras/MacOSX/Framework/Sources/VLCMediaPlayer.m
extras/MacOSX/Framework/Sources/VLCMediaPlayer.m
+39
-7
No files found.
extras/MacOSX/Framework/Headers/Public/VLCMediaPlayer.h
View file @
096ebc37
...
@@ -104,8 +104,7 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
...
@@ -104,8 +104,7 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
-
(
void
)
setVideoTeleText
:(
int
)
value
;
-
(
void
)
setVideoTeleText
:(
int
)
value
;
-
(
int
)
videoTeleText
;
-
(
int
)
videoTeleText
;
-
(
void
)
setRate
:(
int
)
value
;
@property
float
rate
;
-
(
int
)
rate
;
/* Video Information */
/* Video Information */
-
(
NSSize
)
videoSize
;
-
(
NSSize
)
videoSize
;
...
@@ -157,24 +156,24 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
...
@@ -157,24 +156,24 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
/**
/**
* Fast forwards through the feed at the standard 1x rate.
* Fast forwards through the feed at the standard 1x rate.
*/
*/
//
- (void)fastForward;
-
(
void
)
fastForward
;
/**
/**
* Fast forwards through the feed at the rate specified.
* Fast forwards through the feed at the rate specified.
* \param rate Rate at which the feed should be fast forwarded.
* \param rate Rate at which the feed should be fast forwarded.
*/
*/
//- (void)fastForwardAtRate:(in
t)rate;
-
(
void
)
fastForwardAtRate
:(
floa
t
)
rate
;
/**
/**
* Rewinds through the feed at the standard 1x rate.
* Rewinds through the feed at the standard 1x rate.
*/
*/
//
- (void)rewind;
-
(
void
)
rewind
;
/**
/**
* Rewinds through the feed at the rate specified.
* Rewinds through the feed at the rate specified.
* \param rate Rate at which the feed should be fast rewound.
* \param rate Rate at which the feed should be fast rewound.
*/
*/
//- (void)rewindAtRate:(in
t)rate;
-
(
void
)
rewindAtRate
:(
floa
t
)
rate
;
/* Playback Information */
/* Playback Information */
/**
/**
...
@@ -204,4 +203,6 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
...
@@ -204,4 +203,6 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
-
(
BOOL
)
isSeekable
;
-
(
BOOL
)
isSeekable
;
-
(
BOOL
)
canPause
;
@end
@end
extras/MacOSX/Framework/Sources/VLCMediaPlayer.m
View file @
096ebc37
...
@@ -59,6 +59,7 @@ static void HandleMediaInstanceVolumeChanged(const libvlc_event_t * event, void
...
@@ -59,6 +59,7 @@ static void HandleMediaInstanceVolumeChanged(const libvlc_event_t * event, void
static
void
HandleMediaTimeChanged
(
const
libvlc_event_t
*
event
,
void
*
self
)
static
void
HandleMediaTimeChanged
(
const
libvlc_event_t
*
event
,
void
*
self
)
{
{
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
NSAutoreleasePool
*
pool
=
[[
NSAutoreleasePool
alloc
]
init
];
[[
VLCEventManager
sharedManager
]
callOnMainThreadObject
:
self
[[
VLCEventManager
sharedManager
]
callOnMainThreadObject
:
self
withMethod:
@selector
(
mediaPlayerTimeChanged
:)
withMethod:
@selector
(
mediaPlayerTimeChanged
:)
withArgumentAsObject:
[
NSNumber
numberWithLongLong
:
event
->
u
.
media_instance_time_changed
.
new_time
]];
withArgumentAsObject:
[
NSNumber
numberWithLongLong
:
event
->
u
.
media_instance_time_changed
.
new_time
]];
...
@@ -82,7 +83,7 @@ static void HandleMediaPositionChanged(const libvlc_event_t * event, void * self
...
@@ -82,7 +83,7 @@ static void HandleMediaPositionChanged(const libvlc_event_t * event, void * self
static
void
HandleMediaInstanceStateChanged
(
const
libvlc_event_t
*
event
,
void
*
self
)
static
void
HandleMediaInstanceStateChanged
(
const
libvlc_event_t
*
event
,
void
*
self
)
{
{
VLCMediaPlayerState
newState
;
VLCMediaPlayerState
newState
;
if
(
event
->
type
==
libvlc_MediaInstancePlayed
)
if
(
event
->
type
==
libvlc_MediaInstancePlayed
)
newState
=
VLCMediaPlayerStatePlaying
;
newState
=
VLCMediaPlayerStatePlaying
;
else
if
(
event
->
type
==
libvlc_MediaInstancePaused
)
else
if
(
event
->
type
==
libvlc_MediaInstancePaused
)
...
@@ -128,14 +129,22 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
...
@@ -128,14 +129,22 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
+
(
NSSet
*
)
keyPathsForValuesAffectingValueForKey
:(
NSString
*
)
key
+
(
NSSet
*
)
keyPathsForValuesAffectingValueForKey
:(
NSString
*
)
key
{
{
static
NSDictionary
*
dict
=
nil
;
static
NSDictionary
*
dict
=
nil
;
NSSet
*
superKeyPaths
;
if
(
!
dict
)
if
(
!
dict
)
{
{
dict
=
[[
NSDictionary
dictionaryWithObjectsAndKeys
:
dict
=
[[
NSDictionary
dictionaryWithObjectsAndKeys
:
[
NSSet
setWithObject
:
@"state"
],
@"playing"
,
[
NSSet
setWithObject
:
@"state"
],
@"playing"
,
[
NSSet
setWithObjects
:
@"state"
,
@"media"
,
nil
],
@"seekable"
,
[
NSSet
setWithObjects
:
@"state"
,
@"media"
,
nil
],
@"seekable"
,
[
NSSet
setWithObjects
:
@"state"
,
@"media"
,
nil
],
@"canPause"
,
[
NSSet
setWithObjects
:
@"state"
,
@"media"
,
nil
],
@"description"
,
[
NSSet
setWithObjects
:
@"state"
,
@"media"
,
nil
],
@"description"
,
nil
]
retain
];
nil
]
retain
];
}
}
if
(
(
superKeyPaths
=
[
super
keyPathsForValuesAffectingValueForKey
:
key
])
)
{
NSMutableSet
*
ret
=
[
NSMutableSet
setWithSet
:[
dict
objectForKey
:
key
]];
[
ret
unionSet
:
superKeyPaths
];
return
ret
;
}
return
[
dict
objectForKey
:
key
];
return
[
dict
objectForKey
:
key
];
}
}
...
@@ -261,12 +270,12 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
...
@@ -261,12 +270,12 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
return
result
;
return
result
;
}
}
-
(
void
)
setRate
:(
in
t
)
value
-
(
void
)
setRate
:(
floa
t
)
value
{
{
libvlc_media_instance_set_rate
(
instance
,
value
,
NULL
);
libvlc_media_instance_set_rate
(
instance
,
value
,
NULL
);
}
}
-
(
in
t
)
rate
-
(
floa
t
)
rate
{
{
libvlc_exception_t
ex
;
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
libvlc_exception_init
(
&
ex
);
...
@@ -467,10 +476,25 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
...
@@ -467,10 +476,25 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
// TODO: Should we pause this or destroy the media instance so that it appears as being "stopped"?
// TODO: Should we pause this or destroy the media instance so that it appears as being "stopped"?
}
}
//- (void)fastForward;
-
(
void
)
fastForward
//- (void)fastForwardAtRate:(int)rate;
{
//- (void)rewind;
[
self
fastForwardAtRate
:
2
.
0
];
//- (void)rewindAtRate:(int)rate;
}
-
(
void
)
fastForwardAtRate
:(
float
)
rate
{
[
self
setRate
:
rate
];
}
-
(
void
)
rewind
{
[
self
rewindAtRate
:
2
.
0
];
}
-
(
void
)
rewindAtRate
:(
float
)
rate
{
[
self
setRate
:
-
rate
];
}
-
(
BOOL
)
isPlaying
-
(
BOOL
)
isPlaying
{
{
...
@@ -531,6 +555,14 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
...
@@ -531,6 +555,14 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
return
ret
;
return
ret
;
}
}
-
(
BOOL
)
canPause
{
libvlc_exception_t
ex
;
libvlc_exception_init
(
&
ex
);
BOOL
ret
=
libvlc_media_instance_can_pause
(
instance
,
&
ex
);
catch_exception
(
&
ex
);
return
ret
;
}
@end
@end
@implementation
VLCMediaPlayer
(
Private
)
@implementation
VLCMediaPlayer
(
Private
)
...
...
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