+ playlist_item_t* copy = NULL;
+ // check if item exists at the provided index
+ if ( index >= 0 && index < p_playlist->i_size )
+ {
+ playlist_item_t* item = p_playlist->pp_items[index];
+ if ( item )
+ {
+ // make a copy of the removed item
+ copy = (playlist_item_t*)PlaylistCloneItem( (void*)item );
+ // remove item from playlist (unfortunately, this frees it)
+ playlist_Delete( p_playlist, index );
+ }
+ }
+ return (void*)copy;
+}
+
+// PlaylistRemoveItem
+void*
+VlcWrapper::PlaylistRemoveItem( void* item ) const
+{
+ playlist_item_t* copy = NULL;
+ for ( int32 i = 0; i < p_playlist->i_size; i++ )
+ {
+ if ( p_playlist->pp_items[i] == item )
+ {
+ copy = (playlist_item_t*)PlaylistRemoveItem( i );
+ break;
+ }
+ }
+ return (void*)copy;
+}
+
+// PlaylistAddItem
+bool
+VlcWrapper::PlaylistAddItem( void* item, int index ) const
+{
+ if ( item )
+ {
+ playlist_AddItem( p_playlist, (playlist_item_t*)item,
+ PLAYLIST_INSERT, index );
+ }
+ // TODO: once playlist is returning useful info, return that instead
+ return true;
+}
+
+// PlaylistCloneItem
+void*
+VlcWrapper::PlaylistCloneItem( void* castToItem ) const
+{
+ playlist_item_t* copy = NULL;
+ playlist_item_t* item = (playlist_item_t*)castToItem;
+ if ( item )
+ {
+ copy = (playlist_item_t*)malloc( sizeof( playlist_item_t ) );
+ if ( copy )