Changeset 17557ea64382428560a75ecef753e88f39158834
- Timestamp:
- 05/01/04 13:59:43 (5 years ago)
- git-parent:
- Files:
-
- Makefile.am (modified) (1 diff)
- include/vlc_common.h (modified) (2 diffs)
- include/vlc_playlist.h (modified) (8 diffs)
- src/input/input.c (modified) (4 diffs)
- src/libvlc.c (modified) (3 diffs)
- src/playlist/group.c (modified) (5 diffs)
- src/playlist/info.c (added)
- src/playlist/item-ext.c (added)
- src/playlist/item.c (modified) (7 diffs)
- src/playlist/loadsave.c (modified) (2 diffs)
- src/playlist/playlist.c (modified) (10 diffs)
- src/playlist/sort.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Makefile.am
r78ffa46 r17557ea 318 318 src/playlist/group.c \ 319 319 src/playlist/item.c \ 320 src/playlist/item-ext.c \ 321 src/playlist/info.c \ 320 322 src/input/input.c \ 321 323 src/input/es_out.c \ include/vlc_common.h
r3edb6d7 r17557ea 4 4 ***************************************************************************** 5 5 * Copyright (C) 1998, 1999, 2000 VideoLAN 6 * $Id: vlc_common.h,v 1.9 6 2003/12/06 22:45:53 jpsamanExp $6 * $Id: vlc_common.h,v 1.97 2004/01/05 12:59:43 zorglub Exp $ 7 7 * 8 8 * Authors: Samuel Hocevar <sam@via.ecp.fr> … … 191 191 typedef struct playlist_item_t playlist_item_t; 192 192 typedef struct playlist_group_t playlist_group_t; 193 typedef struct item_info_t item_info_t; 194 typedef struct item_info_category_t item_info_category_t; 193 195 194 196 /* Modules */ include/vlc_playlist.h
rddc2316 r17557ea 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN 5 * $Id: vlc_playlist.h,v 1.1 8 2003/12/03 21:58:42 sigmunauExp $5 * $Id: vlc_playlist.h,v 1.19 2004/01/05 12:59:43 zorglub Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 35 35 36 36 /** 37 * Playlist info item 38 * \see playlist_item_t 39 */ 40 41 struct item_info_t 42 { 43 char * psz_name; /**< Name of this info */ 44 char * psz_value; /**< Value of the info */ 45 }; 46 47 /** 48 * playlist item info category 49 * \see playlist_item_t 50 * \see item_info_t 51 */ 52 struct item_info_category_t 53 { 54 char * psz_name; /**< Name of this category */ 55 int i_infos; /**< Number of infos in the category */ 56 item_info_t **pp_infos; /**< Pointer to an array of infos */ 57 }; 58 59 /** 37 60 * playlist item 38 61 * \see playlist_t … … 42 65 char * psz_name; /**< text describing this item */ 43 66 char * psz_uri; /**< mrl of this item */ 44 mtime_t i_duration; /**< A hint about the duration of this item */45 char ** ppsz_options; /**< options passed with the :foo=bar syntax*/46 int i_options; /**< number of items in the47 * ppsz_options array */48 int i_type; /**< unused yet*/67 mtime_t i_duration; /**< A hint about the duration of this 68 * item, in miliseconds*/ 69 int i_categories; /**< Number of info categories */ 70 item_info_category_t **pp_categories; 71 /**< Pointer to the first info category */ 49 72 int i_status; /**< unused yet */ 73 int i_nb_played; /**< How many times was this item played ? */ 50 74 vlc_bool_t b_autodeletion; /**< Indicates whther this item is to 51 75 * be deleted after playback. True mean … … 54 78 vlc_bool_t b_enabled; /**< Indicates whether this item is to be 55 79 * played or skipped */ 56 57 int i_group; /**< unused yet */ 58 char * psz_author; /**< Author */ 59 }; 60 80 int i_group; /**< Which group does this item belongs to ? */ 81 int i_id; /**< Unique id to track this item */ 82 }; 83 84 /** 85 * playlist group 86 * \see playlist_t 87 */ 61 88 struct playlist_group_t 62 89 { … … 90 117 playlist_group_t ** pp_groups;/**< array of pointers to the playlist 91 118 * groups */ 92 int i_ max_id; /**< Maximal group id given */119 int i_last_group; /**< Maximal group id given */ 93 120 input_thread_t * p_input; /**< the input thread ascosiated 94 121 * with the current item */ 122 int i_last_id; /**< Last id to an item */ 95 123 /*@}*/ 96 124 }; … … 121 149 #define playlist_Skip(p,i) playlist_Command(p,PLAYLIST_SKIP,i) 122 150 #define playlist_Goto(p,i) playlist_Command(p,PLAYLIST_GOTO,i) 151 123 152 VLC_EXPORT( void, playlist_Command, ( playlist_t *, playlist_command_t, int ) ); 124 153 125 VLC_EXPORT( int, playlist_Add, ( playlist_t *, const char *, const char **, int, int, int ) ); 126 VLC_EXPORT( int, playlist_AddExt, ( playlist_t *, const char *, const char *, mtime_t, const char **, int, int, int ) ); 154 155 /* Item functions */ 156 VLC_EXPORT( int, playlist_Add, ( playlist_t *, const char *, const char *, int, int ) ); 157 /* For internal use. Do not use this one anymore */ 127 158 VLC_EXPORT( int, playlist_AddItem, ( playlist_t *, playlist_item_t *, int, int ) ); 128 159 VLC_EXPORT( int, playlist_Delete, ( playlist_t *, int ) ); … … 132 163 VLC_EXPORT( int, playlist_EnableGroup, ( playlist_t *, int ) ); 133 164 165 /* Basic item informations accessors */ 166 VLC_EXPORT( int, playlist_SetGroup, (playlist_t *, int, int ) ); 167 VLC_EXPORT( int, playlist_SetName, (playlist_t *, int, char * ) ); 168 VLC_EXPORT( int, playlist_SetDuration, (playlist_t *, int, int ) ); 169 170 /* Item search functions */ 171 VLC_EXPORT( int, playlist_GetPositionById, (playlist_t *, int) ); 172 VLC_EXPORT( playlist_item_t *, playlist_GetItemById, (playlist_t *, int) ); 173 174 175 /* Group management functions */ 134 176 VLC_EXPORT( playlist_group_t *, playlist_CreateGroup, (playlist_t *, char* ) ); 135 177 VLC_EXPORT( int, playlist_DeleteGroup, (playlist_t *, int ) ); … … 137 179 VLC_EXPORT( int, playlist_GroupToId, (playlist_t *, char * ) ); 138 180 181 /* Info functions */ 182 VLC_EXPORT( char * , playlist_GetInfo, ( playlist_t * , int, const char *, const char *) ); 183 VLC_EXPORT( char * , playlist_GetItemInfo, ( playlist_item_t * , const char *, const char *) ); 184 185 VLC_EXPORT( item_info_category_t*, playlist_GetCategory, ( playlist_t *, int, const char *) ); 186 VLC_EXPORT( item_info_category_t*, playlist_GetItemCategory, ( playlist_item_t *, const char *) ); 187 188 VLC_EXPORT( item_info_category_t*, playlist_CreateCategory, ( playlist_t *, int, const char *) ); 189 VLC_EXPORT( item_info_category_t*, playlist_CreateItemCategory, ( playlist_item_t *, const char *) ); 190 191 VLC_EXPORT( int, playlist_AddInfo, (playlist_t *, int, const char * , const char *, const char *, ...) ); 192 VLC_EXPORT( int, playlist_AddItemInfo, (playlist_item_t *, const char * , const char *, const char *, ...) ); 193 194 /* Option functions */ 195 VLC_EXPORT( int, playlist_AddOption, (playlist_t *, int, const char *, ...) ); 196 VLC_EXPORT( int, playlist_AddItemOption, (playlist_item_t *, const char *, ...) ); 197 198 /* Playlist sorting */ 139 199 #define playlist_SortTitle(p, i) playlist_Sort( p, SORT_TITLE, i) 140 200 #define playlist_SortAuthor(p, i) playlist_Sort( p, SORT_AUTHOR, i) 141 201 #define playlist_SortGroup(p, i) playlist_Sort( p, SORT_GROUP, i) 142 143 202 VLC_EXPORT( int, playlist_Sort, ( playlist_t *, int, int) ); 144 145 203 VLC_EXPORT( int, playlist_Move, ( playlist_t *, int, int ) ); 204 205 /* Load/Save */ 146 206 VLC_EXPORT( int, playlist_LoadFile, ( playlist_t *, const char * ) ); 147 207 VLC_EXPORT( int, playlist_SaveFile, ( playlist_t *, const char * ) ); src/input/input.c
r8cedcb3 r17557ea 5 5 ***************************************************************************** 6 6 * Copyright (C) 1998-2002 VideoLAN 7 * $Id: input.c,v 1.27 1 2003/12/03 22:14:38 sigmunauExp $7 * $Id: input.c,v 1.272 2004/01/05 12:59:43 zorglub Exp $ 8 8 * 9 9 * Authors: Christophe Massiot <massiot@via.ecp.fr> … … 87 87 input_thread_t * p_input; /* thread descriptor */ 88 88 input_info_category_t * p_info; 89 item_info_category_t *p_cat; 89 90 vlc_value_t val; 90 int i ;91 int i,j; 91 92 92 93 /* Allocate descriptor */ … … 99 100 100 101 /* Parse input options */ 101 for( i = 0; i < p_item->i_options; i++ ) 102 { 103 ParseOption( p_input, p_item->ppsz_options[i] ); 102 for( i = 0 ; i < p_item->i_categories ; i++ ) 103 { 104 if( !strncmp( p_item->pp_categories[i]->psz_name, "Options", 7 ) ) 105 { 106 msg_Dbg(p_input,"Parsing %i options for item", 107 p_item->pp_categories[i]->i_infos ); 108 for( j = 0; j< p_item->pp_categories[i]->i_infos ; j++ ) 109 { 110 msg_Dbg(p_input,"Option : %s", 111 p_item->pp_categories[i]->pp_infos[j]->psz_name); 112 ParseOption( p_input, 113 p_item->pp_categories[i]->pp_infos[j]->psz_value); 114 } 115 break; 116 } 104 117 } 105 118 … … 790 803 if( p_playlist ) 791 804 { 792 vlc_mutex_lock( &p_playlist->object_lock ); 793 p_playlist->pp_items[ p_playlist->i_index ]->i_duration = i_length; 805 playlist_SetDuration( p_playlist, -1 , i_length ); 794 806 val.b_bool = VLC_TRUE; 795 vlc_mutex_unlock( &p_playlist->object_lock ); 796 var_Set( p_playlist, "intf-change", val ); 807 var_Set( p_playlist, "item-change", val ); 797 808 vlc_object_release( p_playlist ); 798 809 } 799 } 800 810 } 811 801 812 802 813 /* get fps */ src/libvlc.c
r8a9ed93 r17557ea 3 3 ***************************************************************************** 4 4 * Copyright (C) 1998-2002 VideoLAN 5 * $Id: libvlc.c,v 1.10 6 2003/12/24 10:06:53 gbazinExp $5 * $Id: libvlc.c,v 1.107 2004/01/05 12:59:43 zorglub Exp $ 6 6 * 7 7 * Authors: Vincent Seguin <seguin@via.ecp.fr> … … 797 797 int i_mode, int i_pos ) 798 798 { 799 int i; 799 800 int i_err; 800 801 playlist_t *p_playlist; … … 822 823 } 823 824 824 i_err = playlist_Add( p_playlist, psz_target, p psz_options, i_options,825 i_err = playlist_Add( p_playlist, psz_target, psz_target, 825 826 i_mode, i_pos ); 827 828 for( i = 0 ; i< i_options ; i++ ) 829 { 830 playlist_AddOption( p_playlist, i_err , ppsz_options[i] ); 831 } 826 832 827 833 vlc_object_release( p_playlist ); src/playlist/group.c
rc882cec r17557ea 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999-2001 VideoLAN 5 * $Id: group.c,v 1. 4 2003/12/11 11:30:37zorglub Exp $5 * $Id: group.c,v 1.5 2004/01/05 12:59:43 zorglub Exp $ 6 6 * 7 7 * Authors: Cl�nt Stenac <zorglub@videolan.org> … … 62 62 63 63 p_group->psz_name = strdup( psz_name ); 64 p_group->i_id = ++p_playlist->i_ max_id;64 p_group->i_id = ++p_playlist->i_last_group; 65 65 66 66 msg_Dbg(p_playlist,"Creating group %s with id %i at position %i", … … 111 111 112 112 /** 113 * Find the name with theID113 * Find the name of the group given its ID 114 114 * 115 115 * \param p_playlist the playlist where to find the group … … 125 125 { 126 126 if( p_playlist->pp_groups[i]->psz_name) 127 return strdup( p_playlist->pp_groups[i]->psz_name );127 return strdup( p_playlist->pp_groups[i]->psz_name ); 128 128 } 129 129 } … … 132 132 133 133 /** 134 * Find the Id with the givenname134 * Find the Id of a group given its name 135 135 * 136 136 * \param p_playlist the playlist where to find the group src/playlist/item.c
rd3de646 r17557ea 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999-2001 VideoLAN 5 * $Id: item.c,v 1. 9 2003/12/13 17:16:11 gbazinExp $5 * $Id: item.c,v 1.10 2004/01/05 12:59:43 zorglub Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 33 33 34 34 /** 35 * Add an MRL to the playlist. This is a simplified version of36 * playlist_AddExt inculded for convenince. It equals calling playlist_AddExt37 * with psz_name == psz_target and i_duration == -138 */39 40 int playlist_Add( playlist_t *p_playlist, const char *psz_target,41 const char **ppsz_options, int i_options,42 int i_mode, int i_pos )43 {44 return playlist_AddExt( p_playlist, psz_target, psz_target, -1,45 ppsz_options, i_options, i_mode, i_pos );46 }47 48 /**49 * Add a MRL into the playlist.50 *51 * \param p_playlist the playlist to add into52 * \param psz_uri the mrl to add to the playlist53 * \param psz_name a text giving a name or description of this item54 * \param i_duration a hint about the duration of this item, in microseconds,55 * or -1 if unknown.56 * \param ppsz_options array of options57 * \param i_options number of items in ppsz_options58 * \param i_mode the mode used when adding59 * \param i_pos the position in the playlist where to add. If this is60 * PLAYLIST_END the item will be added at the end of the playlist61 * regardless of it's size62 * \return always returns 063 */64 int playlist_AddExt( playlist_t *p_playlist, const char * psz_uri,65 const char * psz_name, mtime_t i_duration,66 const char **ppsz_options, int i_options, int i_mode,67 int i_pos )68 {69 playlist_item_t * p_item;70 71 p_item = malloc( sizeof( playlist_item_t ) );72 if( p_item == NULL )73 {74 msg_Err( p_playlist, "out of memory" );75 }76 77 p_item->psz_name = strdup( psz_name );78 p_item->psz_uri = strdup( psz_uri );79 p_item->psz_author = strdup( "" );80 p_item->i_duration = i_duration;81 p_item->i_type = 0;82 p_item->i_status = 0;83 p_item->b_autodeletion = VLC_FALSE;84 p_item->b_enabled = VLC_TRUE;85 p_item->i_group = PLAYLIST_TYPE_MANUAL;86 87 p_item->ppsz_options = NULL;88 p_item->i_options = i_options;89 90 if( i_options > 0 )91 {92 int i;93 94 p_item->ppsz_options = malloc( i_options * sizeof(char *) );95 for( i = 0; i < i_options; i++ )96 {97 p_item->ppsz_options[i] = strdup( ppsz_options[i] );98 }99 100 }101 102 return playlist_AddItem( p_playlist, p_item, i_mode, i_pos );103 }104 105 /**106 35 * Add a playlist item into a playlist 107 36 * … … 112 41 * PLAYLIST_END the item will be added at the end of the playlist 113 42 * regardless of it's size 114 * \return always returns 043 * \return position of the new item 115 44 */ 116 45 int playlist_AddItem( playlist_t *p_playlist, playlist_item_t * p_item, … … 143 72 free( p_item->psz_uri ); 144 73 } 145 if( p_item->i_options )146 {147 int i_opt;148 for( i_opt = 0; i_opt < p_item->i_options; i_opt++ )149 {150 free( p_item->ppsz_options[i_opt] );151 }152 free( p_item->ppsz_options );153 }154 if( p_item->psz_author )155 {156 free( p_item->psz_author );157 }158 74 free( p_item ); 159 75 vlc_mutex_unlock( &p_playlist->object_lock ); 160 return 0;76 return -1; 161 77 } 162 78 } … … 169 85 msg_Dbg( p_playlist, "adding playlist item � %s � ( %s )", p_item->psz_name, p_item->psz_uri); 170 86 171 /* Create the new playlist item */172 87 88 p_item->i_id = ++p_playlist->i_last_id; 173 89 174 90 /* Do a few boundary checks and allocate space for the item */ … … 224 140 free( p_playlist->pp_items[i_pos]->psz_uri ); 225 141 } 226 if( p_playlist->pp_items[i_pos]->psz_author )227 {228 free( p_playlist->pp_items[i_pos]->psz_author );229 }230 142 /* XXX: what if the item is still in use? */ 231 143 free( p_playlist->pp_items[i_pos] ); … … 248 160 var_Set( p_playlist, "intf-change", val ); 249 161 250 return 0;162 return p_item->i_id; 251 163 } 252 253 /**254 * delete an item from a playlist.255 *256 * \param p_playlist the playlist to remove from.257 * \param i_pos the position of the item to remove258 * \return returns 0259 */260 int playlist_Delete( playlist_t * p_playlist, int i_pos )261 {262 vlc_value_t val;263 264 /* if i_pos is the current played item, playlist should stop playing it */265 if( p_playlist->i_status == PLAYLIST_RUNNING &&266 p_playlist->i_index == i_pos )267 {268 playlist_Command( p_playlist, PLAYLIST_SKIP, 1 );269 }270 271 vlc_mutex_lock( &p_playlist->object_lock );272 if( i_pos >= 0 && i_pos < p_playlist->i_size )273 {274 playlist_item_t *p_item = p_playlist->pp_items[i_pos];275 276 msg_Dbg( p_playlist, "deleting playlist item � %s �",277 p_item->psz_name );278 279 if( p_item->psz_name )280 {281 free( p_item->psz_name );282 }283 if( p_item->psz_uri )284 {285 free( p_item->psz_uri );286 }287 if( p_item->psz_author )288 {289 free( p_item->psz_author );290 }291 if( p_item->i_options > 0 )292 {293 int i;294 295 for( i = 0; i < p_item->i_options; i++ )296 {297 free( p_item->ppsz_options[i] );298 }299 300 free( p_item->ppsz_options );301 }302 303 /* XXX: what if the item is still in use? */304 free( p_item );305 306 if( i_pos <= p_playlist->i_index )307 {308 p_playlist->i_index--;309 }310 311 /* Renumber the playlist */312 REMOVE_ELEM( p_playlist->pp_items,313 p_playlist->i_size,314 i_pos );315 if( p_playlist->i_enabled > 0 )316 p_playlist->i_enabled--;317 }318 319 vlc_mutex_unlock( &p_playlist->object_lock );320 321 val.b_bool = VLC_TRUE;322 var_Set( p_playlist, "intf-change", val );323 324 return 0;325 }326 327 /**328 * Disables a playlist item329 *330 * \param p_playlist the playlist to disable from.331 * \param i_pos the position of the item to disable332 * \return returns 0333 */334 int playlist_Disable( playlist_t * p_playlist, int i_pos )335 {336 vlc_value_t val;337 vlc_mutex_lock( &p_playlist->object_lock );338 339 340 if( i_pos >= 0 && i_pos < p_playlist->i_size )341 {342 msg_Dbg( p_playlist, "disabling playlist item � %s �",343 p_playlist->pp_items[i_pos]->psz_name );344 345 if( p_playlist->pp_items[i_pos]->b_enabled == VLC_TRUE )346 p_playlist->i_enabled--;347 p_playlist->pp_items[i_pos]->b_enabled = VLC_FALSE;348 }349 350 vlc_mutex_unlock( &p_playlist->object_lock );351 352 val.b_bool = VLC_TRUE;353 var_Set( p_playlist, "intf-change", val );354 355 return 0;356 }357 358 /**359 * Enables a playlist item360 *361 * \param p_playlist the playlist to enable from.362 * \param i_pos the position of the item to enable363 * \return returns 0364 */365 int playlist_Enable( playlist_t * p_playlist, int i_pos )366 {367 vlc_value_t val;368 vlc_mutex_lock( &p_playlist->object_lock );369 370 if( i_pos >= 0 && i_pos < p_playlist->i_size )371 {372 msg_Dbg( p_playlist, "enabling playlist item � %s �",373 p_playlist->pp_items[i_pos]->psz_name );374 375 if( p_playlist->pp_items[i_pos]->b_enabled == VLC_FALSE )376 p_playlist->i_enabled++;377 378 p_playlist->pp_items[i_pos]->b_enabled = VLC_TRUE;379 }380 381 vlc_mutex_unlock( &p_playlist->object_lock );382 383 val.b_bool = VLC_TRUE;384 var_Set( p_playlist, "intf-change", val );385 386 return 0;387 }388 389 /**390 * Disables a playlist group391 *392 * \param p_playlist the playlist to disable from.393 * \param i_pos the id of the group to disable394 * \return returns 0395 */396 int playlist_DisableGroup( playlist_t * p_playlist, int i_group)397 {398 vlc_value_t val;399 int i;400 vlc_mutex_lock( &p_playlist->object_lock );401 402 msg_Dbg(p_playlist,"Disabling group %i",i_group);403 for( i = 0 ; i< p_playlist->i_size; i++ )404 {405 if( p_playlist->pp_items[i]->i_group == i_group )406 {407 msg_Dbg( p_playlist, "disabling playlist item � %s �",408 p_playlist->pp_items[i]->psz_name );409 410 if( p_playlist->pp_items[i]->b_enabled == VLC_TRUE )411 p_playlist->i_enabled--;412 413 p_playlist->pp_items[i]->b_enabled = VLC_FALSE;414 }415 }416 vlc_mutex_unlock( &p_playlist->object_lock );417 418 val.b_bool = VLC_TRUE;419 var_Set( p_playlist, "intf-change", val );420 421 return 0;422 }423 424 /**425 * Enables a playlist group426 *427 * \param p_playlist the playlist to enable from.428 * \param i_pos the id of the group to enable429 * \return returns 0430 */431 int playlist_EnableGroup( playlist_t * p_playlist, int i_group)432 {433 vlc_value_t val;434 int i;435 vlc_mutex_lock( &p_playlist->object_lock );436 437 for( i = 0 ; i< p_playlist->i_size; i++ )438 {439 if( p_playlist->pp_items[i]->i_group == i_group )440 {441 msg_Dbg( p_playlist, "enabling playlist item � %s �",442 p_playlist->pp_items[i]->psz_name );443 444 if( p_playlist->pp_items[i]->b_enabled == VLC_FALSE )445 p_playlist->i_enabled++;446 447 p_playlist->pp_items[i]->b_enabled = VLC_TRUE;448 }449 }450 vlc_mutex_unlock( &p_playlist->object_lock );451 452 val.b_bool = VLC_TRUE;453 var_Set( p_playlist, "intf-change", val );454 455 return 0;456 }457 458 /**459 * Move an item in a playlist460 *461 * Move the item in the playlist with position i_pos before the current item462 * at position i_newpos.463 * \param p_playlist the playlist to move items in464 * \param i_pos the position of the item to move465 * \param i_newpos the position of the item that will be behind the moved item466 * after the move467 * \return returns 0468 */469 int playlist_Move( playlist_t * p_playlist, int i_pos, int i_newpos)470 {471 vlc_value_t val;472 vlc_mutex_lock( &p_playlist->object_lock );473 474 /* take into account that our own row disappears. */475 if ( i_pos < i_newpos ) i_newpos--;476 477 if( i_pos >= 0 && i_newpos >=0 && i_pos <= p_playlist->i_size478 && i_newpos <= p_playlist->i_size )479 {480 playlist_item_t * temp;481 482 msg_Dbg( p_playlist, "moving playlist item � %s � (%i -> %i)",483 p_playlist->pp_items[i_pos]->psz_name, i_pos,484 i_newpos );485 486 if( i_pos == p_playlist->i_index )487 {488 p_playlist->i_index = i_newpos;489 }490 else if( i_pos > p_playlist->i_index && i_newpos <= p_playlist->i_index )491 {492 p_playlist->i_index++;493 }494 else if( i_pos < p_playlist->i_index && i_newpos >= p_playlist->i_index )495 {496 p_playlist->i_index--;497 }498 499 if ( i_pos < i_newpos )500 {501 temp = p_playlist->pp_items[i_pos];502 while ( i_pos < i_newpos )503 {504 p_playlist->pp_items[i_pos] = p_playlist->pp_items[i_pos+1];505 i_pos++;506 }507 p_playlist->pp_items[i_newpos] = temp;508 }509 else if ( i_pos > i_newpos )510 {511 temp = p_playlist->pp_items[i_pos];512 while ( i_pos > i_newpos )513 {514 p_playlist->pp_items[i_pos] = p_playlist->pp_items[i_pos-1];515 i_pos--;516 }517 p_playlist->pp_items[i_newpos] = temp;518 }519 }520 521 vlc_mutex_unlock( &p_playlist->object_lock );522 523 val.b_bool = VLC_TRUE;524 var_Set( p_playlist, "intf-change", val );525 526 return 0;527 }src/playlist/loadsave.c
rfd616f9 r17557ea 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999-2001 VideoLAN 5 * $Id: loadsave.c,v 1. 1 2003/10/29 18:00:46zorglub Exp $5 * $Id: loadsave.c,v 1.2 2004/01/05 12:59:43 zorglub Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 119 119 if( i_format == 5 ) 120 120 { 121 playlist_Add ( p_playlist , (char *)&line , 122 0, 0,PLAYLIST_APPEND , PLAYLIST_END );121 playlist_Add ( p_playlist , (char *)&line , (char *)&line, 122 PLAYLIST_APPEND , PLAYLIST_END ); 123 123 } 124 124 else src/playlist/playlist.c
rd3de646 r17557ea 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999-2001 VideoLAN 5 * $Id: playlist.c,v 1.7 0 2003/12/13 17:16:11 gbazinExp $5 * $Id: playlist.c,v 1.71 2004/01/05 12:59:43 zorglub Exp $ 6 6 * 7 7 * Authors: Samuel Hocevar <sam@zoy.org> … … 45 45 static void PlayItem ( playlist_t * ); 46 46 47 #if 048 static void Poubellize ( playlist_t *, input_thread_t * );49 #endif50 51 47 /** 52 48 * Create playlist … … 73 69 var_Set( p_playlist, "intf-change", val ); 74 70 71 var_Create( p_playlist, "item-change", VLC_VAR_INTEGER ); 72 val.i_int = -1; 73 var_Set( p_playlist, "item-change", val ); 74 75 var_Create( p_playlist, "playlist-current", VLC_VAR_INTEGER ); 76 val.i_int = -1; 77 var_Set( p_playlist, "playlist-current", val ); 78 75 79 var_Create( p_playlist, "intf-popupmenu", VLC_VAR_BOOL ); 76 80 … … 91 95 p_playlist->i_groups = 0; 92 96 p_playlist->pp_groups = NULL; 93 p_playlist->i_max_id = 0; 97 p_playlist->i_last_group = 0; 98 p_playlist->i_last_id = 0; 94 99 95 100 playlist_CreateGroup( p_playlist, "Normal" ); … … 122 127 123 128 var_Destroy( p_playlist, "intf-change" ); 129 var_Destroy( p_playlist, "item-change" ); 124 130 125 131 while( p_playlist->i_groups > 0 ) … … 158 164 { 159 165 input_StopThread( p_playlist->p_input ); 166 val.i_int = p_playlist->i_index; 167 var_Set( p_playlist, "item-change",val ); 160 168 } 161 169 break; … … 232 240 233 241 vlc_mutex_unlock( &p_playlist->object_lock ); 234 242 #if 0 235 243 val.b_bool = VLC_TRUE; 236 244 var_Set( p_playlist, "intf-change", val ); 237 245 #endif 238 246 return; 239 247 } 240 /* Following functions are local */ 248 241 249 242 250 static void ObjectGarbageCollector( playlist_t *p_playlist, … … 354 362 } 355 363 364 val.i_int = p_playlist->i_index; 365 var_Set( p_playlist, "playlist-current", val); 366 #if 0 356 367 val.b_bool = VLC_TRUE; 357 368 var_Set( p_playlist, "intf-change", val ); 369 #endif 358 370 continue; 359 371 } … … 539 551 static void PlayItem( playlist_t *p_playlist ) 540 552 { 553 vlc_value_t val; 541 554 if( p_playlist->i_index == -1 ) 542 555 { … … 557 570 p_playlist->p_input = input_CreateThread( p_playlist, 558 571 p_playlist->pp_items[p_playlist->i_index] ); 559 } 572 573 val.i_int = p_playlist->i_index; 574 var_Set( p_playlist, "item-change", val ); 575 } src/playlist/sort.c
r4fac715 r17557ea 3 3 ***************************************************************************** 4 4 * Copyright (C) 1999-2001 VideoLAN 5 * $Id: sort.c,v 1. 3 2003/12/13 17:46:07 asmaxExp $5 * $Id: sort.c,v 1.4 2004/01/05 12:59:43 zorglub Exp $ 6 6 * 7 7 * Authors: Cl�nt Stenac <zorglub@videolan.org> … … 65 65 vlc_mutex_unlock( &p_playlist->object_lock ); 66 66 67 /* Notify the interfaces (XXX: use a different variable)*/67 /* Notify the interfaces */ 68 68 var_Set( p_playlist, "intf-change", val ); 69 69 … … 90 90 else if( i_mode == SORT_AUTHOR ) 91 91 { 92 i_test = strcasecmp( p_playlist->pp_items[i]->psz_author, 93 p_playlist->pp_items[i_small]->psz_author ); 92 i_test = strcasecmp( 93 playlist_GetInfo( p_playlist, i, 94 _("General") , _("Author") ), 95 playlist_GetInfo( p_playlist, i_small, 96 _("General") , _("Author") ) ); 94 97 } 95 98 … … 112 115 vlc_mutex_unlock( &p_playlist->object_lock ); 113 116 114 /* Notify the interfaces (XXX: use a different variable)*/117 /* Notify the interfaces */ 115 118 var_Set( p_playlist, "intf-change", val ); 116 119
