gmyth/src/gmyth_tvchain.h
author rosfran
Fri Apr 13 20:07:32 2007 +0100 (2007-04-13)
branchtrunk
changeset 545 7f0a3066f6ab
parent 428 44db5239d628
child 578 9e589622f097
permissions -rw-r--r--
[svn r550] A lot of GObject fixes (using the GType casting), added inheritance to the GMythFile* modules, locks all the the STOP_RECORDING messages.
     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 #include "gmyth_backendinfo.h"
    37 
    38 G_BEGIN_DECLS
    39 
    40 #define GMYTH_TVCHAIN_TYPE               (gmyth_tvchain_get_type ())
    41 #define GMYTH_TVCHAIN(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_TVCHAIN_TYPE, GMythTVChain))
    42 #define GMYTH_TVCHAIN_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_TVCHAIN_TYPE, GMythTVChainClass))
    43 #define IS_GMYTH_TVCHAIN(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_TVCHAIN_TYPE))
    44 #define IS_GMYTH_TVCHAIN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_TVCHAIN_TYPE))
    45 #define GMYTH_TVCHAIN_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_TVCHAIN_TYPE, GMythTVChainClass))
    46 
    47 
    48 typedef struct _GMythTVChain         GMythTVChain;
    49 typedef struct _GMythTVChainClass    GMythTVChainClass;
    50 
    51 
    52 struct LiveTVChainEntry
    53 {
    54     GString *chanid;
    55 
    56     GTimeVal* starttime;
    57     GTimeVal* endtime;
    58     
    59     gboolean discontinuity; // if true, can't play smooth from last entry
    60     GString *hostprefix;
    61     GString *cardtype;
    62     GString *channum;
    63     GString *inputname;
    64 };
    65 
    66 
    67 struct _GMythTVChainClass
    68 {
    69     GObjectClass parent_class;
    70 
    71     /* callbacks */
    72     /* no one for now */
    73 };
    74 
    75 struct _GMythTVChain
    76 {
    77   GObject parent;
    78 
    79 	GString *tvchain_id;
    80 	GList   *tvchain_list;
    81 	
    82 	GTimeVal*  cur_startts;
    83 	GString *cur_chanid;
    84 	gint     cur_pos;
    85 
    86   GMythBackendInfo *backend_info;
    87   
    88   GMutex *mutex;
    89 };
    90 
    91 GType       	gmyth_tvchain_get_type (void);
    92 
    93 GMythTVChain* gmyth_tvchain_new ();
    94 
    95 gboolean      gmyth_tvchain_initialize    (GMythTVChain *tvchain, 
    96                                          GMythBackendInfo *backend_info);
    97 gboolean    	gmyth_tvchain_reload_all    (GMythTVChain *tvchain);
    98 GString*    	gmyth_tvchain_get_id        (GMythTVChain *tvchain);
    99 gint         	gmyth_tvchain_program_is_at (GMythTVChain *tvchain, 
   100                                          GString *chanid, GTimeVal* startts);
   101 
   102 struct LiveTVChainEntry* gmyth_tvchain_get_entry_at (GMythTVChain *tvchain, 
   103                                                      gint index);
   104 
   105 GMythProgramInfo*   gmyth_tvchain_entry_to_program (GMythTVChain *tvchain, 
   106                                                     struct LiveTVChainEntry *entry);
   107 GMythProgramInfo*   gmyth_tvchain_get_program_at (GMythTVChain *tvchain, gint index);
   108 
   109 G_END_DECLS
   110 
   111 #endif /*LIVETVCHAIN_H_*/