* info.c : Playlist info management
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
- * $Id: info.c,v 1.9 2004/02/08 18:17:22 gbazin Exp $
+ * $Id: info.c,v 1.10 2004/02/28 17:10:23 gbazin Exp $
*
* Authors: Clément Stenac <zorglub@videolan.org>
*
return VLC_SUCCESS;
}
-
-/**
- * Add a special info : option
- *
- * \param p_playlist the playlist
- * \param i_item the position of the item on which we
- * add the option ( -1 for current )
- * \param psz_value the option to add
- * \return the info category.
- */
-int playlist_AddOption( playlist_t *p_playlist, int i_pos,
- const char *psz_option)
-{
- playlist_item_t *p_item;
-
- /* Check the existence of the playlist */
- if( p_playlist == NULL)
- {
- return VLC_EGENERIC;
- }
-
- p_item = playlist_ItemGetByPos( p_playlist , i_pos );
- if( !p_item )
- {
- return VLC_ENOOBJ;
- }
-
- vlc_mutex_lock( &p_item->lock );
- INSERT_ELEM( p_item->ppsz_options,
- p_item->i_options,
- p_item->i_options,
- (char *)psz_option );
- vlc_mutex_unlock( &p_item->lock );
-
- return VLC_SUCCESS;
-}
* item-ext.c : Playlist item management functions
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
- * $Id: item-ext.c,v 1.13 2004/01/29 17:51:08 zorglub Exp $
+ * $Id: item-ext.c,v 1.14 2004/02/28 17:10:23 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Clément Stenac <zorglub@videolan.org>
int playlist_Delete( playlist_t * p_playlist, int i_pos )
{
vlc_value_t val;
- int i,j;
- int i_delay=0;
/* if i_pos is the current played item, playlist should stop playing it */
if( ( p_playlist->i_status == PLAYLIST_RUNNING) &&
{
playlist_item_t *p_item = p_playlist->pp_items[i_pos];
- msg_Dbg( p_playlist, "deleting playlist item « %s »",
+ msg_Dbg( p_playlist, "deleting playlist item `%s'",
p_item->psz_name );
#if 0
+ int i,j;
+
vlc_mutex_lock( &p_item->lock );
if( p_item->psz_name )
if( i_pos >= 0 && i_pos < p_playlist->i_size )
{
- msg_Dbg( p_playlist, "disabling playlist item « %s »",
+ msg_Dbg( p_playlist, "disabling playlist item `%s'",
p_playlist->pp_items[i_pos]->psz_name );
if( p_playlist->pp_items[i_pos]->b_enabled == VLC_TRUE )
if( i_pos >= 0 && i_pos < p_playlist->i_size )
{
- msg_Dbg( p_playlist, "enabling playlist item « %s »",
+ msg_Dbg( p_playlist, "enabling playlist item `%s'",
p_playlist->pp_items[i_pos]->psz_name );
if( p_playlist->pp_items[i_pos]->b_enabled == VLC_FALSE )
{
if( p_playlist->pp_items[i]->i_group == i_group )
{
- msg_Dbg( p_playlist, "disabling playlist item « %s »",
+ msg_Dbg( p_playlist, "disabling playlist item `%s'",
p_playlist->pp_items[i]->psz_name );
if( p_playlist->pp_items[i]->b_enabled == VLC_TRUE )
{
if( p_playlist->pp_items[i]->i_group == i_group )
{
- msg_Dbg( p_playlist, "enabling playlist item « %s »",
+ msg_Dbg( p_playlist, "enabling playlist item `%s'",
p_playlist->pp_items[i]->psz_name );
if( p_playlist->pp_items[i]->b_enabled == VLC_FALSE )
{
playlist_item_t * temp;
- msg_Dbg( p_playlist, "moving playlist item « %s » (%i -> %i)",
+ msg_Dbg( p_playlist, "moving playlist item `%s' (%i -> %i)",
p_playlist->pp_items[i_pos]->psz_name, i_pos,
i_newpos );
return VLC_SUCCESS;
}
+
+/**
+ * Add a special info : option
+ *
+ * \param p_playlist the playlist
+ * \param i_item the position of the item on which we
+ * add the option ( -1 for current )
+ * \param psz_value the option to add
+ * \return the info category.
+ */
+int playlist_AddOption( playlist_t *p_playlist, int i_pos,
+ const char *psz_option )
+{
+ playlist_item_t *p_item;
+
+ /* Check the existence of the playlist */
+ if( p_playlist == NULL)
+ {
+ return VLC_EGENERIC;
+ }
+
+ p_item = playlist_ItemGetByPos( p_playlist , i_pos );
+ if( !p_item )
+ {
+ return VLC_ENOOBJ;
+ }
+
+ vlc_mutex_lock( &p_item->lock );
+ INSERT_ELEM( p_item->ppsz_options, p_item->i_options, p_item->i_options,
+ strdup( psz_option ) );
+ vlc_mutex_unlock( &p_item->lock );
+
+ return VLC_SUCCESS;
+}
* item.c : Playlist item functions
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
- * $Id: item.c,v 1.14 2004/02/08 18:17:22 gbazin Exp $
+ * $Id: item.c,v 1.15 2004/02/28 17:10:23 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
}
- msg_Dbg( p_playlist, "adding playlist item « %s » ( %s )", p_item->psz_name, p_item->psz_uri);
+ msg_Dbg( p_playlist, "adding playlist item `%s' ( %s )",
+ p_item->psz_name, p_item->psz_uri );
p_item->i_id = ++p_playlist->i_last_id;