gmyth/src/libgmyth/gmyth_tvchain.h
author leo_sobral
Thu Sep 21 00:33:03 2006 +0100 (2006-09-21)
branchtrunk
changeset 6 051875c9e136
parent 1 ffdf467315ec
permissions -rw-r--r--
[svn r7] Corrected glib macros G_BEGIN_DECLS, G_END_DECLS usage (andrunko's patch)
     1 /**
     2  * GMyth Library
     3  *
     4  * @file gmyth/gmyth_tvchain.h
     5  * 
     6  * @brief <p> This component contains functions for creating and accessing
     7  * the tvchain functions for live tv playback.
     8  * 
     9  * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    10  * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
    11  *
    12  *//*
    13  * 
    14  * This program is free software; you can redistribute it and/or modify
    15  * it under the terms of the GNU Lesser General Public License as published by
    16  * the Free Software Foundation; either version 2 of the License, or
    17  * (at your option) any later version.
    18  *
    19  * This program is distributed in the hope that it will be useful,
    20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    22  * GNU General Public License for more details.
    23  *
    24  * You should have received a copy of the GNU Lesser General Public License
    25  * along with this program; if not, write to the Free Software
    26  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    27  */
    28 
    29 #ifndef LIVETVCHAIN_H_
    30 #define LIVETVCHAIN_H_
    31 
    32 #include <glib-object.h>
    33 #include <time.h>
    34 
    35 #include "gmyth_common.h"
    36 
    37 G_BEGIN_DECLS
    38 
    39 #define GMYTH_TVCHAIN_TYPE               (gmyth_tvchain_get_type ())
    40 #define GMYTH_TVCHAIN(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_TVCHAIN_TYPE, GMythTVChain))
    41 #define GMYTH_TVCHAIN_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_TVCHAIN_TYPE, GMythTVChainClass))
    42 #define IS_GMYTH_TVCHAIN(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_TVCHAIN_TYPE))
    43 #define IS_GMYTH_TVCHAIN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_TVCHAIN_TYPE))
    44 #define GMYTH_TVCHAIN_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_TVCHAIN_TYPE, GMythTVChainClass))
    45 
    46 
    47 typedef struct _GMythTVChain         GMythTVChain;
    48 typedef struct _GMythTVChainClass    GMythTVChainClass;
    49 
    50 
    51 struct LiveTVChainEntry
    52 {
    53     GString *chanid;
    54 
    55     time_t starttime;
    56     time_t endtime;
    57     
    58     gboolean discontinuity; // if true, can't play smooth from last entry
    59     GString *hostprefix;
    60     GString *cardtype;
    61     GString *channum;
    62     GString *inputname;
    63 };
    64 
    65 
    66 struct _GMythTVChainClass
    67 {
    68     GObjectClass parent_class;
    69 
    70     /* callbacks */
    71     /* no one for now */
    72 };
    73 
    74 struct _GMythTVChain
    75 {
    76     GObject parent;
    77 
    78 	GString *tvchain_id;
    79 	GList   *tvchain_list;
    80 	
    81 	time_t  cur_startts;
    82 	GString *cur_chanid;
    83 	int     cur_pos;
    84 };
    85 
    86 
    87 GType       gmyth_tvchain_get_type (void);
    88 
    89 void        gmyth_tvchain_initialize    (GMythTVChain *tvchain, 
    90                                          GString *hostname);
    91 gboolean    gmyth_tvchain_reload_all    (GMythTVChain *tvchain);
    92 GString*    gmyth_tvchain_get_id        (GMythTVChain *tvchain);
    93 int         gmyth_tvchain_program_is_at (GMythTVChain *tvchain, 
    94                                          GString *chanid, time_t startts);
    95 
    96 struct LiveTVChainEntry* gmyth_tvchain_get_entry_at (GMythTVChain *tvchain, 
    97                                                      gint index);
    98 
    99 GMythProgramInfo*   gmyth_tvchain_entry_to_program (GMythTVChain *tvchain, 
   100                                                     struct LiveTVChainEntry *entry);
   101 GMythProgramInfo*   gmyth_tvchain_get_program_at (GMythTVChain *tvchain, gint index);
   102 
   103 G_END_DECLS
   104 
   105 #endif /*LIVETVCHAIN_H_*/