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
rosfran@291
     1
/**
rosfran@291
     2
 * GMyth Library
rosfran@420
     3
 *
rosfran@420
     4
 * @file gmyth/gmyth_programinfo.h
rosfran@291
     5
 * 
rosfran@420
     6
 * @brief <p> GMythProgramInfo representing the program info, with the
rosfran@420
     7
 * configuration data to the actual remote file in the TV chain.
rosfran@291
     8
 *
rosfran@291
     9
 * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
rosfran@420
    10
 * @author Rosfran Borges <rosfran.borges@indt.org.br>
rosfran@291
    11
 * @author Leonardo Sobral Cunha <leonardo.cunha@indt.org.br>
rosfran@291
    12
 *
rosfran@701
    13
 * 
rosfran@701
    14
 * This program is free software; you can redistribute it and/or modify
rosfran@701
    15
 * it under the terms of the GNU Lesser General Public License as published by
rosfran@701
    16
 * the Free Software Foundation; either version 2 of the License, or
rosfran@701
    17
 * (at your option) any later version.
rosfran@701
    18
 *
rosfran@701
    19
 * This program is distributed in the hope that it will be useful,
rosfran@701
    20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
rosfran@701
    21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
rosfran@701
    22
 * GNU General Public License for more details.
rosfran@701
    23
 *
rosfran@701
    24
 * You should have received a copy of the GNU Lesser General Public License
rosfran@701
    25
 * along with this program; if not, write to the Free Software
rosfran@701
    26
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
rosfran@701
    27
 *
rosfran@701
    28
 */
melunko@128
    29
melunko@128
    30
#ifndef _GMYTH_PROGRAMINFO_H
melunko@128
    31
#define _GMYTH_PROGRAMINFO_H
melunko@128
    32
rosfran@291
    33
#include <glib.h>
rosfran@291
    34
#include <glib-object.h>
rosfran@291
    35
melunko@128
    36
#include "gmyth_stringlist.h"
melunko@128
    37
rosfran@291
    38
G_BEGIN_DECLS
rosfran@291
    39
#define GMYTH_PROGRAM_INFO_TYPE               (gmyth_program_info_get_type ())
rosfran@291
    40
#define GMYTH_PROGRAM_INFO(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_PROGRAM_INFO_TYPE, GMythProgramInfo))
rosfran@291
    41
#define GMYTH_PROGRAM_INFO_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_PROGRAM_INFO_TYPE, GMythProgramInfoClass))
rosfran@545
    42
#define IS_GMYTH_PROGRAM_INFO(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_PROGRAM_INFO_TYPE))
rosfran@291
    43
#define IS_GMYTH_PROGRAM_INFO_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_PROGRAM_INFO_TYPE))
rosfran@291
    44
#define GMYTH_PROGRAM_INFO_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_PROGRAM_INFO_TYPE, GMythProgramInfoClass))
rosfran@698
    45
typedef struct _GMythProgramInfo GMythProgramInfo;
rosfran@698
    46
typedef struct _GMythProgramInfoClass GMythProgramInfoClass;
rosfran@291
    47
renatofilho@754
    48
struct _GMythProgramInfoClass {
renatofilho@754
    49
    GObjectClass    parent_class;
rosfran@291
    50
renatofilho@754
    51
    /*
renatofilho@754
    52
     * callbacks 
renatofilho@754
    53
     */
renatofilho@750
    54
};
rosfran@291
    55
ali@951
    56
typedef enum {
ali@951
    57
    GMYTH_REC_STATUS_FAILED = -9,
ali@951
    58
    GMYTH_REC_STATUS_TUNER_BUSY = -8,
ali@951
    59
    GMYTH_REC_STATUS_LOW_DISK_SPACE = -7,
ali@951
    60
    GMYTH_REC_STATUS_CANCELLED = -6,
ali@951
    61
    GMYTH_REC_STATUS_MISSED = -5,
ali@951
    62
    GMYTH_REC_STATUS_ABORTED = -4,
ali@951
    63
    GMYTH_REC_STATUS_RECORDED = -3,
ali@951
    64
    GMYTH_REC_STATUS_RECORDING = -2,
ali@951
    65
    GMYTH_REC_STATUS_WILL_RECORD = -1,
ali@951
    66
    GMYTH_REC_STATUS_UNKNOWN = 0,
ali@951
    67
    GMYTH_REC_STATUS_DONT_RECORD = 1,
ali@951
    68
    GMYTH_REC_STATUS_PREVIOUS_RECORDING = 2,
ali@951
    69
    GMYTH_REC_STATUS_CURRENT_RECORDING = 3,
ali@951
    70
    GMYTH_REC_STATUS_EARLIER_SHOWING = 4,
ali@951
    71
    GMYTH_REC_STATUS_TOO_MANY_RECORDINGS = 5,
ali@951
    72
    GMYTH_REC_STATUS_NOT_LISTED = 6,
ali@951
    73
    GMYTH_REC_STATUS_CONFLICT = 7,
ali@951
    74
    GMYTH_REC_STATUS_LATER_SHOWING = 8,
ali@951
    75
    GMYTH_REC_STATUS_REPEAT = 9,
ali@951
    76
    GMYTH_REC_STATUS_INACTIVE = 10,
ali@951
    77
    GMYTH_REC_STATUS_NEVER_RECORD = 11,
ali@951
    78
    GMYTH_REC_STATUS_OFF_LINE = 12,
ali@951
    79
    GMYTH_REC_STATUS_OTHER_SHOWING = 13,
ali@951
    80
} GMythRecStatus;
ali@951
    81
rosfran@291
    82
/**
rosfran@291
    83
 * The GMythProgramInfo structure represents a program information
rosfran@291
    84
 * stored in the database. It could be a program from the EPG data,
rosfran@291
    85
 * a program scheduled to be recorded, or a program already recorded.
rosfran@291
    86
 */
renatofilho@754
    87
struct _GMythProgramInfo {
renatofilho@754
    88
    GObject         parent;
rosfran@698
    89
renatofilho@754
    90
    /** The channel unique ID. */
renatofilho@895
    91
    gint            channel_id;
renatofilho@754
    92
    /** The program start time. */
renatofilho@754
    93
    GTimeVal       *startts;
renatofilho@754
    94
    /** The program end time. */
renatofilho@754
    95
    GTimeVal       *endts;
renatofilho@754
    96
    /** The recording schedule start time. */
renatofilho@754
    97
    GTimeVal       *recstartts;
renatofilho@754
    98
    /** The recording schedule end time */
renatofilho@754
    99
    GTimeVal       *recendts;
rosfran@698
   100
renatofilho@754
   101
    /** The program title. */
renatofilho@754
   102
    GString        *title;
renatofilho@754
   103
    /** The program subtitle. */
renatofilho@754
   104
    GString        *subtitle;
renatofilho@754
   105
    /** The program description. */
renatofilho@754
   106
    GString        *description;
renatofilho@754
   107
    /** The program category. */
renatofilho@754
   108
    GString        *category;
rosfran@698
   109
renatofilho@754
   110
    GString        *chanstr;
renatofilho@754
   111
    GString        *chansign;
renatofilho@754
   112
    /** The associated channel name. */
renatofilho@754
   113
    GString        *channame;
renatofilho@754
   114
    gint            chancommfree;
renatofilho@754
   115
    GString        *chanOutputFilters;
rosfran@698
   116
renatofilho@754
   117
    GString        *seriesid;
renatofilho@754
   118
    /** The program unique id. */
renatofilho@895
   119
    GString        *program_id;
renatofilho@754
   120
    GString        *catType;
rosfran@291
   121
renatofilho@754
   122
    GString        *sortTitle;
rosfran@291
   123
renatofilho@754
   124
    /** A flag informing if the program has video or not. */
renatofilho@754
   125
    gboolean        isVideo;
renatofilho@754
   126
    gint            lenMins;
rosfran@698
   127
renatofilho@754
   128
    GString        *year;
renatofilho@754
   129
    gdouble         stars;
renatofilho@754
   130
    gint            repeat;
rosfran@698
   131
renatofilho@754
   132
    GTimeVal       *originalAirDate;
renatofilho@754
   133
    GTimeVal       *lastmodified;
renatofilho@754
   134
    GTimeVal       *lastInUseTime;
rosfran@698
   135
renatofilho@754
   136
    gboolean        hasAirDate;
rosfran@291
   137
renatofilho@754
   138
    gint            spread;
renatofilho@754
   139
    gint            startCol;
rosfran@291
   140
renatofilho@754
   141
    gint            recpriority2;
renatofilho@754
   142
    gint            reactivate;
rosfran@291
   143
renatofilho@754
   144
    gint            recordid;
renatofilho@754
   145
    gint            parentid;
rosfran@698
   146
renatofilho@754
   147
    /** The backend video source id associated to this program.*/
renatofilho@754
   148
    gint            sourceid;
renatofilho@754
   149
    /** the backend input id associated to this program.*/
renatofilho@754
   150
    gint            inputid;
renatofilho@754
   151
    /** The backend card id associated to this program.*/
renatofilho@754
   152
    gint            cardid;
renatofilho@754
   153
    gboolean        shareable;
renatofilho@754
   154
    gboolean        duplicate;
rosfran@291
   155
renatofilho@754
   156
    GString        *schedulerid;
renatofilho@754
   157
    gint            findid;
rosfran@291
   158
renatofilho@754
   159
    gint            programflags;
renatofilho@754
   160
    gint            transcoder;
rosfran@291
   161
renatofilho@754
   162
    GString        *recgroup;
renatofilho@754
   163
    GString        *playgroup;
morphbr@841
   164
    gint            rectype;
ali@951
   165
    GMythRecStatus  recstatus;
renatofilho@754
   166
    gint            recpriority;
morphbr@841
   167
    gint            dupin;
morphbr@841
   168
    gint            dupmethod;
rosfran@291
   169
renatofilho@754
   170
    /** The file size of the recorded program.*/
renatofilho@754
   171
    gint64          filesize;
rosfran@698
   172
renatofilho@754
   173
    /** The file name of the recorded program.*/
renatofilho@754
   174
    GString        *pathname;
renatofilho@754
   175
    GString        *hostname;
renatofilho@750
   176
};
rosfran@291
   177
renatofilho@911
   178
GType           gmyth_program_info_get_type(void);
rosfran@291
   179
renatofilho@750
   180
GMythProgramInfo *gmyth_program_info_new(void);
rosfran@291
   181
renatofilho@750
   182
GMythStringList *gmyth_program_info_to_string_list(GMythProgramInfo * prog,
renatofilho@754
   183
                                                   GMythStringList *
renatofilho@754
   184
                                                   slist);
rosfran@568
   185
renatofilho@754
   186
GMythProgramInfo
renatofilho@754
   187
    * gmyth_program_info_from_string_list_from_pos(GMythStringList * slist,
renatofilho@754
   188
                                                   guint pos);
rosfran@568
   189
renatofilho@750
   190
GMythProgramInfo *gmyth_program_info_from_string_list(GMythStringList *
renatofilho@754
   191
                                                      slist);
rosfran@291
   192
rosfran@698
   193
GMythProgramInfo
renatofilho@754
   194
    * gmyth_program_info_from_string_list_next_prog(GMythStringList *
renatofilho@754
   195
                                                    slist);
rosfran@568
   196
renatofilho@754
   197
const gchar    *gmyth_program_info_to_string(const GMythProgramInfo *
renatofilho@754
   198
                                             prog);
rosfran@356
   199
renatofilho@754
   200
gboolean        gmyth_program_info_is_equals(const GMythProgramInfo *
renatofilho@754
   201
                                             prog1,
renatofilho@754
   202
                                             const GMythProgramInfo *
renatofilho@754
   203
                                             prog2);
rosfran@443
   204
rosfran@291
   205
G_END_DECLS
rosfran@291
   206
#endif /*_GMYTH_PROGRAMINFO_H*/