gmyth/src/gmyth_programinfo.h
author leo_sobral
Mon Mar 05 22:18:17 2007 +0000 (2007-03-05)
branchtrunk
changeset 387 f8eb1446ff5a
parent 356 5486e606498b
child 420 c1601c03cc78
permissions -rw-r--r--
[svn r392] code refactor and memory leaks fixed
     1 /**
     2  * GMyth Library
     3  * 
     4  * @file gmyth/gmyth_common.h
     5  * 
     6  * @brief <p> This file contains basic common functions for the gmyth library.
     7  *
     8  * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
     9  * @author Leonardo Sobral Cunha <leonardo.cunha@indt.org.br>
    10  *
    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 _GMYTH_PROGRAMINFO_H
    29 #define _GMYTH_PROGRAMINFO_H
    30 
    31 #include <glib.h>
    32 #include <glib-object.h>
    33 
    34 #include "gmyth_stringlist.h"
    35 
    36 G_BEGIN_DECLS
    37 
    38 #define GMYTH_PROGRAM_INFO_TYPE               (gmyth_program_info_get_type ())
    39 #define GMYTH_PROGRAM_INFO(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_PROGRAM_INFO_TYPE, GMythProgramInfo))
    40 #define GMYTH_PROGRAM_INFO_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_PROGRAM_INFO_TYPE, GMythProgramInfoClass))
    41 #define IS_GMYTH_PROGRAM_INFO(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_PROGRAM_INFO_TYPE))
    42 #define IS_GMYTH_PROGRAM_INFO_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_PROGRAM_INFO_TYPE))
    43 #define GMYTH_PROGRAM_INFO_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_PROGRAM_INFO_TYPE, GMythProgramInfoClass))
    44 
    45 typedef struct _GMythProgramInfo         GMythProgramInfo;
    46 typedef struct _GMythProgramInfoClass    GMythProgramInfoClass;
    47 
    48 struct _GMythProgramInfoClass
    49 {
    50   GObjectClass parent_class;
    51 
    52   /* callbacks */
    53 };
    54 
    55 /**
    56  * The GMythProgramInfo structure represents a program information
    57  * stored in the database. It could be a program from the EPG data,
    58  * a program scheduled to be recorded, or a program already recorded.
    59  */
    60 struct _GMythProgramInfo
    61 {
    62     GObject parent;
    63     
    64     /** The channel unique ID. */
    65     GString *chanid;
    66   
    67     /** The program start time. */
    68     GTimeVal* startts;
    69     /** The program end time. */
    70     GTimeVal* endts;
    71     /** The recording schedule start time. */
    72     GTimeVal* recstartts;
    73     /** The recording schedule end time */
    74     GTimeVal* recendts;
    75   
    76     /** The program title. */
    77     GString *title;
    78     /** The program subtitle. */
    79     GString *subtitle;
    80     /** The program description. */
    81     GString *description;
    82     /** The program category. */
    83     GString *category;
    84   
    85     GString *chanstr;
    86     GString *chansign;
    87     /** The associated channel name. */
    88     GString *channame;
    89     gint chancommfree;
    90     GString *chanOutputFilters;
    91   
    92     GString *seriesid;
    93     /** The program unique id. */
    94     GString *programid;
    95     GString *catType;
    96 
    97     GString *sortTitle;  
    98 
    99 	/** A flag informing if the program has video or not. */    
   100     gboolean isVideo;
   101     gint lenMins;
   102   
   103     GString *year;    
   104     gdouble stars;
   105     gint repeat;
   106   
   107     GTimeVal* originalAirDate;
   108     GTimeVal* lastmodified;
   109     GTimeVal* lastInUseTime;
   110   
   111     gboolean hasAirDate;
   112 
   113     gint spread;
   114     gint startCol;
   115 
   116     gint recpriority2;
   117     gint reactivate;    
   118 
   119     gint recordid;
   120     gint parentid;   
   121   
   122     /** The backend video source id associated to this program.*/
   123     gint sourceid;
   124     /** the backend input id associated to this program.*/
   125     gint inputid;
   126     /** The backend card id associated to this program.*/
   127     gint cardid;
   128     gboolean shareable;
   129     gboolean duplicate;
   130 
   131     GString * schedulerid;
   132     gint findid;
   133 
   134     gint programflags;
   135     gint transcoder;
   136 
   137     GString *recgroup;
   138     GString *playgroup;
   139     gint recpriority;
   140 
   141 	/** The file size of the recorded program.*/
   142     gint64 filesize;
   143   
   144     /** The file name of the recorded program.*/
   145     GString *pathname;
   146     GString *hostname;
   147 };
   148 
   149 GType     			gmyth_program_info_type (void);
   150 
   151 GMythProgramInfo* 	gmyth_program_info_new (void);
   152 
   153 GMythStringList*	gmyth_program_info_to_string_list (GMythProgramInfo *prog, 
   154                                                        GMythStringList *slist);
   155 GMythProgramInfo* 	gmyth_program_info_from_string_list (GMythStringList *slist);
   156 
   157 const gchar*		gmyth_program_info_to_string( const GMythProgramInfo* prog );
   158 
   159 G_END_DECLS
   160 
   161 #endif /*_GMYTH_PROGRAMINFO_H*/