Changeset 7fef8b8726f85876ffe110a949e1a09251094c83

Show
Ignore:
Timestamp:
17/09/06 20:41:21 (2 years ago)
Author:
Felix Paul Kühne <fkuehne@videolan.org>
git-committer:
Felix Paul Kühne <fkuehne@videolan.org> 1158518481 +0000
git-parent:

[c77d5dcdee547ee3c2345610a56c95c49ae75259]

git-author:
Felix Paul Kühne <fkuehne@videolan.org> 1158518481 +0000
Message:

* updated all files to yield the playlist instead of finding it

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/macosx/controls.m

    rf485214 r7fef8b8  
    6464    vlc_value_t val; 
    6565    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 
    8481    val.i_int = config_GetInt( p_intf, "key-play-pause" ); 
    8582    var_Set( p_intf->p_libvlc, "key-pressed", val ); 
     
    156153    vlc_value_t val; 
    157154    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 ); 
    164156 
    165157    var_Get( p_playlist, "random", &val ); 
     
    186178    vlc_value_t val; 
    187179    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 ); 
    194181 
    195182    var_Get( p_playlist, "repeat", &val ); 
     
    220207    vlc_value_t val; 
    221208    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 ); 
    228210 
    229211    var_Get( p_playlist, "loop", &val ); 
     
    346328    else 
    347329    { 
    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]] ) 
    353334        { 
    354335            vlc_value_t val; 
     
    356337            var_Set( p_playlist, "fullscreen", (vlc_value_t)!val.b_bool ); 
    357338        } 
    358         if( p_playlist ) vlc_object_release( (vlc_object_t *)p_playlist ); 
     339 
     340        vlc_object_release( p_playlist ); 
    359341    } 
    360342 
     
    698680    vlc_value_t val; 
    699681    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 ); 
    708685 
    709686#define p_input p_playlist->p_input 
  • modules/gui/macosx/embeddedwindow.m

    reaeeb9b r7fef8b8  
    8888- (BOOL)windowShouldClose:(id)sender 
    8989{ 
    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 ); 
    9691 
    9792    playlist_Stop( p_playlist ); 
  • modules/gui/macosx/extended.m

    r665d0ef r7fef8b8  
    370370    NSArray *o_windows = [NSApp orderedWindows]; 
    371371    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 ); 
    374373    vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT, FIND_ANYWHERE ); 
    375374    vout_thread_t *p_real_vout; 
     
    849848    /* save the preferences to make sure that our module-changes will up on 
    850849     * 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 ); 
    853851    int returnedValue; 
    854852    NSArray * theModules; 
  • modules/gui/macosx/intf.m

    r997c585 r7fef8b8  
    457457    o_size_with_playlist = [o_window frame].size; 
    458458 
    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 ); 
    478475     
    479476    var_Create( p_intf, "interaction", VLC_VAR_ADDRESS ); 
     
    742739            /* there are two events when the plus or minus button is pressed 
    743740               one when the button is pressed down and one when the button is released */ 
    744             if (pressedDown
     741            if( pressedDown
    745742            { 
    746743                [o_controls volumeUp: self]; 
     
    750747            /* there are two events when the plus or minus button is pressed 
    751748               one when the button is pressed down and one when the button is released */ 
    752             if (pressedDown) { 
     749            if( pressedDown ) 
     750            { 
    753751                [o_controls volumeDown: self]; 
    754752            } 
     
    764762            /* simulate an event as long as the user holds the button */ 
    765763            b_left_right_remote_button_hold = pressedDown; 
    766             if (pressedDown) {                 
     764            if( pressedDown ) 
     765            {                 
    767766                NSNumber* buttonIdentifierNumber = [NSNumber numberWithInt: buttonIdentifier];   
    768767                [self performSelector:@selector(triggerMovieStepForRemoteButton:)  
     
    918917- (id)getPlaylist 
    919918{ 
    920     if ( o_playlist ) 
    921     { 
    922         return o_playlist; 
    923     } 
    924     return nil; 
     919    return o_playlist; 
    925920} 
    926921 
     
    1000995    vlc_thread_set_priority( p_intf, VLC_THREAD_PRIORITY_LOW ); 
    1001996 
    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 ); 
    10151006 
    10161007    while( !p_intf->b_die ) 
     
    10741065        vlc_bool_t b_chapters = VLC_FALSE; 
    10751066 
    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 ); 
    10781068        b_plmul = p_playlist->i_size > 1; 
    10791069 
     
    11231113    if( p_intf->p_sys->b_fullscreen_update ) 
    11241114    { 
    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 ); 
    11271116        var_Get( p_playlist, "fullscreen", &val ); 
    11281117        [o_embedded_window setFullscreen: val.b_bool]; 
     
    11471136            NSString *o_temp; 
    11481137            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 ) 
    11531141            { 
     1142                vlc_object_release( p_playlist ); 
    11541143                return; 
    11551144            } 
     
    13451334    { 
    13461335        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 
    13531338        o_temp = [NSString stringWithUTF8String: 
    13541339                  p_playlist->status.p_item->p_input->psz_name]; 
     
    15371522 
    15381523    /* 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 ); 
    15451527 
    15461528    /* FIXME - Wait here until all vouts are terminated because 
     
    16481630- (IBAction)intfOpenFile:(id)sender 
    16491631{ 
    1650     if (!nib_open_loaded
     1632    if ( !nib_open_loaded
    16511633    { 
    16521634        nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self]; 
     
    16601642- (IBAction)intfOpenFileGeneric:(id)sender 
    16611643{ 
    1662     if (!nib_open_loaded
     1644    if ( !nib_open_loaded
    16631645    { 
    16641646        nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self]; 
     
    16721654- (IBAction)intfOpenDisc:(id)sender 
    16731655{ 
    1674     if (!nib_open_loaded
     1656    if ( !nib_open_loaded
    16751657    { 
    16761658        nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self]; 
     
    16841666- (IBAction)intfOpenNet:(id)sender 
    16851667{ 
    1686     if (!nib_open_loaded
     1668    if ( !nib_open_loaded
    16871669    { 
    16881670        nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner:self]; 
     
    16961678- (IBAction)showWizard:(id)sender 
    16971679{ 
    1698     if (!nib_wizard_loaded
     1680    if ( !nib_wizard_loaded
    16991681    { 
    17001682        nib_wizard_loaded = [NSBundle loadNibNamed:@"Wizard" owner:self]; 
     
    17141696        o_extended = [[VLCExtended alloc] init]; 
    17151697    } 
    1716     if (!nib_extended_loaded
     1698    if ( !nib_extended_loaded
    17171699    { 
    17181700        nib_extended_loaded = [NSBundle loadNibNamed:@"Extended" owner:self]; 
     
    17301712        o_sfilters = [[VLCsFilters alloc] init]; 
    17311713    } 
    1732     if (!nib_sfilters_loaded
     1714    if ( !nib_sfilters_loaded
    17331715    { 
    17341716        nib_sfilters_loaded = [NSBundle loadNibNamed:@"SFilters" owner:self]; 
     
    17431725{ 
    17441726    /* we need the wizard-nib for the bookmarks's extract functionality */ 
    1745     if (!nib_wizard_loaded
     1727    if ( !nib_wizard_loaded
    17461728    { 
    17471729        nib_wizard_loaded = [NSBundle loadNibNamed:@"Wizard" owner:self]; 
     
    17491731    } 
    17501732     
    1751     if (!nib_bookmarks_loaded
     1733    if ( !nib_bookmarks_loaded
    17521734    { 
    17531735        nib_bookmarks_loaded = [NSBundle loadNibNamed:@"Bookmarks" owner:self]; 
     
    17601742- (IBAction)viewAbout:(id)sender 
    17611743{ 
    1762     if (!nib_about_loaded
     1744    if ( !nib_about_loaded
    17631745    { 
    17641746        nib_about_loaded = [NSBundle loadNibNamed:@"About" owner:self]; 
     
    17791761- (IBAction)checkForUpdate:(id)sender 
    17801762{ 
    1781     if (!nib_update_loaded
     1763    if ( !nib_update_loaded
    17821764    { 
    17831765        nib_update_loaded = [NSBundle loadNibNamed:@"Update" owner:self]; 
  • modules/gui/macosx/playlist.m

    ra5df65a r7fef8b8  
    115115- (void)awakeFromNib 
    116116{ 
    117     playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 
    118                                           FIND_ANYWHERE ); 
     117    playlist_t * p_playlist = pl_Yield( VLCIntf ); 
    119118    [o_outline_view setTarget: self]; 
    120119    [o_outline_view setDelegate: self]; 
     
    152151    int i_return = 0; 
    153152    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 ); 
    158154    if( outlineView != o_outline_view ) 
    159155    { 
     
    186182    playlist_item_t *p_return = NULL, *p_item = NULL; 
    187183    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 ); 
    193185 
    194186    if( item == nil ) 
     
    207199 
    208200    o_value = [o_outline_dict objectForKey:[NSString stringWithFormat: @"%p", p_return]]; 
     201    #if 0 
    209202    NSLog( @"%s", p_return->p_input->psz_name); 
     203    #endif 
    210204    if( o_value == nil ) 
    211205    { 
    212206        o_value = [[NSValue valueWithPointer: p_return] retain]; 
    213         NSLog( @"error missing value" ); 
     207        msg_Err( VLCIntf, @"missing playlist item's pointer value" ); 
    214208    } 
    215209    return o_value; 
     
    220214{ 
    221215    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 ); 
    226217 
    227218    if( item == nil ) 
     
    253244    id o_value = nil; 
    254245    intf_thread_t *p_intf = VLCIntf; 
    255     playlist_t *p_playlist; 
    256246    playlist_item_t *p_item; 
    257247     
    258248    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); 
    264249     
    265250    p_item = (playlist_item_t *)[item pointerValue]; 
     
    355340- (void)awakeFromNib 
    356341{ 
    357     playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 
    358                                           FIND_ANYWHERE ); 
     342    playlist_t * p_playlist = pl_Yield( VLCIntf ); 
    359343    vlc_list_t *p_list = vlc_list_find( p_playlist, VLC_OBJECT_MODULE, 
    360344                                        FIND_ANYWHERE ); 
     
    479463    [[[[VLCMain sharedInstance] getBookmarks] getDataTable] reloadData]; 
    480464 
    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 ); 
    485466 
    486467    if( p_playlist->i_size >= 2 ) 
     
    505486- (void)playModeUpdated 
    506487{ 
    507     playlist_t *p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 
    508                                           FIND_ANYWHERE ); 
     488    playlist_t *p_playlist = pl_Yield( VLCIntf ); 
    509489    vlc_value_t val, val2; 
    510  
    511     if( p_playlist == NULL ) 
    512     { 
    513         return; 
    514     } 
    515490 
    516491    var_Get( p_playlist, "loop", &val2 ); 
     
    540515    unsigned int j; 
    541516 
    542     playlist_t *p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 
    543                                           FIND_ANYWHERE ); 
     517    playlist_t *p_playlist = pl_Yield( VLCIntf ); 
    544518    playlist_item_t *p_item, *p_temp_item; 
    545519    NSMutableArray *o_array = [NSMutableArray array]; 
    546  
    547     if( p_playlist == NULL ) 
    548         return; 
    549520 
    550521    p_item = p_playlist->status.p_item; 
     
    588559    [o_outline_view scrollRowToVisible: i_row]; 
    589560 
    590     vlc_object_release(p_playlist); 
     561    vlc_object_release( p_playlist ); 
    591562 
    592563    /* update our info-panel to reflect the new item */ 
     
    603574 
    604575{ 
    605     playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 
    606                                           FIND_ANYWHERE ); 
     576    playlist_t * p_playlist = pl_Yield( VLCIntf ); 
    607577    playlist_item_t *p_temp_item = p_item; 
    608  
    609     if( p_playlist == NULL ) 
    610     { 
    611         return NO; 
    612     } 
    613578 
    614579    if( p_node == p_item ) 
     
    694659{ 
    695660    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 ); 
    698662 
    699663    NSSavePanel *o_save_panel = [NSSavePanel savePanel]; 
     
    758722{ 
    759723    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]; 
    776744            } 
    777745            else 
    778746            { 
    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 ); 
    793753} 
    794754 
     
    799759    NSMutableArray *o_to_preparse; 
    800760    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 ); 
    803762                                                        
    804763    o_to_preparse = [NSMutableArray arrayWithArray:[[o_outline_view selectedRowEnumerator] allObjects]]; 
    805764    i_count = [o_to_preparse count]; 
    806765 
    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 ); 
    835791    [self playlistUpdated]; 
    836792} 
     
    840796    NSMenuItem *o_mi = (NSMenuItem *)sender; 
    841797    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 ); 
    844799    if( !playlist_IsServicesDiscoveryLoaded( p_playlist, [o_string cString] ) ) 
    845800        playlist_ServicesDiscoveryAdd( p_playlist, [o_string cString] ); 
     
    869824    intf_thread_t * p_intf = VLCIntf; 
    870825 
    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 
    878828    o_to_delete = [NSMutableArray arrayWithArray:[[o_outline_view selectedRowEnumerator] allObjects]]; 
    879829    i_count = [o_to_delete count]; 
     
    925875- (void)sortNode:(int)i_mode 
    926876{ 
    927     playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 
    928                                           FIND_ANYWHERE ); 
     877    playlist_t * p_playlist = pl_Yield( VLCIntf ); 
    929878    playlist_item_t * p_item; 
    930  
    931     if (p_playlist == NULL) 
    932     { 
    933         return; 
    934     } 
    935879 
    936880    if( [o_outline_view selectedRow] > -1 ) 
     
    965909{ 
    966910    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 
    974913    input_item_t *p_input; 
    975914    int i; 
     
    1057996{ 
    1058997    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 ); 
    1065999 
    10661000    for( i_item = 0; i_item < (int)[o_array count]; i_item++ ) 
     
    11011035{ 
    11021036    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 ); 
    11091038 
    11101039    for( i_item = 0; i_item < (int)[o_array count]; i_item++ ) 
     
    11501079    intf_thread_t * p_intf = VLCIntf; 
    11511080    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 ); 
    11581082 
    11591083    switch( [o_loop_popup indexOfSelectedItem] ) 
     
    11941118- (NSMutableArray *)subSearchItem:(playlist_item_t *)p_item 
    11951119{ 
    1196     playlist_t *p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 
    1197                                                        FIND_ANYWHERE ); 
     1120    playlist_t *p_playlist = pl_Yield( VLCIntf ); 
    11981121    playlist_item_t *p_selected_item; 
    11991122    int i_current, i_selected_row; 
    1200  
    1201     if( !p_playlist ) 
    1202         return NULL; 
    12031123 
    12041124    i_selected_row = [o_outline_view selectedRow]; 
     
    12651185- (IBAction)searchItem:(id)sender 
    12661186{ 
    1267     playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 
    1268                                                        FIND_ANYWHERE ); 
     1187    playlist_t * p_playlist = pl_Yield( VLCIntf ); 
    12691188    id o_result; 
    12701189 
     
    12731192 
    12741193    b_selected_item_met = NO; 
    1275  
    1276     if( p_playlist == NULL ) 
    1277         return; 
    12781194 
    12791195        /*First, only search after the selected item:* 
     
    13611277    intf_thread_t *p_intf = VLCIntf; 
    13621278 
    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 ); 
    13691280 
    13701281    /* Check whether the selected table column header corresponds to a 
     
    14311342                                item:(id)item 
    14321343{ 
    1433     playlist_t *p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 
    1434                                           FIND_ANYWHERE ); 
     1344    playlist_t *p_playlist = pl_Yield( VLCIntf ); 
    14351345 
    14361346    id o_playing_item; 
    1437  
    1438     if( !p_playlist ) return; 
    14391347 
    14401348    o_playing_item = [o_outline_dict objectForKey: 
     
    14691377 
    14701378    /* 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 ); 
    14731380    vlc_thread_set_priority( p_playlist, VLC_THREAD_PRIORITY_LOW ); 
    1474  
    1475     if( !p_playlist ) 
    1476     { 
    1477         return; 
    1478     } 
    14791381 
    14801382    int ret_v; 
     
    15041406{ 
    15051407    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 */ 
    15101412 
    15111413    if( p_playlist->i_size >= 2 ) 
     
    15291431    [o_outline_dict setObject:o_value forKey:[NSString stringWithFormat:@"%p", 
    15301432                                                    [o_value pointerValue]]]; 
    1531 NSLog( @"add item %p", [o_value pointerValue] ); 
     1433    msg_Dbg( VLCIntf, "adding item %p", [o_value pointerValue] ); 
    15321434    return o_value; 
    15331435 
     
    15381440{ 
    15391441    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 ); 
    15421443 
    15431444    /* First remove the items that were moved during the last drag & drop 
     
    15451446    [o_items_array removeAllObjects]; 
    15461447    [o_nodes_array removeAllObjects]; 
    1547  
    1548     if( !p_playlist ) return NO; 
    15491448 
    15501449    for( i = 0 ; i < [items count] ; i++ ) 
     
    15851484- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id <NSDraggingInfo>)info proposedItem:(id)item proposedChildIndex:(int)index 
    15861485{ 
    1587     playlist_t *p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 
    1588                                                FIND_ANYWHERE ); 
     1486    playlist_t *p_playlist = pl_Yield( VLCIntf ); 
    15891487    NSPasteboard *o_pasteboard = [info draggingPasteboard]; 
    15901488 
     
    16271525            } 
    16281526        } 
    1629         vlc_object_release(p_playlist); 
     1527        vlc_object_release( p_playlist ); 
    16301528        return NSDragOperationMove; 
    16311529    } 
     
    16341532    else if( [[o_pasteboard types] containsObject: NSFilenamesPboardType] ) 
    16351533    { 
    1636         vlc_object_release(p_playlist); 
     1534        vlc_object_release( p_playlist ); 
    16371535        return NSDragOperationGeneric; 
    16381536    } 
    1639     vlc_object_release(p_playlist); 
     1537    vlc_object_release( p_playlist ); 
    16401538    return NSDragOperationNone; 
    16411539} 
     
    16431541- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id <NSDraggingInfo>)info item:(id)item childIndex:(int)index 
    16441542{ 
    1645     playlist_t * p_playlist =  vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, 
    1646                                                        FIND_ANYWHERE ); 
     1543    playlist_t * p_playlist =  pl_Yield( VLCIntf ); 
    16471544    NSPasteboard *o_pasteboard = [info draggingPasteboard]; 
    1648  
    1649     if( !p_playlist ) return NO; 
    16501545 
    16511546    /* Drag & Drop inside the playlist */ 
     
    17341629        [o_outline_view scrollRowToVisible: i_row]; 
    17351630 
    1736         vlc_object_release(p_playlist); 
     1631        vlc_object_release( p_playlist ); 
    17371632        return YES; 
    17381633    } 
  • modules/gui/macosx/playlistinfo.m

    rbd475b0 r7fef8b8  
    136136    { 
    137137        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         
    147143        [self initPanel:sender]; 
    148144    } 
     
    174170    /* make sure that we got the current item and not an outdated one */ 
    175171    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 ); 
    184176 
    185177    /* check whether our item is valid, because we would crash if not */ 
     
    288280{ 
    289281    intf_thread_t * p_intf = VLCIntf; 
    290     playlist_t * p_playlist = vlc_object_find( p_intf, VLC