2001-02-08 05:43:28 +01:00
|
|
|
/*****************************************************************************
|
* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly
do what remains to be fixed during the weekend.
Changes in vlc:
===============
* vlc is now a very small program (20 lines) which uses the libvlc API;
it is quite simple for the moment but can be extended in the future.
* interfaces, decoders, video outputs, etc. are now almost the same
objects (yes, I know, this is C++ redone in C) and are structured in
a tree. More about this later, but basically it allows the following
nice features:
- several interfaces
- several playlists with several outputs
- input plugins spawning helper interfaces (will be used for DVD menus)
- anything spawning anything; I swear there are useful uses for this!
* libvlc can be used in other programs; I'm currently writing a Mozilla
plugin for my employer.
Things currently broken:
========================
* most interfaces, most ports
* the playlist handling (almost finished rewriting this though). This means
no file can be played from the GUI, you need to use the commandline. This
also means it segfaults at EOF, when exiting the program, and it sometimes
refuses to open a file when asked to.
2002-06-01 14:32:02 +02:00
|
|
|
* vlc_playlist.h : Playlist functions
|
2001-02-08 05:43:28 +01:00
|
|
|
*****************************************************************************
|
2005-07-09 08:17:09 +02:00
|
|
|
* Copyright (C) 1999-2004 the VideoLAN team
|
2004-03-31 22:52:31 +02:00
|
|
|
* $Id$
|
2001-02-08 05:43:28 +01:00
|
|
|
*
|
2001-02-08 08:24:25 +01:00
|
|
|
* Authors: Samuel Hocevar <sam@zoy.org>
|
2001-02-08 05:43:28 +01:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
2003-10-06 18:23:30 +02:00
|
|
|
*
|
2001-02-08 05:43:28 +01:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
2009-05-30 00:14:24 +02:00
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
|
2001-02-08 05:43:28 +01:00
|
|
|
*****************************************************************************/
|
|
|
|
|
2008-08-11 18:13:10 +02:00
|
|
|
#ifndef VLC_PLAYLIST_H_
|
|
|
|
#define VLC_PLAYLIST_H_
|
2006-05-14 20:29:00 +02:00
|
|
|
|
2006-11-26 15:20:34 +01:00
|
|
|
# ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
# endif
|
|
|
|
|
2006-11-12 00:37:25 +01:00
|
|
|
#include <vlc_input.h>
|
2007-08-17 04:23:11 +02:00
|
|
|
#include <vlc_events.h>
|
2006-09-16 00:10:37 +02:00
|
|
|
|
2010-01-18 18:45:13 +01:00
|
|
|
TYPEDEF_ARRAY(playlist_item_t*, playlist_item_array_t)
|
2006-11-19 15:37:04 +01:00
|
|
|
|
2003-08-14 15:02:55 +02:00
|
|
|
/**
|
2006-10-21 13:09:51 +02:00
|
|
|
* \file
|
|
|
|
* This file contain structures and function prototypes related
|
|
|
|
* to the playlist in vlc
|
|
|
|
*
|
2003-08-14 15:02:55 +02:00
|
|
|
* \defgroup vlc_playlist Playlist
|
2006-11-19 14:20:02 +01:00
|
|
|
*
|
|
|
|
* The VLC playlist system has a tree structure. This allows advanced
|
|
|
|
* categorization, like for SAP streams (which are grouped by "sap groups").
|
|
|
|
*
|
|
|
|
* The base structure for all playlist operations is the input_item_t. This
|
|
|
|
* contains all information needed to play a stream and get info, ie, mostly,
|
|
|
|
* mrl and metadata. This structure contains a unique i_id field. ids are
|
|
|
|
* not recycled when an item is destroyed.
|
|
|
|
*
|
|
|
|
* Input items are not used directly, but through playlist items.
|
|
|
|
* The playlist items are themselves in a tree structure. They only contain
|
|
|
|
* a link to the input item, a unique id and a few flags. the playlist
|
|
|
|
* item id is NOT the same as the input item id.
|
|
|
|
* Several playlist items can be attached to a single input item. The input
|
|
|
|
* item is refcounted and is automatically destroyed when it is not used
|
|
|
|
* anymore.
|
|
|
|
*
|
2010-06-09 19:39:01 +02:00
|
|
|
* The top-level items are the main media sources and include:
|
|
|
|
* playlist, media library, SAP, Shoutcast, devices, ...
|
2006-11-19 14:20:02 +01:00
|
|
|
*
|
|
|
|
* It is envisioned that a third tree will appear: VLM, but it's not done yet
|
|
|
|
*
|
|
|
|
* The playlist also stores, for utility purposes, an array of all input
|
|
|
|
* items, an array of all playlist items and an array of all playlist items
|
|
|
|
* and nodes (both are represented by the same structure).
|
|
|
|
*
|
|
|
|
* So, here is an example:
|
2006-11-19 15:04:06 +01:00
|
|
|
* \verbatim
|
2006-11-19 14:20:02 +01:00
|
|
|
* Inputs array
|
|
|
|
* - input 1 -> name = foo 1 uri = ...
|
|
|
|
* - input 2 -> name = foo 2 uri = ...
|
|
|
|
*
|
2010-06-09 19:39:01 +02:00
|
|
|
* Playlist items tree
|
|
|
|
* - playlist (id 1)
|
|
|
|
* - category 1 (id 2)
|
|
|
|
* - foo 2 (id 6 - input 2)
|
|
|
|
* - media library (id 2)
|
2006-11-19 14:20:02 +01:00
|
|
|
* - foo 1 (id 5 - input 1)
|
2006-11-19 15:04:06 +01:00
|
|
|
* \endverbatim
|
2010-06-09 19:39:01 +02:00
|
|
|
*
|
|
|
|
* Sometimes, an item creates subitems. This happens for the directory access
|
|
|
|
* for example. In that case, if the item is under the "playlist" top-level item
|
|
|
|
* and playlist is configured to be flat then the item will be deleted and
|
|
|
|
* replaced with new subitems. If the item is under another top-level item, it
|
|
|
|
* will be transformed to a node and removed from the list of all items without
|
|
|
|
* nodes.
|
2006-11-19 14:20:02 +01:00
|
|
|
*
|
|
|
|
* For "standard" item addition, you can use playlist_Add, playlist_AddExt
|
|
|
|
* (more options) or playlist_AddInput if you already created your input
|
|
|
|
* item. This will add the item at the root of "Playlist" or of "Media library"
|
|
|
|
* in each of the two trees.
|
|
|
|
*
|
2010-06-09 19:39:01 +02:00
|
|
|
* You can create nodes with playlist_NodeCreate and can create items from
|
|
|
|
* existing input items to be placed under any node with playlist_NodeAddInput.
|
2006-11-19 14:20:02 +01:00
|
|
|
*
|
2009-05-16 13:43:41 +02:00
|
|
|
* To delete an item, use playlist_DeleteFromInput( p_item ) which will
|
2010-06-09 19:39:01 +02:00
|
|
|
* remove all occurrences of the input.
|
2006-11-19 14:20:02 +01:00
|
|
|
*
|
2009-02-16 21:33:43 +01:00
|
|
|
*
|
|
|
|
* The playlist defines the following event variables:
|
2009-02-16 22:24:38 +01:00
|
|
|
*
|
2010-06-09 19:39:01 +02:00
|
|
|
* - "item-change": It will contain the input_item_t->i_id of a changed input
|
2009-02-16 21:33:43 +01:00
|
|
|
* item monitored by the playlist.
|
2010-06-09 19:39:01 +02:00
|
|
|
* - "item-current": It will contain a input_item_t->i_id of the current
|
2009-02-16 22:24:38 +01:00
|
|
|
* item being played.
|
|
|
|
*
|
2010-06-09 19:39:01 +02:00
|
|
|
* - "playlist-item-append": It will contain a pointer to a playlist_add_t.
|
|
|
|
* - "playlist-item-deleted": It will contain the playlist_item_t->i_id of a
|
|
|
|
* deleted playlist_item_t.
|
|
|
|
*
|
|
|
|
* - "leaf-to-parent": Set when an item gets subitems and is transformed to a
|
|
|
|
* node. It will contain a pointer to the input_item_t bound to the transformed
|
|
|
|
* playlist item.
|
|
|
|
*
|
2010-09-26 13:50:03 +02:00
|
|
|
* The playlist contains rate-variable which is propagated to current input if available
|
|
|
|
* also rate-slower/rate-faster is in use
|
2009-02-16 21:33:43 +01:00
|
|
|
*
|
|
|
|
* XXX Be really carefull, playlist_item_t->i_id and input_item_t->i_id are not
|
2009-02-16 22:05:02 +01:00
|
|
|
* the same. Yes, the situation is pretty bad.
|
2009-02-16 21:33:43 +01:00
|
|
|
*
|
2003-08-14 15:02:55 +02:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2006-11-19 14:20:02 +01:00
|
|
|
/** Helper structure to export to file part of the playlist */
|
2009-08-23 17:54:47 +02:00
|
|
|
typedef struct playlist_export_t
|
2004-01-11 01:45:06 +01:00
|
|
|
{
|
2009-08-23 17:54:47 +02:00
|
|
|
VLC_COMMON_MEMBERS
|
|
|
|
const char *psz_filename;
|
2004-01-11 01:45:06 +01:00
|
|
|
FILE *p_file;
|
2006-05-14 20:29:00 +02:00
|
|
|
playlist_item_t *p_root;
|
2009-08-23 17:54:47 +02:00
|
|
|
} playlist_export_t;
|
2004-11-06 12:17:46 +01:00
|
|
|
|
2006-11-19 14:20:02 +01:00
|
|
|
/** playlist item / node */
|
2002-07-20 20:01:43 +02:00
|
|
|
struct playlist_item_t
|
2001-02-08 05:43:28 +01:00
|
|
|
{
|
2006-11-19 15:37:04 +01:00
|
|
|
input_item_t *p_input; /**< Linked input item */
|
|
|
|
/** Number of children, -1 if not a node */
|
2004-11-06 12:17:46 +01:00
|
|
|
playlist_item_t **pp_children; /**< Children nodes/items */
|
2006-05-14 20:29:00 +02:00
|
|
|
playlist_item_t *p_parent; /**< Item parent */
|
2010-05-28 22:03:17 +02:00
|
|
|
int i_children;
|
2004-11-06 12:17:46 +01:00
|
|
|
|
2006-05-14 20:29:00 +02:00
|
|
|
int i_id; /**< Playlist item specific id */
|
|
|
|
uint8_t i_flags; /**< Flags */
|
2007-08-16 19:52:28 +02:00
|
|
|
playlist_t *p_playlist; /**< Parent playlist */
|
* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly
do what remains to be fixed during the weekend.
Changes in vlc:
===============
* vlc is now a very small program (20 lines) which uses the libvlc API;
it is quite simple for the moment but can be extended in the future.
* interfaces, decoders, video outputs, etc. are now almost the same
objects (yes, I know, this is C++ redone in C) and are structured in
a tree. More about this later, but basically it allows the following
nice features:
- several interfaces
- several playlists with several outputs
- input plugins spawning helper interfaces (will be used for DVD menus)
- anything spawning anything; I swear there are useful uses for this!
* libvlc can be used in other programs; I'm currently writing a Mozilla
plugin for my employer.
Things currently broken:
========================
* most interfaces, most ports
* the playlist handling (almost finished rewriting this though). This means
no file can be played from the GUI, you need to use the commandline. This
also means it segfaults at EOF, when exiting the program, and it sometimes
refuses to open a file when asked to.
2002-06-01 14:32:02 +02:00
|
|
|
};
|
2001-02-08 05:43:28 +01:00
|
|
|
|
2006-06-14 22:09:51 +02:00
|
|
|
#define PLAYLIST_SAVE_FLAG 0x0001 /**< Must it be saved */
|
|
|
|
#define PLAYLIST_SKIP_FLAG 0x0002 /**< Must playlist skip after it ? */
|
|
|
|
#define PLAYLIST_DBL_FLAG 0x0004 /**< Is it disabled ? */
|
|
|
|
#define PLAYLIST_RO_FLAG 0x0008 /**< Write-enabled ? */
|
|
|
|
#define PLAYLIST_REMOVE_FLAG 0x0010 /**< Remove this item at the end */
|
|
|
|
#define PLAYLIST_EXPANDED_FLAG 0x0020 /**< Expanded node */
|
2010-01-30 10:07:34 +01:00
|
|
|
#define PLAYLIST_SUBITEM_STOP_FLAG 0x0040 /**< Must playlist stop if the item gets subitems ?*/
|
2004-11-06 12:17:46 +01:00
|
|
|
|
2006-11-12 00:37:25 +01:00
|
|
|
/** Playlist status */
|
2006-05-14 20:29:00 +02:00
|
|
|
typedef enum
|
|
|
|
{ PLAYLIST_STOPPED,PLAYLIST_RUNNING,PLAYLIST_PAUSED } playlist_status_t;
|
2003-08-14 15:02:55 +02:00
|
|
|
|
2006-06-14 22:09:51 +02:00
|
|
|
/** Structure containing information about the playlist */
|
2002-07-20 20:01:43 +02:00
|
|
|
struct playlist_t
|
2001-02-08 05:43:28 +01:00
|
|
|
{
|
* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly
do what remains to be fixed during the weekend.
Changes in vlc:
===============
* vlc is now a very small program (20 lines) which uses the libvlc API;
it is quite simple for the moment but can be extended in the future.
* interfaces, decoders, video outputs, etc. are now almost the same
objects (yes, I know, this is C++ redone in C) and are structured in
a tree. More about this later, but basically it allows the following
nice features:
- several interfaces
- several playlists with several outputs
- input plugins spawning helper interfaces (will be used for DVD menus)
- anything spawning anything; I swear there are useful uses for this!
* libvlc can be used in other programs; I'm currently writing a Mozilla
plugin for my employer.
Things currently broken:
========================
* most interfaces, most ports
* the playlist handling (almost finished rewriting this though). This means
no file can be played from the GUI, you need to use the commandline. This
also means it segfaults at EOF, when exiting the program, and it sometimes
refuses to open a file when asked to.
2002-06-01 14:32:02 +02:00
|
|
|
VLC_COMMON_MEMBERS
|
2007-10-11 01:04:09 +02:00
|
|
|
|
2006-10-21 13:09:51 +02:00
|
|
|
playlist_item_array_t items; /**< Arrays of items */
|
|
|
|
playlist_item_array_t all_items; /**< Array of items and nodes */
|
|
|
|
|
|
|
|
playlist_item_array_t current; /**< Items currently being played */
|
|
|
|
int i_current_index; /**< Index in current array */
|
2006-09-02 18:59:50 +02:00
|
|
|
|
2006-06-14 22:09:51 +02:00
|
|
|
/* Predefined items */
|
2010-02-02 03:56:10 +01:00
|
|
|
playlist_item_t * p_root;
|
|
|
|
playlist_item_t * p_playing;
|
|
|
|
playlist_item_t * p_media_library;
|
|
|
|
|
|
|
|
//Phony ones, point to those above;
|
2006-11-19 14:20:02 +01:00
|
|
|
playlist_item_t * p_root_category; /**< Root of category tree */
|
|
|
|
playlist_item_t * p_root_onelevel; /**< Root of onelevel tree */
|
2006-05-14 20:29:00 +02:00
|
|
|
playlist_item_t * p_local_category; /** < "Playlist" in CATEGORY view */
|
|
|
|
playlist_item_t * p_ml_category; /** < "Library" in CATEGORY view */
|
|
|
|
playlist_item_t * p_local_onelevel; /** < "Playlist" in ONELEVEL view */
|
2007-08-04 18:16:44 +02:00
|
|
|
playlist_item_t * p_ml_onelevel; /** < "Library" in ONELEVEL view */
|
* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly
do what remains to be fixed during the weekend.
Changes in vlc:
===============
* vlc is now a very small program (20 lines) which uses the libvlc API;
it is quite simple for the moment but can be extended in the future.
* interfaces, decoders, video outputs, etc. are now almost the same
objects (yes, I know, this is C++ redone in C) and are structured in
a tree. More about this later, but basically it allows the following
nice features:
- several interfaces
- several playlists with several outputs
- input plugins spawning helper interfaces (will be used for DVD menus)
- anything spawning anything; I swear there are useful uses for this!
* libvlc can be used in other programs; I'm currently writing a Mozilla
plugin for my employer.
Things currently broken:
========================
* most interfaces, most ports
* the playlist handling (almost finished rewriting this though). This means
no file can be played from the GUI, you need to use the commandline. This
also means it segfaults at EOF, when exiting the program, and it sometimes
refuses to open a file when asked to.
2002-06-01 14:32:02 +02:00
|
|
|
};
|
2001-02-08 05:43:28 +01:00
|
|
|
|
2006-11-12 00:37:25 +01:00
|
|
|
/** Helper to add an item */
|
2004-11-14 00:06:53 +01:00
|
|
|
struct playlist_add_t
|
|
|
|
{
|
2009-02-16 22:46:16 +01:00
|
|
|
int i_node; /**< Playist id of the parent node */
|
|
|
|
int i_item; /**< Playist id of the playlist_item_t */
|
2004-11-14 00:06:53 +01:00
|
|
|
};
|
|
|
|
|
2009-05-30 00:14:24 +02:00
|
|
|
/* A bit of macro magic to generate an enum out of the following list,
|
|
|
|
* and later, to generate a list of static functions out of the same list.
|
|
|
|
* There is also SORT_RANDOM, which is always last and handled specially.
|
|
|
|
*/
|
|
|
|
#define VLC_DEFINE_SORT_FUNCTIONS \
|
|
|
|
DEF( SORT_ID )\
|
|
|
|
DEF( SORT_TITLE )\
|
|
|
|
DEF( SORT_TITLE_NODES_FIRST )\
|
|
|
|
DEF( SORT_ARTIST )\
|
|
|
|
DEF( SORT_GENRE )\
|
|
|
|
DEF( SORT_DURATION )\
|
|
|
|
DEF( SORT_TITLE_NUMERIC )\
|
|
|
|
DEF( SORT_ALBUM )\
|
|
|
|
DEF( SORT_TRACK_NUMBER )\
|
|
|
|
DEF( SORT_DESCRIPTION )\
|
|
|
|
DEF( SORT_RATING )\
|
|
|
|
DEF( SORT_URI )
|
|
|
|
|
|
|
|
#define DEF( s ) s,
|
2008-12-22 10:21:28 +01:00
|
|
|
enum
|
|
|
|
{
|
2009-05-30 00:14:24 +02:00
|
|
|
VLC_DEFINE_SORT_FUNCTIONS
|
|
|
|
SORT_RANDOM,
|
|
|
|
NUM_SORT_FNS=SORT_RANDOM
|
2008-12-22 10:21:28 +01:00
|
|
|
};
|
2009-05-30 00:14:24 +02:00
|
|
|
#undef DEF
|
|
|
|
#ifndef VLC_INTERNAL_PLAYLIST_SORT_FUNCTIONS
|
|
|
|
#undef VLC_DEFINE_SORT_FUNCTIONS
|
|
|
|
#endif
|
|
|
|
|
2008-12-22 10:21:28 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
ORDER_NORMAL = 0,
|
|
|
|
ORDER_REVERSE = 1,
|
|
|
|
};
|
2003-09-08 14:02:16 +02:00
|
|
|
|
2008-05-31 20:27:28 +02:00
|
|
|
/* Used by playlist_Import */
|
|
|
|
#define PLAYLIST_INSERT 0x0001
|
|
|
|
#define PLAYLIST_APPEND 0x0002
|
|
|
|
#define PLAYLIST_GO 0x0004
|
|
|
|
#define PLAYLIST_PREPARSE 0x0008
|
|
|
|
#define PLAYLIST_SPREPARSE 0x0010
|
|
|
|
#define PLAYLIST_NO_REBUILD 0x0020
|
|
|
|
|
|
|
|
#define PLAYLIST_END -666
|
|
|
|
|
2008-07-15 13:48:57 +02:00
|
|
|
enum pl_locked_state
|
|
|
|
{
|
|
|
|
pl_Locked = true,
|
|
|
|
pl_Unlocked = false
|
|
|
|
};
|
|
|
|
|
2001-02-09 00:40:26 +01:00
|
|
|
/*****************************************************************************
|
|
|
|
* Prototypes
|
|
|
|
*****************************************************************************/
|
2004-11-06 12:17:46 +01:00
|
|
|
|
2006-05-14 20:29:00 +02:00
|
|
|
/* Helpers */
|
2009-01-17 18:19:51 +01:00
|
|
|
#define PL_LOCK playlist_Lock( p_playlist )
|
|
|
|
#define PL_UNLOCK playlist_Unlock( p_playlist )
|
|
|
|
#define PL_ASSERT_LOCKED playlist_AssertLocked( p_playlist )
|
2006-05-14 20:29:00 +02:00
|
|
|
|
2010-08-01 22:29:29 +02:00
|
|
|
VLC_EXPORT( playlist_t *, pl_Get, ( vlc_object_t * ) LIBVLC_USED );
|
2010-02-09 20:18:40 +01:00
|
|
|
#define pl_Get( a ) pl_Get( VLC_OBJECT(a) )
|
2006-09-16 00:10:37 +02:00
|
|
|
|
2004-11-06 12:17:46 +01:00
|
|
|
/* Playlist control */
|
2008-07-15 19:41:43 +02:00
|
|
|
#define playlist_Play(p) playlist_Control(p,PLAYLIST_PLAY, pl_Unlocked )
|
|
|
|
#define playlist_Pause(p) playlist_Control(p,PLAYLIST_PAUSE, pl_Unlocked )
|
|
|
|
#define playlist_Stop(p) playlist_Control(p,PLAYLIST_STOP, pl_Unlocked )
|
|
|
|
#define playlist_Next(p) playlist_Control(p,PLAYLIST_SKIP, pl_Unlocked, 1)
|
|
|
|
#define playlist_Prev(p) playlist_Control(p,PLAYLIST_SKIP, pl_Unlocked, -1)
|
2008-12-22 10:21:28 +01:00
|
|
|
#define playlist_Skip(p,i) playlist_Control(p,PLAYLIST_SKIP, pl_Unlocked, (i) )
|
2004-01-05 13:59:43 +01:00
|
|
|
|
2009-01-17 18:19:51 +01:00
|
|
|
VLC_EXPORT( void, playlist_Lock, ( playlist_t * ) );
|
|
|
|
VLC_EXPORT( void, playlist_Unlock, ( playlist_t * ) );
|
|
|
|
VLC_EXPORT( void, playlist_AssertLocked, ( playlist_t * ) );
|
|
|
|
|
2006-11-19 15:37:04 +01:00
|
|
|
/**
|
|
|
|
* Do a playlist action.
|
|
|
|
* If there is something in the playlist then you can do playlist actions.
|
|
|
|
* Possible queries are listed in vlc_common.h
|
|
|
|
* \param p_playlist the playlist to do the command on
|
|
|
|
* \param i_query the command to do
|
|
|
|
* \param b_locked TRUE if playlist is locked when entering this function
|
|
|
|
* \param variable number of arguments
|
|
|
|
* \return VLC_SUCCESS or an error
|
|
|
|
*/
|
2008-04-14 00:08:29 +02:00
|
|
|
VLC_EXPORT( int, playlist_Control, ( playlist_t *p_playlist, int i_query, bool b_locked, ... ) );
|
2004-11-06 12:17:46 +01:00
|
|
|
|
2008-07-05 15:10:03 +02:00
|
|
|
/** Get current playing input. The object is retained.
|
|
|
|
*/
|
2010-08-01 22:29:29 +02:00
|
|
|
VLC_EXPORT( input_thread_t *, playlist_CurrentInput, ( playlist_t *p_playlist ) LIBVLC_USED );
|
2008-07-05 15:10:03 +02:00
|
|
|
|
2006-11-19 15:37:04 +01:00
|
|
|
/** Clear the playlist
|
|
|
|
* \param b_locked TRUE if playlist is locked when entering this function
|
|
|
|
*/
|
2008-04-14 00:08:29 +02:00
|
|
|
VLC_EXPORT( void, playlist_Clear, ( playlist_t *, bool ) );
|
* ALL: the first libvlc commit.
As for video output 4, this breaks almost everything, but I'll slowly
do what remains to be fixed during the weekend.
Changes in vlc:
===============
* vlc is now a very small program (20 lines) which uses the libvlc API;
it is quite simple for the moment but can be extended in the future.
* interfaces, decoders, video outputs, etc. are now almost the same
objects (yes, I know, this is C++ redone in C) and are structured in
a tree. More about this later, but basically it allows the following
nice features:
- several interfaces
- several playlists with several outputs
- input plugins spawning helper interfaces (will be used for DVD menus)
- anything spawning anything; I swear there are useful uses for this!
* libvlc can be used in other programs; I'm currently writing a Mozilla
plugin for my employer.
Things currently broken:
========================
* most interfaces, most ports
* the playlist handling (almost finished rewriting this though). This means
no file can be played from the GUI, you need to use the commandline. This
also means it segfaults at EOF, when exiting the program, and it sometimes
refuses to open a file when asked to.
2002-06-01 14:32:02 +02:00
|
|
|
|
2006-11-19 15:37:04 +01:00
|
|
|
/** Enqueue an input item for preparsing */
|
2010-02-09 18:08:13 +01:00
|
|
|
VLC_EXPORT( int, playlist_PreparseEnqueue, (playlist_t *, input_item_t * ) );
|
2006-11-19 15:37:04 +01:00
|
|
|
|
|
|
|
/** Request the art for an input item to be fetched */
|
2010-02-09 18:08:13 +01:00
|
|
|
VLC_EXPORT( int, playlist_AskForArtEnqueue, (playlist_t *, input_item_t * ) );
|
2004-01-05 13:59:43 +01:00
|
|
|
|
2006-08-11 15:32:42 +02:00
|
|
|
/* Playlist sorting */
|
|
|
|
VLC_EXPORT( int, playlist_TreeMove, ( playlist_t *, playlist_item_t *, playlist_item_t *, int ) );
|
2009-08-18 12:13:28 +02:00
|
|
|
VLC_EXPORT( int, playlist_TreeMoveMany, ( playlist_t *, int, playlist_item_t **, playlist_item_t *, int ) );
|
2006-08-11 15:32:42 +02:00
|
|
|
VLC_EXPORT( int, playlist_RecursiveNodeSort, ( playlist_t *, playlist_item_t *,int, int ) );
|
|
|
|
|
2010-08-01 22:29:29 +02:00
|
|
|
VLC_EXPORT( playlist_item_t *, playlist_CurrentPlayingItem, ( playlist_t * ) LIBVLC_USED );
|
2008-09-27 19:12:07 +02:00
|
|
|
VLC_EXPORT( int, playlist_Status, ( playlist_t * ) );
|
|
|
|
|
2006-11-19 15:37:04 +01:00
|
|
|
/**
|
|
|
|
* Export a node of the playlist to a certain type of playlistfile
|
|
|
|
* \param p_playlist the playlist to export
|
|
|
|
* \param psz_filename the location where the exported file will be saved
|
|
|
|
* \param p_export_root the root node to export
|
|
|
|
* \param psz_type the type of playlist file to create (m3u, pls, ..)
|
|
|
|
* \return VLC_SUCCESS on success
|
|
|
|
*/
|
|
|
|
VLC_EXPORT( int, playlist_Export, ( playlist_t *p_playlist, const char *psz_name, playlist_item_t *p_export_root, const char *psz_type ) );
|
2006-08-11 15:32:42 +02:00
|
|
|
|
2008-12-22 10:21:28 +01:00
|
|
|
/**
|
|
|
|
* Open a playlist file, add its content to the current playlist
|
|
|
|
*/
|
|
|
|
VLC_EXPORT( int, playlist_Import, ( playlist_t *p_playlist, const char *psz_file ) );
|
|
|
|
|
2008-09-27 19:12:07 +02:00
|
|
|
/********************** Services discovery ***********************/
|
|
|
|
|
|
|
|
/** Add a list of comma-separated service discovery modules */
|
|
|
|
VLC_EXPORT( int, playlist_ServicesDiscoveryAdd, (playlist_t *, const char *));
|
|
|
|
/** Remove a services discovery module by name */
|
|
|
|
VLC_EXPORT( int, playlist_ServicesDiscoveryRemove, (playlist_t *, const char *));
|
|
|
|
/** Check whether a given SD is loaded */
|
|
|
|
VLC_EXPORT( bool, playlist_IsServicesDiscoveryLoaded, ( playlist_t *,const char *));
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-08-11 15:32:42 +02:00
|
|
|
/********************************************************
|
|
|
|
* Item management
|
|
|
|
********************************************************/
|
|
|
|
|
|
|
|
/*************************** Item deletion **************************/
|
2009-05-16 13:43:41 +02:00
|
|
|
VLC_EXPORT( int, playlist_DeleteFromInput, ( playlist_t *, input_item_t *, bool ) );
|
2006-05-14 20:29:00 +02:00
|
|
|
|
2006-08-11 15:32:42 +02:00
|
|
|
/******************** Item addition ********************/
|
2008-04-14 00:08:29 +02:00
|
|
|
VLC_EXPORT( int, playlist_Add, ( playlist_t *, const char *, const char *, int, int, bool, bool ) );
|
2009-01-18 15:11:13 +01:00
|
|
|
VLC_EXPORT( int, playlist_AddExt, ( playlist_t *, const char *, const char *, int, int, mtime_t, int, const char *const *, unsigned, bool, bool ) );
|
2008-04-14 00:08:29 +02:00
|
|
|
VLC_EXPORT( int, playlist_AddInput, ( playlist_t *, input_item_t *, int, int, bool, bool ) );
|
2010-02-02 10:25:28 +01:00
|
|
|
VLC_EXPORT( playlist_item_t *, playlist_NodeAddInput, ( playlist_t *, input_item_t *, playlist_item_t *, int, int, bool ) );
|
2010-03-11 19:26:53 +01:00
|
|
|
VLC_EXPORT( int, playlist_NodeAddCopy, ( playlist_t *, playlist_item_t *, playlist_item_t *, int ) );
|
2006-05-14 20:29:00 +02:00
|
|
|
|
2006-08-11 15:32:42 +02:00
|
|
|
/********************************** Item search *************************/
|
2010-08-01 22:29:29 +02:00
|
|
|
VLC_EXPORT( playlist_item_t *, playlist_ItemGetById, (playlist_t *, int ) LIBVLC_USED );
|
|
|
|
VLC_EXPORT( playlist_item_t *, playlist_ItemGetByInput, (playlist_t *,input_item_t * ) LIBVLC_USED );
|
2006-05-14 20:29:00 +02:00
|
|
|
|
2010-02-12 11:42:12 +01:00
|
|
|
VLC_EXPORT( int, playlist_LiveSearchUpdate, (playlist_t *, playlist_item_t *, const char *, bool ) );
|
2004-01-05 13:59:43 +01:00
|
|
|
|
2006-08-11 15:32:42 +02:00
|
|
|
/********************************************************
|
|
|
|
* Tree management
|
|
|
|
********************************************************/
|
|
|
|
/* Node management */
|
2010-03-11 19:26:53 +01:00
|
|
|
VLC_EXPORT( playlist_item_t *, playlist_NodeCreate, ( playlist_t *, const char *, playlist_item_t * p_parent, int i_pos, int i_flags, input_item_t * ) );
|
2006-08-11 15:32:42 +02:00
|
|
|
VLC_EXPORT( int, playlist_NodeAppend, (playlist_t *,playlist_item_t*,playlist_item_t *) );
|
|
|
|
VLC_EXPORT( int, playlist_NodeInsert, (playlist_t *,playlist_item_t*,playlist_item_t *, int) );
|
|
|
|
VLC_EXPORT( int, playlist_NodeRemoveItem, (playlist_t *,playlist_item_t*,playlist_item_t *) );
|
2010-08-01 22:29:29 +02:00
|
|
|
VLC_EXPORT( playlist_item_t *, playlist_ChildSearchName, (playlist_item_t*, const char* ) LIBVLC_USED );
|
2008-04-14 00:08:29 +02:00
|
|
|
VLC_EXPORT( int, playlist_NodeDelete, ( playlist_t *, playlist_item_t *, bool , bool ) );
|
2009-02-16 20:50:31 +01:00
|
|
|
|
2010-08-01 22:29:29 +02:00
|
|
|
VLC_EXPORT( playlist_item_t *, playlist_GetNextLeaf, ( playlist_t *p_playlist, playlist_item_t *p_root, playlist_item_t *p_item, bool b_ena, bool b_unplayed ) LIBVLC_USED );
|
|
|
|
VLC_EXPORT( playlist_item_t *, playlist_GetPrevLeaf, ( playlist_t *p_playlist, playlist_item_t *p_root, playlist_item_t *p_item, bool b_ena, bool b_unplayed ) LIBVLC_USED );
|
2006-08-11 15:32:42 +02:00
|
|
|
|
2004-11-06 12:17:46 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* Inline functions
|
|
|
|
***********************************************************************/
|
2008-07-13 12:50:12 +02:00
|
|
|
/** Small helper tp get current playing input or NULL. Release the input after use. */
|
|
|
|
#define pl_CurrentInput(a) __pl_CurrentInput( VLC_OBJECT(a) )
|
|
|
|
static inline input_thread_t * __pl_CurrentInput( vlc_object_t * p_this )
|
|
|
|
{
|
2010-02-09 20:18:40 +01:00
|
|
|
return playlist_CurrentInput( pl_Get( p_this ) );
|
2008-07-13 12:50:12 +02:00
|
|
|
}
|
2008-07-05 15:10:03 +02:00
|
|
|
|
2006-05-14 20:29:00 +02:00
|
|
|
/** Tell if the playlist is empty */
|
2008-12-22 10:21:28 +01:00
|
|
|
static inline bool playlist_IsEmpty( playlist_t *p_playlist )
|
|
|
|
{
|
|
|
|
PL_ASSERT_LOCKED;
|
|
|
|
return p_playlist->items.i_size == 0;
|
|
|
|
}
|
2003-08-14 15:02:55 +02:00
|
|
|
|
2006-10-21 18:59:09 +02:00
|
|
|
/** Tell the number of items in the current playing context */
|
2008-12-22 10:21:28 +01:00
|
|
|
static inline int playlist_CurrentSize( playlist_t *p_playlist )
|
|
|
|
{
|
|
|
|
PL_ASSERT_LOCKED;
|
|
|
|
return p_playlist->current.i_size;
|
|
|
|
}
|
2006-10-21 15:33:06 +02:00
|
|
|
|
2006-11-19 14:20:02 +01:00
|
|
|
/** @} */
|
2006-11-26 15:20:34 +01:00
|
|
|
# ifdef __cplusplus
|
|
|
|
}
|
|
|
|
# endif
|
2006-05-14 20:29:00 +02:00
|
|
|
|
|
|
|
#endif
|