1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/branches/gmyth-0.1b/src/gmyth_tvchain.h Wed Feb 14 21:28:49 2007 +0000
1.3 @@ -0,0 +1,108 @@
1.4 +/**
1.5 + * GMyth Library
1.6 + *
1.7 + * @file gmyth/gmyth_tvchain.h
1.8 + *
1.9 + * @brief <p> This component contains functions for creating and accessing
1.10 + * the tvchain functions for live tv playback.
1.11 + *
1.12 + * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
1.13 + * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
1.14 + *
1.15 + *//*
1.16 + *
1.17 + * This program is free software; you can redistribute it and/or modify
1.18 + * it under the terms of the GNU Lesser General Public License as published by
1.19 + * the Free Software Foundation; either version 2 of the License, or
1.20 + * (at your option) any later version.
1.21 + *
1.22 + * This program is distributed in the hope that it will be useful,
1.23 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.24 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.25 + * GNU General Public License for more details.
1.26 + *
1.27 + * You should have received a copy of the GNU Lesser General Public License
1.28 + * along with this program; if not, write to the Free Software
1.29 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1.30 + */
1.31 +
1.32 +#ifndef LIVETVCHAIN_H_
1.33 +#define LIVETVCHAIN_H_
1.34 +
1.35 +#include <glib-object.h>
1.36 +#include <time.h>
1.37 +
1.38 +#include "gmyth_common.h"
1.39 +#include "gmyth_backendinfo.h"
1.40 +
1.41 +G_BEGIN_DECLS
1.42 +
1.43 +#define GMYTH_TVCHAIN_TYPE (gmyth_tvchain_get_type ())
1.44 +#define GMYTH_TVCHAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_TVCHAIN_TYPE, GMythTVChain))
1.45 +#define GMYTH_TVCHAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_TVCHAIN_TYPE, GMythTVChainClass))
1.46 +#define IS_GMYTH_TVCHAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_TVCHAIN_TYPE))
1.47 +#define IS_GMYTH_TVCHAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_TVCHAIN_TYPE))
1.48 +#define GMYTH_TVCHAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_TVCHAIN_TYPE, GMythTVChainClass))
1.49 +
1.50 +
1.51 +typedef struct _GMythTVChain GMythTVChain;
1.52 +typedef struct _GMythTVChainClass GMythTVChainClass;
1.53 +
1.54 +
1.55 +struct LiveTVChainEntry
1.56 +{
1.57 + GString *chanid;
1.58 +
1.59 + GTimeVal* starttime;
1.60 + GTimeVal* endtime;
1.61 +
1.62 + gboolean discontinuity; // if true, can't play smooth from last entry
1.63 + GString *hostprefix;
1.64 + GString *cardtype;
1.65 + GString *channum;
1.66 + GString *inputname;
1.67 +};
1.68 +
1.69 +
1.70 +struct _GMythTVChainClass
1.71 +{
1.72 + GObjectClass parent_class;
1.73 +
1.74 + /* callbacks */
1.75 + /* no one for now */
1.76 +};
1.77 +
1.78 +struct _GMythTVChain
1.79 +{
1.80 + GObject parent;
1.81 +
1.82 + GString *tvchain_id;
1.83 + GList *tvchain_list;
1.84 +
1.85 + GTimeVal* cur_startts;
1.86 + GString *cur_chanid;
1.87 + gint cur_pos;
1.88 +
1.89 + GMythBackendInfo *backend_info;
1.90 +};
1.91 +
1.92 +
1.93 +GType gmyth_tvchain_get_type (void);
1.94 +
1.95 +gboolean gmyth_tvchain_initialize (GMythTVChain *tvchain,
1.96 + GMythBackendInfo *backend_info);
1.97 +gboolean gmyth_tvchain_reload_all (GMythTVChain *tvchain);
1.98 +GString* gmyth_tvchain_get_id (GMythTVChain *tvchain);
1.99 +gint gmyth_tvchain_program_is_at (GMythTVChain *tvchain,
1.100 + GString *chanid, GTimeVal* startts);
1.101 +
1.102 +struct LiveTVChainEntry* gmyth_tvchain_get_entry_at (GMythTVChain *tvchain,
1.103 + gint index);
1.104 +
1.105 +GMythProgramInfo* gmyth_tvchain_entry_to_program (GMythTVChain *tvchain,
1.106 + struct LiveTVChainEntry *entry);
1.107 +GMythProgramInfo* gmyth_tvchain_get_program_at (GMythTVChain *tvchain, gint index);
1.108 +
1.109 +G_END_DECLS
1.110 +
1.111 +#endif /*LIVETVCHAIN_H_*/