/*****************************************************************************
* ListViews.h: BeOS interface list view class implementation
*****************************************************************************
- * Copyright (C) 1999, 2000, 2001 VideoLAN
+ * Copyright (C) 1999, 2000, 2001 the VideoLAN team
* $Id$
*
* Authors: Stephan Aßmus <stippi@yellowbites.com>
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
-#include <stdio.h>
+#if 0
+
#include <malloc.h>
#include <Bitmap.h>
#include <String.h>
/* VLC headers */
-#include <vlc/vlc.h>
-#include <vlc/intf.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_interface.h>
#include "InterfaceWindow.h"
#include "ListViews.h"
v->SetHighColor( 0, 0, 0, 255 );
v->StrokeRect( v->Bounds() );
v->Sync();
-
+
uint8 *bits = (uint8 *)dragBitmap->Bits();
int32 height = (int32)dragBitmap->Bounds().Height() + 1;
int32 width = (int32)dragBitmap->Bounds().Width() + 1;
int32 bpr = dragBitmap->BytesPerRow();
-
+
if (fade) {
for ( int32 y = 0; y < height - ALPHA / 2; y++, bits += bpr ) {
uint8 *line = bits + 3;
// offset where by half of item height
BRect r( ItemFrame( 0 ) );
where.y += r.Height() / 2.0;
-
+
int32 index = IndexOf( where );
if ( index < 0 )
index = CountItems();
// only do something if user clicked the same item twice
if ( fLastClickedItem == item )
{
- playlist_t * p_playlist;
- 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_Goto( p_playlist, i );
- vlc_object_release( p_playlist );
+ pl_Release( p_intf );
}
handled = true;
}
{
if ( numBytes < 1 )
return;
-
+
if ( ( bytes[0] == B_BACKSPACE ) || ( bytes[0] == B_DELETE ) )
{
RemoveSelected();
void* cloned = fVlcWrapper->PlaylistCloneItem( item );
if ( cloned && !clonedItems.AddItem( cloned ) )
free( cloned );
-
+
}
// add cloned items at index
int32 index = toIndex;
void
PlaylistView::RebuildList()
{
- playlist_t * p_playlist;
- p_playlist = (playlist_t *) vlc_object_find( p_intf,
- VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
-
- if( !p_playlist )
- {
- return;
- }
+ playlist_t * p_playlist = pl_Yield( p_intf );
// remove all items
BListItem * item;
int32 count = CountItems();
while( ( item = RemoveItem( --count ) ) )
delete item;
-
+
// rebuild listview from VLC's playlist
- vlc_mutex_lock( &p_playlist->object_lock );
- for( int i = 0; i < p_playlist->i_size; i++ )
- AddItem( new PlaylistItem( p_playlist->pp_items[i]->input.psz_name ) );
- vlc_mutex_unlock( &p_playlist->object_lock );
+ PL_LOCK;
+ FOREACH_ARRAY( playlist_item_t *p_item, p_playlist->items )
+ AddItem( new PlaylistItem( p_item->p_input->psz_name ) );
+ FOREACH_END();
+ PL_UNLOCK;
vlc_object_release( p_playlist );
}
void
PlaylistView::SortByPath()
{
-
+
}
/*****************************************************************************
BListItem*
PlaylistView::_PlayingItem() const
{
- playlist_t * p_playlist;
- 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 )
{
}
BListItem * item = ItemAt( p_playlist->i_index );
- vlc_object_release( p_playlist );
+ pl_Release( p_intf );
return item;
}
{
if ( item == playingItem )
{
- playlist_t * p_playlist;
- 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 )
{
return;
playlist_Goto( p_playlist, i );
SetCurrent( i );
- vlc_object_release( p_playlist );
+ pl_Release( p_intf );
break;
}
}
}
+
+#endif