1 /*****************************************************************************
2 * vlc_epg.h: Electronic Program Guide
3 *****************************************************************************
4 * Copyright (C) 2007 VLC authors and VideoLAN
7 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
29 * This file defines functions and structures for storing dvb epg information
34 int64_t i_start
; /* Interpreted as a value return by time() */
35 uint32_t i_duration
; /* Duration of the event in second */
36 uint16_t i_id
; /* Unique event id withing the event set */
39 char *psz_short_description
;
40 char *psz_description
;
42 uint8_t i_rating
; /* Parental control, set to 0 when undefined */
48 uint32_t i_id
; /* Unique identifier for this table / events (partial sets) */
49 uint16_t i_source_id
;/* Channel / Program reference id this epg relates to */
51 vlc_epg_event_t
**pp_event
;
52 bool b_present
; /* Contains present/following or similar, and sets below */
53 const vlc_epg_event_t
*p_current
; /* NULL, or equal to one of the entries in pp_event */
57 * Creates a new vlc_epg_event_t*
59 * You must call vlc_epg_event_Delete to release the associated resources.
61 * \p i_id is the event unique id
62 * \p i_start start in epoch time
63 * \p i_duration event duration in seconds
65 VLC_API vlc_epg_event_t
* vlc_epg_event_New(uint16_t i_id
,
66 int64_t i_start
, uint32_t i_duration
);
69 * Releases a vlc_epg_event_t*.
71 VLC_API
void vlc_epg_event_Delete(vlc_epg_event_t
*p_event
);
74 * Returns a vlc_epg_event_t * duplicated from \p p_src.
77 VLC_API vlc_epg_event_t
* vlc_epg_event_Duplicate(const vlc_epg_event_t
*p_src
);
80 * It creates a new vlc_epg_t*
82 * You must call vlc_epg_Delete to release the associated resource.
84 * \p i_id is computed unique id depending on standard (table id, eit number)
85 * \p i_source_id is the associated program number
87 VLC_API vlc_epg_t
* vlc_epg_New(uint32_t i_id
, uint16_t i_source_id
);
90 * It releases a vlc_epg_t*.
92 VLC_API
void vlc_epg_Delete(vlc_epg_t
*p_epg
);
95 * It appends a new vlc_epg_event_t to a vlc_epg_t.
96 * Takes ownership of \p p_evt or returns false
98 * \p p_evt a vlc_epg_event_t * created with vlc_epg_event_New.
100 VLC_API
bool vlc_epg_AddEvent(vlc_epg_t
*p_epg
, vlc_epg_event_t
*p_evt
);
103 * It set the current event of a vlc_epg_t given a start time
105 VLC_API
void vlc_epg_SetCurrent(vlc_epg_t
*p_epg
, int64_t i_start
);
108 * It merges all the event of \p p_src and \p p_dst into \p p_dst.
111 VLC_API
void vlc_epg_Merge(vlc_epg_t
*p_dst
, const vlc_epg_t
*p_src
);
114 * Returns a duplicated \p p_src and its associated events.
117 VLC_API vlc_epg_t
* vlc_epg_Duplicate(const vlc_epg_t
*p_src
);