pl_Release( p_intf );
return CDRF_NEWFONT;
}
-
+
+ PL_LOCK;
playlist_item_t *p_item = playlist_ItemGetById( p_playlist,
- (int)lplvcd->nmcd.dwItemSpec, FALSE );
+ (int)lplvcd->nmcd.dwItemSpec );
if( !p_item )
{
+ PL_UNLOCK;
pl_Release( p_intf );
return CDRF_DODEFAULT;
}
if( p_item->i_flags & PLAYLIST_DBL_FLAG )
{
lplvcd->clrText = RGB(192,192,192);
+ PL_UNLOCK;
pl_Release( p_intf );
return CDRF_NEWFONT;
}
+ PL_UNLOCK;
pl_Release( p_intf );
}
playlist_item_t * p_root = p_playlist->p_local_onelevel;
playlist_item_t * p_child = NULL;
- for( int i = 0; i < playlist_NodeChildrenCount( p_playlist, p_root ); i++ )
+ int iItem = 0;
+
+ while( ( p_child = playlist_GetNextLeaf( p_playlist, p_root, p_child, FALSE, FALSE ) ) )
{
- p_child = playlist_GetNextLeaf( p_playlist, p_root, p_child, FALSE, FALSE);
LVITEM lv;
lv.mask = LVIF_TEXT;
lv.pszText = _T("");
lv.cchTextMax = 1;
lv.iSubItem = 0;
- lv.iItem = i;
+ lv.iItem = iItem;
ListView_InsertItem( hListView, &lv );
ListView_SetItemText( hListView, lv.iItem, 0,
_FROMMB(p_child->p_input->psz_name) );
UpdateItem( p_child->i_id );
+ iItem++;
}
PL_UNLOCK;
if( p_playlist == NULL ) return;
- playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i, FALSE );
+ PL_LOCK;
+ playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i );
if( !p_item )
{
+ PL_UNLOCK;
pl_Release( p_intf );
return;
}
char psz_duration[MSTRTIME_MAX_SIZE];
mtime_t dur = input_item_GetDuration( p_item->p_input );
+ PL_UNLOCK;
if( dur != -1 ) secstotimestr( psz_duration, dur/1000000 );
else memcpy( psz_duration , "-:--:--", sizeof("-:--:--") );
/**********************************************************************
* Private functions
**********************************************************************/
-void Playlist::DeleteItem( int item )
+void Playlist::DeleteItem( input_item_t *item )
{
playlist_t *p_playlist = pl_Hold( p_intf );
if( p_playlist == NULL ) return;
{
if( ListView_GetItemState( hListView, item, LVIS_SELECTED ) )
{
- playlist_item_t *p_item =
- playlist_ItemGetById( p_playlist, item, FALSE );
+ PL_LOCK;
+ playlist_item_t *p_item = playlist_ItemGetById( p_playlist, item );
p_item->i_flags ^= PLAYLIST_DBL_FLAG;
+ PL_UNLOCK;
UpdateItem( item );
}
}
{
if( ListView_GetItemState( hListView, item, LVIS_SELECTED ) )
{
- /*XXX*/
- playlist_item_t *p_item =
- playlist_ItemGetById( p_playlist, item, FALSE );
+ PL_LOCK;
+ playlist_item_t *p_item = playlist_ItemGetById( p_playlist, item );
p_item->i_flags |= PLAYLIST_DBL_FLAG;
+ PL_UNLOCK;
UpdateItem( item );
}
}
if( p_playlist == NULL ) return;
PL_LOCK;
- playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_item, true );
- PL_UNLOCK;
-
+ playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_item );
if( p_item )
{
ItemInfoDialog *iteminfo_dialog =
new ItemInfoDialog( p_intf, this, hInst, p_item );
+ PL_UNLOCK;
CreateDialogBox( hwnd, iteminfo_dialog );
UpdateItem( i_item );
delete iteminfo_dialog;
playlist_t *p_playlist = pl_Hold( p_intf );
if( p_playlist == NULL ) return;
- playlist_item_t *p_item =
- playlist_ItemGetById( p_playlist, i_popup_item, FALSE );
+ PL_LOCK;
+ playlist_item_t *p_item = playlist_ItemGetById( p_playlist, i_popup_item );
if( !(p_playlist->items.p_elems[i_popup_item]->i_flags & PLAYLIST_DBL_FLAG) )
//playlist_IsEnabled( p_playlist, i_popup_item ) )
p_item->i_flags ^= PLAYLIST_DBL_FLAG;
}
+ PL_UNLOCK;
pl_Release( p_intf );
UpdateItem( i_popup_item );
}