gmyth/src/gmyth_scheduler.h
author renatofilho
Wed Oct 24 18:41:42 2007 +0100 (2007-10-24)
branchtrunk
changeset 864 56cfd1feef30
parent 841 25fb81d23ef5
child 865 3eeb6b565018
permissions -rw-r--r--
[svn r870] created function stop recording
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@754
   102
    guint           program_id;
renatofilho@754
   103
    guint           channel_id;
leo_sobral@391
   104
renatofilho@754
   105
    GTimeVal       *start_time;
renatofilho@754
   106
    GTimeVal       *end_time;
leo_sobral@391
   107
renatofilho@754
   108
    GString        *title;
renatofilho@754
   109
    GString        *subtitle;
renatofilho@754
   110
    GString        *description;
renatofilho@754
   111
    GString        *category;
leo_sobral@391
   112
melunko@836
   113
    GMythScheduleType type;
melunko@836
   114
melunko@814
   115
    gint parentid;
melunko@814
   116
renatofilho@750
   117
} ScheduleInfo;
leo_sobral@1
   118
renatofilho@754
   119
typedef struct {
renatofilho@754
   120
    guint           record_id;
renatofilho@754
   121
    guint           program_id;
renatofilho@754
   122
    guint           channel_id;
leo_sobral@1
   123
renatofilho@754
   124
    GTimeVal       *start_time;
renatofilho@754
   125
    GTimeVal       *end_time;
leo_sobral@1
   126
renatofilho@754
   127
    GString        *title;
renatofilho@754
   128
    GString        *subtitle;
renatofilho@754
   129
    GString        *description;
renatofilho@754
   130
    GString        *category;
rosfran@698
   131
renatofilho@754
   132
    GString        *basename;
melunko@207
   133
renatofilho@754
   134
    guint64         filesize;
rosfran@698
   135
renatofilho@750
   136
} RecordedInfo;
leo_sobral@1
   137
leo_sobral@1
   138
renatofilho@864
   139
GType               gmyth_scheduler_get_type                (void);
leo_sobral@1
   140
renatofilho@864
   141
GMythScheduler*     gmyth_scheduler_new                     (void);
renatofilho@864
   142
gboolean            gmyth_scheduler_connect                 (GMythScheduler * scheduler,
renatofilho@864
   143
                                                             GMythBackendInfo * backend_info);
renatofilho@864
   144
gboolean            gmyth_scheduler_connect_with_timeout    (GMythScheduler * scheduler,
renatofilho@864
   145
                                                             GMythBackendInfo * backend_info,
renatofilho@864
   146
                                                             guint timeout);
renatofilho@864
   147
gboolean            gmyth_scheduler_disconnect              (GMythScheduler * scheduler);
renatofilho@864
   148
gint                gmyth_scheduler_get_schedule_list       (GMythScheduler * scheduler,
renatofilho@864
   149
                                                             GList ** sched_list);
renatofilho@864
   150
gint                gmyth_scheduler_get_recorded_list       (GMythScheduler * scheduler,
renatofilho@864
   151
                                                             GList ** rec_list);
renatofilho@864
   152
RecordedInfo*       gmyth_scheduler_get_recorded_info       (GMythScheduler *scheduler,
renatofilho@864
   153
                                                             const char *basename);
renatofilho@864
   154
gboolean            gmyth_scheduler_was_recorded_before     (GMythScheduler* scheduler,
renatofilho@864
   155
                                                             gint channel_id,
renatofilho@864
   156
                                                             time_t start_time);
renatofilho@864
   157
gboolean            gmyth_scheduler_reactivate_schedule     (GMythScheduler* scheduler,
renatofilho@864
   158
                                                             gint channel_id,
renatofilho@864
   159
                                                             time_t start_time);
renatofilho@864
   160
GMythProgramInfo*   gmyth_scheduler_get_recorded_on_time    (GMythScheduler* scheduler,
renatofilho@864
   161
                                                             guint channel_id);
renatofilho@864
   162
GMythProgramInfo*   gmyth_scheduler_get_recorded            (GMythScheduler * scheduler,
renatofilho@864
   163
                                                             GString * channel,
renatofilho@864
   164
                                                             GTimeVal * starttime);
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@864
   173
gint                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
gboolean            gmyth_scheduler_stop_recording          (GMythScheduler * scheduler,
renatofilho@864
   178
                                                             gint channel_id,
renatofilho@864
   179
                                                             time_t start);
renatofilho@864
   180
void                gmyth_scheduler_recorded_info_get_preview(RecordedInfo * info,
renatofilho@864
   181
                                                             GByteArray * data);
morphbr@841
   182
morphbr@841
   183
renatofilho@864
   184
void                gmyth_recorded_info_free                (RecordedInfo * info);
renatofilho@864
   185
void                gmyth_schedule_info_free                (ScheduleInfo * info);
renatofilho@864
   186
void                gmyth_recorded_info_list_free           (GList * list);
renatofilho@864
   187
void                gmyth_schedule_info_list_free           (GList * list);
leo_sobral@271
   188
leo_sobral@6
   189
G_END_DECLS
renatofilho@754
   190
#endif                          /* __GMYTH_SCHEDULER_H__ */