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