Changeset 499a384591d4238957f08348471fab5f36747fe7
- Timestamp:
- 29/01/04 18:51:08 (5 years ago)
- git-parent:
- Files:
-
- include/vlc_playlist.h (modified) (6 diffs)
- modules/access/cdda/access.c (modified) (8 diffs)
- modules/access/vcdx/access.c (modified) (4 diffs)
- modules/codec/speex.c (modified) (3 diffs)
- modules/codec/theora.c (modified) (3 diffs)
- modules/codec/vorbis.c (modified) (3 diffs)
- modules/control/http.c (modified) (5 diffs)
- modules/demux/util/id3tag.c (modified) (9 diffs)
- modules/gui/pda/pda_callbacks.c (modified) (2 diffs)
- modules/gui/wxwindows/iteminfo.cpp (modified) (4 diffs)
- modules/gui/wxwindows/open.cpp (modified) (5 diffs)
- modules/gui/wxwindows/playlist.cpp (modified) (9 diffs)
- modules/gui/wxwindows/streamwizard.cpp (modified) (4 diffs)
- modules/misc/sap.c (modified) (5 diffs)
- src/input/input.c (modified) (3 diffs)
- src/libvlc.c (modified) (3 diffs)
- src/misc/win32_specific.c (modified) (2 diffs)
- src/playlist/info.c (modified) (18 diffs)
- src/playlist/item-ext.c (modified) (16 diffs)
- src/playlist/item.c (modified) (2 diffs)
- src/playlist/loadsave.c (modified) (2 diffs)
- src/playlist/playlist.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
include/vlc_playlist.h
r6de15a6 r499a384 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999-2004 VideoLAN 5 * $Id: vlc_playlist.h,v 1.2 6 2004/01/25 18:17:08zorglub Exp $5 * $Id: vlc_playlist.h,v 1.27 2004/01/29 17:51:07 zorglub Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 76 76 mtime_t i_duration; /**< A hint about the duration of this 77 77 * item, in milliseconds*/ 78 int i_categories; /**< Number of info categories */ 79 item_info_category_t **pp_categories; 80 /**< Pointer to the first info category */ 81 int i_status; /**< unused yet */ 78 int i_categories; /**< Number of info categories */ 79 item_info_category_t ** 80 pp_categories; /**< Pointer to the first info category */ 81 int i_options; /**< Number of options */ 82 char ** ppsz_options; /**< Array of options */ 82 83 int i_nb_played; /**< How many times was this item played ? */ 83 84 vlc_bool_t b_autodeletion; /**< Indicates whther this item is to … … 87 88 vlc_bool_t b_enabled; /**< Indicates whether this item is to be 88 89 * played or skipped */ 89 int i_group; /**< Which group does this item belongs to ? */90 int i_group; /**< Which group does this item belongs to ? */ 90 91 int i_id; /**< Unique id to track this item */ 92 vlc_mutex_t lock; /**< Item cannot be changed without this lock */ 91 93 }; 92 94 … … 166 168 167 169 168 /* Item functions */ 170 /* Item management functions */ 171 #define playlist_AddItem(p,pi,i1,i2) playlist_ItemAdd(p,pi,i1,i2) 172 #define playlist_ItemNew( a , b, c ) __playlist_ItemNew(VLC_OBJECT(a) , b , c ) 173 VLC_EXPORT( playlist_item_t* , __playlist_ItemNew, ( vlc_object_t *,const char *,const char * ) ); 174 VLC_EXPORT( void, playlist_ItemDelete, ( playlist_item_t * ) ); 175 VLC_EXPORT( int, playlist_ItemAdd, ( playlist_t *, playlist_item_t *, int, int ) ); 176 177 /* Simple add/remove funcctions */ 169 178 VLC_EXPORT( int, playlist_Add, ( playlist_t *, const char *, const char *, int, int ) ); 170 VLC_EXPORT( int, playlist_Add WDuration, ( playlist_t *, const char *, const char *, int, int, mtime_t ) );171 /* For internal use. Do not use this one anymore */ 172 VLC_EXPORT( int, playlist_AddItem, ( playlist_t *, playlist_item_t *, int, int ) ); 179 VLC_EXPORT( int, playlist_AddExt, ( playlist_t *, const char *, const char *, int, int, mtime_t, const char **,int ) ); 180 181 173 182 VLC_EXPORT( int, playlist_Clear, ( playlist_t * ) ); 174 183 VLC_EXPORT( int, playlist_Delete, ( playlist_t *, int ) ); … … 179 188 180 189 /* Basic item informations accessors */ 181 VLC_EXPORT( int, playlist_SetGroup, (playlist_t *, int, int ) ); 182 VLC_EXPORT( int, playlist_SetName, (playlist_t *, int, char * ) ); 183 VLC_EXPORT( int, playlist_SetDuration, (playlist_t *, int, mtime_t ) ); 190 VLC_EXPORT( int, playlist_ItemSetGroup, (playlist_item_t *, int ) ); 191 VLC_EXPORT( int, playlist_ItemSetName, (playlist_item_t *, char * ) ); 192 VLC_EXPORT( int, playlist_ItemSetDuration, (playlist_item_t *, mtime_t ) ); 193 194 VLC_EXPORT( int, playlist_SetGroup, (playlist_t * , int , int ) ); 195 VLC_EXPORT( int, playlist_SetName, (playlist_t *, int , char * ) ); 196 VLC_EXPORT( int, playlist_SetDuration, (playlist_t *, int , mtime_t ) ); 184 197 185 198 /* Item search functions */ 186 199 VLC_EXPORT( int, playlist_GetPositionById, (playlist_t *, int) ); 187 VLC_EXPORT( playlist_item_t *, playlist_GetItemById, (playlist_t *, int) ); 200 VLC_EXPORT( playlist_item_t *, playlist_ItemGetById, (playlist_t *, int) ); 201 VLC_EXPORT( playlist_item_t *, playlist_ItemGetByPos, (playlist_t *, int) ); 188 202 189 203 … … 196 210 /* Info functions */ 197 211 VLC_EXPORT( char * , playlist_GetInfo, ( playlist_t * , int, const char *, const char *) ); 198 VLC_EXPORT( char * , playlist_ GetItemInfo, ( playlist_item_t * , const char *, const char *) );212 VLC_EXPORT( char * , playlist_ItemGetInfo, ( playlist_item_t * , const char *, const char *) ); 199 213 200 214 VLC_EXPORT( item_info_category_t*, playlist_GetCategory, ( playlist_t *, int, const char *) ); 201 VLC_EXPORT( item_info_category_t*, playlist_ GetItemCategory, ( playlist_item_t *, const char *) );215 VLC_EXPORT( item_info_category_t*, playlist_ItemGetCategory, ( playlist_item_t *, const char *) ); 202 216 203 217 VLC_EXPORT( item_info_category_t*, playlist_CreateCategory, ( playlist_t *, int, const char *) ); 204 VLC_EXPORT( item_info_category_t*, playlist_ CreateItemCategory, ( playlist_item_t *, const char *) );218 VLC_EXPORT( item_info_category_t*, playlist_ItemCreateCategory, ( playlist_item_t *, const char *) ); 205 219 206 220 VLC_EXPORT( int, playlist_AddInfo, (playlist_t *, int, const char * , const char *, const char *, ...) ); 207 VLC_EXPORT( int, playlist_ AddItemInfo, (playlist_item_t *, const char * , const char *, const char *, ...) );221 VLC_EXPORT( int, playlist_ItemAddInfo, (playlist_item_t *, const char * , const char *, const char *, ...) ); 208 222 209 223 /* Option functions */ 210 VLC_EXPORT( int, playlist_AddOption, (playlist_t *, int, const char * , ...) );211 VLC_EXPORT( int, playlist_ AddItemOption, (playlist_item_t *, const char *, ...) );224 VLC_EXPORT( int, playlist_AddOption, (playlist_t *, int, const char *) ); 225 VLC_EXPORT( int, playlist_ItemAddOption, (playlist_item_t *, const char *) ); 212 226 213 227 /* Playlist sorting */ modules/access/cdda/access.c
r9841276 r499a384 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000,2003 VideoLAN 5 * $Id: access.c,v 1.2 2 2004/01/07 07:21:31 rockyExp $5 * $Id: access.c,v 1.23 2004/01/29 17:51:07 zorglub Exp $ 6 6 * 7 7 * Authors: Rocky Bernstein <rocky@panix.com> … … 315 315 dbg_print( INPUT_DBG_META, "field %s: %s\n", title, str); \ 316 316 input_AddInfo( p_cat, _(title), "%s", str ); \ 317 playlist_AddInfo( p_playlist, -1, p_cat->psz_name, \ 317 vlc_mutex_lock( &p_playlist->object_lock ); \ 318 p_item = playlist_ItemGetByPos( p_playlist, -1 ); \ 319 vlc_mutex_unlock( &p_playlist->object_lock ); \ 320 vlc_mutex_lock( &p_item->lock ); \ 321 playlist_ItemAddInfo( p_item, p_cat->psz_name, \ 318 322 _(title), "%s" , str ); \ 323 vlc_mutex_unlock( &p_item->lock ); \ 319 324 } 320 325 … … 326 331 FIND_PARENT ); 327 332 input_info_category_t *p_cat; 333 playlist_item_t *p_item; 328 334 329 335 p_cat = input_InfoCategory( p_input, "General" ); 330 336 331 337 332 338 #ifdef HAVE_LIBCDDB … … 670 676 char *p_title; 671 677 char *config_varname = MODULE_STRING "-title-format"; 678 playlist_item_t *p_item; 672 679 673 680 #ifdef HAVE_LIBCDDB … … 686 693 dbg_print( INPUT_DBG_META, "mrl: %s, title: %s, duration, %ld, pos %d", 687 694 psz_mrl, p_title, (long int) i_duration / 1000000 , i_pos ); 688 playlist_Add WDuration( p_playlist, psz_mrl, p_title, playlist_operation,689 i_pos, i_duration);695 playlist_AddExt( p_playlist, psz_mrl, p_title, playlist_operation, 696 i_pos, i_duration , NULL, 0); 690 697 691 698 if( i_pos == PLAYLIST_END ) i_pos = p_playlist->i_size - 1; 699 700 vlc_mutex_lock( &p_playlist->object_lock ); 701 p_item = playlist_ItemGetByPos( p_playlist, i_pos ); 702 vlc_mutex_unlock( &p_playlist->object_lock ); 703 if( !p_item ) 704 return; 705 706 vlc_mutex_lock( &p_item->lock ); 692 707 693 708 p_author = … … 696 711 psz_mrl, i_track ); 697 712 698 playlist_ AddInfo( p_playlist, i_pos,_("General"),_("Author"), p_author);713 playlist_ItemAddInfo( p_item , _("General"),_("Author"), p_author); 699 714 700 715 #ifdef HAVE_LIBCDDB … … 702 717 const char *psz_general_cat = _("General"); 703 718 704 playlist_ AddInfo( p_playlist, i_pos, psz_general_cat, _("Album"),705 "%s", p_cdda->cddb.disc->title);706 playlist_ AddInfo( p_playlist, i_pos, psz_general_cat, _("Disc Artist(s)"),707 "%s", p_cdda->cddb.disc->artist);708 playlist_ AddInfo( p_playlist, i_pos, psz_general_cat,709 _("CDDB Disc Category"),710 "%s", CDDB_CATEGORY[p_cdda->cddb.disc->category]);711 playlist_ AddInfo( p_playlist, i_pos, psz_general_cat, _("Genre"),712 "%s", p_cdda->cddb.disc->genre);719 playlist_ItemAddInfo( p_item, psz_general_cat, _("Album"), 720 "%s", p_cdda->cddb.disc->title); 721 playlist_ItemAddInfo( p_item, psz_general_cat, _("Disc Artist(s)"), 722 "%s", p_cdda->cddb.disc->artist); 723 playlist_ItemAddInfo( p_item, psz_general_cat, 724 _("CDDB Disc Category"), 725 "%s", CDDB_CATEGORY[p_cdda->cddb.disc->category]); 726 playlist_ItemAddInfo( p_item, psz_general_cat, _("Genre"), 727 "%s", p_cdda->cddb.disc->genre); 713 728 if ( p_cdda->cddb.disc->discid ) { 714 playlist_ AddInfo( p_playlist, i_pos, psz_general_cat, _("CDDB Disc ID"),715 "%x", p_cdda->cddb.disc->discid );729 playlist_ItemAddInfo( p_item, psz_general_cat, _("CDDB Disc ID"), 730 "%x", p_cdda->cddb.disc->discid ); 716 731 } 717 732 if (p_cdda->cddb.disc->year != 0) { 718 playlist_ AddInfo( p_playlist, i_pos, psz_general_cat,719 _("Year"), "%5d", p_cdda->cddb.disc->year );733 playlist_ItemAddInfo( p_item, psz_general_cat, 734 _("Year"), "%5d", p_cdda->cddb.disc->year ); 720 735 } 721 736 722 737 if (p_cdda->i_cddb_enabled) { 723 738 cddb_track_t *t=cddb_disc_get_track(p_cdda->cddb.disc, 724 i_track-1);739 i_track-1); 725 740 if (t != NULL && t->artist != NULL) { 726 playlist_AddInfo( p_playlist, i_pos, psz_general_cat,727 _("Track Artist"), "%s", t->artist );728 playlist_AddInfo( p_playlist, i_pos, psz_general_cat,729 _("Track Title"), "%s", t->title );741 playlist_ItemAddInfo( p_item, psz_general_cat, 742 _("Track Artist"), "%s", t->artist ); 743 playlist_ItemAddInfo( p_item , psz_general_cat, 744 _("Track Title"), "%s", t->title ); 730 745 } 731 746 } … … 734 749 #endif /*HAVE_LIBCDDB*/ 735 750 751 vlc_mutex_unlock( &p_item->lock ); 736 752 } 737 753 modules/access/vcdx/access.c
rc71e26d r499a384 5 5 ***************************************************************************** 6 6 * Copyright (C) 2000, 2003, 2004 VideoLAN 7 * $Id: access.c,v 1.1 7 2004/01/25 04:53:16 rockyExp $7 * $Id: access.c,v 1.18 2004/01/29 17:51:07 zorglub Exp $ 8 8 * 9 9 * Authors: Rocky Bernstein <rocky@panix.com> … … 1004 1004 1005 1005 static inline void 1006 MetaInfoAddStr(input_thread_t *p_input, input_info_category_t *p_cat, 1007 playlist_t *p_playlist, char *title, 1008 const char *str)1006 MetaInfoAddStr(input_thread_t *p_input, input_info_category_t *p_cat, 1007 playlist_t *p_playlist, char *title, 1008 const char *str) 1009 1009 { 1010 1010 thread_vcd_data_t *p_vcd = (thread_vcd_data_t *) p_input->p_access_data; 1011 if ( str ) { 1011 playlist_item_t *p_item; 1012 if ( str ) { 1012 1013 dbg_print( INPUT_DBG_META, "field: %s: %s\n", title, str); 1013 input_AddInfo( p_cat, title, "%s", str ); 1014 playlist_AddInfo( p_playlist, -1, p_cat->psz_name, title, 1015 "%s",str ); 1014 input_AddInfo( p_cat, title, "%s", str ); 1015 1016 vlc_mutex_lock( &p_playlist->object_lock ); 1017 p_item = playlist_ItemGetByPos( p_playlist, -1 ); 1018 vlc_mutex_unlock( &p_playlist->object_lock ); 1019 1020 vlc_mutex_lock( &p_item->lock ); 1021 playlist_ItemAddInfo( p_item, p_cat->psz_name, title, 1022 "%s",str ); 1023 vlc_mutex_unlock( &p_item->lock ); 1016 1024 } 1017 1025 } … … 1019 1027 1020 1028 static inline void 1021 MetaInfoAddNum(input_thread_t *p_input, input_info_category_t *p_cat, 1022 playlist_t *p_playlist, char *title, int num)1029 MetaInfoAddNum(input_thread_t *p_input, input_info_category_t *p_cat, 1030 playlist_t *p_playlist, char *title, int num) 1023 1031 { 1024 1032 thread_vcd_data_t *p_vcd = (thread_vcd_data_t *) p_input->p_access_data; 1033 playlist_item_t *p_item; 1034 1035 vlc_mutex_lock( &p_playlist->object_lock ); 1036 p_item = playlist_ItemGetByPos( p_playlist, -1 ); 1037 vlc_mutex_unlock( &p_playlist->object_lock ); 1038 1025 1039 dbg_print( INPUT_DBG_META, "field %s: %d\n", title, num); 1026 1040 input_AddInfo( p_cat, title, "%d", num ); 1027 playlist_AddInfo( p_playlist, -1, p_cat->psz_name, title, 1028 "%d",num ); 1029 } 1030 1041 1042 vlc_mutex_lock( &p_item->lock ); 1043 playlist_ItemAddInfo( p_item , p_cat->psz_name, title, "%d",num ); 1044 vlc_mutex_unlock( &p_item->lock ); 1045 } 1046 1031 1047 #define addstr(title, str) \ 1032 1048 MetaInfoAddStr( p_input, p_cat, p_playlist, title, str ); … … 1034 1050 #define addnum(title, num) \ 1035 1051 MetaInfoAddNum( p_input, p_cat, p_playlist, title, num ); 1036 1052 1037 1053 static void InformationCreate( input_thread_t *p_input ) 1038 1054 { modules/codec/speex.c
rfea7f38 r499a384 3 3 ***************************************************************************** 4 4 * Copyright (C) 2003 VideoLAN 5 * $Id: speex.c,v 1.1 0 2004/01/25 18:20:12 bigbenExp $5 * $Id: speex.c,v 1.11 2004/01/29 17:51:07 zorglub Exp $ 6 6 * 7 7 * Authors: Gildas Bazin <gbazin@netcourrier.com> … … 472 472 p_mode = speex_mode_list[p_sys->p_header->mode]; 473 473 input_AddInfo( p_cat, _("Mode"), "%s%s", 474 p_mode->modeName, p_sys->p_header->vbr ? " VBR" : "" ); 475 playlist_AddInfo( p_playlist, -1, _("Speex comment") , _("Mode"), "%s%s", 474 p_mode->modeName, p_sys->p_header->vbr ? " VBR" : "" ); 475 476 vlc_mutex_lock( &p_playlist->object_lock ); 477 p_item = playlist_ItemGetByPos( p_playlist, -1 ); 478 vlc_mutex_unlock( &p_playlist->object_lock ); 479 if( !p_item) 480 { 481 msg_Err(p_dec, "unable to find item" ); 482 return; 483 } 484 vlc_mutex_lock( &p_item->lock ); 485 486 playlist_ItemAddInfo( p_item, _("Speex comment") , _("Mode"),"%s%s", 476 487 p_mode->modeName, p_sys->p_header->vbr ? " VBR" : "" ); 477 488 … … 490 501 491 502 input_AddInfo( p_cat, p_buf, "" ); 492 playlist_AddInfo( p_playlist, -1, _("Speex comment") , p_buf , "" ); 503 playlist_ItemAddInfo( p_item , _("Speex comment") , p_buf , "" ); 504 505 vlc_mutex_unlock( &p_item->lock ); 493 506 494 507 if( p_playlist ) vlc_object_release( p_playlist ); modules/codec/theora.c
rfea7f38 r499a384 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999-2001 VideoLAN 5 * $Id: theora.c,v 1.2 3 2004/01/25 18:20:12 bigbenExp $5 * $Id: theora.c,v 1.24 2004/01/29 17:51:07 zorglub Exp $ 6 6 * 7 7 * Authors: Gildas Bazin <gbazin@netcourrier.com> … … 341 341 playlist_t *p_playlist = vlc_object_find( p_dec, VLC_OBJECT_PLAYLIST, 342 342 FIND_ANYWHERE ); 343 playlist_item_t *p_item; 343 344 int i = 0; 344 345 char *psz_name, *psz_value, *psz_comment; … … 358 359 psz_value++; 359 360 input_AddInfo( p_cat, psz_name, psz_value ); 360 playlist_AddInfo( p_playlist, -1, _("Theora comment") , 361 psz_name, psz_value ); 361 vlc_mutex_lock( &p_playlist->object_lock ); 362 p_item = playlist_ItemGetByPos( p_playlist, -1 ); 363 vlc_mutex_unlock( &p_playlist->object_lock ); 364 if( !p_item) 365 { 366 msg_Err(p_dec, "unable to find item" ); 367 return; 368 } 369 vlc_mutex_lock( &p_item->lock ); 370 playlist_ItemAddInfo( p_item, _("Theora comment") , 371 psz_name, psz_value ); 372 vlc_mutex_unlock( &p_item->lock ); 362 373 } 363 374 free( psz_comment ); modules/codec/vorbis.c
rfea7f38 r499a384 3 3 ***************************************************************************** 4 4 * Copyright (C) 2001-2003 VideoLAN 5 * $Id: vorbis.c,v 1.3 0 2004/01/25 18:20:12 bigbenExp $5 * $Id: vorbis.c,v 1.31 2004/01/29 17:51:07 zorglub Exp $ 6 6 * 7 7 * Authors: Gildas Bazin <gbazin@netcourrier.com> … … 457 457 playlist_t *p_playlist = vlc_object_find( p_dec, VLC_OBJECT_PLAYLIST, 458 458 FIND_ANYWHERE ); 459 playlist_item_t *p_item; 459 460 int i = 0; 460 461 char *psz_name, *psz_value, *psz_comment; … … 474 475 psz_value++; 475 476 input_AddInfo( p_cat, psz_name, psz_value ); 476 playlist_AddInfo( p_playlist, -1, _("Vorbis comment") , 477 psz_name, psz_value ); 477 vlc_mutex_lock( &p_playlist->object_lock ); 478 p_item = playlist_ItemGetByPos( p_playlist, -1 ); 479 vlc_mutex_unlock( &p_playlist->object_lock ); 480 if( !p_item) 481 { 482 msg_Err(p_dec, "unable to find item" ); 483 return; 484 } 485 vlc_mutex_lock( &p_item->lock ); 486 playlist_ItemAddInfo( p_item, _("Vorbis comment") , 487 psz_name, psz_value ); 488 vlc_mutex_unlock( &p_item->lock ); 478 489 } 479 490 free( psz_comment ); modules/control/http.c
r59bd8e1 r499a384 3 3 ***************************************************************************** 4 4 * Copyright (C) 2001-2004 VideoLAN 5 * $Id: http.c,v 1.5 0 2004/01/25 16:17:03 anilExp $5 * $Id: http.c,v 1.51 2004/01/29 17:51:07 zorglub Exp $ 6 6 * 7 7 * Authors: Gildas Bazin <gbazin@netcourrier.com> … … 126 126 static char *Find_end_MRL( char *psz ); 127 127 128 static playlist_item_t * parse_MRL( char *psz );128 static playlist_item_t * parse_MRL( intf_thread_t * , char *psz ); 129 129 130 130 /***************************************************************************** … … 1765 1765 uri_extract_value( p_request, "mrl", mrl, 512 ); 1766 1766 uri_decode_url_encoded( mrl ); 1767 p_item = parse_MRL( mrl );1767 p_item = parse_MRL( p_intf, mrl ); 1768 1768 1769 1769 if( !p_item || !p_item->psz_uri || !*p_item->psz_uri ) … … 2871 2871 * return NULL if there is an error. 2872 2872 **********************************************************************/ 2873 playlist_item_t * parse_MRL( char *psz )2873 playlist_item_t * parse_MRL( intf_thread_t *p_intf, char *psz ) 2874 2874 { 2875 2875 char **ppsz_options = NULL; … … 2968 2968 { 2969 2969 /* now create an item */ 2970 p_item = malloc( sizeof( playlist_item_t ) ); 2971 memset( p_item, 0, sizeof( playlist_item_t ) ); 2972 p_item->psz_name = mrl; 2973 p_item->psz_uri = strdup( mrl ); 2974 p_item->i_duration = -1; 2975 p_item->b_enabled = VLC_TRUE; 2976 p_item->i_group = PLAYLIST_TYPE_MANUAL; 2977 2970 p_item = playlist_ItemNew( p_intf, mrl, mrl); 2978 2971 for( i = 0 ; i< i_options ; i++ ) 2979 2972 { 2980 playlist_ AddItemOption( p_item, ppsz_options[i] );2973 playlist_ItemAddOption( p_item, ppsz_options[i] ); 2981 2974 } 2982 2975 } modules/demux/util/id3tag.c
rffdca9a r499a384 3 3 ***************************************************************************** 4 4 * Copyright (C) 2002-2004 VideoLAN 5 * $Id: id3tag.c,v 1. 19 2004/01/25 20:05:29 hartmanExp $5 * $Id: id3tag.c,v 1.20 2004/01/29 17:51:07 zorglub Exp $ 6 6 * 7 7 * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> … … 86 86 while ( ( p_frame = id3_tag_findframe( p_id3_tag , "T", i ) ) ) 87 87 { 88 playlist_item_t *p_item = p_playlist ? p_playlist->pp_items[p_playlist->i_index] : NULL; 88 playlist_item_t *p_item = playlist_ItemGetByPos( p_playlist, -1 ); 89 if( !p_item ) 90 { 91 msg_Err( p_input, "Unable to get item" ); 92 return; 93 } 94 95 vlc_mutex_lock( &p_item->lock ); 89 96 90 97 int i_strings = id3_field_getnstrings( &p_frame->fields[1] ); … … 102 109 input_AddInfo( p_category, (char *)p_frame->description, 103 110 ppsz_genres[atoi(psz_temp)]); 104 playlist_ AddItemInfo( p_item, "ID3",111 playlist_ItemAddInfo( p_item, "ID3", 105 112 (char *)p_frame->description, 106 113 ppsz_genres[atoi(psz_temp)]); … … 110 117 input_AddInfo( p_category, (char *)p_frame->description, 111 118 psz_temp ); 112 playlist_ AddItemInfo( p_item, "ID3",119 playlist_ItemAddInfo( p_item, "ID3", 113 120 (char *)p_frame->description, 114 121 psz_temp); … … 129 136 input_AddInfo( p_category, (char *)p_frame->description, 130 137 psz_temp ); 131 playlist_ AddItemInfo( p_item, "ID3",138 playlist_ItemAddInfo( p_item, "ID3", 132 139 (char *)p_frame->description, 133 140 psz_temp); … … 137 144 if( p_item ) 138 145 { 139 playlist_ AddItemInfo( p_item,146 playlist_ItemAddInfo( p_item, 140 147 _("General"), _("Author"), psz_temp); 141 148 val.b_bool = VLC_TRUE; … … 143 150 input_AddInfo( p_category, (char *)p_frame->description, 144 151 psz_temp ); 145 playlist_ AddItemInfo( p_item, "ID3",152 playlist_ItemAddInfo( p_item, "ID3", 146 153 (char *)p_frame->description, 147 154 psz_temp); … … 151 158 input_AddInfo( p_category, (char *)p_frame->description, 152 159 psz_temp ); 153 playlist_ AddItemInfo( p_item, "ID3",160 playlist_ItemAddInfo( p_item, "ID3", 154 161 (char *)p_frame->description, 155 162 psz_temp); … … 158 165 } 159 166 i++; 167 vlc_mutex_unlock( &p_item->lock ); 160 168 } 161 169 id3_tag_delete( p_id3_tag ); modules/gui/pda/pda_callbacks.c
rc14327c r499a384 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000, 2001 VideoLAN 5 * $Id: pda_callbacks.c,v 1.2 5 2004/01/25 14:15:21 kuehneExp $5 * $Id: pda_callbacks.c,v 1.26 2004/01/29 17:51:07 zorglub Exp $ 6 6 * 7 7 * Authors: Jean-Paul Saman <jpsaman@wxs.nl> … … 134 134 #endif 135 135 { 136 i_id = playlist_Add( p_playlist, (const char*)name, 137 (const char*)name, 138 PLAYLIST_APPEND, PLAYLIST_END ); 139 140 i_pos = playlist_GetPositionById( p_playlist, i_id ); 141 142 for( i = 0 ; i< i_size ; i++ ) 143 { 144 playlist_AddOption( p_playlist, i_pos , ppsz_options[i] ); 145 } 136 i_id = playlist_AddExt( p_playlist, (const char*)name, 137 (const char*)name, 138 PLAYLIST_APPEND, PLAYLIST_END, 139 ppsz_options, i_pos ); 146 140 } 147 141 modules/gui/wxwindows/iteminfo.cpp
rd03df88 r499a384 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000-2004 VideoLAN 5 * $Id: iteminfo.cpp,v 1. 7 2004/01/25 03:29:01 hartmanExp $5 * $Id: iteminfo.cpp,v 1.8 2004/01/29 17:51:08 zorglub Exp $ 6 6 * 7 7 * Authors: Cl�nt Stenac <zorglub@videolan.org> … … 179 179 author_text = 180 180 new wxTextCtrl( info_panel, Uri_Event, 181 wxU( playlist_ GetItemInfo( p_item,181 wxU( playlist_ItemGetInfo( p_item, 182 182 _("General"), _("Author") ) ), 183 183 wxDefaultPosition, wxSize( 300, -1 ), … … 306 306 void ItemInfoDialog::OnOk( wxCommandEvent& WXUNUSED(event) ) 307 307 { 308 vlc_mutex_lock( &p_item->lock ); 308 309 p_item->psz_name = strdup( name_text->GetLineText(0).mb_str() ); 309 310 p_item->psz_uri = strdup( uri_text->GetLineText(0).mb_str() ); 310 playlist_ AddItemInfo( p_item,"General","Author",311 playlist_ItemAddInfo( p_item,"General","Author", 311 312 author_text->GetLineText(0).mb_str() ); 312 313 vlc_bool_t b_old_enabled = p_item->b_enabled; … … 336 337 337 338 p_item->b_enabled = enabled_checkbox->IsChecked() ? VLC_TRUE : VLC_FALSE ; 339 vlc_mutex_unlock( &p_item->lock ); 338 340 EndModal( wxID_OK ); 339 341 } modules/gui/wxwindows/open.cpp
r41fd167 r499a384 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000-2004 VideoLAN 5 * $Id: open.cpp,v 1.6 6 2004/01/26 22:10:20 gbazinExp $5 * $Id: open.cpp,v 1.67 2004/01/29 17:51:08 zorglub Exp $ 6 6 * 7 7 * Authors: Gildas Bazin <gbazin@netcourrier.com> … … 891 891 { 892 892 int i_options = 0; 893 894 int i_id = playlist_Add( p_playlist, (const char *)mrl[i].mb_str(), 895 (const char *)mrl[i].mb_str(), 896 PLAYLIST_APPEND, PLAYLIST_END ); 897 playlist_item_t *p_item = playlist_GetItemById( p_playlist , i_id ); 893 playlist_item_t *p_item = 894 playlist_ItemNew( p_intf, 895 (const char*)mrl[i].mb_str(), 896 (const char *)mrl[i].mb_str() ); 898 897 899 898 /* Count the input options */ … … 907 906 for( int j = 0; j < i_options; j++ ) 908 907 { 909 playlist_ AddItemOption( p_item, mrl[i + j + 1].mb_str() );908 playlist_ItemAddOption( p_item, mrl[i + j + 1].mb_str() ); 910 909 } 911 910 … … 915 914 for( int j = 0; j < (int)subsfile_mrl.GetCount(); j++ ) 916 915 { 917 playlist_ AddItemOption( p_item, subsfile_mrl[j].mb_str() );916 playlist_ItemAddOption( p_item, subsfile_mrl[j].mb_str() ); 918 917 } 919 918 } … … 924 923 for( int j = 0; j < (int)sout_mrl.GetCount(); j++ ) 925 924 { 926 playlist_ AddItemOption( p_item, sout_mrl[j].mb_str() );925 playlist_ItemAddOption( p_item, sout_mrl[j].mb_str() ); 927 926 } 928 927 } 928 929 int i_id = playlist_AddItem( p_playlist, p_item, 930 PLAYLIST_APPEND, PLAYLIST_END ); 929 931 930 932 if( !i && i_open_arg ) modules/gui/wxwindows/playlist.cpp
rd03df88 r499a384 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000-2004 VideoLAN 5 * $Id: playlist.cpp,v 1. 39 2004/01/25 03:29:01 hartmanExp $5 * $Id: playlist.cpp,v 1.40 2004/01/29 17:51:08 zorglub Exp $ 6 6 * 7 7 * Authors: Olivier Teuli� <ipkiss@via.ecp.fr> … … 406 406 (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, 407 407 FIND_ANYWHERE ); 408 if( p_playlist == NULL ) 409 { 410 return; 411 } 412 if( i < 0 || i >= p_playlist->i_size || !p_playlist->pp_items[i] ) 408 409 if( p_playlist == NULL ) 410 { 411 return; 412 } 413 414 playlist_item_t *p_item = playlist_ItemGetByPos( p_playlist, i ); 415 416 if( !p_item ) 413 417 { 414 418 vlc_object_release(p_playlist); 415 419 return; 416 420 } 417 listview->SetItem( i, 0, wxL2U(p_playlist->pp_items[i]->psz_name) ); 418 listview->SetItem( i, 1, wxU( playlist_GetInfo( p_playlist, i, 421 422 listview->SetItem( i, 0, wxL2U(p_item->psz_name) ); 423 listview->SetItem( i, 1, wxU( playlist_ItemGetInfo( p_item, 419 424 _("General") , _("Author") ) ) ); 420 425 char *psz_group = playlist_FindGroup(p_playlist, 421 p_ playlist->pp_items[i]->i_group);426 p_item->i_group); 422 427 listview->SetItem( i, 2, 423 428 wxL2U( psz_group ? psz_group : _("Normal") ) ); 424 429 425 if( p_ playlist->pp_items[i]->b_enabled == VLC_FALSE )430 if( p_item->b_enabled == VLC_FALSE ) 426 431 { 427 432 wxListItem listitem; … … 432 437 433 438 char psz_duration[MSTRTIME_MAX_SIZE]; 434 mtime_t dur = p_ playlist->pp_items[i]->i_duration;439 mtime_t dur = p_item->i_duration; 435 440 if( dur != -1 ) secstotimestr( psz_duration, dur/1000000 ); 436 441 else memcpy( psz_duration , "-:--:--", sizeof("-:--:--") ); … … 612 617 } 613 618 } 614 619 615 620 vlc_object_release( p_playlist ); 616 621 617 622 } 618 623 } … … 901 906 if( listview->IsSelected( item ) ) 902 907 { 908 /*XXX*/ 903 909 playlist_Enable( p_playlist, item ); 904 910 UpdateItem( item ); … … 922 928 if( listview->IsSelected( item ) ) 923 929 { 930 /*XXX*/ 924 931 playlist_Disable( p_playlist, item ); 925 932 UpdateItem( item ); … … 1022 1029 if( iteminfo_dialog == NULL ) 1023 1030 { 1024 if( i_item >= 0 && i_item < p_playlist->i_size ) 1031 vlc_mutex_lock( &p_playlist->object_lock); 1032 playlist_item_t *p_item = playlist_ItemGetByPos( p_playlist, i_item ); 1033 vlc_mutex_unlock( &p_playlist->object_lock ); 1034 1035 if( p_item ) 1025 1036 { 1026 1037 iteminfo_dialog = new ItemInfoDialog( 1027 p_intf, p_ playlist->pp_items[i_item], this );1038 p_intf, p_item , this ); 1028 1039 if( iteminfo_dialog->ShowModal() == wxID_OK ) 1029 1040 UpdateItem( i_item ); … … 1061 1072 { 1062 1073 case EnableGroup_Event: 1074 /*XXX*/ 1063 1075 playlist_EnableGroup( p_playlist , 1064 1076 p_playlist->pp_items[i_item]->i_group ); … … 1169 1181 { 1170 1182 Playlist *p_playlist_dialog = (Playlist *)param; 1183 fprintf(stderr,"Update item: %i\n",new_val.i_int); 1171 1184 p_playlist_dialog->UpdateItem( new_val.i_int ); 1172 1185 return 0; modules/gui/wxwindows/streamwizard.cpp
rd03df88 r499a384 3 3 ***************************************************************************** 4 4 * Copyright (C) 2000-2004 VideoLAN 5 * $Id: streamwizard.cpp,v 1. 5 2004/01/25 03:29:01 hartmanExp $5 * $Id: streamwizard.cpp,v 1.6 2004/01/29 17:51:08 zorglub Exp $ 6 6 * 7 7 * Authors: Cl�nt Stenac <zorglub@videolan.org> … … 205 205 for( int i = 0; i < (int)p_open_dialog->mrl.GetCount(); i++ ) 206 206 { 207 int i_id = playlist_Add( p_playlist,207 playlist_item_t *p_item = playlist_ItemNew( p_intf, 208 208 (const char *)p_open_dialog->mrl[i].mb_str(), 209 (const char *)p_open_dialog->mrl[i].mb_str(), 210 PLAYLIST_APPEND | (i ? 0 : PLAYLIST_GO), PLAYLIST_END ); 211 int i_pos = playlist_GetPositionById( p_playlist, i_id ); 209 (const char *)p_open_dialog->mrl[i].mb_str() ); 212 210 int i_options = 0; 213 211 … … 223 221 for( int j = 0; j < i_options; j++ ) 224 222 { 225 playlist_ AddOption( p_playlist, i_pos,223 playlist_ItemAddOption( p_item , 226 224 &nbs
