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