Changeset 982c016f90b5992fc7d4e4f6ed5e11f6556d18a6
- Timestamp:
- 06/01/04 09:50:20
(5 years ago)
- Author:
- Clément Stenac <zorglub@videolan.org>
- git-committer:
- Clément Stenac <zorglub@videolan.org> 1073379020 +0000
- git-parent:
[12dc6ed79fdc9c8c443f5539257c82d6dd266a1b]
- git-author:
- Clément Stenac <zorglub@videolan.org> 1073379020 +0000
- Message:
- src/misc/win32_specific: compilation fix for win32 (can someone please
check that command line parsing still works for items and options? )
- src/libvlc.c
include/vlc/vlc.h : New libvlc functions to get playlist status and
clear the playlist
Patch by Tong Ka Man
- src/playlist/* : Update copyrights
- src/playlist/playlist.c:
-When a user explicitely asks for an item, do play it, even if random mode
-Do not stop playlist upon deletion of an autodelete item
-playlist_Clear (Patch by Tong Ka Man)
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r97d84d1 |
r982c016 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 1998, 1999, 2000 VideoLAN |
|---|
| 5 | | * $Id: vlc.h,v 1.28 2003/12/02 12:57:35 gbazin Exp $ |
|---|
| | 5 | * $Id: vlc.h,v 1.29 2004/01/06 08:50:20 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * This program is free software; you can redistribute it and/or modify |
|---|
| … | … | |
| 140 | 140 | int VLC_Stop ( int ); |
|---|
| 141 | 141 | int VLC_FullScreen ( int ); |
|---|
| | 142 | int VLC_ClearPlaylist( int ); |
|---|
| | 143 | vlc_bool_t VLC_IsPlaying ( int ); |
|---|
| 142 | 144 | |
|---|
| 143 | 145 | # ifdef __cplusplus |
|---|
| r12dc6ed |
r982c016 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN |
|---|
| 5 | | * $Id: vlc_playlist.h,v 1.20 2004/01/06 04:57:34 rocky Exp $ |
|---|
| | 5 | * $Id: vlc_playlist.h,v 1.21 2004/01/06 08:50:20 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Samuel Hocevar <sam@zoy.org> |
|---|
| … | … | |
| 158 | 158 | /* For internal use. Do not use this one anymore */ |
|---|
| 159 | 159 | VLC_EXPORT( int, playlist_AddItem, ( playlist_t *, playlist_item_t *, int, int ) ); |
|---|
| | 160 | VLC_EXPORT( int, playlist_Clear, ( playlist_t * ) ); |
|---|
| 160 | 161 | VLC_EXPORT( int, playlist_Delete, ( playlist_t *, int ) ); |
|---|
| 161 | 162 | VLC_EXPORT( int, playlist_Disable, ( playlist_t *, int ) ); |
|---|
| r17557ea |
r982c016 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 1998-2002 VideoLAN |
|---|
| 5 | | * $Id: libvlc.c,v 1.107 2004/01/05 12:59:43 zorglub Exp $ |
|---|
| | 5 | * $Id: libvlc.c,v 1.108 2004/01/06 08:50:20 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Vincent Seguin <seguin@via.ecp.fr> |
|---|
| … | … | |
| 911 | 911 | |
|---|
| 912 | 912 | /* FIXME: temporary hacks */ |
|---|
| | 913 | |
|---|
| | 914 | |
|---|
| | 915 | /***************************************************************************** |
|---|
| | 916 | * VLC_IsPlaying: Query for Playlist Status |
|---|
| | 917 | *****************************************************************************/ |
|---|
| | 918 | vlc_bool_t VLC_IsPlaying( int i_object ) |
|---|
| | 919 | { |
|---|
| | 920 | |
|---|
| | 921 | playlist_t * p_playlist; |
|---|
| | 922 | vlc_bool_t playing; |
|---|
| | 923 | |
|---|
| | 924 | vlc_t *p_vlc = vlc_current_object( i_object ); |
|---|
| | 925 | |
|---|
| | 926 | /* Check that the handle is valid */ |
|---|
| | 927 | if( !p_vlc ) |
|---|
| | 928 | { |
|---|
| | 929 | return VLC_ENOOBJ; |
|---|
| | 930 | } |
|---|
| | 931 | |
|---|
| | 932 | p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST, FIND_CHILD ); |
|---|
| | 933 | |
|---|
| | 934 | if( !p_playlist ) |
|---|
| | 935 | { |
|---|
| | 936 | if( i_object ) vlc_object_release( p_vlc ); |
|---|
| | 937 | return VLC_ENOOBJ; |
|---|
| | 938 | } |
|---|
| | 939 | |
|---|
| | 940 | playing = playlist_IsPlaying( p_playlist ); |
|---|
| | 941 | |
|---|
| | 942 | vlc_object_release( p_playlist ); |
|---|
| | 943 | |
|---|
| | 944 | if( i_object ) vlc_object_release( p_vlc ); |
|---|
| | 945 | |
|---|
| | 946 | return playing; |
|---|
| | 947 | |
|---|
| | 948 | } |
|---|
| | 949 | |
|---|
| | 950 | |
|---|
| | 951 | /***************************************************************************** |
|---|
| | 952 | * VLC_ClearPlaylist: Query for Playlist Status |
|---|
| | 953 | * |
|---|
| | 954 | * return: 0 |
|---|
| | 955 | *****************************************************************************/ |
|---|
| | 956 | int VLC_ClearPlaylist( int i_object ) |
|---|
| | 957 | { |
|---|
| | 958 | |
|---|
| | 959 | playlist_t * p_playlist; |
|---|
| | 960 | vlc_t *p_vlc = vlc_current_object( i_object ); |
|---|
| | 961 | |
|---|
| | 962 | /* Check that the handle is valid */ |
|---|
| | 963 | if( !p_vlc ) |
|---|
| | 964 | { |
|---|
| | 965 | return VLC_ENOOBJ; |
|---|
| | 966 | } |
|---|
| | 967 | |
|---|
| | 968 | p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST, FIND_CHILD ); |
|---|
| | 969 | |
|---|
| | 970 | if( !p_playlist ) |
|---|
| | 971 | { |
|---|
| | 972 | if( i_object ) vlc_object_release( p_vlc ); |
|---|
| | 973 | return VLC_ENOOBJ; |
|---|
| | 974 | } |
|---|
| | 975 | |
|---|
| | 976 | playlist_Clear(p_playlist); |
|---|
| | 977 | |
|---|
| | 978 | vlc_object_release( p_playlist ); |
|---|
| | 979 | |
|---|
| | 980 | if( i_object ) vlc_object_release( p_vlc ); |
|---|
| | 981 | return 0; |
|---|
| | 982 | } |
|---|
| | 983 | |
|---|
| 913 | 984 | |
|---|
| 914 | 985 | /***************************************************************************** |
|---|
| r9e1d63b |
r982c016 |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 2001 VideoLAN |
|---|
| 5 | | * $Id: win32_specific.c,v 1.28 2003/12/09 19:18:48 gbazin Exp $ |
|---|
| | 5 | * $Id: win32_specific.c,v 1.29 2004/01/06 08:50:20 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Samuel Hocevar <sam@zoy.org> |
|---|
| … | … | |
| 298 | 298 | if( pwm_data->lpData ) |
|---|
| 299 | 299 | { |
|---|
| 300 | | int i_argc, i_data, i_opt, i_options; |
|---|
| | 300 | int i_argc, i_data, i_opt, i_options,i_id,i_pos,j; |
|---|
| 301 | 301 | char **ppsz_argv; |
|---|
| 302 | 302 | char *p_data = (char *)pwm_data->lpData; |
|---|
| … | … | |
| 322 | 322 | i_options++; |
|---|
| 323 | 323 | } |
|---|
| 324 | | |
|---|
| 325 | | playlist_Add( p_playlist, ppsz_argv[ i_opt ], |
|---|
| 326 | | (char const **)( i_options ? &ppsz_argv[i_opt+1] : NULL ), |
|---|
| 327 | | i_options, PLAYLIST_APPEND | (i_opt? 0 : PLAYLIST_GO), |
|---|
| 328 | | PLAYLIST_END ); |
|---|
| 329 | | |
|---|
| | 324 | i_id = playlist_Add( p_playlist, ppsz_argv[ i_opt ], |
|---|
| | 325 | ppsz_argv[ i_opt ], |
|---|
| | 326 | PLAYLIST_APPEND | (i_opt? 0 : PLAYLIST_GO), |
|---|
| | 327 | PLAYLIST_END ); |
|---|
| | 328 | i_pos = playlist_GetPositionById( p_playlist, i_id ); |
|---|
| | 329 | for( j = 0 ; j < i_options ; j++ ) |
|---|
| | 330 | { |
|---|
| | 331 | playlist_AddOption( p_playlist, i_pos , |
|---|
| | 332 | &ppsz_argv[i_opt+1+j] ); |
|---|
| | 333 | } |
|---|
| 330 | 334 | i_opt += i_options; |
|---|
| 331 | 335 | } |
|---|
| r17557ea |
r982c016 |
|
| 2 | 2 | * playlist.c : Playlist groups management functions |
|---|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | | * Copyright (C) 1999-2001 VideoLAN |
|---|
| 5 | | * $Id: group.c,v 1.5 2004/01/05 12:59:43 zorglub Exp $ |
|---|
| | 4 | * Copyright (C) 1999-2004 VideoLAN |
|---|
| | 5 | * $Id: group.c,v 1.6 2004/01/06 08:50:20 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cl�nt Stenac <zorglub@videolan.org> |
|---|
| r17557ea |
r982c016 |
|
| 2 | 2 | * info.c : Playlist info management |
|---|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | | * Copyright (C) 1999-2001 VideoLAN |
|---|
| 5 | | * $Id: info.c,v 1.1 2004/01/05 12:59:43 zorglub Exp $ |
|---|
| | 4 | * Copyright (C) 1999-2004 VideoLAN |
|---|
| | 5 | * $Id: info.c,v 1.2 2004/01/06 08:50:20 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cl�nt Stenac <zorglub@videolan.org> |
|---|
| … | … | |
| 106 | 106 | const char * psz_cat ) |
|---|
| 107 | 107 | { |
|---|
| 108 | | int i; |
|---|
| 109 | | |
|---|
| 110 | 108 | /* Check the existence of the playlist */ |
|---|
| 111 | 109 | if( p_playlist == NULL) |
|---|
| r12dc6ed |
r982c016 |
|
| 2 | 2 | * item-ext.c : Exported playlist item functions |
|---|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | | * Copyright (C) 1999-2001 VideoLAN |
|---|
| 5 | | * $Id: item-ext.c,v 1.3 2004/01/06 04:57:34 rocky Exp $ |
|---|
| | 4 | * Copyright (C) 1999-2004 VideoLAN |
|---|
| | 5 | * $Id: item-ext.c,v 1.4 2004/01/06 08:50:20 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Samuel Hocevar <sam@zoy.org> |
|---|
| … | … | |
| 46 | 46 | */ |
|---|
| 47 | 47 | int playlist_AddWDuration( playlist_t *p_playlist, const char * psz_uri, |
|---|
| 48 | | const char *psz_name, int i_mode, int i_pos, |
|---|
| 49 | | mtime_t i_duration ) |
|---|
| | 48 | const char *psz_name, int i_mode, int i_pos, |
|---|
| | 49 | mtime_t i_duration ) |
|---|
| 50 | 50 | { |
|---|
| 51 | 51 | playlist_item_t * p_item; |
|---|
| … | … | |
| 99 | 99 | const char *psz_name, int i_mode, int i_pos ) |
|---|
| 100 | 100 | { |
|---|
| 101 | | return playlist_AddWDuration ( p_playlist, psz_uri, psz_name, i_mode, i_pos, |
|---|
| 102 | | -1 ); |
|---|
| | 101 | return playlist_AddWDuration ( p_playlist, psz_uri, psz_name, i_mode, i_pos, |
|---|
| | 102 | -1 ); |
|---|
| 103 | 103 | } |
|---|
| 104 | 104 | |
|---|
| … | … | |
| 152 | 152 | * |
|---|
| 153 | 153 | * \param p_playlist the playlist |
|---|
| 154 | | * \param i_item the item of which we change the group |
|---|
| | 154 | * \param i_item the item of which we change the group (position) |
|---|
| 155 | 155 | * \param i_group the new group |
|---|
| 156 | 156 | * \return 0 on success, -1 on failure |
|---|
| … | … | |
| 365 | 365 | } |
|---|
| 366 | 366 | |
|---|
| | 367 | |
|---|
| | 368 | |
|---|
| | 369 | /** |
|---|
| | 370 | * Clear all playlist items |
|---|
| | 371 | * |
|---|
| | 372 | * \param p_playlist the playlist to be cleared. |
|---|
| | 373 | * \return returns 0 |
|---|
| | 374 | */ |
|---|
| | 375 | int playlist_Clear( playlist_t * p_playlist ) { |
|---|
| | 376 | |
|---|
| | 377 | while( p_playlist->i_groups > 0 ) |
|---|
| | 378 | { |
|---|
| | 379 | playlist_DeleteGroup( p_playlist, p_playlist->pp_groups[0]->i_id ); |
|---|
| | 380 | } |
|---|
| | 381 | |
|---|
| | 382 | while( p_playlist->i_size > 0 ) |
|---|
| | 383 | { |
|---|
| | 384 | playlist_Delete( p_playlist, 0 ); |
|---|
| | 385 | } |
|---|
| | 386 | return 0; |
|---|
| | 387 | } |
|---|
| | 388 | |
|---|
| | 389 | |
|---|
| 367 | 390 | /** |
|---|
| 368 | 391 | * Disables a playlist item |
|---|
| r17557ea |
r982c016 |
|
| 2 | 2 | * item.c : Playlist item functions |
|---|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | | * Copyright (C) 1999-2001 VideoLAN |
|---|
| 5 | | * $Id: item.c,v 1.10 2004/01/05 12:59:43 zorglub Exp $ |
|---|
| | 4 | * Copyright (C) 1999-2004 VideoLAN |
|---|
| | 5 | * $Id: item.c,v 1.11 2004/01/06 08:50:20 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Samuel Hocevar <sam@zoy.org> |
|---|
| r17557ea |
r982c016 |
|
| 2 | 2 | * loadsave.c : Playlist loading / saving functions |
|---|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | | * Copyright (C) 1999-2001 VideoLAN |
|---|
| 5 | | * $Id: loadsave.c,v 1.2 2004/01/05 12:59:43 zorglub Exp $ |
|---|
| | 4 | * Copyright (C) 1999-2004 VideoLAN |
|---|
| | 5 | * $Id: loadsave.c,v 1.3 2004/01/06 08:50:20 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Samuel Hocevar <sam@zoy.org> |
|---|
| r17557ea |
r982c016 |
|
| 2 | 2 | * playlist.c : Playlist management functions |
|---|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | | * Copyright (C) 1999-2001 VideoLAN |
|---|
| 5 | | * $Id: playlist.c,v 1.71 2004/01/05 12:59:43 zorglub Exp $ |
|---|
| | 4 | * Copyright (C) 1999-2004 VideoLAN |
|---|
| | 5 | * $Id: playlist.c,v 1.72 2004/01/06 08:50:20 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Samuel Hocevar <sam@zoy.org> |
|---|
| … | … | |
| 83 | 83 | var_Set( p_playlist, "intf-show", val ); |
|---|
| 84 | 84 | |
|---|
| | 85 | |
|---|
| | 86 | var_Create( p_playlist, "prevent-skip", VLC_VAR_BOOL ); |
|---|
| | 87 | val.b_bool = VLC_FALSE; |
|---|
| | 88 | var_Set( p_playlist, "prevent-skip", val ); |
|---|
| | 89 | |
|---|
| 85 | 90 | var_Create( p_playlist, "random", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); |
|---|
| 86 | 91 | var_Create( p_playlist, "repeat", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); |
|---|
| … | … | |
| 128 | 133 | var_Destroy( p_playlist, "intf-change" ); |
|---|
| 129 | 134 | var_Destroy( p_playlist, "item-change" ); |
|---|
| | 135 | var_Destroy( p_playlist, "playlist-current" ); |
|---|
| | 136 | var_Destroy( p_playlist, "intf-popmenu" ); |
|---|
| | 137 | var_Destroy( p_playlist, "intf-show" ); |
|---|
| | 138 | var_Destroy( p_playlist, "prevent-skip" ); |
|---|
| | 139 | var_Destroy( p_playlist, "random" ); |
|---|
| | 140 | var_Destroy( p_playlist, "repeat" ); |
|---|
| | 141 | var_Destroy( p_playlist, "loop" ); |
|---|
| 130 | 142 | |
|---|
| 131 | 143 | while( p_playlist->i_groups > 0 ) |
|---|
| … | … | |
| 230 | 242 | input_StopThread( p_playlist->p_input ); |
|---|
| 231 | 243 | } |
|---|
| | 244 | val.b_bool = VLC_TRUE; |
|---|
| | 245 | var_Set( p_playlist, "prevent-skip", val ); |
|---|
| 232 | 246 | p_playlist->i_status = PLAYLIST_RUNNING; |
|---|
| 233 | 247 | } |
|---|
| … | … | |
| 353 | 367 | vlc_mutex_unlock( &p_playlist->object_lock ); |
|---|
| 354 | 368 | playlist_Delete( p_playlist, p_playlist->i_index ); |
|---|
| | 369 | p_playlist->i_index++; |
|---|
| | 370 | p_playlist->i_status = PLAYLIST_RUNNING; |
|---|
| 355 | 371 | } |
|---|
| 356 | 372 | else |
|---|
| … | … | |
| 382 | 398 | else if( p_playlist->i_status != PLAYLIST_STOPPED ) |
|---|
| 383 | 399 | { |
|---|
| 384 | | SkipItem( p_playlist, 0 ); |
|---|
| | 400 | var_Get( p_playlist, "prevent-skip", &val); |
|---|
| | 401 | if( val.b_bool == VLC_FALSE) |
|---|
| | 402 | { |
|---|
| | 403 | SkipItem( p_playlist, 0 ); |
|---|
| | 404 | } |
|---|
| | 405 | val.b_bool = VLC_TRUE; |
|---|
| | 406 | var_Set( p_playlist, "prevent-skip", val); |
|---|
| 385 | 407 | PlayItem( p_playlist ); |
|---|
| 386 | 408 | } |
|---|
| … | … | |
| 538 | 560 | if( p_playlist->pp_items[p_playlist->i_index]->b_enabled == VLC_FALSE && |
|---|
| 539 | 561 | p_playlist->i_enabled != 0) |
|---|
| 540 | | { |
|---|
| | 562 | { |
|---|
| 541 | 563 | SkipItem( p_playlist , 1 ); |
|---|
| 542 | 564 | } |
|---|
| r17557ea |
r982c016 |
|
| 2 | 2 | * sort.c : Playlist sorting functions |
|---|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | | * Copyright (C) 1999-2001 VideoLAN |
|---|
| 5 | | * $Id: sort.c,v 1.4 2004/01/05 12:59:43 zorglub Exp $ |
|---|
| | 4 | * Copyright (C) 1999-2004 VideoLAN |
|---|
| | 5 | * $Id: sort.c,v 1.5 2004/01/06 08:50:20 zorglub Exp $ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Cl�nt Stenac <zorglub@videolan.org> |
|---|