leo_sobral@1
|
1 |
/**
|
leo_sobral@1
|
2 |
* GMyth Library
|
leo_sobral@1
|
3 |
*
|
leo_sobral@1
|
4 |
* @file gmyth/gmyth_scheduler.h
|
leo_sobral@1
|
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 |
*
|
leo_sobral@1
|
12 |
*//*
|
leo_sobral@1
|
13 |
*
|
leo_sobral@1
|
14 |
* This program is free software; you can redistribute it and/or modify
|
leo_sobral@1
|
15 |
* it under the terms of the GNU Lesser General Public License as published by
|
leo_sobral@1
|
16 |
* the Free Software Foundation; either version 2 of the License, or
|
leo_sobral@1
|
17 |
* (at your option) any later version.
|
leo_sobral@1
|
18 |
*
|
leo_sobral@1
|
19 |
* This program is distributed in the hope that it will be useful,
|
leo_sobral@1
|
20 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
leo_sobral@1
|
21 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
leo_sobral@1
|
22 |
* GNU General Public License for more details.
|
leo_sobral@1
|
23 |
*
|
leo_sobral@1
|
24 |
* You should have received a copy of the GNU Lesser General Public License
|
leo_sobral@1
|
25 |
* along with this program; if not, write to the Free Software
|
leo_sobral@1
|
26 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
leo_sobral@1
|
27 |
*/
|
leo_sobral@1
|
28 |
|
leo_sobral@1
|
29 |
#ifndef __GMYTH_SCHEDULER_H__
|
leo_sobral@1
|
30 |
#define __GMYTH_SCHEDULER_H__
|
leo_sobral@1
|
31 |
|
leo_sobral@1
|
32 |
#include <glib-object.h>
|
leo_sobral@1
|
33 |
#include <time.h>
|
leo_sobral@1
|
34 |
|
leo_sobral@1
|
35 |
#include "gmyth_common.h"
|
leo_sobral@1
|
36 |
#include "gmyth_query.h"
|
melunko@117
|
37 |
#include "gmyth_backendinfo.h"
|
leo_sobral@1
|
38 |
|
leo_sobral@6
|
39 |
G_BEGIN_DECLS
|
leo_sobral@1
|
40 |
|
leo_sobral@1
|
41 |
#define GMYTH_SCHEDULER_TYPE (gmyth_scheduler_get_type ())
|
leo_sobral@1
|
42 |
#define GMYTH_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_SCHEDULER_TYPE, GMythScheduler))
|
leo_sobral@1
|
43 |
#define GMYTH_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SCHEDULER_TYPE, GMythSchedulerClass))
|
rosfran@545
|
44 |
#define IS_GMYTH_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_SCHEDULER_TYPE))
|
leo_sobral@1
|
45 |
#define IS_GMYTH_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SCHEDULER_TYPE))
|
leo_sobral@1
|
46 |
#define GMYTH_SCHEDULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_SCHEDULER_TYPE, GMythSchedulerClass))
|
leo_sobral@1
|
47 |
|
leo_sobral@1
|
48 |
|
leo_sobral@1
|
49 |
typedef struct _GMythScheduler GMythScheduler;
|
leo_sobral@1
|
50 |
typedef struct _GMythSchedulerClass GMythSchedulerClass;
|
leo_sobral@1
|
51 |
|
leo_sobral@1
|
52 |
struct _GMythSchedulerClass
|
leo_sobral@1
|
53 |
{
|
leo_sobral@390
|
54 |
GObjectClass parent_class;
|
leo_sobral@1
|
55 |
|
leo_sobral@390
|
56 |
/* callbacks */
|
leo_sobral@390
|
57 |
/* no one for now */
|
leo_sobral@1
|
58 |
};
|
leo_sobral@1
|
59 |
|
leo_sobral@1
|
60 |
struct _GMythScheduler
|
leo_sobral@1
|
61 |
{
|
leo_sobral@1
|
62 |
GObject parent;
|
leo_sobral@1
|
63 |
|
leo_sobral@390
|
64 |
unsigned long recordid;
|
leo_sobral@1
|
65 |
unsigned long type;
|
leo_sobral@1
|
66 |
unsigned long search;
|
leo_sobral@1
|
67 |
GString *profile;
|
leo_sobral@1
|
68 |
|
leo_sobral@1
|
69 |
long dupin;
|
leo_sobral@1
|
70 |
long dupmethod;
|
leo_sobral@1
|
71 |
long autoexpire;
|
leo_sobral@1
|
72 |
short int autotranscode;
|
leo_sobral@1
|
73 |
long transcoder;
|
leo_sobral@1
|
74 |
|
leo_sobral@1
|
75 |
short int autocommflag;
|
leo_sobral@1
|
76 |
short int autouserjob1;
|
leo_sobral@1
|
77 |
short int autouserjob2;
|
leo_sobral@1
|
78 |
short int autouserjob3;
|
leo_sobral@1
|
79 |
short int autouserjob4;
|
leo_sobral@1
|
80 |
|
leo_sobral@1
|
81 |
long startoffset;
|
leo_sobral@1
|
82 |
long endoffset;
|
leo_sobral@1
|
83 |
long maxepisodes;
|
leo_sobral@1
|
84 |
long maxnewest;
|
leo_sobral@1
|
85 |
|
leo_sobral@1
|
86 |
long recpriority;
|
leo_sobral@1
|
87 |
GString *recgroup;
|
leo_sobral@1
|
88 |
GString *playgroup;
|
leo_sobral@1
|
89 |
|
leo_sobral@1
|
90 |
long prefinput;
|
leo_sobral@1
|
91 |
short int inactive;
|
leo_sobral@1
|
92 |
|
leo_sobral@387
|
93 |
GString *search_type;
|
leo_sobral@387
|
94 |
GString *search_what;
|
leo_sobral@1
|
95 |
|
leo_sobral@1
|
96 |
GMythQuery *msqlquery;
|
melunko@117
|
97 |
GMythBackendInfo *backend_info;
|
leo_sobral@1
|
98 |
};
|
leo_sobral@1
|
99 |
|
leo_sobral@1
|
100 |
typedef struct {
|
melunko@592
|
101 |
guint schedule_id;
|
leo_sobral@391
|
102 |
guint program_id;
|
leo_sobral@391
|
103 |
guint channel_id;
|
leo_sobral@391
|
104 |
|
leo_sobral@387
|
105 |
GTimeVal *start_time;
|
leo_sobral@391
|
106 |
GTimeVal *end_time;
|
leo_sobral@391
|
107 |
|
leo_sobral@391
|
108 |
GString *title;
|
leo_sobral@391
|
109 |
GString *subtitle;
|
leo_sobral@391
|
110 |
GString *description;
|
leo_sobral@391
|
111 |
GString *category;
|
leo_sobral@391
|
112 |
|
leo_sobral@1
|
113 |
} ScheduleInfo;
|
leo_sobral@1
|
114 |
|
leo_sobral@1
|
115 |
typedef struct {
|
melunko@207
|
116 |
guint record_id;
|
melunko@207
|
117 |
guint program_id;
|
melunko@207
|
118 |
guint channel_id;
|
leo_sobral@1
|
119 |
|
rosfran@214
|
120 |
GTimeVal* start_time;
|
rosfran@214
|
121 |
GTimeVal* end_time;
|
leo_sobral@1
|
122 |
|
melunko@207
|
123 |
GString *title;
|
melunko@207
|
124 |
GString *subtitle;
|
melunko@207
|
125 |
GString *description;
|
melunko@207
|
126 |
GString *category;
|
leo_sobral@1
|
127 |
|
melunko@207
|
128 |
GString *basename;
|
melunko@207
|
129 |
|
melunko@207
|
130 |
guint64 filesize;
|
leo_sobral@1
|
131 |
|
leo_sobral@1
|
132 |
} RecordedInfo;
|
leo_sobral@1
|
133 |
|
leo_sobral@1
|
134 |
|
leo_sobral@1
|
135 |
GType gmyth_scheduler_get_type (void);
|
leo_sobral@1
|
136 |
|
leo_sobral@1
|
137 |
GMythScheduler* gmyth_scheduler_new ();
|
leo_sobral@271
|
138 |
gboolean gmyth_scheduler_connect (GMythScheduler *scheduler,
|
leo_sobral@271
|
139 |
GMythBackendInfo *backend_info);
|
melunko@257
|
140 |
gboolean gmyth_scheduler_connect_with_timeout (GMythScheduler *scheduler,
|
leo_sobral@271
|
141 |
GMythBackendInfo *backend_info, guint timeout);
|
leo_sobral@1
|
142 |
gboolean gmyth_scheduler_disconnect (GMythScheduler *scheduler);
|
leo_sobral@1
|
143 |
|
leo_sobral@1
|
144 |
gint gmyth_scheduler_get_schedule_list (GMythScheduler *scheduler,
|
leo_sobral@1
|
145 |
GList **sched_list);
|
leo_sobral@1
|
146 |
gint gmyth_scheduler_get_recorded_list (GMythScheduler *scheduler,
|
leo_sobral@1
|
147 |
GList **rec_list);
|
leo_sobral@1
|
148 |
|
leo_sobral@1
|
149 |
GMythProgramInfo* gmyth_scheduler_get_recorded (GMythScheduler *scheduler,
|
rosfran@214
|
150 |
GString *channel, GTimeVal* starttime);
|
leo_sobral@1
|
151 |
|
leo_sobral@1
|
152 |
gint gmyth_scheduler_add_schedule(GMythScheduler *scheduler,
|
leo_sobral@1
|
153 |
ScheduleInfo *schedule_info);
|
leo_sobral@1
|
154 |
|
leo_sobral@1
|
155 |
gint gmyth_scheduler_delete_schedule (GMythScheduler *scheduler,
|
leo_sobral@1
|
156 |
gint record_id);
|
leo_sobral@1
|
157 |
gint gmyth_scheduler_delete_recorded (GMythScheduler *scheduler,
|
leo_sobral@1
|
158 |
gint record_id);
|
leo_sobral@1
|
159 |
|
leo_sobral@271
|
160 |
void gmyth_scheduler_recorded_info_get_preview (RecordedInfo *info,
|
leo_sobral@271
|
161 |
GByteArray* data);
|
leo_sobral@271
|
162 |
|
melunko@591
|
163 |
void gmyth_recorded_info_free (RecordedInfo *info);
|
melunko@591
|
164 |
void gmyth_schedule_info_free (ScheduleInfo *info);
|
melunko@591
|
165 |
|
melunko@591
|
166 |
void gmyth_recorded_info_list_free (GList *list);
|
melunko@591
|
167 |
void gmyth_schedule_info_list_free (GList *list);
|
leo_sobral@271
|
168 |
|
leo_sobral@6
|
169 |
G_END_DECLS
|
leo_sobral@1
|
170 |
|
leo_sobral@1
|
171 |
#endif /* __GMYTH_SCHEDULER_H__ */
|
leo_sobral@1
|
172 |
|