an interface to allow setting the duration on adding a playlist item.
* vlc_playlist.h : Playlist functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
- * $Id: vlc_playlist.h,v 1.19 2004/01/05 12:59:43 zorglub Exp $
+ * $Id: vlc_playlist.h,v 1.20 2004/01/06 04:57:34 rocky Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
char * psz_name; /**< text describing this item */
char * psz_uri; /**< mrl of this item */
mtime_t i_duration; /**< A hint about the duration of this
- * item, in miliseconds*/
+ * item, in milliseconds*/
int i_categories; /**< Number of info categories */
item_info_category_t **pp_categories;
/**< Pointer to the first info category */
/* Item functions */
VLC_EXPORT( int, playlist_Add, ( playlist_t *, const char *, const char *, int, int ) );
+VLC_EXPORT( int, playlist_AddWDuration, ( playlist_t *, const char *, const char *, int, int, mtime_t ) );
/* For internal use. Do not use this one anymore */
VLC_EXPORT( int, playlist_AddItem, ( playlist_t *, playlist_item_t *, int, int ) );
VLC_EXPORT( int, playlist_Delete, ( playlist_t *, int ) );
* cddax.c : CD digital audio input module for vlc using libcdio
*****************************************************************************
* Copyright (C) 2000,2003 VideoLAN
- * $Id: access.c,v 1.20 2004/01/05 13:07:02 zorglub Exp $
+ * $Id: access.c,v 1.21 2004/01/06 04:57:34 rocky Exp $
*
* Authors: Rocky Bernstein <rocky@panix.com>
* Laurent Aimar <fenrir@via.ecp.fr>
int i_pos)
{
mtime_t i_duration =
- (p_cdda->p_sectors[i_track] - p_cdda->p_sectors[i_track-1])
- / CDIO_CD_FRAMES_PER_SEC;
+ ((p_cdda->p_sectors[i_track] - p_cdda->p_sectors[i_track-1])
+ / CDIO_CD_FRAMES_PER_SEC) * 1000000;
char *p_author;
char *p_title;
char *config_varname = MODULE_STRING "-title-format";
psz_mrl, i_track);
dbg_print( INPUT_DBG_META, "mrl: %s, title: %s, duration, %ld, pos %d",
- psz_mrl, p_title, (long int) i_duration, i_pos );
- playlist_Add( p_playlist, psz_mrl, p_title, playlist_operation, i_pos );
-
- /* XXX Set the duration ! */
+ psz_mrl, p_title, (long int) i_duration / 1000000 , i_pos );
+ playlist_AddWDuration( p_playlist, psz_mrl, p_title, playlist_operation,
+ i_pos, i_duration );
p_author =
CDDAFormatStr( p_input, p_cdda,
* item-ext.c : Exported playlist item functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: item-ext.c,v 1.2 2004/01/05 14:42:14 zorglub Exp $
+ * $Id: item-ext.c,v 1.3 2004/01/06 04:57:34 rocky Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Clément Stenac <zorglub@videolan.org>
* \param i_pos the position in the playlist where to add. If this is
* PLAYLIST_END the item will be added at the end of the playlist
* regardless of it's size
+ * \param i_duration length of the item in milliseconds.
* \return the position of the new item
*/
-int playlist_Add( playlist_t *p_playlist, const char * psz_uri,
- const char *psz_name, int i_mode, int i_pos )
+int playlist_AddWDuration( playlist_t *p_playlist, const char * psz_uri,
+ const char *psz_name, int i_mode, int i_pos,
+ mtime_t i_duration )
{
playlist_item_t * p_item;
p_item->b_autodeletion = VLC_FALSE;
p_item->b_enabled = VLC_TRUE;
p_item->i_group = PLAYLIST_TYPE_MANUAL;
- p_item->i_duration = -1;
+ p_item->i_duration = i_duration;
p_item->pp_categories = NULL;
p_item->i_categories = 0;
return playlist_AddItem( p_playlist, p_item, i_mode, i_pos );
}
+/**
+ * Add a MRL into the playlist.
+ *
+ * \param p_playlist the playlist to add into
+ * \param psz_uri the mrl to add to the playlist
+ * \param psz_name a text giving a name or description of this item
+ * \param i_mode the mode used when adding
+ * \param i_pos the position in the playlist where to add. If this is
+ * PLAYLIST_END the item will be added at the end of the playlist
+ * regardless of it's size
+ * \return the position of the new item
+*/
+int playlist_Add( playlist_t *p_playlist, const char * psz_uri,
+ const char *psz_name, int i_mode, int i_pos )
+{
+ return playlist_AddWDuration ( p_playlist, psz_uri, psz_name, i_mode, i_pos,
+ -1 );
+}
+
/**
* Search the position of an item by its id
* \param p_playlist the playlist