Changeset 096ebc37110a1c2656a221c9820f0d9181e74490
- Timestamp:
- 07/01/08 20:30:38
(1 year ago)
- Author:
- Pierre d'Herbemont <pdherbemont@videolan.org>
- git-committer:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1199734238 +0000
- git-parent:
[79179c9e91d20221979ea176054b6ce724fe89de]
- git-author:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1199734238 +0000
- Message:
MacOSX/Framework: Implement -canPause and the various setRate related functions.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r11c628e |
r096ebc3 |
|
| 105 | 105 | - (int)videoTeleText; |
|---|
| 106 | 106 | |
|---|
| 107 | | - (void)setRate:(int)value; |
|---|
| 108 | | - (int)rate; |
|---|
| | 107 | @property float rate; |
|---|
| 109 | 108 | |
|---|
| 110 | 109 | /* Video Information */ |
|---|
| … | … | |
| 158 | 157 | * Fast forwards through the feed at the standard 1x rate. |
|---|
| 159 | 158 | */ |
|---|
| 160 | | //- (void)fastForward; |
|---|
| | 159 | - (void)fastForward; |
|---|
| 161 | 160 | |
|---|
| 162 | 161 | /** |
|---|
| … | … | |
| 164 | 163 | * \param rate Rate at which the feed should be fast forwarded. |
|---|
| 165 | 164 | */ |
|---|
| 166 | | //- (void)fastForwardAtRate:(int)rate; |
|---|
| | 165 | - (void)fastForwardAtRate:(float)rate; |
|---|
| 167 | 166 | |
|---|
| 168 | 167 | /** |
|---|
| 169 | 168 | * Rewinds through the feed at the standard 1x rate. |
|---|
| 170 | 169 | */ |
|---|
| 171 | | //- (void)rewind; |
|---|
| | 170 | - (void)rewind; |
|---|
| 172 | 171 | |
|---|
| 173 | 172 | /** |
|---|
| … | … | |
| 175 | 174 | * \param rate Rate at which the feed should be fast rewound. |
|---|
| 176 | 175 | */ |
|---|
| 177 | | //- (void)rewindAtRate:(int)rate; |
|---|
| | 176 | - (void)rewindAtRate:(float)rate; |
|---|
| 178 | 177 | |
|---|
| 179 | 178 | /* Playback Information */ |
|---|
| … | … | |
| 205 | 204 | - (BOOL)isSeekable; |
|---|
| 206 | 205 | |
|---|
| | 206 | - (BOOL)canPause; |
|---|
| | 207 | |
|---|
| 207 | 208 | @end |
|---|
| re3bc1e0 |
r096ebc3 |
|
| 60 | 60 | { |
|---|
| 61 | 61 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; |
|---|
| | 62 | |
|---|
| 62 | 63 | [[VLCEventManager sharedManager] callOnMainThreadObject:self |
|---|
| 63 | 64 | withMethod:@selector(mediaPlayerTimeChanged:) |
|---|
| … | … | |
| 83 | 84 | { |
|---|
| 84 | 85 | VLCMediaPlayerState newState; |
|---|
| 85 | | |
|---|
| | 86 | |
|---|
| 86 | 87 | if( event->type == libvlc_MediaInstancePlayed ) |
|---|
| 87 | 88 | newState = VLCMediaPlayerStatePlaying; |
|---|
| … | … | |
| 129 | 130 | { |
|---|
| 130 | 131 | static NSDictionary * dict = nil; |
|---|
| | 132 | NSSet * superKeyPaths; |
|---|
| 131 | 133 | if( !dict ) |
|---|
| 132 | 134 | { |
|---|
| … | … | |
| 134 | 136 | [NSSet setWithObject:@"state"], @"playing", |
|---|
| 135 | 137 | [NSSet setWithObjects:@"state", @"media", nil], @"seekable", |
|---|
| | 138 | [NSSet setWithObjects:@"state", @"media", nil], @"canPause", |
|---|
| 136 | 139 | [NSSet setWithObjects:@"state", @"media", nil], @"description", |
|---|
| 137 | 140 | nil] retain]; |
|---|
| | 141 | } |
|---|
| | 142 | if( (superKeyPaths = [super keyPathsForValuesAffectingValueForKey: key]) ) |
|---|
| | 143 | { |
|---|
| | 144 | NSMutableSet * ret = [NSMutableSet setWithSet:[dict objectForKey: key]]; |
|---|
| | 145 | [ret unionSet:superKeyPaths]; |
|---|
| | 146 | return ret; |
|---|
| 138 | 147 | } |
|---|
| 139 | 148 | return [dict objectForKey: key]; |
|---|
| … | … | |
| 262 | 271 | } |
|---|
| 263 | 272 | |
|---|
| 264 | | - (void)setRate:(int)value |
|---|
| | 273 | - (void)setRate:(float)value |
|---|
| 265 | 274 | { |
|---|
| 266 | 275 | libvlc_media_instance_set_rate( instance, value, NULL ); |
|---|
| 267 | 276 | } |
|---|
| 268 | 277 | |
|---|
| 269 | | - (int)rate |
|---|
| | 278 | - (float)rate |
|---|
| 270 | 279 | { |
|---|
| 271 | 280 | libvlc_exception_t ex; |
|---|
| … | … | |
| 468 | 477 | } |
|---|
| 469 | 478 | |
|---|
| 470 | | //- (void)fastForward; |
|---|
| 471 | | //- (void)fastForwardAtRate:(int)rate; |
|---|
| 472 | | //- (void)rewind; |
|---|
| 473 | | //- (void)rewindAtRate:(int)rate; |
|---|
| | 479 | - (void)fastForward |
|---|
| | 480 | { |
|---|
| | 481 | [self fastForwardAtRate: 2.0]; |
|---|
| | 482 | } |
|---|
| | 483 | |
|---|
| | 484 | - (void)fastForwardAtRate:(float)rate |
|---|
| | 485 | { |
|---|
| | 486 | [self setRate:rate]; |
|---|
| | 487 | } |
|---|
| | 488 | |
|---|
| | 489 | - (void)rewind |
|---|
| | 490 | { |
|---|
| | 491 | [self rewindAtRate: 2.0]; |
|---|
| | 492 | } |
|---|
| | 493 | |
|---|
| | 494 | - (void)rewindAtRate:(float)rate |
|---|
| | 495 | { |
|---|
| | 496 | [self setRate: -rate]; |
|---|
| | 497 | } |
|---|
| 474 | 498 | |
|---|
| 475 | 499 | - (BOOL)isPlaying |
|---|
| … | … | |
| 532 | 556 | } |
|---|
| 533 | 557 | |
|---|
| | 558 | - (BOOL)canPause |
|---|
| | 559 | { |
|---|
| | 560 | libvlc_exception_t ex; |
|---|
| | 561 | libvlc_exception_init( &ex ); |
|---|
| | 562 | BOOL ret = libvlc_media_instance_can_pause( instance, &ex ); |
|---|
| | 563 | catch_exception( &ex ); |
|---|
| | 564 | return ret; |
|---|
| | 565 | } |
|---|
| 534 | 566 | @end |
|---|
| 535 | 567 | |
|---|