playlist.h 3.43 KB
Newer Older
sigmunau's avatar
sigmunau committed
1
2
3
/*****************************************************************************
 * playlist.h:  Playlist import module common functions
 *****************************************************************************
4
 * Copyright (C) 2004 the VideoLAN team
5
 * $Id$
sigmunau's avatar
sigmunau committed
6
 *
7
 * Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
sigmunau's avatar
sigmunau committed
8
9
10
11
12
13
14
15
16
17
18
19
20
 *
 * 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.
 *
 * 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
dionoea's avatar
dionoea committed
21
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
sigmunau's avatar
sigmunau committed
22
23
 *****************************************************************************/

24
#include <vlc_playlist.h>
25
26
char *E_(ProcessMRL)( char *, char * );
char *E_(FindPrefix)( demux_t * );
sigmunau's avatar
sigmunau committed
27

28
vlc_bool_t E_(FindItem)( demux_t *, playlist_t *, playlist_item_t **);
29

30
31
void E_(AddToPlaylist)( demux_t *, playlist_t*,input_item_t*,playlist_item_t*,int );

32
int E_(Import_Old) ( vlc_object_t * );
33

34
35
int E_(Import_Native) ( vlc_object_t * );
void E_(Close_Native) ( vlc_object_t * );
zorglub's avatar
zorglub committed
36

37
38
int E_(Import_M3U) ( vlc_object_t * );
void E_(Close_M3U) ( vlc_object_t * );
39

40
41
int E_(Import_PLS) ( vlc_object_t * );
void E_(Close_PLS) ( vlc_object_t * );
42

43
44
int E_(Import_B4S) ( vlc_object_t * );
void E_(Close_B4S) ( vlc_object_t * );
45
46
47

int E_(Import_DVB) ( vlc_object_t * );
void E_(Close_DVB) ( vlc_object_t * );
48
49
50

int E_(Import_podcast) ( vlc_object_t * );
void E_(Close_podcast) ( vlc_object_t * );
51

gbazin's avatar
gbazin committed
52
53
int E_(Import_xspf) ( vlc_object_t * );
void E_(Close_xspf) ( vlc_object_t * );
54
55
56

int E_(Import_Shoutcast) ( vlc_object_t * );
void E_(Close_Shoutcast) ( vlc_object_t * );
57

hartman's avatar
hartman committed
58
59
60
int E_(Import_ASX) ( vlc_object_t * );
void E_(Close_ASX) ( vlc_object_t * );

61
62
63
int E_(Import_SGIMB) ( vlc_object_t * );
void E_(Close_SGIMB) ( vlc_object_t * );

64
65
66
int E_(Import_QTL) ( vlc_object_t * );
void E_(Close_QTL) ( vlc_object_t * );

67
68
69
int E_(Import_GVP) ( vlc_object_t * );
void E_(Close_GVP) ( vlc_object_t * );

70
#define INIT_PLAYLIST_STUFF \
71
    playlist_t *p_playlist = pl_Yield( p_demux ); \
72
    vlc_bool_t b_play = var_CreateGetBool( p_demux, "playlist-autostart" ); \
73
74
    input_thread_t *p_input_thread = (input_thread_t *)vlc_object_find( p_demux, VLC_OBJECT_INPUT, FIND_PARENT ); \
    input_item_t *p_current_input = input_GetItem( p_input_thread ); \
75
    playlist_item_t *p_current = \
76
                 playlist_ItemGetByInput( p_playlist, p_current_input, VLC_FALSE ); \
77
    playlist_item_t *p_item_in_category = \
78
79
                            playlist_ItemToNode( p_playlist, p_current, \
                                                 VLC_TRUE ); \
80
81
82
    b_play = b_play && p_current == p_playlist->status.p_item; \
    if( p_item_in_category ) \
        p_item_in_category->p_input->i_type = ITEM_TYPE_PLAYLIST;
83
84
85

#define HANDLE_PLAY_AND_RELEASE \
    /* Go back and play the playlist */ \
86
    if( b_play && p_item_in_category ) \
87
        playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, VLC_TRUE, p_item_in_category, NULL ); \
88
    vlc_object_release( p_input_thread ); \
89
    vlc_object_release( p_playlist );
90