Changeset 1b26ff77b0fd9ea5d713c7acd52259e6c68efbf5
- Timestamp:
- 30/12/07 02:50:14
(9 months ago)
- Author:
- Pierre d'Herbemont <pdherbemont@videolan.org>
- git-committer:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1198979414 +0000
- git-parent:
[0d4609bfb9bdb1900613263ac66b354dd3bf754a]
- git-author:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1198979414 +0000
- Message:
MacOSX/Framework/VLCMedia.m: Update the subitems on sub item additions.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r35f97be |
r1b26ff7 |
|
| 71 | 71 | /* Callback Methods */ |
|---|
| 72 | 72 | - (void)metaChanged:(NSString *)metaType; |
|---|
| | 73 | - (void)subItemAdded; |
|---|
| 73 | 74 | @end |
|---|
| 74 | 75 | |
|---|
| … | … | |
| 123 | 124 | } |
|---|
| 124 | 125 | |
|---|
| | 126 | static void HandleMediaSubItemAdded(const libvlc_event_t *event, void *self) |
|---|
| | 127 | { |
|---|
| | 128 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
|---|
| | 129 | [[VLCEventManager sharedManager] callOnMainThreadObject:self |
|---|
| | 130 | withMethod:@selector(subItemAdded) |
|---|
| | 131 | withArgumentAsObject:nil]; |
|---|
| | 132 | [pool release]; |
|---|
| | 133 | } |
|---|
| | 134 | |
|---|
| 125 | 135 | /****************************************************************************** |
|---|
| 126 | 136 | * Implementation |
|---|
| … | … | |
| 207 | 217 | libvlc_event_detach(p_em, libvlc_MediaDescriptorDurationChanged, HandleMediaDurationChanged, self, NULL); |
|---|
| 208 | 218 | libvlc_event_detach(p_em, libvlc_MediaDescriptorStateChanged, HandleMediaStateChanged, self, NULL); |
|---|
| | 219 | libvlc_event_detach(p_em, libvlc_MediaDescriptorSubItemAdded, HandleMediaSubItemAdded, self, NULL); |
|---|
| 209 | 220 | } |
|---|
| 210 | 221 | [super release]; |
|---|
| … | … | |
| 428 | 439 | libvlc_event_attach(p_em, libvlc_MediaDescriptorDurationChanged, HandleMediaDurationChanged, self, &ex); |
|---|
| 429 | 440 | libvlc_event_attach(p_em, libvlc_MediaDescriptorStateChanged, HandleMediaStateChanged, self, &ex); |
|---|
| | 441 | libvlc_event_attach(p_em, libvlc_MediaDescriptorSubItemAdded, HandleMediaSubItemAdded, self, &ex); |
|---|
| 430 | 442 | quit_on_exception( &ex ); |
|---|
| 431 | 443 | |
|---|
| … | … | |
| 439 | 451 | libvlc_media_list_release( p_mlist ); |
|---|
| 440 | 452 | } |
|---|
| | 453 | |
|---|
| 441 | 454 | state = LibVLCStateToMediaState(libvlc_media_descriptor_get_state( p_md, NULL )); |
|---|
| 442 | 455 | /* Force VLCMetaInformationTitle, that will trigger preparsing |
|---|
| … | … | |
| 490 | 503 | [self fetchMetaInformationFromLibVLCWithType:metaType]; |
|---|
| 491 | 504 | } |
|---|
| | 505 | |
|---|
| | 506 | - (void)subItemAdded |
|---|
| | 507 | { |
|---|
| | 508 | if( subitems ) |
|---|
| | 509 | return; /* Nothing to do */ |
|---|
| | 510 | |
|---|
| | 511 | libvlc_media_list_t *p_mlist = libvlc_media_descriptor_subitems( p_md, NULL ); |
|---|
| | 512 | |
|---|
| | 513 | NSAssert( p_mlist, @"The mlist shouldn't be nil, we are receiving a subItemAdded"); |
|---|
| | 514 | |
|---|
| | 515 | [self willChangeValueForKey:@"subitems"]; |
|---|
| | 516 | subitems = [[VLCMediaList mediaListWithLibVLCMediaList:p_mlist] retain]; |
|---|
| | 517 | [self didChangeValueForKey:@"subitems"]; |
|---|
| | 518 | libvlc_media_list_release( p_mlist ); |
|---|
| | 519 | } |
|---|
| 492 | 520 | @end |
|---|
| 493 | 521 | |
|---|