Changeset 982c016f90b5992fc7d4e4f6ed5e11f6556d18a6

Show
Ignore:
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
  • include/vlc/vlc.h

    r97d84d1 r982c016  
    33 ***************************************************************************** 
    44 * 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 $ 
    66 * 
    77 * This program is free software; you can redistribute it and/or modify 
     
    140140int     VLC_Stop         ( int ); 
    141141int     VLC_FullScreen   ( int ); 
     142int VLC_ClearPlaylist( int ); 
     143vlc_bool_t VLC_IsPlaying ( int ); 
    142144 
    143145# ifdef __cplusplus 
  • include/vlc_playlist.h

    r12dc6ed r982c016  
    33 ***************************************************************************** 
    44 * 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 $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    158158/* For internal use. Do not use this one anymore */ 
    159159VLC_EXPORT( int,  playlist_AddItem, ( playlist_t *, playlist_item_t *, int, int ) ); 
     160VLC_EXPORT( int,  playlist_Clear, ( playlist_t * ) ); 
    160161VLC_EXPORT( int,  playlist_Delete, ( playlist_t *, int ) ); 
    161162VLC_EXPORT( int,  playlist_Disable, ( playlist_t *, int ) ); 
  • src/libvlc.c

    r17557ea r982c016  
    33 ***************************************************************************** 
    44 * 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 $ 
    66 * 
    77 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    911911 
    912912/* FIXME: temporary hacks */ 
     913 
     914 
     915/***************************************************************************** 
     916 * VLC_IsPlaying: Query for Playlist Status 
     917 *****************************************************************************/ 
     918vlc_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 *****************************************************************************/ 
     956int 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 
    913984 
    914985/***************************************************************************** 
  • src/misc/win32_specific.c

    r9e1d63b r982c016  
    33 ***************************************************************************** 
    44 * 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 $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    298298        if( pwm_data->lpData ) 
    299299        { 
    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
    301301            char **ppsz_argv; 
    302302            char *p_data = (char *)pwm_data->lpData; 
     
    322322                    i_options++; 
    323323                } 
    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                } 
    330334                i_opt += i_options; 
    331335            } 
  • src/playlist/group.c

    r17557ea r982c016  
    22 * playlist.c : Playlist groups management functions 
    33 ***************************************************************************** 
    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 $ 
    66 * 
    77 * Authors: Cl�nt Stenac <zorglub@videolan.org> 
  • src/playlist/info.c

    r17557ea r982c016  
    22 * info.c : Playlist info management 
    33 ***************************************************************************** 
    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 $ 
    66 * 
    77 * Authors: Cl�nt Stenac <zorglub@videolan.org> 
     
    106106                      const char * psz_cat ) 
    107107{ 
    108     int i; 
    109  
    110108    /* Check the existence of the playlist */ 
    111109    if( p_playlist == NULL) 
  • src/playlist/item-ext.c

    r12dc6ed r982c016  
    22 * item-ext.c : Exported playlist item functions 
    33 ***************************************************************************** 
    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 $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    4646*/ 
    4747int 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 ) 
    5050{ 
    5151    playlist_item_t * p_item; 
     
    9999                     const char *psz_name, int i_mode, int i_pos ) 
    100100{ 
    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 ); 
    103103} 
    104104 
     
    152152 * 
    153153 * \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) 
    155155 * \param i_group the new group 
    156156 * \return 0 on success, -1 on failure 
     
    365365} 
    366366 
     367 
     368 
     369/** 
     370 * Clear all playlist items 
     371 * 
     372 * \param p_playlist the playlist to be cleared. 
     373 * \return returns 0 
     374 */ 
     375int 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 
    367390/** 
    368391 * Disables a playlist item 
  • src/playlist/item.c

    r17557ea r982c016  
    22 * item.c : Playlist item functions 
    33 ***************************************************************************** 
    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 $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
  • src/playlist/loadsave.c

    r17557ea r982c016  
    22 * loadsave.c : Playlist loading / saving functions 
    33 ***************************************************************************** 
    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 $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
  • src/playlist/playlist.c

    r17557ea r982c016  
    22 * playlist.c : Playlist management functions 
    33 ***************************************************************************** 
    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 $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    8383    var_Set( p_playlist, "intf-show", val ); 
    8484 
     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 
    8590    var_Create( p_playlist, "random", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); 
    8691    var_Create( p_playlist, "repeat", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); 
     
    128133    var_Destroy( p_playlist, "intf-change" ); 
    129134    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" ); 
    130142 
    131143    while( p_playlist->i_groups > 0 ) 
     
    230242                input_StopThread( p_playlist->p_input ); 
    231243            } 
     244            val.b_bool = VLC_TRUE; 
     245            var_Set( p_playlist, "prevent-skip", val ); 
    232246            p_playlist->i_status = PLAYLIST_RUNNING; 
    233247        } 
     
    353367                    vlc_mutex_unlock( &p_playlist->object_lock ); 
    354368                    playlist_Delete( p_playlist, p_playlist->i_index ); 
     369                    p_playlist->i_index++; 
     370                    p_playlist->i_status = PLAYLIST_RUNNING; 
    355371                } 
    356372                else 
     
    382398        else if( p_playlist->i_status != PLAYLIST_STOPPED ) 
    383399        { 
    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); 
    385407            PlayItem( p_playlist ); 
    386408        } 
     
    538560   if( p_playlist->pp_items[p_playlist->i_index]->b_enabled == VLC_FALSE && 
    539561       p_playlist->i_enabled != 0) 
    540    
     562   
    541563        SkipItem( p_playlist , 1 ); 
    542564    } 
  • src/playlist/sort.c

    r17557ea r982c016  
    22 * sort.c : Playlist sorting functions 
    33 ***************************************************************************** 
    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 $ 
    66 * 
    77 * Authors: Cl�nt Stenac <zorglub@videolan.org>