2007-08-09 15:42:01 +00:00
|
|
|
|
/*
|
|
|
|
|
* tvheadend, channel functions
|
|
|
|
|
* Copyright (C) 2007 Andreas <EFBFBD>man
|
|
|
|
|
*
|
|
|
|
|
* 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 3 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, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef CHANNELS_H
|
|
|
|
|
#define CHANNELS_H
|
|
|
|
|
|
2008-09-06 19:08:10 +00:00
|
|
|
|
LIST_HEAD(channel_tag_mapping_list, channel_tag_mapping);
|
|
|
|
|
TAILQ_HEAD(channel_tag_queue, channel_tag);
|
2008-09-05 16:02:41 +00:00
|
|
|
|
|
2008-09-07 08:54:16 +00:00
|
|
|
|
extern struct channel_tag_queue channel_tags;
|
|
|
|
|
|
|
|
|
|
|
2008-09-03 16:23:39 +00:00
|
|
|
|
/*
|
|
|
|
|
* Channel definition
|
|
|
|
|
*/
|
|
|
|
|
typedef struct channel {
|
|
|
|
|
|
|
|
|
|
int ch_refcount;
|
|
|
|
|
int ch_zombie;
|
|
|
|
|
|
|
|
|
|
RB_ENTRY(channel) ch_name_link;
|
|
|
|
|
char *ch_name;
|
|
|
|
|
char *ch_sname;
|
|
|
|
|
|
|
|
|
|
RB_ENTRY(channel) ch_identifier_link;
|
|
|
|
|
int ch_id;
|
|
|
|
|
|
2010-11-29 20:06:52 +00:00
|
|
|
|
LIST_HEAD(, service) ch_services;
|
2008-09-03 16:23:39 +00:00
|
|
|
|
LIST_HEAD(, th_subscription) ch_subscriptions;
|
|
|
|
|
|
|
|
|
|
struct event_tree ch_epg_events;
|
2008-09-24 15:50:07 +00:00
|
|
|
|
struct event *ch_epg_current;
|
|
|
|
|
|
|
|
|
|
gtimer_t ch_epg_timer_head;
|
|
|
|
|
gtimer_t ch_epg_timer_current;
|
2009-10-14 21:02:39 +00:00
|
|
|
|
int ch_dvr_extra_time_pre;
|
|
|
|
|
int ch_dvr_extra_time_post;
|
2009-11-09 19:07:14 +00:00
|
|
|
|
int ch_number; // User configurable number
|
2008-09-03 16:23:39 +00:00
|
|
|
|
char *ch_icon;
|
|
|
|
|
|
2008-09-16 21:04:50 +00:00
|
|
|
|
struct dvr_entry_list ch_dvrs;
|
2008-09-03 16:23:39 +00:00
|
|
|
|
|
2008-09-23 21:16:59 +00:00
|
|
|
|
struct dvr_autorec_entry_list ch_autorecs;
|
2008-09-03 16:23:39 +00:00
|
|
|
|
|
2008-09-05 16:02:41 +00:00
|
|
|
|
struct xmltv_channel *ch_xc;
|
|
|
|
|
LIST_ENTRY(channel) ch_xc_link;
|
2008-09-03 16:23:39 +00:00
|
|
|
|
|
2008-09-06 19:08:10 +00:00
|
|
|
|
struct channel_tag_mapping_list ch_ctms;
|
|
|
|
|
|
2008-09-05 16:02:41 +00:00
|
|
|
|
} channel_t;
|
2008-09-03 16:23:39 +00:00
|
|
|
|
|
2008-09-06 19:08:10 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Channel tag
|
|
|
|
|
*/
|
|
|
|
|
typedef struct channel_tag {
|
|
|
|
|
TAILQ_ENTRY(channel_tag) ct_link;
|
|
|
|
|
int ct_enabled;
|
|
|
|
|
int ct_internal;
|
2008-09-28 08:20:30 +00:00
|
|
|
|
int ct_titled_icon;
|
2009-02-28 16:31:33 +00:00
|
|
|
|
int ct_identifier;
|
2008-09-06 19:08:10 +00:00
|
|
|
|
char *ct_name;
|
|
|
|
|
char *ct_comment;
|
2008-09-28 08:20:30 +00:00
|
|
|
|
char *ct_icon;
|
2008-09-06 19:08:10 +00:00
|
|
|
|
struct channel_tag_mapping_list ct_ctms;
|
2008-09-23 21:16:59 +00:00
|
|
|
|
|
|
|
|
|
struct dvr_autorec_entry_list ct_autorecs;
|
2008-09-06 19:08:10 +00:00
|
|
|
|
} channel_tag_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Channel tag mapping
|
|
|
|
|
*/
|
|
|
|
|
typedef struct channel_tag_mapping {
|
|
|
|
|
LIST_ENTRY(channel_tag_mapping) ctm_channel_link;
|
|
|
|
|
channel_t *ctm_channel;
|
|
|
|
|
|
|
|
|
|
LIST_ENTRY(channel_tag_mapping) ctm_tag_link;
|
|
|
|
|
channel_tag_t *ctm_tag;
|
|
|
|
|
|
2008-09-07 08:54:16 +00:00
|
|
|
|
int ctm_mark;
|
|
|
|
|
|
2008-09-06 19:08:10 +00:00
|
|
|
|
} channel_tag_mapping_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-09-05 16:02:41 +00:00
|
|
|
|
void channels_init(void);
|
2007-08-09 15:42:01 +00:00
|
|
|
|
|
2010-06-04 20:59:18 +00:00
|
|
|
|
channel_t *channel_find_by_name(const char *name, int create, int number);
|
2007-08-09 15:42:01 +00:00
|
|
|
|
|
2008-08-26 14:15:33 +00:00
|
|
|
|
channel_t *channel_find_by_identifier(int id);
|
2007-08-09 15:42:01 +00:00
|
|
|
|
|
2008-05-03 06:00:07 +00:00
|
|
|
|
void channel_set_teletext_rundown(channel_t *ch, int v);
|
2008-01-28 20:40:35 +00:00
|
|
|
|
|
2008-05-03 06:00:07 +00:00
|
|
|
|
void channel_settings_write(channel_t *ch);
|
2008-04-17 21:16:33 +00:00
|
|
|
|
|
2008-05-03 06:00:07 +00:00
|
|
|
|
int channel_rename(channel_t *ch, const char *newname);
|
2008-05-03 05:13:31 +00:00
|
|
|
|
|
2008-05-03 06:00:07 +00:00
|
|
|
|
void channel_delete(channel_t *ch);
|
2008-05-03 05:13:31 +00:00
|
|
|
|
|
2008-05-03 06:38:42 +00:00
|
|
|
|
void channel_merge(channel_t *dst, channel_t *src);
|
|
|
|
|
|
2009-10-14 21:02:39 +00:00
|
|
|
|
void channel_set_epg_postpre_time(channel_t *ch, int pre, int mins);
|
|
|
|
|
|
2009-11-09 19:07:14 +00:00
|
|
|
|
void channel_set_number(channel_t *ch, int number);
|
|
|
|
|
|
2008-08-25 20:37:19 +00:00
|
|
|
|
void channel_set_icon(channel_t *ch, const char *icon);
|
|
|
|
|
|
2008-09-05 16:02:41 +00:00
|
|
|
|
struct xmltv_channel;
|
|
|
|
|
void channel_set_xmltv_source(channel_t *ch, struct xmltv_channel *xc);
|
|
|
|
|
|
2008-09-07 08:54:16 +00:00
|
|
|
|
void channel_set_tags_from_list(channel_t *ch, const char *maplist);
|
|
|
|
|
|
2009-08-26 20:34:13 +00:00
|
|
|
|
channel_tag_t *channel_tag_find_by_name(const char *name, int create);
|
|
|
|
|
|
2009-11-28 13:09:20 +00:00
|
|
|
|
channel_tag_t *channel_tag_find_by_identifier(uint32_t id);
|
|
|
|
|
|
2009-08-26 20:34:13 +00:00
|
|
|
|
int channel_tag_map(channel_t *ch, channel_tag_t *ct, int check);
|
|
|
|
|
|
|
|
|
|
void channel_save(channel_t *ch);
|
2008-09-08 22:17:37 +00:00
|
|
|
|
|
2008-09-05 16:02:41 +00:00
|
|
|
|
extern struct channel_list channels_not_xmltv_mapped;
|
|
|
|
|
|
2007-08-09 15:42:01 +00:00
|
|
|
|
#endif /* CHANNELS_H */
|