gmyth/src/gmyth_tvchain.h
author renatofilho
Tue Jun 19 22:01:13 2007 +0100 (2007-06-19)
branchtrunk
changeset 755 4b5efa290285
parent 750 312d6bc514f3
permissions -rw-r--r--
[svn r761] create function to get recorded inf; fixe some headers indent
     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  * This program is free software; you can redistribute it and/or modify
    14  * it under the terms of the GNU Lesser General Public License as published by
    15  * the Free Software Foundation; either version 2 of the License, or
    16  * (at your option) any later version.
    17  *
    18  * This program is distributed in the hope that it will be useful,
    19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    21  * GNU General Public License for more details.
    22  *
    23  * You should have received a copy of the GNU Lesser General Public License
    24  * along with this program; if not, write to the Free Software
    25  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    26  */
    27 
    28 #ifndef LIVETVCHAIN_H_
    29 #define LIVETVCHAIN_H_
    30 
    31 #include <glib-object.h>
    32 #include <time.h>
    33 
    34 #include "gmyth_common.h"
    35 #include "gmyth_backendinfo.h"
    36 
    37 G_BEGIN_DECLS
    38 #define GMYTH_TVCHAIN_TYPE               (gmyth_tvchain_get_type ())
    39 #define GMYTH_TVCHAIN(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_TVCHAIN_TYPE, GMythTVChain))
    40 #define GMYTH_TVCHAIN_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_TVCHAIN_TYPE, GMythTVChainClass))
    41 #define IS_GMYTH_TVCHAIN(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_TVCHAIN_TYPE))
    42 #define IS_GMYTH_TVCHAIN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_TVCHAIN_TYPE))
    43 #define GMYTH_TVCHAIN_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_TVCHAIN_TYPE, GMythTVChainClass))
    44 typedef struct _GMythTVChain GMythTVChain;
    45 typedef struct _GMythTVChainClass GMythTVChainClass;
    46 
    47 
    48 struct LiveTVChainEntry {
    49     GString        *chanid;
    50 
    51     GTimeVal       *starttime;
    52     GTimeVal       *endtime;
    53 
    54     gboolean        discontinuity;  // if true, can't play smooth from
    55     // last entry
    56     GString        *hostprefix;
    57     GString        *cardtype;
    58     GString        *channum;
    59     GString        *inputname;
    60 };
    61 
    62 
    63 struct _GMythTVChainClass {
    64     GObjectClass    parent_class;
    65 
    66     /*
    67      * callbacks 
    68      */
    69     /*
    70      * no one for now 
    71      */
    72 };
    73 
    74 struct _GMythTVChain {
    75     GObject         parent;
    76 
    77     GString        *tvchain_id;
    78     GList          *tvchain_list;
    79 
    80     GTimeVal       *cur_startts;
    81     GString        *cur_chanid;
    82     gint            cur_pos;
    83 
    84     GMythBackendInfo *backend_info;
    85 
    86     GMutex         *mutex;
    87 };
    88 
    89 GType           gmyth_tvchain_get_type(void);
    90 
    91 GMythTVChain   *gmyth_tvchain_new();
    92 
    93 gboolean        gmyth_tvchain_initialize(GMythTVChain * tvchain,
    94                                          GMythBackendInfo * backend_info);
    95 gboolean        gmyth_tvchain_reload_all(GMythTVChain * tvchain);
    96 GString        *gmyth_tvchain_get_id(GMythTVChain * tvchain);
    97 gint            gmyth_tvchain_program_is_at(GMythTVChain * tvchain,
    98                                             GString * chanid,
    99                                             GTimeVal * startts);
   100 
   101 struct LiveTVChainEntry *gmyth_tvchain_get_entry_at(GMythTVChain * tvchain,
   102                                                     gint index);
   103 
   104 GMythProgramInfo *gmyth_tvchain_entry_to_program(GMythTVChain * tvchain, struct LiveTVChainEntry
   105                                                  *entry);
   106 GMythProgramInfo *gmyth_tvchain_get_program_at(GMythTVChain * tvchain,
   107                                                gint index);
   108 
   109 GList          *gmyth_tvchain_get_program_info_from_channel(GMythTVChain *
   110                                                             tvchain,
   111                                                             const gchar *
   112                                                             channel);
   113 
   114 GList          *gmyth_tvchain_get_program_info_list(GMythTVChain *
   115                                                     tvchain);
   116 
   117 G_END_DECLS
   118 #endif                          /* LIVETVCHAIN_H_ */