gmyth/gmyth/gmyth_scheduler.h
author melunko
Thu Mar 13 16:29:38 2008 +0000 (2008-03-13)
branchtrunk
changeset 942 c93bfa74c71f
parent 935 067904b6921f
child 944 ec1d5934d8e8
permissions -rw-r--r--
[svn r951] gmyth now is 0.8.1. Added methods epg_is_connected() and scheduler_is_connected()
leo_sobral@1
     1
/**
leo_sobral@1
     2
 * GMyth Library
leo_sobral@1
     3
 *
leo_sobral@1
     4
 * @file gmyth/gmyth_scheduler.h
renatofilho@771
     5
 *
leo_sobral@1
     6
 * @brief <p> The scheduler encapsulates all functions for browsing, scheduling
leo_sobral@1
     7
 * and modifying the recorded content.
leo_sobral@1
     8
 *
leo_sobral@1
     9
 * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
leo_sobral@1
    10
 * @author Alexsandro Jose Virginio dos Santos <alexsandro.santos@indt.org.br>
leo_sobral@1
    11
 *
renatofilho@771
    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 __GMYTH_SCHEDULER_H__
leo_sobral@1
    29
#define __GMYTH_SCHEDULER_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"
leo_sobral@1
    35
#include "gmyth_query.h"
melunko@117
    36
#include "gmyth_backendinfo.h"
leo_sobral@1
    37
leo_sobral@6
    38
G_BEGIN_DECLS
melunko@801
    39
melunko@801
    40
typedef enum {
melunko@801
    41
    GMYTH_SCHEDULE_ONE_OCCURRENCE,
melunko@814
    42
    GMYTH_SCHEDULE_ALL_OCCURRENCES,
melunko@814
    43
    GMYTH_SCHEDULE_EXCEPTION
melunko@801
    44
} GMythScheduleType;
melunko@801
    45
melunko@801
    46
leo_sobral@1
    47
#define GMYTH_SCHEDULER_TYPE               (gmyth_scheduler_get_type ())
leo_sobral@1
    48
#define GMYTH_SCHEDULER(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_SCHEDULER_TYPE, GMythScheduler))
leo_sobral@1
    49
#define GMYTH_SCHEDULER_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SCHEDULER_TYPE, GMythSchedulerClass))
rosfran@545
    50
#define IS_GMYTH_SCHEDULER(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_SCHEDULER_TYPE))
leo_sobral@1
    51
#define IS_GMYTH_SCHEDULER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SCHEDULER_TYPE))
leo_sobral@1
    52
#define GMYTH_SCHEDULER_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_SCHEDULER_TYPE, GMythSchedulerClass))
melunko@801
    53
rosfran@698
    54
typedef struct _GMythScheduler GMythScheduler;
rosfran@698
    55
typedef struct _GMythSchedulerClass GMythSchedulerClass;
leo_sobral@1
    56
renatofilho@754
    57
struct _GMythSchedulerClass {
renatofilho@754
    58
    GObjectClass    parent_class;
renatofilho@750
    59
};
leo_sobral@1
    60
renatofilho@754
    61
struct _GMythScheduler {
renatofilho@754
    62
    GObject         parent;
leo_sobral@1
    63
renatofilho@754
    64
    unsigned long   recordid;
renatofilho@754
    65
    unsigned long   type;
renatofilho@754
    66
    unsigned long   search;
renatofilho@754
    67
    GString        *profile;
rosfran@698
    68
renatofilho@754
    69
    long            dupin;
renatofilho@754
    70
    long            dupmethod;
renatofilho@754
    71
    long            autoexpire;
renatofilho@754
    72
    short int       autotranscode;
renatofilho@754
    73
    long            transcoder;
rosfran@698
    74
renatofilho@754
    75
    short int       autocommflag;
renatofilho@754
    76
    short int       autouserjob1;
renatofilho@754
    77
    short int       autouserjob2;
renatofilho@754
    78
    short int       autouserjob3;
renatofilho@754
    79
    short int       autouserjob4;
rosfran@698
    80
renatofilho@754
    81
    long            startoffset;
renatofilho@754
    82
    long            endoffset;
renatofilho@754
    83
    long            maxepisodes;
renatofilho@754
    84
    long            maxnewest;
rosfran@698
    85
renatofilho@754
    86
    long            recpriority;
renatofilho@754
    87
    GString        *recgroup;
renatofilho@754
    88
    GString        *playgroup;
rosfran@698
    89
renatofilho@754
    90
    long            prefinput;
renatofilho@754
    91
    short int       inactive;
rosfran@698
    92
renatofilho@754
    93
    GString        *search_type;
renatofilho@754
    94
    GString        *search_what;
rosfran@698
    95
renatofilho@754
    96
    GMythQuery     *msqlquery;
renatofilho@754
    97
    GMythBackendInfo *backend_info;
renatofilho@750
    98
};
leo_sobral@1
    99
renatofilho@754
   100
typedef struct {
renatofilho@754
   101
    guint           schedule_id;
renatofilho@895
   102
    gint            channel_id;
renatofilho@895
   103
    GString        *program_id;
leo_sobral@391
   104
renatofilho@754
   105
    GTimeVal       *start_time;
renatofilho@754
   106
    GTimeVal       *end_time;
leo_sobral@391
   107
renatofilho@886
   108
    GString        *seriesid;
renatofilho@754
   109
    GString        *title;
renatofilho@754
   110
    GString        *subtitle;
renatofilho@754
   111
    GString        *description;
renatofilho@754
   112
    GString        *category;
leo_sobral@391
   113
melunko@836
   114
    GMythScheduleType type;
melunko@836
   115
melunko@814
   116
    gint parentid;
melunko@814
   117
renatofilho@750
   118
} ScheduleInfo;
leo_sobral@1
   119
renatofilho@754
   120
typedef struct {
renatofilho@754
   121
    guint           record_id;
renatofilho@895
   122
    gint            channel_id;
renatofilho@895
   123
    GString        *program_id;
leo_sobral@1
   124
renatofilho@754
   125
    GTimeVal       *start_time;
renatofilho@754
   126
    GTimeVal       *end_time;
leo_sobral@1
   127
renatofilho@886
   128
    GString         *seriesid;
renatofilho@754
   129
    GString        *title;
renatofilho@754
   130
    GString        *subtitle;
renatofilho@754
   131
    GString        *description;
renatofilho@754
   132
    GString        *category;
rosfran@698
   133
renatofilho@754
   134
    GString        *basename;
melunko@207
   135
renatofilho@754
   136
    guint64         filesize;
rosfran@698
   137
renatofilho@750
   138
} RecordedInfo;
leo_sobral@1
   139
leo_sobral@1
   140
renatofilho@864
   141
GType               gmyth_scheduler_get_type                (void);
leo_sobral@1
   142
renatofilho@864
   143
GMythScheduler*     gmyth_scheduler_new                     (void);
renatofilho@864
   144
gboolean            gmyth_scheduler_connect                 (GMythScheduler * scheduler,
renatofilho@864
   145
                                                             GMythBackendInfo * backend_info);
renatofilho@864
   146
gboolean            gmyth_scheduler_connect_with_timeout    (GMythScheduler * scheduler,
renatofilho@864
   147
                                                             GMythBackendInfo * backend_info,
renatofilho@864
   148
                                                             guint timeout);
melunko@942
   149
gboolean            gmyth_scheduler_is_connected (GMythScheduler *scheduler);
renatofilho@864
   150
gboolean            gmyth_scheduler_disconnect              (GMythScheduler * scheduler);
renatofilho@864
   151
gint                gmyth_scheduler_get_schedule_list       (GMythScheduler * scheduler,
renatofilho@864
   152
                                                             GList ** sched_list);
melunko@935
   153
ScheduleInfo*       gmyth_scheduler_get_schedule            (GMythScheduler * scheduler,
melunko@935
   154
		                                             gint schedule_id);
renatofilho@864
   155
gint                gmyth_scheduler_get_recorded_list       (GMythScheduler * scheduler,
renatofilho@864
   156
                                                             GList ** rec_list);
renatofilho@864
   157
RecordedInfo*       gmyth_scheduler_get_recorded_info       (GMythScheduler *scheduler,
renatofilho@864
   158
                                                             const char *basename);
renatofilho@864
   159
GMythProgramInfo*   gmyth_scheduler_get_recorded            (GMythScheduler * scheduler,
renatofilho@864
   160
                                                             GString * channel,
renatofilho@864
   161
                                                             GTimeVal * starttime);
renatofilho@886
   162
ScheduleInfo*       gmyth_scheduler_add_schedule_program    (GMythScheduler * scheduler,
renatofilho@886
   163
                                                             GMythProgramInfo *program,
renatofilho@886
   164
                                                             GMythScheduleType type);
renatofilho@864
   165
gint                gmyth_scheduler_add_schedule            (GMythScheduler * scheduler,
renatofilho@864
   166
                                                             ScheduleInfo * schedule_info);
renatofilho@864
   167
gboolean            gmyth_scheduler_add_schedule_full       (GMythScheduler * scheduler,
renatofilho@864
   168
                                                             ScheduleInfo * schedule_info,
renatofilho@864
   169
                                                             GMythScheduleType type);
renatofilho@864
   170
gboolean            gmyth_scheduler_add_exception           (GMythScheduler *scheduler,
renatofilho@864
   171
                                                             gint schedule_id,
renatofilho@864
   172
                                                             ScheduleInfo *exception_info);
renatofilho@886
   173
gboolean            gmyth_scheduler_delete_schedule         (GMythScheduler * scheduler,
renatofilho@864
   174
                                                             gint record_id);
renatofilho@864
   175
gint                gmyth_scheduler_delete_recorded         (GMythScheduler * scheduler,
renatofilho@864
   176
                                                             gint record_id);
renatofilho@864
   177
void                gmyth_scheduler_recorded_info_get_preview(RecordedInfo * info,
renatofilho@864
   178
                                                             GByteArray * data);
morphbr@841
   179
morphbr@841
   180
renatofilho@864
   181
void                gmyth_recorded_info_free                (RecordedInfo * info);
renatofilho@864
   182
void                gmyth_schedule_info_free                (ScheduleInfo * info);
renatofilho@864
   183
void                gmyth_recorded_info_list_free           (GList * list);
renatofilho@864
   184
void                gmyth_schedule_info_list_free           (GList * list);
leo_sobral@271
   185
leo_sobral@6
   186
G_END_DECLS
renatofilho@754
   187
#endif                          /* __GMYTH_SCHEDULER_H__ */