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.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2006-01-13 00:10:04 +01:00
|
|
|
* 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
|
|
|
|
2006-10-21 13:09:51 +02: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.
|
|
|
|
*
|
|
|
|
* In the playlist itself, there are two trees, that should always be kept
|
|
|
|
* in sync. The "category" tree contains the whole tree structure with
|
|
|
|
* several levels, while the onelevel tree contains only one level :), ie
|
|
|
|
* it only contains "real" items, not nodes
|
|
|
|
* For example, if you open a directory, you will have
|
2006-11-19 15:04:06 +01:00
|
|
|
*\verbatim
|
2007-08-04 18:13:39 +02:00
|
|
|
* Category tree: Onelevel tree:
|
2006-11-19 14:20:02 +01:00
|
|
|
* Playlist Playlist
|
|
|
|
* - Dir - item1
|
|
|
|
* - Subdir - item2
|
|
|
|
* - item1
|
|
|
|
* - item2
|
2006-11-19 15:04:06 +01:00
|
|
|
*\endverbatim
|
2006-11-19 14:20:02 +01:00
|
|
|
* The top-level items of both tree are the same, and they are reproduced
|
|
|
|
* in the left-part of the playlist GUIs, they are the "sources" from the
|
|
|
|
* source selectors. Top-level items include: playlist, media library, SAP,
|
|
|
|
* Shoutcast, devices, ...
|
|
|
|
*
|
|
|
|
* 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 = ...
|
|
|
|
*
|
2007-08-04 18:13:39 +02:00
|
|
|
* Category tree Onelevel tree
|
2006-11-19 14:20:02 +01:00
|
|
|
* - playlist (id 1) - playlist (id 3)
|
|
|
|
* - category 1 (id 2) - foo 2 (id 8 - input 2)
|
|
|
|
* - foo 2 (id 6 - input 2) - media library (id 4)
|
|
|
|
* - media library (id 2) - foo 1 (id6 - input 1)
|
|
|
|
* - foo 1 (id 5 - input 1)
|
2006-11-19 15:04:06 +01:00
|
|
|
* \endverbatim
|
2006-11-19 14:20:02 +01:00
|
|
|
* Sometimes, an item must be transformed to a node. This happens for the
|
|
|
|
* directory access for example. In that case, the item is removed from
|
|
|
|
* the onelevel tree, as it is not a real item anymore.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* If you want more control (like, adding the item as the child of a given
|
|
|
|
* node in the category tree, use playlist_BothAddInput. You'll have to provide
|
|
|
|
* the node in the category tree. The item will be added as a child of
|
|
|
|
* this node in the category tree, and as a child of the matching top-level
|
|
|
|
* node in the onelevel tree. (Nodes are created with playlist_NodeCreate)
|
|
|
|
*
|
|
|
|
* Generally speaking, playlist_NodeAddInput should not be used in newer code, it
|
|
|
|
* will maybe become useful again when we merge VLM;
|
|
|
|
*
|
|
|
|
* To delete an item, use playlist_DeleteFromInput( input_id ) which will
|
2008-03-21 22:25:30 +01:00
|
|
|
* remove all occurrences of the input in both trees
|
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
|
|
|
*
|
2009-02-16 21:33:43 +01:00
|
|
|
* - "item-change": It will contains the input_item_t->i_id of a changed input
|
|
|
|
* item monitored by the playlist.
|
2009-02-16 22:24:38 +01:00
|
|
|
* * - "item-current": It will contains a input_item_t->i_id of the current
|
|
|
|
* item being played.
|
|
|
|
*
|
2009-02-16 22:30:58 +01:00
|
|
|
* - "playlist-item-append": It will contains a pointer to a playlist_add_t.
|
|
|
|
* - "playlist-item-deleted": It will contains the playlist_item_t->i_id of a deleted
|
2009-02-16 22:05:02 +01:00
|
|
|
* playlist_item_t.
|
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 */
|
2004-01-11 01:45:06 +01:00
|
|
|
struct playlist_export_t
|
|
|
|
{
|
|
|
|
char *psz_filename;
|
|
|
|
FILE *p_file;
|
2006-05-14 20:29:00 +02:00
|
|
|
playlist_item_t *p_root;
|
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 */
|
|
|
|
int i_children;
|
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 */
|
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 */
|
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 */
|
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
|
|
|
};
|
|
|
|
|
2008-12-22 10:21:28 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
SORT_ID = 0,
|
|
|
|
SORT_TITLE = 1,
|
|
|
|
SORT_TITLE_NODES_FIRST = 2,
|
|
|
|
SORT_ARTIST = 3,
|
|
|
|
SORT_GENRE = 4,
|
|
|
|
SORT_RANDOM = 5,
|
|
|
|
SORT_DURATION = 6,
|
|
|
|
SORT_TITLE_NUMERIC = 7,
|
|
|
|
SORT_ALBUM = 8,
|
|
|
|
SORT_TRACK_NUMBER = 9,
|
|
|
|
SORT_DESCRIPTION = 10,
|
|
|
|
SORT_RATING = 11,
|
|
|
|
SORT_URI = 12,
|
|
|
|
};
|
|
|
|
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
|
|
|
|
2008-09-20 19:41:42 +02:00
|
|
|
VLC_EXPORT( playlist_t *, __pl_Hold, ( vlc_object_t * ) );
|
|
|
|
#define pl_Hold( a ) __pl_Hold( VLC_OBJECT(a) )
|
2007-09-16 17:29:04 +02:00
|
|
|
|
|
|
|
VLC_EXPORT( void, __pl_Release, ( vlc_object_t * ) );
|
2007-12-06 17:26:46 +01:00
|
|
|
#define pl_Release(a) __pl_Release( 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.
|
|
|
|
*/
|
|
|
|
VLC_EXPORT( input_thread_t *, playlist_CurrentInput, ( playlist_t *p_playlist ) );
|
|
|
|
|
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 */
|
2008-12-23 16:26:51 +01:00
|
|
|
VLC_EXPORT( int, playlist_PreparseEnqueue, (playlist_t *, input_item_t *, bool b_locked ) );
|
2006-11-19 15:37:04 +01:00
|
|
|
|
|
|
|
/** Request the art for an input item to be fetched */
|
2008-12-23 16:26:51 +01:00
|
|
|
VLC_EXPORT( int, playlist_AskForArtEnqueue, (playlist_t *, input_item_t *, bool b_locked ) );
|
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 ) );
|
|
|
|
VLC_EXPORT( int, playlist_RecursiveNodeSort, ( playlist_t *, playlist_item_t *,int, int ) );
|
|
|
|
|
2008-12-22 10:21:28 +01:00
|
|
|
VLC_EXPORT( playlist_item_t *, playlist_CurrentPlayingItem, ( playlist_t * ) );
|
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 **************************/
|
2008-04-14 00:08:29 +02:00
|
|
|
VLC_EXPORT( int, playlist_DeleteFromInput, ( playlist_t *, int, 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 ) );
|
|
|
|
VLC_EXPORT( int, playlist_BothAddInput, ( playlist_t *, input_item_t *,playlist_item_t *,int , int, int*, int*, bool ) );
|
2006-05-14 20:29:00 +02:00
|
|
|
|
2006-08-11 15:32:42 +02:00
|
|
|
/********************************** Item search *************************/
|
2009-02-11 15:29:51 +01:00
|
|
|
VLC_EXPORT( playlist_item_t *, playlist_ItemGetById, (playlist_t *, int ) );
|
2009-02-11 15:50:00 +01:00
|
|
|
VLC_EXPORT( playlist_item_t *, playlist_ItemGetByInput, (playlist_t *,input_item_t * ) );
|
2006-05-14 20:29:00 +02:00
|
|
|
|
|
|
|
VLC_EXPORT( int, playlist_LiveSearchUpdate, (playlist_t *, playlist_item_t *, const char *) );
|
2004-01-05 13:59:43 +01:00
|
|
|
|
2006-08-11 15:32:42 +02:00
|
|
|
/********************************************************
|
|
|
|
* Tree management
|
|
|
|
********************************************************/
|
|
|
|
/* Node management */
|
2007-10-18 17:34:01 +02:00
|
|
|
VLC_EXPORT( playlist_item_t *, playlist_NodeCreate, ( playlist_t *, const char *, playlist_item_t * p_parent, 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 *) );
|
|
|
|
VLC_EXPORT( playlist_item_t *, playlist_ChildSearchName, (playlist_item_t*, const char* ) );
|
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
|
|
|
|
2006-08-26 18:51:55 +02:00
|
|
|
VLC_EXPORT( playlist_item_t *, playlist_GetPreferredNode, ( playlist_t *p_playlist, playlist_item_t *p_node ) );
|
2008-04-14 00:08: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 ) );
|
|
|
|
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 ) );
|
2007-03-08 01:04:54 +01:00
|
|
|
VLC_EXPORT( playlist_item_t *, playlist_GetLastLeaf, ( playlist_t *p_playlist, playlist_item_t *p_root ) );
|
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 )
|
|
|
|
{
|
2008-09-20 19:41:42 +02:00
|
|
|
playlist_t * p_playlist = pl_Hold( p_this );
|
2008-07-13 12:50:12 +02:00
|
|
|
if( !p_playlist ) return NULL;
|
|
|
|
input_thread_t * p_input = playlist_CurrentInput( p_playlist );
|
|
|
|
pl_Release( p_this );
|
|
|
|
return p_input;
|
|
|
|
}
|
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
|