// random, loop, repeat buttons states
vlc_value_t val;
- p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ p_playlist = pl_Yield( p_intf );
if( !p_playlist ) break;
var_Get( p_playlist , "random", &val );
bState = val.b_bool ? TBSTATE_CHECKED : 0;
SendMessage( hwndTB, TB_SETSTATE, Repeat_Event,
MAKELONG(bState | TBSTATE_ENABLED, 0) );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
GetClientRect( hwnd, &rect );
hListView = CreateWindow( WC_LISTVIEW, NULL, WS_VISIBLE | WS_CHILD |
return CDRF_NOTIFYITEMDRAW;
case CDDS_ITEMPREPAINT: //Before an item is drawn
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return CDRF_DODEFAULT;
if( (int)lplvcd->nmcd.dwItemSpec == p_playlist->i_index )
{
lplvcd->clrText = RGB(255,0,0);
- vlc_object_release(p_playlist);
+ pl_Release( p_playlist );
return CDRF_NEWFONT;
}
(int)lplvcd->nmcd.dwItemSpec );
if( !p_item )
{
- vlc_object_release(p_playlist);
+ pl_Release( p_playlist );
return CDRF_DODEFAULT;
}
if( p_item->b_enabled == false )
{
lplvcd->clrText = RGB(192,192,192);
- vlc_object_release(p_playlist);
+ pl_Release( p_playlist );
return CDRF_NEWFONT;
}
+ pl_Release( p_playlist );
}
return CDRF_DODEFAULT;
b_need_update = false;
}
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
/* Update the colour of items */
}
vlc_object_unlock( p_playlist );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
/**********************************************************************
**********************************************************************/
void Playlist::Rebuild()
{
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
int i_focused =
ListView_SetItemState( hListView, i_focused, LVIS_FOCUSED,
LVIS_STATEIMAGEMASK );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
/**********************************************************************
**********************************************************************/
void Playlist::UpdateItem( int i )
{
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
if( !p_item )
{
- vlc_object_release(p_playlist);
+ pl_Release(p_playlist);
return;
}
ListView_SetItemText( hListView, i, 3, _FROMMB(psz_duration) );
- vlc_object_release(p_playlist);
+ pl_Release(p_playlist);
}
/**********************************************************************
**********************************************************************/
void Playlist::DeleteItem( int item )
{
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
playlist_Delete( p_playlist, item );
ListView_DeleteItem( hListView, item );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
/**********************************************************************
if( p_arg->i_results && p_arg->psz_results[0] )
{
- playlist_t * p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t * p_playlist = pl_Yield( p_intf );
if( p_playlist )
{
playlist_Import( p_playlist, p_arg->psz_results[0] );
+ pl_Release( p_playlist );
}
-
- if( p_playlist ) vlc_object_release( p_playlist );
}
}
if( p_arg->i_results && p_arg->psz_results[0] )
{
- playlist_t * p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t * p_playlist = pl_Yield( p_intf );
if( p_playlist )
{
else psz_export = "export-m3u";
playlist_Export( p_playlist, p_arg->psz_results[0], psz_export );
+ pl_Release( p_playlist );
}
-
- if( p_playlist ) vlc_object_release( p_playlist );
}
}
void Playlist::OnEnableSelection()
{
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
for( long item = ListView_GetItemCount( hListView ) - 1;
UpdateItem( item );
}
}
- vlc_object_release( p_playlist);
+ pl_Release( p_playlist);
}
void Playlist::OnDisableSelection()
{
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
for( long item = ListView_GetItemCount( hListView ) - 1;
UpdateItem( item );
}
}
- vlc_object_release( p_playlist);
+ pl_Release( p_playlist);
}
void Playlist::OnSelectAll()
void Playlist::OnActivateItem( int i_item )
{
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
playlist_Goto( p_playlist, i_item );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
void Playlist::ShowInfos( HWND hwnd, int i_item )
{
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
vlc_object_lock( p_playlist);
delete iteminfo_dialog;
}
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
/********************************************************************
********************************************************************/
void Playlist::OnUp()
{
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
/* We use the first selected item, so find it */
LVIS_STATEIMAGEMASK );
}
}
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
return;
}
void Playlist::OnDown()
{
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
/* We use the first selected item, so find it */
ListView_SetItemState( hListView, i_item + 1, LVIS_FOCUSED,
LVIS_STATEIMAGEMASK );
}
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
return;
}
int bState = SendMessage( hwndTB, TB_GETSTATE, Random_Event, 0 );
val.b_bool = (bState & TBSTATE_CHECKED) ? true : false;
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
var_Set( p_playlist , "random", val );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
void Playlist::OnLoop ()
int bState = SendMessage( hwndTB, TB_GETSTATE, Loop_Event, 0 );
val.b_bool = (bState & TBSTATE_CHECKED) ? true : false;
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
var_Set( p_playlist , "loop", val );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
void Playlist::OnRepeat ()
int bState = SendMessage( hwndTB, TB_GETSTATE, Repeat_Event, 0 );
val.b_bool = (bState & TBSTATE_CHECKED) ? true : false;
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
var_Set( p_playlist , "repeat", val );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
/********************************************************************
********************************************************************/
void Playlist::OnSort( UINT event )
{
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
switch( event )
break;
}
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
b_need_update = true;
void Playlist::OnColSelect( int iSubItem )
{
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
switch( iSubItem )
break;
}
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
b_need_update = true;
int i_popup_item =
ListView_GetNextItem( hListView, -1, LVIS_SELECTED | LVNI_ALL );
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
if( i_popup_item != -1 )
playlist_Goto( p_playlist, i_popup_item );
}
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
void Playlist::OnPopupDel()
int i_popup_item =
ListView_GetNextItem( hListView, -1, LVIS_SELECTED | LVNI_ALL );
- playlist_t *p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
playlist_item_t *p_item =
playlist_Enable( p_playlist, p_item );
}
- vlc_object_release( p_playlist);
+ pl_Release( p_playlist);
UpdateItem( i_popup_item );
}