Changeset 7fef8b8726f85876ffe110a949e1a09251094c83
- Timestamp:
- 17/09/06 20:41:21 (2 years ago)
- git-parent:
- Files:
-
- modules/gui/macosx/controls.m (modified) (7 diffs)
- modules/gui/macosx/embeddedwindow.m (modified) (1 diff)
- modules/gui/macosx/extended.m (modified) (2 diffs)
- modules/gui/macosx/intf.m (modified) (22 diffs)
- modules/gui/macosx/playlist.m (modified) (37 diffs)
- modules/gui/macosx/playlistinfo.m (modified) (5 diffs)
- modules/gui/macosx/wizard.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/gui/macosx/controls.m
rf485214 r7fef8b8 64 64 vlc_value_t val; 65 65 intf_thread_t * p_intf = VLCIntf; 66 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 67 FIND_ANYWHERE ); 68 if( p_playlist ) 69 { 70 vlc_mutex_lock( &p_playlist->object_lock ); 71 if( p_playlist->i_size <= 0 ) 72 { 73 vlc_mutex_unlock( &p_playlist->object_lock ); 74 vlc_object_release( p_playlist ); 75 [o_main intfOpenFileGeneric: (id)sender]; 76 } 77 else 78 { 79 vlc_mutex_unlock( &p_playlist->object_lock ); 80 vlc_object_release( p_playlist ); 81 } 82 83 } 66 playlist_t * p_playlist = pl_Yield( p_intf ); 67 68 vlc_mutex_lock( &p_playlist->object_lock ); 69 if( p_playlist->i_size <= 0 ) 70 { 71 vlc_mutex_unlock( &p_playlist->object_lock ); 72 vlc_object_release( p_playlist ); 73 [o_main intfOpenFileGeneric: (id)sender]; 74 } 75 else 76 { 77 vlc_mutex_unlock( &p_playlist->object_lock ); 78 vlc_object_release( p_playlist ); 79 } 80 84 81 val.i_int = config_GetInt( p_intf, "key-play-pause" ); 85 82 var_Set( p_intf->p_libvlc, "key-pressed", val ); … … 156 153 vlc_value_t val; 157 154 intf_thread_t * p_intf = VLCIntf; 158 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 159 FIND_ANYWHERE ); 160 if( p_playlist == NULL ) 161 { 162 return; 163 } 155 playlist_t * p_playlist = pl_Yield( p_intf ); 164 156 165 157 var_Get( p_playlist, "random", &val ); … … 186 178 vlc_value_t val; 187 179 intf_thread_t * p_intf = VLCIntf; 188 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 189 FIND_ANYWHERE ); 190 if( p_playlist == NULL ) 191 { 192 return; 193 } 180 playlist_t * p_playlist = pl_Yield( p_intf ); 194 181 195 182 var_Get( p_playlist, "repeat", &val ); … … 220 207 vlc_value_t val; 221 208 intf_thread_t * p_intf = VLCIntf; 222 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 223 FIND_ANYWHERE ); 224 if( p_playlist == NULL ) 225 { 226 return; 227 } 209 playlist_t * p_playlist = pl_Yield( p_intf ); 228 210 229 211 var_Get( p_playlist, "loop", &val ); … … 346 328 else 347 329 { 348 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 349 FIND_ANYWHERE ); 350 351 if( p_playlist && ( [o_title isEqualToString: _NS("Fullscreen")] || 352 [sender isKindOfClass:[NSButton class]] ) ) 330 playlist_t * p_playlist = pl_Yield( VLCIntf ); 331 332 if( [o_title isEqualToString: _NS("Fullscreen")] || 333 [sender isKindOfClass:[NSButton class]] ) 353 334 { 354 335 vlc_value_t val; … … 356 337 var_Set( p_playlist, "fullscreen", (vlc_value_t)!val.b_bool ); 357 338 } 358 if( p_playlist ) vlc_object_release( (vlc_object_t *)p_playlist ); 339 340 vlc_object_release( p_playlist ); 359 341 } 360 342 … … 698 680 vlc_value_t val; 699 681 intf_thread_t * p_intf = VLCIntf; 700 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 701 FIND_ANYWHERE ); 702 703 if( p_playlist != NULL ) 704 { 705 vlc_mutex_lock( &p_playlist->object_lock ); 706 } 707 else return FALSE; 682 playlist_t * p_playlist = pl_Yield( p_intf ); 683 684 vlc_mutex_lock( &p_playlist->object_lock ); 708 685 709 686 #define p_input p_playlist->p_input modules/gui/macosx/embeddedwindow.m
reaeeb9b r7fef8b8 88 88 - (BOOL)windowShouldClose:(id)sender 89 89 { 90 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 91 FIND_ANYWHERE ); 92 if( p_playlist == NULL ) 93 { 94 return NO; 95 } 90 playlist_t * p_playlist = pl_Yield( VLCIntf ); 96 91 97 92 playlist_Stop( p_playlist ); modules/gui/macosx/extended.m
r665d0ef r7fef8b8 370 370 NSArray *o_windows = [NSApp orderedWindows]; 371 371 NSEnumerator *o_enumerator = [o_windows objectEnumerator]; 372 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 373 FIND_ANYWHERE ); 372 playlist_t * p_playlist = pl_Yield( VLCIntf ); 374 373 vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT, FIND_ANYWHERE ); 375 374 vout_thread_t *p_real_vout; … … 849 848 /* save the preferences to make sure that our module-changes will up on 850 849 * next launch again */ 851 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 852 FIND_ANYWHERE ); 850 playlist_t * p_playlist = pl_Yield( VLCIntf ); 853 851 int returnedValue; 854 852 NSArray * theModules; modules/gui/macosx/intf.m
r997c585 r7fef8b8 457 457 o_size_with_playlist = [o_window frame].size; 458 458 459 p_playlist = (playlist_t *) vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); 460 461 if( p_playlist ) 462 { 463 /* Check if we need to start playing */ 464 if( p_intf->b_play ) 465 { 466 playlist_LockControl( p_playlist, PLAYLIST_AUTOPLAY ); 467 } 468 var_Create( p_playlist, "fullscreen", VLC_VAR_BOOL | VLC_VAR_DOINHERIT); 469 val.b_bool = VLC_FALSE; 470 471 var_AddCallback( p_playlist, "fullscreen", FullscreenChanged, self); 472 var_AddCallback( p_playlist, "intf-show", ShowController, self); 473 474 [o_embedded_window setFullscreen: var_GetBool( p_playlist, 475 "fullscreen" )]; 476 vlc_object_release( p_playlist ); 477 } 459 p_playlist = pl_Yield( p_intf ); 460 461 /* Check if we need to start playing */ 462 if( p_intf->b_play ) 463 { 464 playlist_LockControl( p_playlist, PLAYLIST_AUTOPLAY ); 465 } 466 var_Create( p_playlist, "fullscreen", VLC_VAR_BOOL | VLC_VAR_DOINHERIT); 467 val.b_bool = VLC_FALSE; 468 469 var_AddCallback( p_playlist, "fullscreen", FullscreenChanged, self); 470 var_AddCallback( p_playlist, "intf-show", ShowController, self); 471 472 [o_embedded_window setFullscreen: var_GetBool( p_playlist, 473 "fullscreen" )]; 474 vlc_object_release( p_playlist ); 478 475 479 476 var_Create( p_intf, "interaction", VLC_VAR_ADDRESS ); … … 742 739 /* there are two events when the plus or minus button is pressed 743 740 one when the button is pressed down and one when the button is released */ 744 if (pressedDown)741 if( pressedDown ) 745 742 { 746 743 [o_controls volumeUp: self]; … … 750 747 /* there are two events when the plus or minus button is pressed 751 748 one when the button is pressed down and one when the button is released */ 752 if (pressedDown) { 749 if( pressedDown ) 750 { 753 751 [o_controls volumeDown: self]; 754 752 } … … 764 762 /* simulate an event as long as the user holds the button */ 765 763 b_left_right_remote_button_hold = pressedDown; 766 if (pressedDown) { 764 if( pressedDown ) 765 { 767 766 NSNumber* buttonIdentifierNumber = [NSNumber numberWithInt: buttonIdentifier]; 768 767 [self performSelector:@selector(triggerMovieStepForRemoteButton:) … … 918 917 - (id)getPlaylist 919 918 { 920 if ( o_playlist ) 921 { 922 return o_playlist; 923 } 924 return nil; 919 return o_playlist; 925 920 } 926 921 … … 1000 995 vlc_thread_set_priority( p_intf, VLC_THREAD_PRIORITY_LOW ); 1001 996 1002 p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 1003 FIND_ANYWHERE ); 1004 1005 if( p_playlist != NULL ) 1006 { 1007 var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self ); 1008 var_AddCallback( p_playlist, "item-change", PlaylistChanged, self ); 1009 var_AddCallback( p_playlist, "item-append", PlaylistChanged, self ); 1010 var_AddCallback( p_playlist, "item-deleted", PlaylistChanged, self ); 1011 var_AddCallback( p_playlist, "playlist-current", PlaylistChanged, self ); 1012 1013 vlc_object_release( p_playlist ); 1014 } 997 p_playlist = pl_Yield( p_intf ); 998 999 var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self ); 1000 var_AddCallback( p_playlist, "item-change", PlaylistChanged, self ); 1001 var_AddCallback( p_playlist, "item-append", PlaylistChanged, self ); 1002 var_AddCallback( p_playlist, "item-deleted", PlaylistChanged, self ); 1003 var_AddCallback( p_playlist, "playlist-current", PlaylistChanged, self ); 1004 1005 vlc_object_release( p_playlist ); 1015 1006 1016 1007 while( !p_intf->b_die ) … … 1074 1065 vlc_bool_t b_chapters = VLC_FALSE; 1075 1066 1076 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 1077 FIND_ANYWHERE ); 1067 playlist_t * p_playlist = pl_Yield( p_intf ); 1078 1068 b_plmul = p_playlist->i_size > 1; 1079 1069 … … 1123 1113 if( p_intf->p_sys->b_fullscreen_update ) 1124 1114 { 1125 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 1126 FIND_ANYWHERE ); 1115 playlist_t * p_playlist = pl_Yield( p_intf ); 1127 1116 var_Get( p_playlist, "fullscreen", &val ); 1128 1117 [o_embedded_window setFullscreen: val.b_bool]; … … 1147 1136 NSString *o_temp; 1148 1137 vout_thread_t *p_vout; 1149 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 1150 FIND_ANYWHERE ); 1151 1152 if( p_playlist == NULL || p_playlist->status.p_item == NULL ) 1138 playlist_t * p_playlist = pl_Yield( p_intf ); 1139 1140 if( p_playlist->status.p_item == NULL ) 1153 1141 { 1142 vlc_object_release( p_playlist ); 1154 1143 return; 1155 1144 } … … 1345 1334 { 1346 1335 NSString *o_temp; 1347 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 1348 FIND_ANYWHERE ); 1349 if( p_playlist == NULL ) 1350 { 1351 return; 1352 } 1336 playlist_t * p_playlist = pl_Yield( p_intf ); 1337 1353 1338 o_temp = [NSString stringWithUTF8String: 1354 1339 p_playlist->status.p_item->p_input->psz_name]; … … 1537 1522 1538 1523 /* Stop playback */ 1539 if( ( p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 1540 FIND_ANYWHERE ) ) ) 1541 { 1542 playlist_Stop( p_playlist ); 1543 vlc_object_release( p_playlist ); 1544 } 1524 p_playlist = pl_Yield( p_intf ); 1525 playlist_Stop( p_playlist ); 1526 vlc_object_release( p_playlist ); 1545 1527 1546 1528 /* FIXME - Wait here until all vouts are terminated because … … 1648 1630 - (IBAction)intfOpenFile:(id)sender 1649 1631 { 1650 if ( !nib_open_loaded)1632 if ( !nib_open_loaded ) 1651 1633 { 1652 1634 nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self]; … … 1660 1642 - (IBAction)intfOpenFileGeneric:(id)sender 1661 1643 { 1662 if ( !nib_open_loaded)1644 if ( !nib_open_loaded ) 1663 1645 { 1664 1646 nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self]; … … 1672 1654 - (IBAction)intfOpenDisc:(id)sender 1673 1655 { 1674 if ( !nib_open_loaded)1656 if ( !nib_open_loaded ) 1675 1657 { 1676 1658 nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self]; … … 1684 1666 - (IBAction)intfOpenNet:(id)sender 1685 1667 { 1686 if ( !nib_open_loaded)1668 if ( !nib_open_loaded ) 1687 1669 { 1688 1670 nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self]; … … 1696 1678 - (IBAction)showWizard:(id)sender 1697 1679 { 1698 if ( !nib_wizard_loaded)1680 if ( !nib_wizard_loaded ) 1699 1681 { 1700 1682 nib_wizard_loaded = [NSBundle loadNibNamed:@"Wizard" owner:self]; … … 1714 1696 o_extended = [[VLCExtended alloc] init]; 1715 1697 } 1716 if ( !nib_extended_loaded)1698 if ( !nib_extended_loaded ) 1717 1699 { 1718 1700 nib_extended_loaded = [NSBundle loadNibNamed:@"Extended" owner:self]; … … 1730 1712 o_sfilters = [[VLCsFilters alloc] init]; 1731 1713 } 1732 if ( !nib_sfilters_loaded)1714 if ( !nib_sfilters_loaded ) 1733 1715 { 1734 1716 nib_sfilters_loaded = [NSBundle loadNibNamed:@"SFilters" owner:self]; … … 1743 1725 { 1744 1726 /* we need the wizard-nib for the bookmarks's extract functionality */ 1745 if ( !nib_wizard_loaded)1727 if ( !nib_wizard_loaded ) 1746 1728 { 1747 1729 nib_wizard_loaded = [NSBundle loadNibNamed:@"Wizard" owner:self]; … … 1749 1731 } 1750 1732 1751 if ( !nib_bookmarks_loaded)1733 if ( !nib_bookmarks_loaded ) 1752 1734 { 1753 1735 nib_bookmarks_loaded = [NSBundle loadNibNamed:@"Bookmarks" owner:self]; … … 1760 1742 - (IBAction)viewAbout:(id)sender 1761 1743 { 1762 if ( !nib_about_loaded)1744 if ( !nib_about_loaded ) 1763 1745 { 1764 1746 nib_about_loaded = [NSBundle loadNibNamed:@"About" owner:self]; … … 1779 1761 - (IBAction)checkForUpdate:(id)sender 1780 1762 { 1781 if ( !nib_update_loaded)1763 if ( !nib_update_loaded ) 1782 1764 { 1783 1765 nib_update_loaded = [NSBundle loadNibNamed:@"Update" owner:self]; modules/gui/macosx/playlist.m
ra5df65a r7fef8b8 115 115 - (void)awakeFromNib 116 116 { 117 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 118 FIND_ANYWHERE ); 117 playlist_t * p_playlist = pl_Yield( VLCIntf ); 119 118 [o_outline_view setTarget: self]; 120 119 [o_outline_view setDelegate: self]; … … 152 151 int i_return = 0; 153 152 playlist_item_t *p_item = NULL; 154 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 155 FIND_ANYWHERE ); 156 if( p_playlist == NULL ) 157 return 0; 153 playlist_t * p_playlist = pl_Yield( VLCIntf ); 158 154 if( outlineView != o_outline_view ) 159 155 { … … 186 182 playlist_item_t *p_return = NULL, *p_item = NULL; 187 183 NSValue *o_value; 188 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 189 FIND_ANYWHERE ); 190 191 if( p_playlist == NULL ) 192 return nil; 184 playlist_t * p_playlist = pl_Yield( VLCIntf ); 193 185 194 186 if( item == nil ) … … 207 199 208 200 o_value = [o_outline_dict objectForKey:[NSString stringWithFormat: @"%p", p_return]]; 201 #if 0 209 202 NSLog( @"%s", p_return->p_input->psz_name); 203 #endif 210 204 if( o_value == nil ) 211 205 { 212 206 o_value = [[NSValue valueWithPointer: p_return] retain]; 213 NSLog( @"error missingvalue" );207 msg_Err( VLCIntf, @"missing playlist item's pointer value" ); 214 208 } 215 209 return o_value; … … 220 214 { 221 215 int i_return = 0; 222 playlist_t *p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 223 FIND_ANYWHERE ); 224 if( p_playlist == NULL ) 225 return NO; 216 playlist_t *p_playlist = pl_Yield( VLCIntf ); 226 217 227 218 if( item == nil ) … … 253 244 id o_value = nil; 254 245 intf_thread_t *p_intf = VLCIntf; 255 playlist_t *p_playlist;256 246 playlist_item_t *p_item; 257 247 258 248 if( item == nil || ![item isKindOfClass: [NSValue class]] ) return( @"error" ); 259 260 /* Check to see if the playlist is present */261 p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );262 if( p_playlist == NULL ) return( @"error");263 vlc_object_release( p_playlist);264 249 265 250 p_item = (playlist_item_t *)[item pointerValue]; … … 355 340 - (void)awakeFromNib 356 341 { 357 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 358 FIND_ANYWHERE ); 342 playlist_t * p_playlist = pl_Yield( VLCIntf ); 359 343 vlc_list_t *p_list = vlc_list_find( p_playlist, VLC_OBJECT_MODULE, 360 344 FIND_ANYWHERE ); … … 479 463 [[[[VLCMain sharedInstance] getBookmarks] getDataTable] reloadData]; 480 464 481 playlist_t *p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 482 FIND_ANYWHERE ); 483 if(! p_playlist ) 484 return; 465 playlist_t *p_playlist = pl_Yield( VLCIntf ); 485 466 486 467 if( p_playlist->i_size >= 2 ) … … 505 486 - (void)playModeUpdated 506 487 { 507 playlist_t *p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 508 FIND_ANYWHERE ); 488 playlist_t *p_playlist = pl_Yield( VLCIntf ); 509 489 vlc_value_t val, val2; 510 511 if( p_playlist == NULL )512 {513 return;514 }515 490 516 491 var_Get( p_playlist, "loop", &val2 ); … … 540 515 unsigned int j; 541 516 542 playlist_t *p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 543 FIND_ANYWHERE ); 517 playlist_t *p_playlist = pl_Yield( VLCIntf ); 544 518 playlist_item_t *p_item, *p_temp_item; 545 519 NSMutableArray *o_array = [NSMutableArray array]; 546 547 if( p_playlist == NULL )548 return;549 520 550 521 p_item = p_playlist->status.p_item; … … 588 559 [o_outline_view scrollRowToVisible: i_row]; 589 560 590 vlc_object_release( p_playlist);561 vlc_object_release( p_playlist ); 591 562 592 563 /* update our info-panel to reflect the new item */ … … 603 574 604 575 { 605 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 606 FIND_ANYWHERE ); 576 playlist_t * p_playlist = pl_Yield( VLCIntf ); 607 577 playlist_item_t *p_temp_item = p_item; 608 609 if( p_playlist == NULL )610 {611 return NO;612 }613 578 614 579 if( p_node == p_item ) … … 694 659 { 695 660 intf_thread_t * p_intf = VLCIntf; 696 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 697 FIND_ANYWHERE ); 661 playlist_t * p_playlist = pl_Yield( p_intf ); 698 662 699 663 NSSavePanel *o_save_panel = [NSSavePanel savePanel]; … … 758 722 { 759 723 intf_thread_t * p_intf = VLCIntf; 760 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 761 FIND_ANYWHERE ); 762 763 if( p_playlist != NULL ) 764 { 765 playlist_item_t *p_item; 766 playlist_item_t *p_node = NULL; 767 768 p_item = [[o_outline_view itemAtRow:[o_outline_view selectedRow]] pointerValue]; 769 770 if( p_item ) 771 { 772 if( p_item->i_children == -1 ) 773 { 774 p_node = p_item->p_parent; 775 724 playlist_t * p_playlist = pl_Yield( p_intf ); 725 726 playlist_item_t *p_item; 727 playlist_item_t *p_node = NULL; 728 729 p_item = [[o_outline_view itemAtRow:[o_outline_view selectedRow]] pointerValue]; 730 731 if( p_item ) 732 { 733 if( p_item->i_children == -1 ) 734 { 735 p_node = p_item->p_parent; 736 737 } 738 else 739 { 740 p_node = p_item; 741 if( p_node->i_children > 0 && p_node->pp_children[0]->i_children == -1 ) 742 { 743 p_item = p_node->pp_children[0]; 776 744 } 777 745 else 778 746 { 779 p_node = p_item; 780 if( p_node->i_children > 0 && p_node->pp_children[0]->i_children == -1 ) 781 { 782 p_item = p_node->pp_children[0]; 783 } 784 else 785 { 786 p_item = NULL; 787 } 788 } 789 playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, p_node, p_item ); 790 } 791 vlc_object_release( p_playlist ); 792 } 747 p_item = NULL; 748 } 749 } 750 playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, p_node, p_item ); 751 } 752 vlc_object_release( p_playlist ); 793 753 } 794 754 … … 799 759 NSMutableArray *o_to_preparse; 800 760 intf_thread_t * p_intf = VLCIntf; 801 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 802 FIND_ANYWHERE ); 761 playlist_t * p_playlist = pl_Yield( p_intf ); 803 762 804 763 o_to_preparse = [NSMutableArray arrayWithArray:[[o_outline_view selectedRowEnumerator] allObjects]]; 805 764 i_count = [o_to_preparse count]; 806 765 807 if( p_playlist != NULL ) 808 { 809 int i, i_row; 810 NSNumber *o_number; 811 playlist_item_t *p_item = NULL; 812 813 for( i = 0; i < i_count; i++ ) 814 { 815 o_number = [o_to_preparse lastObject]; 816 i_row = [o_number intValue]; 817 p_item = [[o_outline_view itemAtRow:i_row] pointerValue]; 818 [o_to_preparse removeObject: o_number]; 819 [o_outline_view deselectRow: i_row]; 820 821 if( p_item ) 822 { 823 if( p_item->i_children == -1 ) 824 { 825 playlist_PreparseEnqueue( p_playlist, p_item->p_input ); 826 } 827 else 828 { 829 msg_Dbg( p_intf, "preparse of nodes not yet implemented" ); 830 } 831 } 832 } 833 vlc_object_release( p_playlist ); 834 } 766 int i, i_row; 767 NSNumber *o_number; 768 playlist_item_t *p_item = NULL; 769 770 for( i = 0; i < i_count; i++ ) 771 { 772 o_number = [o_to_preparse lastObject]; 773 i_row = [o_number intValue]; 774 p_item = [[o_outline_view itemAtRow:i_row] pointerValue]; 775 [o_to_preparse removeObject: o_number]; 776 [o_outline_view deselectRow: i_row]; 777 778 if( p_item ) 779 { 780 if( p_item->i_children == -1 ) 781 { 782 playlist_PreparseEnqueue( p_playlist, p_item->p_input ); 783 } 784 else 785 { 786 msg_Dbg( p_intf, "preparse of nodes not yet implemented" ); 787 } 788 } 789 } 790 vlc_object_release( p_playlist ); 835 791 [self playlistUpdated]; 836 792 } … … 840 796 NSMenuItem *o_mi = (NSMenuItem *)sender; 841 797 NSString *o_string = [o_mi representedObject]; 842 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 843 FIND_ANYWHERE ); 798 playlist_t * p_playlist = pl_Yield( VLCIntf ); 844 799 if( !playlist_IsServicesDiscoveryLoaded( p_playlist, [o_string cString] ) ) 845 800 playlist_ServicesDiscoveryAdd( p_playlist, [o_string cString] ); … … 869 824 intf_thread_t * p_intf = VLCIntf; 870 825 871 p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 872 FIND_ANYWHERE ); 873 874 if ( p_playlist == NULL ) 875 { 876 return; 877 } 826 p_playlist = pl_Yield( p_intf ); 827 878 828 o_to_delete = [NSMutableArray arrayWithArray:[[o_outline_view selectedRowEnumerator] allObjects]]; 879 829 i_count = [o_to_delete count]; … … 925 875 - (void)sortNode:(int)i_mode 926 876 { 927 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 928 FIND_ANYWHERE ); 877 playlist_t * p_playlist = pl_Yield( VLCIntf ); 929 878 playlist_item_t * p_item; 930 931 if (p_playlist == NULL)932 {933 return;934 }935 879 936 880 if( [o_outline_view selectedRow] > -1 ) … … 965 909 { 966 910 intf_thread_t * p_intf = VLCIntf; 967 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 968 FIND_ANYWHERE ); 969 970 if( p_playlist == NULL ) 971 { 972 return NULL; 973 } 911 playlist_t * p_playlist = pl_Yield( p_intf ); 912 974 913 input_item_t *p_input; 975 914 int i; … … 1057 996 { 1058 997 int i_item; 1059 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 1060 FIND_ANYWHERE ); 1061 if( p_playlist == NULL ) 1062 { 1063 return; 1064 } 998 playlist_t * p_playlist = pl_Yield( VLCIntf ); 1065 999 1066 1000 for( i_item = 0; i_item < (int)[o_array count]; i_item++ ) … … 1101 1035 { 1102 1036 int i_item; 1103 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 1104 FIND_ANYWHERE ); 1105 if( p_playlist == NULL ) 1106 { 1107 return; 1108 } 1037 playlist_t * p_playlist = pl_Yield( VLCIntf ); 1109 1038 1110 1039 for( i_item = 0; i_item < (int)[o_array count]; i_item++ ) … … 1150 1079 intf_thread_t * p_intf = VLCIntf; 1151 1080 vlc_value_t val1,val2; 1152 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 1153 FIND_ANYWHERE ); 1154 if( p_playlist == NULL ) 1155 { 1156 return; 1157 } 1081 playlist_t * p_playlist = pl_Yield( p_intf ); 1158 1082 1159 1083 switch( [o_loop_popup indexOfSelectedItem] ) … … 1194 1118 - (NSMutableArray *)subSearchItem:(playlist_item_t *)p_item 1195 1119 { 1196 playlist_t *p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 1197 FIND_ANYWHERE ); 1120 playlist_t *p_playlist = pl_Yield( VLCIntf ); 1198 1121 playlist_item_t *p_selected_item; 1199 1122 int i_current, i_selected_row; 1200 1201 if( !p_playlist )1202 return NULL;1203 1123 1204 1124 i_selected_row = [o_outline_view selectedRow]; … … 1265 1185 - (IBAction)searchItem:(id)sender 1266 1186 { 1267 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 1268 FIND_ANYWHERE ); 1187 playlist_t * p_playlist = pl_Yield( VLCIntf ); 1269 1188 id o_result; 1270 1189 … … 1273 1192 1274 1193 b_selected_item_met = NO; 1275 1276 if( p_playlist == NULL )1277 return;1278 1194 1279 1195 /*First, only search after the selected item:* … … 1361 1277 intf_thread_t *p_intf = VLCIntf; 1362 1278 1363 playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 1364 FIND_ANYWHERE ); 1365 if( p_playlist == NULL ) 1366 { 1367 return; 1368 } 1279 playlist_t *p_playlist = pl_Yield( p_intf ); 1369 1280 1370 1281 /* Check whether the selected table column header corresponds to a … … 1431 1342 item:(id)item 1432 1343 { 1433 playlist_t *p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 1434 FIND_ANYWHERE ); 1344 playlist_t *p_playlist = pl_Yield( VLCIntf ); 1435 1345 1436 1346 id o_playing_item; 1437 1438 if( !p_playlist ) return;1439 1347 1440 1348 o_playing_item = [o_outline_dict objectForKey: … … 1469 1377 1470 1378 /* simply adds a new node to the end of the playlist */ 1471 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 1472 FIND_ANYWHERE ); 1379 playlist_t * p_playlist = pl_Yield( VLCIntf ); 1473 1380 vlc_thread_set_priority( p_playlist, VLC_THREAD_PRIORITY_LOW ); 1474 1475 if( !p_playlist )1476 {1477 return;1478 }1479 1381 1480 1382 int ret_v; … … 1504 1406 { 1505 1407 id o_value = [super outlineView: outlineView child: index ofItem: item]; 1506 playlist_t *p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST,1507 FIND_ANYWHERE ); 1508 1509 if( !p_playlist ) return nil;1408 playlist_t *p_playlist = pl_Yield( VLCIntf ); 1409 1410 /* FIXME: playlist->i_size doesn't provide the correct number of items anymore 1411 * check the playlist API for the fixed function, once zorglub implemented it -- fpk, 9/17/06 */ 1510 1412 1511 1413 if( p_playlist->i_size >= 2 ) … … 1529 1431 [o_outline_dict setObject:o_value forKey:[NSString stringWithFormat:@"%p", 1530 1432 [o_value pointerValue]]]; 1531 NSLog( @"additem %p", [o_value pointerValue] );1433 msg_Dbg( VLCIntf, "adding item %p", [o_value pointerValue] ); 1532 1434 return o_value; 1533 1435 … … 1538 1440 { 1539 1441 unsigned int i; 1540 playlist_t *p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 1541 FIND_ANYWHERE ); 1442 playlist_t *p_playlist = pl_Yield( VLCIntf ); 1542 1443 1543 1444 /* First remove the items that were moved during the last drag & drop … … 1545 1446 [o_items_array removeAllObjects]; 1546 1447 [o_nodes_array removeAllObjects]; 1547 1548 if( !p_playlist ) return NO;1549 1448 1550 1449 for( i = 0 ; i < [items count] ; i++ ) … … 1585 1484 - (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id <NSDraggingInfo>)info proposedItem:(id)item proposedChildIndex:(int)index 1586 1485 { 1587 playlist_t *p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 1588 FIND_ANYWHERE ); 1486 playlist_t *p_playlist = pl_Yield( VLCIntf ); 1589 1487 NSPasteboard *o_pasteboard = [info draggingPasteboard]; 1590 1488 … … 1627 1525 } 1628 1526 } 1629 vlc_object_release( p_playlist);1527 vlc_object_release( p_playlist ); 1630 1528 return NSDragOperationMove; 1631 1529 } … … 1634 1532 else if( [[o_pasteboard types] containsObject: NSFilenamesPboardType] ) 1635 1533 { 1636 vlc_object_release( p_playlist);1534 vlc_object_release( p_playlist ); 1637 1535 return NSDragOperationGeneric; 1638 1536 } 1639 vlc_object_release( p_playlist);1537 vlc_object_release( p_playlist ); 1640 1538 return NSDragOperationNone; 1641 1539 } … … 1643 1541 - (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id <NSDraggingInfo>)info item:(id)item childIndex:(int)index 1644 1542 { 1645 playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 1646 FIND_ANYWHERE ); 1543 playlist_t * p_playlist = pl_Yield( VLCIntf ); 1647 1544 NSPasteboard *o_pasteboard = [info draggingPasteboard]; 1648 1649 if( !p_playlist ) return NO;1650 1545 1651 1546 /* Drag & Drop inside the playlist */ … … 1734 1629 [o_outline_view scrollRowToVisible: i_row]; 1735 1630 1736 vlc_object_release( p_playlist);1631 vlc_object_release( p_playlist ); 1737 1632 return YES; 1738 1633 } modules/gui/macosx/playlistinfo.m
rbd475b0 r7fef8b8 136 136 { 137 137 intf_thread_t * p_intf = VLCIntf; 138 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 139 FIND_ANYWHERE ); 140 141 if( p_playlist ) 142 { 143 p_item = p_playlist->status.p_item; 144 vlc_object_release( p_playlist ); 145 } 146 138 playlist_t * p_playlist = pl_Yield( p_intf ); 139 140 p_item = p_playlist->status.p_item; 141 vlc_object_release( p_playlist ); 142 147 143 [self initPanel:sender]; 148 144 } … … 174 170 /* make sure that we got the current item and not an outdated one */ 175 171 intf_thread_t * p_intf = VLCIntf; 176 playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 177 FIND_ANYWHERE ); 178 179 if( p_playlist ) 180 { 181 p_item = p_playlist->status.p_item; 182 vlc_object_release( p_playlist ); 183 } 172 playlist_t * p_playlist = pl_Yield( p_intf ); 173 174 p_item = p_playlist->status.p_item; 175 vlc_object_release( p_playlist ); 184 176 185 177 /* check whether our item is valid, because we would crash if not */ … … 288 280 { 289 281 intf_thread_t * p_intf = VLCIntf; 290 playlist_t * p_playlist = vlc_object_find( p_intf, VLC
