vlc_epg.h 2.94 KB
Newer Older
1 2 3
/*****************************************************************************
 * vlc_epg.h: Electronic Program Guide
 *****************************************************************************
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
4
 * Copyright (C) 2007 VLC authors and VideoLAN
5
 * $Id$
6 7 8
 *
 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
 *
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
9 10 11
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
12 13 14 15
 * (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
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
16 17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
18
 *
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
19 20 21
 * You should have received a copy of the GNU Lesser 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.
22 23
 *****************************************************************************/

24 25
#ifndef VLC_EPG_H
#define VLC_EPG_H 1
26

27 28 29 30 31
/**
 * \file
 * This file defines functions and structures for storing dvb epg information
 */

32 33
typedef struct
{
34 35
    int64_t i_start;    /* Interpreted as a value return by time() */
    int     i_duration;    /* Duration of the event in second */
36

37 38 39
    char    *psz_name;
    char    *psz_short_description;
    char    *psz_description;
40

41
    uint8_t i_rating;   /* Parental control, set to 0 when undefined */
42 43 44 45 46 47 48
} vlc_epg_event_t;

typedef struct
{
    char            *psz_name;
    vlc_epg_event_t *p_current; /* Can be null or should be the same than one of pp_event entry */

49 50
    int             i_event;
    vlc_epg_event_t **pp_event;
51 52
} vlc_epg_t;

53 54 55 56 57
/**
 * It initializes a vlc_epg_t.
 *
 * You must call vlc_epg_Clean to release the associated resource.
 */
58
VLC_API void vlc_epg_Init(vlc_epg_t *p_epg, const char *psz_name);
59

60 61 62
/**
 * It releases all resources associated to a vlc_epg_t
 */
63
VLC_API void vlc_epg_Clean(vlc_epg_t *p_epg);
64

65 66 67 68 69
/**
 * It creates and appends a new vlc_epg_event_t to a vlc_epg_t.
 *
 * \see vlc_epg_t for the definitions of the parameters.
 */
70
VLC_API void vlc_epg_AddEvent(vlc_epg_t *p_epg, int64_t i_start, int i_duration, const char *psz_name, const char *psz_short_description, const char *psz_description, uint8_t i_rating );
71

72 73 74 75 76
/**
 * It creates a new vlc_epg_t*
 *
 * You must call vlc_epg_Delete to release the associated resource.
 */
77
VLC_API vlc_epg_t * vlc_epg_New(const char *psz_name) VLC_USED;
78 79 80 81

/**
 * It releases a vlc_epg_t*.
 */
82
VLC_API void vlc_epg_Delete(vlc_epg_t *p_epg);
83 84 85 86

/**
 * It set the current event of a vlc_epg_t given a start time
 */
87
VLC_API void vlc_epg_SetCurrent(vlc_epg_t *p_epg, int64_t i_start);
88 89 90 91 92 93

/**
 * It merges all the event of \p p_src and \p p_dst into \p p_dst.
 *
 * \p p_src is not modified.
 */
94
VLC_API void vlc_epg_Merge(vlc_epg_t *p_dst, const vlc_epg_t *p_src);
95 96 97

#endif