Changeset 37dbdbd8e1a9df9be0217aa396c3bbbc07298413
- Timestamp:
- 23/01/04 11:48:08
(5 years ago)
- Author:
- Clément Stenac <zorglub@videolan.org>
- git-committer:
- Clément Stenac <zorglub@videolan.org> 1074854888 +0000
- git-parent:
[6729ec178e0d9b3ea08779729575db987e291f24]
- git-author:
- Clément Stenac <zorglub@videolan.org> 1074854888 +0000
- Message:
* Doxygen doc fixes
* Add missing locks
* Duration sort
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r5dc722b |
r37dbdbd |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 1999-2004 VideoLAN |
|---|
| 5 | | * $Id: vlc_playlist.h,v 1.24 2004/01/11 00:45:06 zorglub Exp $ |
|---|
| | 5 | * $Id: vlc_playlist.h,v 1.25 2004/01/23 10:48:08 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Samuel Hocevar <sam@zoy.org> |
|---|
| … | … | |
| 140 | 140 | #define SORT_GROUP 3 |
|---|
| 141 | 141 | #define SORT_RANDOM 4 |
|---|
| | 142 | #define SORT_DURATION 5 |
|---|
| 142 | 143 | |
|---|
| 143 | 144 | #define ORDER_NORMAL 0 |
|---|
| r5dc722b |
r37dbdbd |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 1999-2004 VideoLAN |
|---|
| 5 | | * $Id: group.c,v 1.7 2004/01/11 00:45:06 zorglub Exp $ |
|---|
| | 5 | * $Id: group.c,v 1.8 2004/01/23 10:48:08 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cl�nt Stenac <zorglub@videolan.org> |
|---|
| … | … | |
| 49 | 49 | if( !strcasecmp( p_playlist->pp_groups[i]->psz_name , psz_name ) ) |
|---|
| 50 | 50 | { |
|---|
| 51 | | msg_Info( p_playlist, "This group already exists !"); |
|---|
| | 51 | msg_Info( p_playlist, "this group already exists"); |
|---|
| 52 | 52 | return p_playlist->pp_groups[i]; |
|---|
| 53 | 53 | } |
|---|
| … | … | |
| 82 | 82 | * \param p_playlist the playlist to remove the group from |
|---|
| 83 | 83 | * \param i_id the identifier of the group to remove |
|---|
| 84 | | * \return 0 on success |
|---|
| | 84 | * \return VLC_SUCCESS |
|---|
| 85 | 85 | */ |
|---|
| 86 | 86 | int playlist_DeleteGroup( playlist_t *p_playlist, int i_id ) |
|---|
| … | … | |
| 132 | 132 | |
|---|
| 133 | 133 | /** |
|---|
| 134 | | * Find the Id of a group given its name |
|---|
| | 134 | * Find the id of a group given its name |
|---|
| 135 | 135 | * |
|---|
| 136 | 136 | * \param p_playlist the playlist where to find the group |
|---|
| 137 | | * \param char * the name to search for |
|---|
| | 137 | * \param psz_name the name to search for |
|---|
| 138 | 138 | * \return the id of the group |
|---|
| 139 | 139 | */ |
|---|
| … | … | |
| 141 | 141 | { |
|---|
| 142 | 142 | int i; |
|---|
| 143 | | for( i=0 ; i< p_playlist->i_groups; i++ ) |
|---|
| | 143 | for( i = 0 ; i< p_playlist->i_groups; i++ ) |
|---|
| 144 | 144 | { |
|---|
| 145 | 145 | if( p_playlist->pp_groups[i]->psz_name) |
|---|
| … | … | |
| 151 | 151 | } |
|---|
| 152 | 152 | } |
|---|
| 153 | | return 0; |
|---|
| | 153 | return VLC_SUCCESS; |
|---|
| 154 | 154 | } |
|---|
| r0678f19 |
r37dbdbd |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 1999-2004 VideoLAN |
|---|
| 5 | | * $Id: info.c,v 1.5 2004/01/17 16:24:14 gbazin Exp $ |
|---|
| | 5 | * $Id: info.c,v 1.6 2004/01/23 10:48:08 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cl�nt Stenac <zorglub@videolan.org> |
|---|
| … | … | |
| 35 | 35 | * |
|---|
| 36 | 36 | * \param p_playlist the playlist to get the info from |
|---|
| 37 | | * \param i_item the item on which we want the info ( -1 for current ) |
|---|
| | 37 | * \param i_item position of the item on |
|---|
| | 38 | * which we want the info ( -1 for current ) |
|---|
| 38 | 39 | * \param psz_cat the category in which the info is stored |
|---|
| 39 | 40 | * \param psz_name the name of the info |
|---|
| 40 | | * \return the info value if any, NULL else |
|---|
| | 41 | * \return the info value if any, an empty string else |
|---|
| 41 | 42 | */ |
|---|
| 42 | 43 | char * playlist_GetInfo( playlist_t *p_playlist, int i_item, |
|---|
| 43 | | const char * psz_cat, const char *psz_name ) |
|---|
| | 44 | const char * psz_cat, const char *psz_name ) |
|---|
| 44 | 45 | { |
|---|
| 45 | 46 | /* Check the existence of the playlist */ |
|---|
| … | … | |
| 70 | 71 | * \param psz_cat the category in which the info is stored |
|---|
| 71 | 72 | * \param psz_name the name of the info |
|---|
| 72 | | * \return the info value if any, NULL else |
|---|
| | 73 | * \return the info value if any, an empty string else |
|---|
| 73 | 74 | */ |
|---|
| 74 | 75 | char * playlist_GetItemInfo( playlist_item_t *p_item, |
|---|
| … | … | |
| 95 | 96 | |
|---|
| 96 | 97 | /** |
|---|
| 97 | | * Get one info category. Creates it if it does not exist |
|---|
| 98 | | * |
|---|
| 99 | | * \param p_playlist the playlist to get the info from |
|---|
| 100 | | * \param i_item the item on which we want the info ( -1 for current ) |
|---|
| | 98 | * Get one info category. Create it if it does not exist |
|---|
| | 99 | * |
|---|
| | 100 | * \param p_playlist the playlist to get the category from |
|---|
| | 101 | * \param i_item the position of the item on which we want |
|---|
| | 102 | * the info ( -1 for current ) |
|---|
| 101 | 103 | * \param psz_cat the category we want |
|---|
| 102 | 104 | * \return the info category. |
|---|
| … | … | |
| 129 | 131 | |
|---|
| 130 | 132 | /** |
|---|
| 131 | | * Get one info category (no p_playlist). Creates it if it does not exist |
|---|
| 132 | | * |
|---|
| 133 | | * \param p_item the playlist to search categories in |
|---|
| | 133 | * Get one info category (no p_playlist). Create it if it does not exist |
|---|
| | 134 | * |
|---|
| | 135 | * \param p_item the playlist item to get the category from |
|---|
| 134 | 136 | * \param psz_cat the category we want |
|---|
| 135 | 137 | * \return the info category. |
|---|
| … | … | |
| 157 | 159 | * Create one info category. |
|---|
| 158 | 160 | * |
|---|
| 159 | | * \param p_playlist the playlist to get the info from |
|---|
| 160 | | * \param i_item the item on which we want the info ( -1 for current ) |
|---|
| | 161 | * \param p_playlist the playlist |
|---|
| | 162 | * \param i_item the position of the item for which we create |
|---|
| | 163 | * the category ( -1 for current ) |
|---|
| 161 | 164 | * \param psz_cat the category we want to create |
|---|
| 162 | 165 | * \return the info category. |
|---|
| … | … | |
| 164 | 167 | item_info_category_t * |
|---|
| 165 | 168 | playlist_CreateCategory( playlist_t *p_playlist, int i_item, |
|---|
| 166 | | const char * psz_cat ) |
|---|
| | 169 | const char * psz_cat ) |
|---|
| 167 | 170 | { |
|---|
| 168 | 171 | playlist_item_t *p_item = NULL; |
|---|
| … | … | |
| 194 | 197 | * Create one info category for an item ( no p_playlist required ) |
|---|
| 195 | 198 | * |
|---|
| 196 | | * \param p_playlist the playlist to get the info from |
|---|
| 197 | | * \param i_item the item on which we want the info ( -1 for current ) |
|---|
| | 199 | * \param p_playlist the playlist |
|---|
| | 200 | * \param p_item the item to create category for |
|---|
| 198 | 201 | * \param psz_cat the category we want to create |
|---|
| 199 | 202 | * \return the info category. |
|---|
| … | … | |
| 231 | 234 | * Add an info item |
|---|
| 232 | 235 | * |
|---|
| 233 | | * \param p_playlist the playlist to get the info from |
|---|
| 234 | | * \param i_item the item on which we want the info ( -1 for current ) |
|---|
| | 236 | * \param p_playlist the playlist |
|---|
| | 237 | * \param i_item the position of the item on which we want |
|---|
| | 238 | * the info ( -1 for current ) |
|---|
| 235 | 239 | * \param psz_cat the category we want to put the info into |
|---|
| 236 | | * (gets created if needed) |
|---|
| 237 | | * \return the info category. |
|---|
| | 240 | * (gets created if needed) |
|---|
| | 241 | * \param psz_name the name of the info |
|---|
| | 242 | * \param psz_format printf-style info |
|---|
| | 243 | * \return VLC_SUCCESS |
|---|
| 238 | 244 | */ |
|---|
| 239 | 245 | int playlist_AddInfo( playlist_t *p_playlist, int i_item, |
|---|
| … | … | |
| 249 | 255 | if( p_playlist == NULL) |
|---|
| 250 | 256 | { |
|---|
| 251 | | return -1; |
|---|
| | 257 | return VLC_EGENERIC; |
|---|
| 252 | 258 | } |
|---|
| 253 | 259 | |
|---|
| … | … | |
| 263 | 269 | else |
|---|
| 264 | 270 | { |
|---|
| 265 | | return -1; |
|---|
| | 271 | return VLC_EGENERIC; |
|---|
| 266 | 272 | } |
|---|
| 267 | 273 | |
|---|
| … | … | |
| 280 | 286 | * Add info to one item ( no need for p_playlist ) |
|---|
| 281 | 287 | * |
|---|
| 282 | | * \param p_item the item on which we want the info |
|---|
| 283 | | * \param psz_cat the category in which the info is stored (must exist !) |
|---|
| | 288 | * \param p_item the item for which we add the info |
|---|
| | 289 | * \param psz_cat the category in which the info is stored |
|---|
| 284 | 290 | * \param psz_name the name of the info |
|---|
| 285 | | * \return the info value if any, NULL else |
|---|
| | 291 | * \param psz_format printf-style info |
|---|
| | 292 | * \return VLC_SUCCESS on success |
|---|
| 286 | 293 | */ |
|---|
| 287 | 294 | int playlist_AddItemInfo( playlist_item_t *p_item, |
|---|
| … | … | |
| 299 | 306 | if( p_cat == NULL) |
|---|
| 300 | 307 | { |
|---|
| 301 | | return -1; |
|---|
| | 308 | return VLC_EGENERIC; |
|---|
| 302 | 309 | } |
|---|
| 303 | 310 | |
|---|
| … | … | |
| 318 | 325 | if( ( p_info = malloc( sizeof( item_info_t) ) ) == NULL ) |
|---|
| 319 | 326 | { |
|---|
| 320 | | return -1; |
|---|
| | 327 | return VLC_EGENERIC; |
|---|
| 321 | 328 | } |
|---|
| 322 | 329 | p_info->psz_name = strdup( psz_name); |
|---|
| … | … | |
| 340 | 347 | } |
|---|
| 341 | 348 | |
|---|
| 342 | | return 0; |
|---|
| | 349 | return VLC_SUCCESS; |
|---|
| 343 | 350 | } |
|---|
| 344 | 351 | |
|---|
| … | … | |
| 346 | 353 | * Add a special info : option |
|---|
| 347 | 354 | * |
|---|
| 348 | | * \param p_playlist the playlist to get the info from |
|---|
| 349 | | * \param i_item the item on which we want the info ( -1 for current ) |
|---|
| | 355 | * \param p_playlist the playlist |
|---|
| | 356 | * \param i_item the position of the item on which we |
|---|
| | 357 | * add the option ( -1 for current ) |
|---|
| 350 | 358 | * \param psz_value the option to add |
|---|
| 351 | 359 | * \return the info category. |
|---|
| … | … | |
| 361 | 369 | if( p_playlist == NULL) |
|---|
| 362 | 370 | { |
|---|
| 363 | | return -1; |
|---|
| | 371 | return VLC_EGENERIC; |
|---|
| 364 | 372 | } |
|---|
| 365 | 373 | |
|---|
| … | … | |
| 374 | 382 | else |
|---|
| 375 | 383 | { |
|---|
| 376 | | return -1; |
|---|
| | 384 | return VLC_EGENERIC; |
|---|
| 377 | 385 | } |
|---|
| 378 | 386 | |
|---|
| … | … | |
| 381 | 389 | if( p_cat == NULL) |
|---|
| 382 | 390 | { |
|---|
| 383 | | return -1; |
|---|
| | 391 | return VLC_EGENERIC; |
|---|
| 384 | 392 | } |
|---|
| 385 | 393 | |
|---|
| … | … | |
| 387 | 395 | { |
|---|
| 388 | 396 | msg_Err( p_playlist, "out of memory" ); |
|---|
| 389 | | return -1; |
|---|
| | 397 | return VLC_EGENERIC; |
|---|
| 390 | 398 | } |
|---|
| 391 | 399 | |
|---|
| … | … | |
| 398 | 406 | INSERT_ELEM( p_cat->pp_infos, p_cat->i_infos, p_cat->i_infos, p_info ); |
|---|
| 399 | 407 | |
|---|
| 400 | | return 0; |
|---|
| | 408 | return VLC_SUCCESS; |
|---|
| 401 | 409 | } |
|---|
| 402 | 410 | |
|---|
| … | … | |
| 418 | 426 | if( p_cat == NULL) |
|---|
| 419 | 427 | { |
|---|
| 420 | | return -1; |
|---|
| | 428 | return VLC_EGENERIC; |
|---|
| 421 | 429 | } |
|---|
| 422 | 430 | |
|---|
| 423 | 431 | if( ( p_info = malloc( sizeof( item_info_t) ) ) == NULL ) |
|---|
| 424 | 432 | { |
|---|
| 425 | | return -1; |
|---|
| | 433 | return VLC_EGENERIC; |
|---|
| 426 | 434 | } |
|---|
| 427 | 435 | |
|---|
| … | … | |
| 434 | 442 | INSERT_ELEM( p_cat->pp_infos, p_cat->i_infos, p_cat->i_infos, p_info ); |
|---|
| 435 | 443 | |
|---|
| 436 | | return 0; |
|---|
| 437 | | } |
|---|
| | 444 | return VLC_SUCCESS; |
|---|
| | 445 | } |
|---|
| ra536602 |
r37dbdbd |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 1999-2004 VideoLAN |
|---|
| 5 | | * $Id: item-ext.c,v 1.10 2004/01/17 14:08:37 sigmunau Exp $ |
|---|
| | 5 | * $Id: item-ext.c,v 1.11 2004/01/23 10:48:08 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Samuel Hocevar <sam@zoy.org> |
|---|
| … | … | |
| 33 | 33 | |
|---|
| 34 | 34 | /** |
|---|
| 35 | | * Add a MRL into the playlist. |
|---|
| | 35 | * Add a MRL into the playlist, duration given. |
|---|
| 36 | 36 | * |
|---|
| 37 | 37 | * \param p_playlist the playlist to add into |
|---|
| … | … | |
| 103 | 103 | * \param p_playlist the playlist |
|---|
| 104 | 104 | * \param i_id the id to find |
|---|
| 105 | | * \return the position, or -1 on failure |
|---|
| | 105 | * \return the position, or VLC_EGENERIC on failure |
|---|
| 106 | 106 | */ |
|---|
| 107 | 107 | int playlist_GetPositionById( playlist_t * p_playlist , int i_id ) |
|---|
| … | … | |
| 115 | 115 | } |
|---|
| 116 | 116 | } |
|---|
| 117 | | return -1; |
|---|
| | 117 | return VLC_EGENERIC; |
|---|
| 118 | 118 | } |
|---|
| 119 | 119 | |
|---|
| … | … | |
| 150 | 150 | * \param i_pos the postition of the item of which we change the group |
|---|
| 151 | 151 | * \param i_group the new group |
|---|
| 152 | | * \return 0 on success, -1 on failure |
|---|
| | 152 | * \return VLC_SUCCESS on success, VLC_EGENERIC on failure |
|---|
| 153 | 153 | */ |
|---|
| 154 | 154 | int playlist_SetGroup( playlist_t *p_playlist, int i_pos, int i_group ) |
|---|
| 155 | 155 | { |
|---|
| 156 | 156 | char *psz_group; |
|---|
| | 157 | vlc_value_t val; |
|---|
| 157 | 158 | /* Check the existence of the playlist */ |
|---|
| 158 | 159 | if( p_playlist == NULL) |
|---|
| 159 | 160 | { |
|---|
| 160 | | return -1; |
|---|
| 161 | | } |
|---|
| | 161 | return VLC_EGENERIC; |
|---|
| | 162 | } |
|---|
| | 163 | |
|---|
| | 164 | vlc_mutex_lock( &p_playlist->object_lock ); |
|---|
| | 165 | |
|---|
| 162 | 166 | /* Get a correct item */ |
|---|
| 163 | 167 | if( i_pos >= 0 && i_pos < p_playlist->i_size ) |
|---|
| … | … | |
| 170 | 174 | else |
|---|
| 171 | 175 | { |
|---|
| 172 | | return -1; |
|---|
| | 176 | return VLC_EGENERIC; |
|---|
| 173 | 177 | } |
|---|
| 174 | 178 | |
|---|
| … | … | |
| 178 | 182 | p_playlist->pp_items[i_pos]->i_group = i_group ; |
|---|
| 179 | 183 | } |
|---|
| 180 | | return 0; |
|---|
| | 184 | vlc_mutex_unlock( &p_playlist->object_lock ); |
|---|
| | 185 | val.b_bool = i_pos; |
|---|
| | 186 | var_Set( p_playlist, "item-change", val ); |
|---|
| | 187 | |
|---|
| | 188 | return VLC_SUCCESS; |
|---|
| 181 | 189 | } |
|---|
| 182 | 190 | |
|---|
| … | … | |
| 196 | 204 | if( p_playlist == NULL) |
|---|
| 197 | 205 | { |
|---|
| 198 | | return -1; |
|---|
| 199 | | } |
|---|
| | 206 | return VLC_EGENERIC; |
|---|
| | 207 | } |
|---|
| | 208 | |
|---|
| | 209 | vlc_mutex_lock( &p_playlist->object_lock ); |
|---|
| | 210 | |
|---|
| 200 | 211 | /* Get a correct item */ |
|---|
| 201 | 212 | if( i_pos >= 0 && i_pos < p_playlist->i_size ) |
|---|
| … | … | |
| 208 | 219 | else |
|---|
| 209 | 220 | { |
|---|
| 210 | | return -1; |
|---|
| | 221 | return VLC_EGENERIC; |
|---|
| 211 | 222 | } |
|---|
| 212 | 223 | |
|---|
| … | … | |
| 216 | 227 | if( psz_name ) |
|---|
| 217 | 228 | p_playlist->pp_items[i_pos]->psz_name = strdup( psz_name ); |
|---|
| | 229 | |
|---|
| | 230 | vlc_mutex_unlock( &p_playlist->object_lock ); |
|---|
| 218 | 231 | |
|---|
| 219 | 232 | val.b_bool = i_pos; |
|---|
| … | … | |
| 238 | 251 | if( p_playlist == NULL) |
|---|
| 239 | 252 | { |
|---|
| 240 | | return -1; |
|---|
| 241 | | } |
|---|
| | 253 | return VLC_EGENERIC; |
|---|
| | 254 | } |
|---|
| | 255 | |
|---|
| | 256 | vlc_mutex_lock( &p_playlist->object_lock ); |
|---|
| | 257 | |
|---|
| 242 | 258 | /* Get a correct item */ |
|---|
| 243 | 259 | if( i_pos >= 0 && i_pos < p_playlist->i_size ) |
|---|
| … | … | |
| 264 | 280 | playlist_AddInfo( p_playlist, i_pos, _("General") , _("Duration"), |
|---|
| 265 | 281 | "%s", psz_buffer ); |
|---|
| | 282 | |
|---|
| | 283 | vlc_mutex_unlock( &p_playlist->object_lock ); |
|---|
| 266 | 284 | |
|---|
| 267 | 285 | val.b_bool = i_pos; |
|---|
| … | … | |
| 534 | 552 | * \param i_newpos the position of the item that will be behind the moved item |
|---|
| 535 | 553 | * after the move |
|---|
| 536 | | * \return returns 0 |
|---|
| | 554 | * \return returns VLC_SUCCESS |
|---|
| 537 | 555 | */ |
|---|
| 538 | 556 | int playlist_Move( playlist_t * p_playlist, int i_pos, int i_newpos) |
|---|
| … | … | |
| 593 | 611 | var_Set( p_playlist, "intf-change", val ); |
|---|
| 594 | 612 | |
|---|
| 595 | | return 0; |
|---|
| 596 | | } |
|---|
| | 613 | return VLC_SUCCESS; |
|---|
| | 614 | } |
|---|
| rcc43bca |
r37dbdbd |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 1999-2004 VideoLAN |
|---|
| 5 | | * $Id: loadsave.c,v 1.6 2004/01/22 19:35:14 gbazin Exp $ |
|---|
| | 5 | * $Id: loadsave.c,v 1.7 2004/01/23 10:48:08 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Samuel Hocevar <sam@zoy.org> |
|---|
| … | … | |
| 42 | 42 | |
|---|
| 43 | 43 | /** |
|---|
| 44 | | * Import a playlist file |
|---|
| | 44 | * Import a certain playlist file into the playlist |
|---|
| 45 | 45 | * |
|---|
| 46 | | * Import a certain playlist file into the playlist |
|---|
| 47 | 46 | * \param p_playlist the playlist to which the new items will be added |
|---|
| 48 | 47 | * \param psz_filename the name of the playlistfile to import |
|---|
| 49 | | * \return 0 on succes |
|---|
| | 48 | * \return VLC_SUCCESS on success |
|---|
| 50 | 49 | */ |
|---|
| 51 | 50 | int playlist_Import( playlist_t * p_playlist, const char *psz_filename ) |
|---|
| … | … | |
| 56 | 55 | |
|---|
| 57 | 56 | msg_Dbg( p_playlist, "clearing playlist"); |
|---|
| 58 | | |
|---|
| 59 | | /* Create our "fake" playlist item */ |
|---|
| 60 | 57 | playlist_Clear( p_playlist ); |
|---|
| 61 | 58 | |
|---|
| … | … | |
| 64 | 61 | sprintf( psz_uri, "file/playlist://%s", psz_filename); |
|---|
| 65 | 62 | |
|---|
| | 63 | vlc_mutex_lock( &p_playlist->object_lock ); |
|---|
| 66 | 64 | i_id = playlist_Add( p_playlist, psz_uri, psz_uri, |
|---|
| 67 | 65 | PLAYLIST_INSERT | PLAYLIST_GO , PLAYLIST_END); |
|---|
| … | … | |
| 70 | 68 | p_item->b_autodeletion = VLC_TRUE; |
|---|
| 71 | 69 | |
|---|
| 72 | | //p_playlist->i_index = 0; |
|---|
| 73 | | |
|---|
| 74 | | /* |
|---|
| 75 | | * if( p_item ) |
|---|
| 76 | | { |
|---|
| 77 | | p_playlist->p_input = input_CreateThread( p_playlist, p_item ); |
|---|
| 78 | | } |
|---|
| 79 | | */ |
|---|
| | 70 | vlc_mutex_unlock( &p_playlist->object_lock ); |
|---|
| 80 | 71 | |
|---|
| 81 | 72 | return VLC_SUCCESS; |
|---|
| … | … | |
| 83 | 74 | |
|---|
| 84 | 75 | /** |
|---|
| 85 | | * Export a playlist to a file |
|---|
| | 76 | * Export a playlist to a certain type of playlistfile |
|---|
| 86 | 77 | * |
|---|
| 87 | | * Export a playlist to a certain type of playlistfile |
|---|
| 88 | 78 | * \param p_playlist the playlist to export |
|---|
| 89 | 79 | * \param psz_filename the location where the exported file will be saved |
|---|
| 90 | 80 | * \param psz_type the type of playlist file to create. |
|---|
| 91 | | * \return 0 on succes |
|---|
| | 81 | * \return VLC_SUCCESS on success |
|---|
| 92 | 82 | */ |
|---|
| 93 | 83 | int playlist_Export( playlist_t * p_playlist, const char *psz_filename , |
|---|
| … | … | |
| 97 | 87 | playlist_export_t *p_export; |
|---|
| 98 | 88 | |
|---|
| 99 | | msg_Info( p_playlist, "Saving playlist to file %s", psz_filename ); |
|---|
| | 89 | msg_Info( p_playlist, "saving playlist to file %s", psz_filename ); |
|---|
| 100 | 90 | |
|---|
| 101 | 91 | /* Prepare the playlist_export_t structure */ |
|---|
| … | … | |
| 103 | 93 | if( !p_export) |
|---|
| 104 | 94 | { |
|---|
| 105 | | msg_Err( p_playlist, "Out of memory"); |
|---|
| | 95 | msg_Err( p_playlist, "out of memory"); |
|---|
| 106 | 96 | return VLC_ENOMEM; |
|---|
| 107 | 97 | } |
|---|
| ra826dc3 |
r37dbdbd |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 1999-2004 VideoLAN |
|---|
| 5 | | * $Id: playlist.c,v 1.74 2004/01/11 00:11:56 zorglub Exp $ |
|---|
| | 5 | * $Id: playlist.c,v 1.75 2004/01/23 10:48:08 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Samuel Hocevar <sam@zoy.org> |
|---|
| … | … | |
| 36 | 36 | |
|---|
| 37 | 37 | #define PLAYLIST_FILE_HEADER_0_5 "# vlc playlist file version 0.5" |
|---|
| 38 | | #define PLAYLIST_FILE_HEADER_0_6 "# vlc playlist file version 0.6" |
|---|
| 39 | 38 | |
|---|
| 40 | 39 | /***************************************************************************** |
|---|
| r0d975a4 |
r37dbdbd |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 1999-2004 VideoLAN |
|---|
| 5 | | * $Id: sort.c,v 1.8 2004/01/10 23:44:19 hartman Exp $ |
|---|
| | 5 | * $Id: sort.c,v 1.9 2004/01/23 10:48:08 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cl�nt Stenac <zorglub@videolan.org> |
|---|
| … | … | |
| 36 | 36 | * \param i_mode: SORT_ID, SORT_TITLE, SORT_GROUP, SORT_AUTHOR, SORT_RANDOM |
|---|
| 37 | 37 | * \param i_type: ORDER_NORMAL or ORDER_REVERSE (reversed order) |
|---|
| 38 | | * \return 0 on success |
|---|
| | 38 | * \return VLC_SUCCESS on success |
|---|
| 39 | 39 | */ |
|---|
| 40 | 40 | int playlist_Sort( playlist_t * p_playlist , int i_mode, int i_type ) |
|---|
| … | … | |
| 71 | 71 | var_Set( p_playlist, "intf-change", val ); |
|---|
| 72 | 72 | |
|---|
| 73 | | return 0; |
|---|
| | 73 | return VLC_SUCCESS; |
|---|
| 74 | 74 | } |
|---|
| 75 | 75 | |
|---|
| … | … | |
| 95 | 95 | i_test = p_playlist->pp_items[i]->i_group - |
|---|
| 96 | 96 | p_playlist->pp_items[i_small]->i_group; |
|---|
| | 97 | } |
|---|
| | 98 | else if( i_mode == SORT_DURATION ) |
|---|
| | 99 | { |
|---|
| | 100 | i_test = p_playlist->pp_items[i]->i_duration - |
|---|
| | 101 | p_playlist->pp_items[i_small]->i_duration; |
|---|
| 97 | 102 | } |
|---|
| 98 | 103 | else if( i_mode == SORT_AUTHOR ) |
|---|
| … | … | |
| 126 | 131 | var_Set( p_playlist, "intf-change", val ); |
|---|
| 127 | 132 | |
|---|
| 128 | | return 0; |
|---|
| | 133 | return VLC_SUCCESS; |
|---|
| 129 | 134 | } |
|---|