gmyth/gmyth/gmyth_programinfo.h
author ali@juiblex.co.uk
Wed Dec 16 10:06:21 2009 +0000 (2009-12-16)
branchtrunk
changeset 951 7b0d87ef5e63
parent 925 4a8d56080089
permissions -rw-r--r--
Add rules and upcoming lists to gmyth_ls
     1 /**
     2  * GMyth Library
     3  *
     4  * @file gmyth/gmyth_programinfo.h
     5  * 
     6  * @brief <p> GMythProgramInfo representing the program info, with the
     7  * configuration data to the actual remote file in the TV chain.
     8  *
     9  * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    10  * @author Rosfran Borges <rosfran.borges@indt.org.br>
    11  * @author Leonardo Sobral Cunha <leonardo.cunha@indt.org.br>
    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 
    30 #ifndef _GMYTH_PROGRAMINFO_H
    31 #define _GMYTH_PROGRAMINFO_H
    32 
    33 #include <glib.h>
    34 #include <glib-object.h>
    35 
    36 #include "gmyth_stringlist.h"
    37 
    38 G_BEGIN_DECLS
    39 #define GMYTH_PROGRAM_INFO_TYPE               (gmyth_program_info_get_type ())
    40 #define GMYTH_PROGRAM_INFO(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_PROGRAM_INFO_TYPE, GMythProgramInfo))
    41 #define GMYTH_PROGRAM_INFO_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_PROGRAM_INFO_TYPE, GMythProgramInfoClass))
    42 #define IS_GMYTH_PROGRAM_INFO(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_PROGRAM_INFO_TYPE))
    43 #define IS_GMYTH_PROGRAM_INFO_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_PROGRAM_INFO_TYPE))
    44 #define GMYTH_PROGRAM_INFO_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_PROGRAM_INFO_TYPE, GMythProgramInfoClass))
    45 typedef struct _GMythProgramInfo GMythProgramInfo;
    46 typedef struct _GMythProgramInfoClass GMythProgramInfoClass;
    47 
    48 struct _GMythProgramInfoClass {
    49     GObjectClass    parent_class;
    50 
    51     /*
    52      * callbacks 
    53      */
    54 };
    55 
    56 typedef enum {
    57     GMYTH_REC_STATUS_FAILED = -9,
    58     GMYTH_REC_STATUS_TUNER_BUSY = -8,
    59     GMYTH_REC_STATUS_LOW_DISK_SPACE = -7,
    60     GMYTH_REC_STATUS_CANCELLED = -6,
    61     GMYTH_REC_STATUS_MISSED = -5,
    62     GMYTH_REC_STATUS_ABORTED = -4,
    63     GMYTH_REC_STATUS_RECORDED = -3,
    64     GMYTH_REC_STATUS_RECORDING = -2,
    65     GMYTH_REC_STATUS_WILL_RECORD = -1,
    66     GMYTH_REC_STATUS_UNKNOWN = 0,
    67     GMYTH_REC_STATUS_DONT_RECORD = 1,
    68     GMYTH_REC_STATUS_PREVIOUS_RECORDING = 2,
    69     GMYTH_REC_STATUS_CURRENT_RECORDING = 3,
    70     GMYTH_REC_STATUS_EARLIER_SHOWING = 4,
    71     GMYTH_REC_STATUS_TOO_MANY_RECORDINGS = 5,
    72     GMYTH_REC_STATUS_NOT_LISTED = 6,
    73     GMYTH_REC_STATUS_CONFLICT = 7,
    74     GMYTH_REC_STATUS_LATER_SHOWING = 8,
    75     GMYTH_REC_STATUS_REPEAT = 9,
    76     GMYTH_REC_STATUS_INACTIVE = 10,
    77     GMYTH_REC_STATUS_NEVER_RECORD = 11,
    78     GMYTH_REC_STATUS_OFF_LINE = 12,
    79     GMYTH_REC_STATUS_OTHER_SHOWING = 13,
    80 } GMythRecStatus;
    81 
    82 /**
    83  * The GMythProgramInfo structure represents a program information
    84  * stored in the database. It could be a program from the EPG data,
    85  * a program scheduled to be recorded, or a program already recorded.
    86  */
    87 struct _GMythProgramInfo {
    88     GObject         parent;
    89 
    90     /** The channel unique ID. */
    91     gint            channel_id;
    92     /** The program start time. */
    93     GTimeVal       *startts;
    94     /** The program end time. */
    95     GTimeVal       *endts;
    96     /** The recording schedule start time. */
    97     GTimeVal       *recstartts;
    98     /** The recording schedule end time */
    99     GTimeVal       *recendts;
   100 
   101     /** The program title. */
   102     GString        *title;
   103     /** The program subtitle. */
   104     GString        *subtitle;
   105     /** The program description. */
   106     GString        *description;
   107     /** The program category. */
   108     GString        *category;
   109 
   110     GString        *chanstr;
   111     GString        *chansign;
   112     /** The associated channel name. */
   113     GString        *channame;
   114     gint            chancommfree;
   115     GString        *chanOutputFilters;
   116 
   117     GString        *seriesid;
   118     /** The program unique id. */
   119     GString        *program_id;
   120     GString        *catType;
   121 
   122     GString        *sortTitle;
   123 
   124     /** A flag informing if the program has video or not. */
   125     gboolean        isVideo;
   126     gint            lenMins;
   127 
   128     GString        *year;
   129     gdouble         stars;
   130     gint            repeat;
   131 
   132     GTimeVal       *originalAirDate;
   133     GTimeVal       *lastmodified;
   134     GTimeVal       *lastInUseTime;
   135 
   136     gboolean        hasAirDate;
   137 
   138     gint            spread;
   139     gint            startCol;
   140 
   141     gint            recpriority2;
   142     gint            reactivate;
   143 
   144     gint            recordid;
   145     gint            parentid;
   146 
   147     /** The backend video source id associated to this program.*/
   148     gint            sourceid;
   149     /** the backend input id associated to this program.*/
   150     gint            inputid;
   151     /** The backend card id associated to this program.*/
   152     gint            cardid;
   153     gboolean        shareable;
   154     gboolean        duplicate;
   155 
   156     GString        *schedulerid;
   157     gint            findid;
   158 
   159     gint            programflags;
   160     gint            transcoder;
   161 
   162     GString        *recgroup;
   163     GString        *playgroup;
   164     gint            rectype;
   165     GMythRecStatus  recstatus;
   166     gint            recpriority;
   167     gint            dupin;
   168     gint            dupmethod;
   169 
   170     /** The file size of the recorded program.*/
   171     gint64          filesize;
   172 
   173     /** The file name of the recorded program.*/
   174     GString        *pathname;
   175     GString        *hostname;
   176 };
   177 
   178 GType           gmyth_program_info_get_type(void);
   179 
   180 GMythProgramInfo *gmyth_program_info_new(void);
   181 
   182 GMythStringList *gmyth_program_info_to_string_list(GMythProgramInfo * prog,
   183                                                    GMythStringList *
   184                                                    slist);
   185 
   186 GMythProgramInfo
   187     * gmyth_program_info_from_string_list_from_pos(GMythStringList * slist,
   188                                                    guint pos);
   189 
   190 GMythProgramInfo *gmyth_program_info_from_string_list(GMythStringList *
   191                                                       slist);
   192 
   193 GMythProgramInfo
   194     * gmyth_program_info_from_string_list_next_prog(GMythStringList *
   195                                                     slist);
   196 
   197 const gchar    *gmyth_program_info_to_string(const GMythProgramInfo *
   198                                              prog);
   199 
   200 gboolean        gmyth_program_info_is_equals(const GMythProgramInfo *
   201                                              prog1,
   202                                              const GMythProgramInfo *
   203                                              prog2);
   204 
   205 G_END_DECLS
   206 #endif /*_GMYTH_PROGRAMINFO_H*/