1 /*****************************************************************************
2 * ListViews.h: BeOS interface list view class implementation
3 *****************************************************************************
4 * Copyright (C) 1999, 2000, 2001 VideoLAN
5 * $Id: ListViews.cpp,v 1.4 2003/02/02 11:29:12 stippi Exp $
7 * Authors: Stephan Aßmus <stippi@yellowbites.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
34 #include "VlcWrapper.h"
35 #include "InterfaceWindow.h"
36 #include "ListViews.h"
39 #define MAX_DRAG_HEIGHT 200.0
41 #define TEXT_OFFSET 20.0
43 /*****************************************************************************
45 *****************************************************************************/
46 PlaylistItem::PlaylistItem( const char *name )
51 PlaylistItem::~PlaylistItem()
55 /*****************************************************************************
56 * PlaylistItem::DrawItem
57 *****************************************************************************/
59 PlaylistItem::Draw( BView *owner, BRect frame, bool tintedLine,
60 bool active, bool playing )
62 rgb_color color = (rgb_color){ 255, 255, 255, 255 };
64 color = tint_color( color, 1.04 );
67 color = tint_color( color, B_DARKEN_2_TINT );
68 owner->SetLowColor( color );
69 owner->FillRect( frame, B_SOLID_LOW );
71 owner->SetHighColor( 0, 0, 0, 255 );
73 owner->GetFontHeight( &fh );
74 BString truncatedString( Text() );
75 owner->TruncateString( &truncatedString, B_TRUNCATE_MIDDLE,
76 frame.Width() - TEXT_OFFSET - 4.0 );
77 owner->DrawString( truncatedString.String(),
78 BPoint( frame.left + TEXT_OFFSET,
79 frame.top + fh.ascent + 1.0 ) );
83 rgb_color black = (rgb_color){ 0, 0, 0, 255 };
84 rgb_color green = (rgb_color){ 0, 255, 0, 255 };
85 BRect r( 0.0, 0.0, 10.0, 10.0 );
86 r.OffsetTo( frame.left + 4.0,
87 ceilf( ( frame.top + frame.bottom ) / 2.0 ) - 5.0 );
89 green = tint_color( color, B_DARKEN_1_TINT );
90 rgb_color lightGreen = tint_color( green, B_LIGHTEN_2_TINT );
91 rgb_color darkGreen = tint_color( green, B_DARKEN_2_TINT );
93 arrow[0] = r.LeftTop();
94 arrow[1] = r.LeftBottom();
96 arrow[2].y = ( r.top + r.bottom ) / 2.0;
97 owner->BeginLineArray( 6 );
99 owner->AddLine( arrow[0], arrow[1], black );
100 owner->AddLine( BPoint( arrow[1].x + 1.0, arrow[1].y - 1.0 ),
102 owner->AddLine( arrow[0], arrow[2], black );
109 // highlights and shadow
110 owner->AddLine( arrow[1], arrow[2], darkGreen );
111 owner->AddLine( arrow[0], arrow[2], lightGreen );
112 owner->AddLine( arrow[0], arrow[1], lightGreen );
113 owner->EndLineArray();
120 owner->SetHighColor( green );
121 owner->FillPolygon( arrow, 3 );
125 /*****************************************************************************
126 * DragSortableListView class
127 *****************************************************************************/
128 DragSortableListView::DragSortableListView( BRect frame, const char* name,
129 list_view_type type, uint32 resizingMode,
131 : BListView( frame, name, type, resizingMode, flags ),
132 fDropRect( 0.0, 0.0, -1.0, -1.0 ),
135 SetViewColor( B_TRANSPARENT_32_BIT );
138 DragSortableListView::~DragSortableListView()
142 /*****************************************************************************
143 * DragSortableListView::Draw
144 *****************************************************************************/
146 DragSortableListView::Draw( BRect updateRect )
148 int32 firstIndex = IndexOf( updateRect.LeftTop() );
149 int32 lastIndex = IndexOf( updateRect.RightBottom() );
150 if ( firstIndex >= 0 )
152 if ( lastIndex < firstIndex )
153 lastIndex = CountItems() - 1;
154 // update rect contains items
155 BRect r( updateRect );
156 for ( int32 i = firstIndex; i <= lastIndex; i++)
159 DrawListItem( this, i, r );
161 updateRect.top = r.bottom + 1.0;
162 if ( updateRect.IsValid() )
164 SetLowColor( 255, 255, 255, 255 );
165 FillRect( updateRect, B_SOLID_LOW );
170 SetLowColor( 255, 255, 255, 255 );
171 FillRect( updateRect, B_SOLID_LOW );
173 // drop anticipation indication
174 if ( fDropRect.IsValid() )
176 SetHighColor( 255, 0, 0, 255 );
177 StrokeRect( fDropRect );
181 /*****************************************************************************
182 * DragSortableListView::InitiateDrag
183 *****************************************************************************/
185 DragSortableListView::InitiateDrag( BPoint point, int32 index, bool )
187 bool success = false;
188 BListItem* item = ItemAt( CurrentSelection( 0 ) );
191 // workarround a timing problem
193 item = ItemAt( index );
197 // create drag message
198 BMessage msg( B_SIMPLE_DATA );
199 MakeDragMessage( &msg );
200 // figure out drag rect
201 float width = Bounds().Width();
202 BRect dragRect(0.0, 0.0, width, -1.0);
203 // figure out, how many items fit into our bitmap
206 for (numItems = 0; BListItem* item = ItemAt( CurrentSelection( numItems ) ); numItems++) {
207 dragRect.bottom += ceilf( item->Height() ) + 1.0;
208 if ( dragRect.Height() > MAX_DRAG_HEIGHT ) {
210 dragRect.bottom = MAX_DRAG_HEIGHT;
215 BBitmap* dragBitmap = new BBitmap( dragRect, B_RGB32, true );
216 if ( dragBitmap && dragBitmap->IsValid() ) {
217 if ( BView *v = new BView( dragBitmap->Bounds(), "helper", B_FOLLOW_NONE, B_WILL_DRAW ) ) {
218 dragBitmap->AddChild( v );
220 BRect itemBounds( dragRect) ;
221 itemBounds.bottom = 0.0;
222 // let all selected items, that fit into our drag_bitmap, draw
223 for ( int32 i = 0; i < numItems; i++ ) {
224 int32 index = CurrentSelection( i );
225 BListItem* item = ItemAt( index );
226 itemBounds.bottom = itemBounds.top + ceilf( item->Height() );
227 if ( itemBounds.bottom > dragRect.bottom )
228 itemBounds.bottom = dragRect.bottom;
229 DrawListItem( v, index, itemBounds );
230 itemBounds.top = itemBounds.bottom + 1.0;
232 // make a black frame arround the edge
233 v->SetHighColor( 0, 0, 0, 255 );
234 v->StrokeRect( v->Bounds() );
237 uint8 *bits = (uint8 *)dragBitmap->Bits();
238 int32 height = (int32)dragBitmap->Bounds().Height() + 1;
239 int32 width = (int32)dragBitmap->Bounds().Width() + 1;
240 int32 bpr = dragBitmap->BytesPerRow();
243 for ( int32 y = 0; y < height - ALPHA / 2; y++, bits += bpr ) {
244 uint8 *line = bits + 3;
245 for (uint8 *end = line + 4 * width; line < end; line += 4)
248 for ( int32 y = height - ALPHA / 2; y < height; y++, bits += bpr ) {
249 uint8 *line = bits + 3;
250 for (uint8 *end = line + 4 * width; line < end; line += 4)
251 *line = (height - y) << 1;
254 for ( int32 y = 0; y < height; y++, bits += bpr ) {
255 uint8 *line = bits + 3;
256 for (uint8 *end = line + 4 * width; line < end; line += 4)
260 dragBitmap->Unlock();
265 DragMessage( &msg, dragBitmap, B_OP_ALPHA, BPoint( 0.0, 0.0 ) );
268 DragMessage( &msg, dragRect.OffsetToCopy( point ), this );
274 /*****************************************************************************
275 * DragSortableListView::WindowActivated
276 *****************************************************************************/
278 DragSortableListView::WindowActivated( bool active )
280 // workarround for buggy focus indication of BScrollView
281 if ( BView* view = Parent() )
285 /*****************************************************************************
286 * DragSortableListView::MessageReceived
287 *****************************************************************************/
289 DragSortableListView::MessageReceived(BMessage* message)
291 switch ( message->what )
293 case B_MODIFIERS_CHANGED:
298 DragSortableListView *list = NULL;
299 if ( message->FindPointer( "list", (void **)&list ) == B_OK
302 int32 count = CountItems();
303 if ( fDropIndex < 0 || fDropIndex > count )
307 for ( int32 i = 0; message->FindInt32( "index", i, &index ) == B_OK; i++ )
308 if ( BListItem* item = ItemAt(index) )
309 items.AddItem( (void*)item );
310 if ( items.CountItems() > 0 )
312 if ( modifiers() & B_SHIFT_KEY )
313 CopyItems( items, fDropIndex );
315 MoveItems( items, fDropIndex );
322 BListView::MessageReceived( message );
327 /*****************************************************************************
328 * DragSortableListView::MouseMoved
329 *****************************************************************************/
331 DragSortableListView::MouseMoved(BPoint where, uint32 transit, const BMessage *msg)
333 if ( msg && msg->what == B_SIMPLE_DATA )
335 bool replaceAll = !msg->HasPointer("list") && !(modifiers() & B_SHIFT_KEY);
344 r.bottom--; // compensate for scrollbar offset
345 _SetDropAnticipationRect( r );
350 // offset where by half of item height
351 BRect r( ItemFrame( 0 ) );
352 where.y += r.Height() / 2.0;
354 int32 index = IndexOf( where );
356 index = CountItems();
357 _SetDropIndex( index );
363 _RemoveDropAnticipationRect();
366 // remember drag message
367 // this is needed to react on modifier changes
368 fDragMessageCopy = *msg;
372 _RemoveDropAnticipationRect();
373 fDragMessageCopy.what = 0;
374 BListView::MouseMoved(where, transit, msg);
378 /*****************************************************************************
379 * DragSortableListView::MouseUp
380 *****************************************************************************/
382 DragSortableListView::MouseUp( BPoint where )
385 _SetDropAnticipationRect( BRect( 0.0, 0.0, -1.0, -1.0 ) );
386 fDragMessageCopy.what = 0;
387 BListView::MouseUp( where );
390 /*****************************************************************************
391 * DragSortableListView::DrawItem
392 *****************************************************************************/
394 DragSortableListView::DrawItem( BListItem *item, BRect itemFrame, bool complete )
396 DrawListItem( this, IndexOf( item ), itemFrame );
399 /*****************************************************************************
400 * DragSortableListView::ModifiersChaned
401 *****************************************************************************/
403 DragSortableListView::ModifiersChanged()
407 GetMouse( &where, &buttons, false );
408 uint32 transit = Bounds().Contains( where ) ? B_INSIDE_VIEW : B_OUTSIDE_VIEW;
409 MouseMoved( where, transit, &fDragMessageCopy );
412 /*****************************************************************************
413 * DragSortableListView::MoveItems
414 *****************************************************************************/
416 DragSortableListView::MoveItems( BList& items, int32 index )
419 // we remove the items while we look at them, the insertion index is decreased
420 // when the items index is lower, so that we insert at the right spot after
423 int32 count = items.CountItems();
424 for ( int32 i = 0; i < count; i++ )
426 BListItem* item = (BListItem*)items.ItemAt( i );
427 int32 removeIndex = IndexOf( item );
428 if ( RemoveItem( item ) && removedItems.AddItem( (void*)item ) )
430 if ( removeIndex < index )
433 // else ??? -> blow up
435 for ( int32 i = 0; BListItem* item = (BListItem*)removedItems.ItemAt( i ); i++ )
437 if ( AddItem( item, index ) )
439 // after we're done, the newly inserted items will be selected
440 Select( index, true );
441 // next items will be inserted after this one
449 /*****************************************************************************
450 * DragSortableListView::CopyItems
451 *****************************************************************************/
453 DragSortableListView::CopyItems( BList& items, int32 index )
456 // by inserting the items after we copied all items first, we avoid
457 // cloning an item we already inserted and messing everything up
458 // in other words, don't touch the list before we know which items
461 int32 count = items.CountItems();
462 for ( int32 i = 0; i < count; i++ )
464 BListItem* item = CloneItem( IndexOf( (BListItem*)items.ItemAt( i ) ) );
465 if ( item && !clonedItems.AddItem( (void*)item ) )
468 for ( int32 i = 0; BListItem* item = (BListItem*)clonedItems.ItemAt( i ); i++ )
470 if ( AddItem( item, index ) )
472 // after we're done, the newly inserted items will be selected
473 Select( index, true );
474 // next items will be inserted after this one
482 /*****************************************************************************
483 * DragSortableListView::RemoveItemList
484 *****************************************************************************/
486 DragSortableListView::RemoveItemList( BList& items )
488 int32 count = items.CountItems();
489 for ( int32 i = 0; i < count; i++ )
491 BListItem* item = (BListItem*)items.ItemAt( i );
492 if ( RemoveItem( item ) )
497 /*****************************************************************************
498 * DragSortableListView::RemoveSelected
499 *****************************************************************************/
501 DragSortableListView::RemoveSelected()
504 for ( int32 i = 0; BListItem* item = ItemAt( CurrentSelection( i ) ); i++ )
505 items.AddItem( (void*)item );
506 RemoveItemList( items );
509 /*****************************************************************************
510 * DragSortableListView::_SetDropAnticipationRect
511 *****************************************************************************/
513 DragSortableListView::_SetDropAnticipationRect( BRect r )
515 if ( fDropRect != r )
517 if ( fDropRect.IsValid() )
518 Invalidate( fDropRect );
520 if ( fDropRect.IsValid() )
521 Invalidate( fDropRect );
525 /*****************************************************************************
526 * DragSortableListView::_SetDropAnticipationRect
527 *****************************************************************************/
529 DragSortableListView::_SetDropIndex( int32 index )
531 if ( fDropIndex != index )
534 if ( fDropIndex == -1 )
535 _SetDropAnticipationRect( BRect( 0.0, 0.0, -1.0, -1.0 ) );
538 int32 count = CountItems();
539 if ( fDropIndex == count )
542 if ( BListItem* item = ItemAt( count - 1 ) )
544 r = ItemFrame( count - 1 );
545 r.top = r.bottom + 1.0;
546 r.bottom = r.top + 1.0;
551 r.bottom--; // compensate for scrollbars moved slightly out of window
553 _SetDropAnticipationRect( r );
557 BRect r = ItemFrame( fDropIndex );
558 r.bottom = r.top + 1.0;
559 _SetDropAnticipationRect( r );
565 /*****************************************************************************
566 * DragSortableListView::_RemoveDropAnticipationRect
567 *****************************************************************************/
569 DragSortableListView::_RemoveDropAnticipationRect()
571 _SetDropAnticipationRect( BRect( 0.0, 0.0, -1.0, -1.0 ) );
576 /*****************************************************************************
578 *****************************************************************************/
579 PlaylistView::PlaylistView( BRect frame, InterfaceWindow* mainWindow,
581 BMessage* selectionChangeMessage )
582 : DragSortableListView( frame, "playlist listview",
583 B_MULTIPLE_SELECTION_LIST, B_FOLLOW_ALL_SIDES,
584 B_WILL_DRAW | B_NAVIGABLE | B_PULSE_NEEDED
585 | B_FRAME_EVENTS | B_FULL_UPDATE_ON_RESIZE ),
588 fMainWindow( mainWindow ),
589 fSelectionChangeMessage( selectionChangeMessage ),
590 fVlcWrapper( wrapper )
594 PlaylistView::~PlaylistView()
596 delete fSelectionChangeMessage;
599 /*****************************************************************************
600 * PlaylistView::AttachedToWindow
601 *****************************************************************************/
603 PlaylistView::AttachedToWindow()
605 // get pulse message every two frames
606 Window()->SetPulseRate( 80000 );
609 /*****************************************************************************
610 * PlaylistView::MessageReceived
611 *****************************************************************************/
613 PlaylistView::MessageReceived( BMessage* message)
615 switch ( message->what )
618 if ( message->HasPointer( "list" ) )
620 // message comes from ourself
621 DragSortableListView::MessageReceived( message );
625 // message comes from another app (for example Tracker)
626 message->AddInt32( "drop index", fDropIndex );
627 fMainWindow->PostMessage( message, fMainWindow );
631 DragSortableListView::MessageReceived( message );
636 /*****************************************************************************
637 * PlaylistView::MouseDown
638 *****************************************************************************/
640 PlaylistView::MouseDown( BPoint where )
643 Window()->CurrentMessage()->FindInt32( "clicks", &clicks );
644 bool handled = false;
645 for ( int32 i = 0; PlaylistItem* item = (PlaylistItem*)ItemAt( i ); i++ )
647 BRect r = ItemFrame( i );
648 if ( r.Contains( where ) )
652 fVlcWrapper->PlaylistJumpTo( i );
655 else if ( i == fCurrentIndex )
657 r.right = r.left + TEXT_OFFSET;
658 if ( r.Contains ( where ) )
660 fMainWindow->PostMessage( PAUSE_PLAYBACK );
669 DragSortableListView::MouseDown(where);
672 /*****************************************************************************
673 * PlaylistView::KeyDown
674 *****************************************************************************/
676 PlaylistView::KeyDown( const char* bytes, int32 numBytes )
681 if ( ( bytes[0] == B_BACKSPACE ) || ( bytes[0] == B_DELETE ) )
685 DragSortableListView::KeyDown( bytes, numBytes );
688 /*****************************************************************************
689 * PlaylistView::Pulse
690 *****************************************************************************/
692 PlaylistView::Pulse()
694 if ( fMainWindow->IsStopped() )
698 /*****************************************************************************
699 * PlaylistView::SelectionChanged
700 *****************************************************************************/
702 PlaylistView::SelectionChanged()
704 BLooper* looper = Looper();
705 if ( fSelectionChangeMessage && looper )
707 BMessage message( *fSelectionChangeMessage );
708 looper->PostMessage( &message );
713 /*****************************************************************************
714 * PlaylistView::MoveItems
715 *****************************************************************************/
717 PlaylistView::MoveItems( BList& items, int32 index )
720 // we remove the items while we look at them, the insertion index is decreased
721 // when the items index is lower, so that we insert at the right spot after
723 if ( fVlcWrapper->PlaylistLock() )
727 int32 count = items.CountItems();
728 int32 indexOriginal = index;
729 // remember currently playing item
730 int32 currentIndex, size;
731 fVlcWrapper->GetPlaylistInfo( currentIndex, size );
732 BListItem* playingItem = ItemAt( currentIndex );
733 // collect item pointers for removal by index
734 for ( int32 i = 0; i < count; i++ )
736 int32 removeIndex = IndexOf( (BListItem*)items.ItemAt( i ) );
737 void* item = fVlcWrapper->PlaylistItemAt( removeIndex );
738 if ( item && removeItems.AddItem( item ) )
740 if ( removeIndex < index )
743 // else ??? -> blow up
745 // actually remove items using pointers
746 for ( int32 i = 0; i < count; i++ )
748 void* item = fVlcWrapper->PlaylistRemoveItem( removeItems.ItemAt( i ) );
749 if ( item && !removedItems.AddItem( item ) )
752 // add items at index
753 for ( int32 i = 0; void* item = removedItems.ItemAt( i ); i++ )
755 if ( fVlcWrapper->PlaylistAddItem( item, index ) )
756 // next items will be inserted after this one
762 DragSortableListView::MoveItems( items, indexOriginal );
763 // restore currently playing item
764 for ( int32 i = 0; BListItem* item = ItemAt( i ); i++ )
766 if ( item == playingItem )
768 fVlcWrapper->PlaylistSetPlaying( i );
773 fVlcWrapper->PlaylistUnlock();
777 /*****************************************************************************
778 * PlaylistView::CopyItems
779 *****************************************************************************/
781 PlaylistView::CopyItems( BList& items, int32 toIndex )
784 // we remove the items while we look at them, the insertion index is decreased
785 // when the items index is lower, so that we insert at the right spot after
787 if ( fVlcWrapper->PlaylistLock() )
790 int32 count = items.CountItems();
791 // remember currently playing item
792 int32 currentIndex, size;
793 fVlcWrapper->GetPlaylistInfo( currentIndex, size );
794 BListItem* playingItem = ItemAt( currentIndex );
795 // collect cloned item pointers
796 for ( int32 i = 0; i < count; i++ )
798 int32 index = IndexOf( (BListItem*)items.ItemAt( i ) );
799 void* item = fVlcWrapper->PlaylistItemAt( index );
800 void* cloned = fVlcWrapper->PlaylistCloneItem( item );
801 if ( cloned && !clonedItems.AddItem( cloned ) )
805 // add cloned items at index
806 int32 index = toIndex;
807 for ( int32 i = 0; void* item = clonedItems.ItemAt( i ); i++ )
809 if ( fVlcWrapper->PlaylistAddItem( item, index ) )
810 // next items will be inserted after this one
816 DragSortableListView::CopyItems( items, toIndex );
817 // restore currently playing item
818 for ( int32 i = 0; BListItem* item = ItemAt( i ); i++ )
820 if ( item == playingItem )
822 fVlcWrapper->PlaylistSetPlaying( i );
827 fVlcWrapper->PlaylistUnlock();
831 /*****************************************************************************
832 * PlaylistView::RemoveItemList
833 *****************************************************************************/
835 PlaylistView::RemoveItemList( BList& items )
837 if ( fVlcWrapper->PlaylistLock() )
839 // collect item pointers for removal
841 int32 count = items.CountItems();
842 for ( int32 i = 0; i < count; i++ )
844 int32 index = IndexOf( (BListItem*)items.ItemAt( i ) );
845 void* item = fVlcWrapper->PlaylistItemAt( index );
846 if ( item && !removeItems.AddItem( item ) )
849 // remove items from playlist
850 count = removeItems.CountItems();
851 for ( int32 i = 0; void* item = removeItems.ItemAt( i ); i++ )
853 fVlcWrapper->PlaylistRemoveItem( item );
856 DragSortableListView::RemoveItemList( items );
857 fVlcWrapper->PlaylistUnlock();
861 /*****************************************************************************
862 * PlaylistView::CloneItem
863 *****************************************************************************/
865 PlaylistView::CloneItem( int32 atIndex ) const
867 BListItem* clone = NULL;
868 if ( PlaylistItem* item = dynamic_cast<PlaylistItem*>( ItemAt( atIndex ) ) )
869 clone = new PlaylistItem( item->Text() );
873 /*****************************************************************************
874 * PlaylistView::DrawListItem
875 *****************************************************************************/
877 PlaylistView::DrawListItem( BView* owner, int32 index, BRect frame ) const
879 if ( PlaylistItem* item = dynamic_cast<PlaylistItem*>( ItemAt( index ) ) )
880 item->Draw( owner, frame, index % 2, index == fCurrentIndex, fPlaying );
883 /*****************************************************************************
884 * PlaylistView::MakeDragMessage
885 *****************************************************************************/
887 PlaylistView::MakeDragMessage( BMessage* message ) const
891 message->AddPointer( "list", (void*)this );
893 for ( int32 i = 0; ( index = CurrentSelection( i ) ) >= 0; i++ )
894 message->AddInt32( "index", index );
895 // TODO: add refs to message (inter application communication)
899 /*****************************************************************************
900 * PlaylistView::SetCurrent
901 *****************************************************************************/
903 PlaylistView::SetCurrent( int32 index )
905 if ( fCurrentIndex != index )
907 InvalidateItem( fCurrentIndex );
908 fCurrentIndex = index;
909 InvalidateItem( fCurrentIndex );
913 /*****************************************************************************
914 * PlaylistView::SetPlaying
915 *****************************************************************************/
917 PlaylistView::SetPlaying( bool playing )
919 if ( fPlaying != playing )
922 InvalidateItem( fCurrentIndex );
926 /*****************************************************************************
927 * PlaylistView::SetPlaying
928 *****************************************************************************/
930 PlaylistView::RebuildList()
933 int32 count = CountItems();
934 while ( BListItem* item = RemoveItem( --count ) )
937 // rebuild listview from VLC's playlist
938 for ( int i = 0; i < fVlcWrapper->PlaylistSize(); i++ )
939 AddItem( new PlaylistItem( fVlcWrapper->PlaylistItemName( i ) ) );