leo_sobral@213
|
1 |
/**
|
leo_sobral@213
|
2 |
* GMyth Library
|
leo_sobral@213
|
3 |
*
|
leo_sobral@213
|
4 |
* @file gmyth/gmyth_programinfo.c
|
leo_sobral@213
|
5 |
*
|
leo_sobral@213
|
6 |
* @brief <p> GMythFileTransfer deals with the file streaming media remote/local
|
leo_sobral@213
|
7 |
* transfering to the MythTV frontend.
|
leo_sobral@213
|
8 |
*
|
leo_sobral@213
|
9 |
* Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
|
leo_sobral@213
|
10 |
* @author Leonardo Sobral Cunha <leonardo.cunha@indt.org.br>
|
leo_sobral@213
|
11 |
*
|
leo_sobral@213
|
12 |
*//*
|
leo_sobral@213
|
13 |
*
|
leo_sobral@213
|
14 |
* This program is free software; you can redistribute it and/or modify
|
leo_sobral@213
|
15 |
* it under the terms of the GNU Lesser General Public License as published by
|
leo_sobral@213
|
16 |
* the Free Software Foundation; either version 2 of the License, or
|
leo_sobral@213
|
17 |
* (at your option) any later version.
|
leo_sobral@213
|
18 |
*
|
leo_sobral@213
|
19 |
* This program is distributed in the hope that it will be useful,
|
leo_sobral@213
|
20 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
leo_sobral@213
|
21 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
leo_sobral@213
|
22 |
* GNU General Public License for more details.
|
leo_sobral@213
|
23 |
*
|
leo_sobral@213
|
24 |
* You should have received a copy of the GNU Lesser General Public License
|
leo_sobral@213
|
25 |
* along with this program; if not, write to the Free Software
|
leo_sobral@213
|
26 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
leo_sobral@213
|
27 |
*
|
leo_sobral@213
|
28 |
*/
|
leo_sobral@213
|
29 |
|
leo_sobral@213
|
30 |
#ifdef HAVE_CONFIG_H
|
leo_sobral@213
|
31 |
#include "config.h"
|
leo_sobral@213
|
32 |
#endif
|
melunko@128
|
33 |
|
rosfran@291
|
34 |
#include <stdlib.h>
|
rosfran@291
|
35 |
#include <string.h>
|
rosfran@291
|
36 |
#include <assert.h>
|
rosfran@291
|
37 |
|
melunko@128
|
38 |
#include "gmyth_programinfo.h"
|
rosfran@291
|
39 |
#include "gmyth_util.h"
|
rosfran@291
|
40 |
#include "gmyth_debug.h"
|
rosfran@291
|
41 |
|
rosfran@291
|
42 |
static void gmyth_program_info_class_init (GMythProgramInfoClass *klass);
|
rosfran@291
|
43 |
static void gmyth_program_info_init (GMythProgramInfo *object);
|
rosfran@291
|
44 |
|
rosfran@291
|
45 |
static void gmyth_program_info_dispose (GObject *object);
|
rosfran@291
|
46 |
static void gmyth_program_info_finalize (GObject *object);
|
rosfran@291
|
47 |
|
rosfran@291
|
48 |
G_DEFINE_TYPE(GMythProgramInfo, gmyth_program_info, G_TYPE_OBJECT)
|
rosfran@291
|
49 |
|
rosfran@291
|
50 |
static void
|
rosfran@291
|
51 |
gmyth_program_info_class_init (GMythProgramInfoClass *klass)
|
rosfran@291
|
52 |
{
|
rosfran@291
|
53 |
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
rosfran@291
|
54 |
|
rosfran@291
|
55 |
gobject_class->dispose = gmyth_program_info_dispose;
|
rosfran@291
|
56 |
gobject_class->finalize = gmyth_program_info_finalize;
|
rosfran@291
|
57 |
}
|
rosfran@291
|
58 |
|
rosfran@291
|
59 |
static void
|
rosfran@291
|
60 |
gmyth_program_info_init (GMythProgramInfo *gmyth_program_info)
|
rosfran@298
|
61 |
{
|
rosfran@291
|
62 |
gmyth_program_info->chancommfree = 0;
|
rosfran@291
|
63 |
|
rosfran@291
|
64 |
/** A flag informing if the program has video or not. */
|
rosfran@291
|
65 |
gmyth_program_info->isVideo = FALSE;
|
rosfran@291
|
66 |
gmyth_program_info->lenMins = 0;
|
rosfran@291
|
67 |
|
rosfran@291
|
68 |
gmyth_program_info->stars = 0.0f;
|
rosfran@291
|
69 |
gmyth_program_info->repeat = 0;
|
rosfran@291
|
70 |
|
rosfran@291
|
71 |
gmyth_program_info->hasAirDate = FALSE;
|
rosfran@291
|
72 |
|
rosfran@291
|
73 |
gmyth_program_info->spread = 0;
|
rosfran@291
|
74 |
gmyth_program_info->startCol = 0;
|
rosfran@291
|
75 |
|
rosfran@291
|
76 |
gmyth_program_info->recpriority2 = 0;
|
rosfran@291
|
77 |
gmyth_program_info->reactivate = 0;
|
rosfran@291
|
78 |
|
rosfran@291
|
79 |
gmyth_program_info->recordid = 0;
|
rosfran@291
|
80 |
gmyth_program_info->parentid = 0;
|
rosfran@291
|
81 |
|
rosfran@291
|
82 |
/** The backend video source id associated to this program.*/
|
rosfran@291
|
83 |
gmyth_program_info->sourceid = 0;
|
rosfran@291
|
84 |
/** the backend input id associated to this program.*/
|
rosfran@291
|
85 |
gmyth_program_info->inputid = 0;
|
rosfran@291
|
86 |
/** The backend card id associated to this program.*/
|
rosfran@291
|
87 |
gmyth_program_info->cardid = 0;
|
rosfran@291
|
88 |
gmyth_program_info->shareable = FALSE;
|
rosfran@291
|
89 |
gmyth_program_info->duplicate = FALSE;
|
rosfran@291
|
90 |
|
rosfran@291
|
91 |
gmyth_program_info->findid = 0;
|
rosfran@291
|
92 |
|
rosfran@291
|
93 |
gmyth_program_info->programflags = 0;
|
rosfran@291
|
94 |
gmyth_program_info->transcoder = 0;
|
rosfran@291
|
95 |
|
rosfran@291
|
96 |
gmyth_program_info->recpriority = 0;
|
rosfran@291
|
97 |
|
rosfran@291
|
98 |
/** The file size of the recorded program.*/
|
rosfran@291
|
99 |
gmyth_program_info->filesize = -1;
|
rosfran@298
|
100 |
|
rosfran@291
|
101 |
|
rosfran@291
|
102 |
}
|
rosfran@291
|
103 |
|
rosfran@291
|
104 |
static void
|
rosfran@291
|
105 |
gmyth_program_info_dispose (GObject *object)
|
rosfran@291
|
106 |
{
|
rosfran@298
|
107 |
GMythProgramInfo *gmyth_program_info = GMYTH_PROGRAM_INFO(object);
|
melunko@313
|
108 |
|
rosfran@298
|
109 |
if ( gmyth_program_info->chanid != NULL )
|
rosfran@298
|
110 |
{
|
rosfran@298
|
111 |
g_string_free( gmyth_program_info->chanid, TRUE );
|
rosfran@298
|
112 |
gmyth_program_info->chanid = NULL;
|
rosfran@298
|
113 |
}
|
rosfran@298
|
114 |
|
rosfran@298
|
115 |
/** The program start time. */
|
rosfran@298
|
116 |
if ( gmyth_program_info->startts != NULL )
|
rosfran@298
|
117 |
{
|
rosfran@298
|
118 |
g_free( gmyth_program_info->startts);
|
rosfran@298
|
119 |
gmyth_program_info->startts = NULL;
|
rosfran@298
|
120 |
}
|
rosfran@298
|
121 |
|
rosfran@298
|
122 |
/** The program end time. */
|
rosfran@298
|
123 |
if ( gmyth_program_info->endts != NULL )
|
rosfran@298
|
124 |
{
|
rosfran@298
|
125 |
g_free( gmyth_program_info->endts );
|
rosfran@298
|
126 |
gmyth_program_info->endts = NULL;
|
rosfran@298
|
127 |
}
|
rosfran@298
|
128 |
|
rosfran@298
|
129 |
/** The recording schedule start time. */
|
rosfran@298
|
130 |
if ( gmyth_program_info->recstartts != NULL )
|
rosfran@298
|
131 |
{
|
rosfran@298
|
132 |
g_free( gmyth_program_info->recstartts );
|
rosfran@298
|
133 |
gmyth_program_info->recstartts = NULL;
|
rosfran@298
|
134 |
}
|
rosfran@298
|
135 |
|
rosfran@298
|
136 |
/** The recording schedule end time */
|
rosfran@298
|
137 |
if ( gmyth_program_info->recendts != NULL )
|
rosfran@298
|
138 |
{
|
rosfran@298
|
139 |
g_free(gmyth_program_info->recendts);
|
rosfran@298
|
140 |
gmyth_program_info->recendts = NULL;
|
rosfran@298
|
141 |
}
|
rosfran@298
|
142 |
|
rosfran@298
|
143 |
/** The program title. */
|
rosfran@298
|
144 |
if (gmyth_program_info->title != NULL )
|
rosfran@298
|
145 |
{
|
rosfran@298
|
146 |
g_string_free(gmyth_program_info->title, TRUE);
|
rosfran@298
|
147 |
gmyth_program_info->title = NULL;
|
rosfran@298
|
148 |
}
|
rosfran@298
|
149 |
|
rosfran@298
|
150 |
/** The program subtitle. */
|
rosfran@298
|
151 |
if (gmyth_program_info->subtitle != NULL )
|
rosfran@298
|
152 |
{
|
rosfran@298
|
153 |
g_string_free(gmyth_program_info->subtitle, TRUE );
|
rosfran@298
|
154 |
gmyth_program_info->subtitle = NULL;
|
rosfran@298
|
155 |
}
|
rosfran@298
|
156 |
/** The program description. */
|
rosfran@298
|
157 |
if ( gmyth_program_info->description != NULL )
|
rosfran@298
|
158 |
{
|
rosfran@298
|
159 |
g_string_free( gmyth_program_info->description, TRUE );
|
rosfran@298
|
160 |
gmyth_program_info->description = NULL;
|
rosfran@298
|
161 |
}
|
rosfran@298
|
162 |
|
rosfran@298
|
163 |
/** The program category. */
|
rosfran@298
|
164 |
if ( gmyth_program_info->category != NULL )
|
rosfran@298
|
165 |
{
|
rosfran@298
|
166 |
g_string_free( gmyth_program_info->category, TRUE );
|
rosfran@298
|
167 |
gmyth_program_info->category = NULL;
|
rosfran@298
|
168 |
}
|
rosfran@298
|
169 |
|
rosfran@298
|
170 |
if ( gmyth_program_info->chanstr != NULL )
|
rosfran@298
|
171 |
{
|
rosfran@298
|
172 |
g_string_free( gmyth_program_info->chanstr, TRUE );
|
rosfran@298
|
173 |
gmyth_program_info->chanstr = NULL;
|
rosfran@298
|
174 |
}
|
rosfran@298
|
175 |
if ( gmyth_program_info->chansign != NULL )
|
rosfran@298
|
176 |
{
|
rosfran@298
|
177 |
g_string_free( gmyth_program_info->chansign, TRUE );
|
rosfran@298
|
178 |
gmyth_program_info->chansign = NULL;
|
rosfran@298
|
179 |
}
|
rosfran@298
|
180 |
/** The associated channel name. */
|
rosfran@298
|
181 |
if ( gmyth_program_info->channame != NULL )
|
rosfran@298
|
182 |
{
|
rosfran@298
|
183 |
g_string_free( gmyth_program_info->channame, TRUE );
|
rosfran@298
|
184 |
gmyth_program_info->channame = NULL;
|
rosfran@298
|
185 |
}
|
rosfran@298
|
186 |
if ( gmyth_program_info->chanOutputFilters != NULL )
|
rosfran@298
|
187 |
{
|
rosfran@298
|
188 |
g_string_free( gmyth_program_info->chanOutputFilters, TRUE );
|
rosfran@298
|
189 |
gmyth_program_info->chanOutputFilters = NULL;
|
rosfran@298
|
190 |
}
|
rosfran@298
|
191 |
|
rosfran@298
|
192 |
if ( gmyth_program_info->seriesid != NULL )
|
rosfran@298
|
193 |
{
|
melunko@313
|
194 |
g_string_free( gmyth_program_info->seriesid, TRUE );
|
rosfran@298
|
195 |
gmyth_program_info->chanOutputFilters = NULL;
|
rosfran@298
|
196 |
|
rosfran@298
|
197 |
}
|
rosfran@298
|
198 |
/** The program unique id. */
|
rosfran@298
|
199 |
if ( gmyth_program_info->programid != NULL )
|
rosfran@298
|
200 |
{
|
rosfran@298
|
201 |
g_string_free( gmyth_program_info->programid, TRUE );
|
rosfran@298
|
202 |
gmyth_program_info->programid = NULL;
|
rosfran@298
|
203 |
|
rosfran@298
|
204 |
}
|
rosfran@298
|
205 |
if ( gmyth_program_info->catType != NULL )
|
rosfran@298
|
206 |
{
|
rosfran@298
|
207 |
g_string_free( gmyth_program_info->catType, TRUE );
|
rosfran@298
|
208 |
gmyth_program_info->catType = NULL;
|
rosfran@298
|
209 |
|
rosfran@298
|
210 |
}
|
rosfran@298
|
211 |
|
rosfran@298
|
212 |
if ( gmyth_program_info->sortTitle != NULL )
|
rosfran@298
|
213 |
{
|
rosfran@298
|
214 |
g_string_free( gmyth_program_info->sortTitle, TRUE );
|
rosfran@298
|
215 |
gmyth_program_info->sortTitle = NULL;
|
rosfran@298
|
216 |
|
rosfran@298
|
217 |
}
|
rosfran@298
|
218 |
|
rosfran@298
|
219 |
if ( gmyth_program_info->year != NULL )
|
rosfran@298
|
220 |
{
|
rosfran@298
|
221 |
g_string_free( gmyth_program_info->year, TRUE );
|
rosfran@298
|
222 |
gmyth_program_info->year = NULL;
|
rosfran@298
|
223 |
|
rosfran@298
|
224 |
}
|
rosfran@298
|
225 |
|
rosfran@298
|
226 |
if ( gmyth_program_info->originalAirDate != NULL )
|
rosfran@298
|
227 |
{
|
rosfran@298
|
228 |
g_free( gmyth_program_info->originalAirDate);
|
rosfran@298
|
229 |
gmyth_program_info->originalAirDate = NULL;
|
rosfran@298
|
230 |
}
|
rosfran@298
|
231 |
if ( gmyth_program_info->lastmodified != NULL )
|
rosfran@298
|
232 |
{
|
rosfran@298
|
233 |
g_free( gmyth_program_info->lastmodified );
|
rosfran@298
|
234 |
gmyth_program_info->lastmodified = NULL;
|
rosfran@298
|
235 |
|
rosfran@298
|
236 |
}
|
rosfran@298
|
237 |
if (gmyth_program_info->lastInUseTime != NULL)
|
rosfran@298
|
238 |
{
|
rosfran@298
|
239 |
g_free( gmyth_program_info->lastInUseTime );
|
rosfran@298
|
240 |
gmyth_program_info->lastInUseTime = NULL;
|
rosfran@298
|
241 |
}
|
rosfran@298
|
242 |
|
rosfran@298
|
243 |
if ( gmyth_program_info->schedulerid != NULL )
|
rosfran@298
|
244 |
{
|
rosfran@298
|
245 |
g_string_free( gmyth_program_info->schedulerid, TRUE );
|
rosfran@298
|
246 |
gmyth_program_info->schedulerid = NULL;
|
rosfran@298
|
247 |
}
|
rosfran@298
|
248 |
|
rosfran@298
|
249 |
if ( gmyth_program_info->recgroup != NULL )
|
rosfran@298
|
250 |
{
|
rosfran@298
|
251 |
g_string_free( gmyth_program_info->recgroup, TRUE );
|
rosfran@298
|
252 |
gmyth_program_info->recgroup = NULL;
|
rosfran@298
|
253 |
}
|
rosfran@298
|
254 |
if ( gmyth_program_info->playgroup != NULL )
|
rosfran@298
|
255 |
{
|
rosfran@298
|
256 |
g_string_free( gmyth_program_info->playgroup, TRUE );
|
rosfran@298
|
257 |
gmyth_program_info->playgroup = NULL;
|
rosfran@298
|
258 |
}
|
rosfran@298
|
259 |
|
rosfran@298
|
260 |
/** The file name of the recorded program.*/
|
rosfran@298
|
261 |
if ( gmyth_program_info->pathname != NULL)
|
rosfran@298
|
262 |
{
|
rosfran@298
|
263 |
g_string_free( gmyth_program_info->pathname, TRUE );
|
rosfran@298
|
264 |
gmyth_program_info->pathname = NULL;
|
rosfran@298
|
265 |
}
|
melunko@314
|
266 |
|
rosfran@298
|
267 |
if ( gmyth_program_info->hostname != NULL )
|
rosfran@298
|
268 |
{
|
rosfran@298
|
269 |
g_string_free( gmyth_program_info->hostname, TRUE );
|
rosfran@298
|
270 |
gmyth_program_info->hostname = NULL;
|
rosfran@298
|
271 |
}
|
rosfran@291
|
272 |
|
rosfran@291
|
273 |
G_OBJECT_CLASS (gmyth_program_info_parent_class)->dispose (object);
|
rosfran@291
|
274 |
}
|
rosfran@291
|
275 |
|
rosfran@291
|
276 |
static void
|
rosfran@291
|
277 |
gmyth_program_info_finalize (GObject *object)
|
rosfran@291
|
278 |
{
|
rosfran@291
|
279 |
g_signal_handlers_destroy (object);
|
rosfran@291
|
280 |
|
rosfran@291
|
281 |
G_OBJECT_CLASS (gmyth_program_info_parent_class)->finalize (object);
|
rosfran@291
|
282 |
}
|
rosfran@291
|
283 |
|
rosfran@291
|
284 |
/**
|
rosfran@291
|
285 |
* Creates a new instance of GMythProgramInfo.
|
rosfran@291
|
286 |
*
|
rosfran@291
|
287 |
* @return a new instance of GMythProgramInfo.
|
rosfran@291
|
288 |
*/
|
rosfran@291
|
289 |
GMythProgramInfo*
|
rosfran@291
|
290 |
gmyth_program_info_new (void)
|
rosfran@291
|
291 |
{
|
rosfran@291
|
292 |
GMythProgramInfo *program_info = GMYTH_PROGRAM_INFO (g_object_new(GMYTH_PROGRAM_INFO_TYPE, NULL));
|
rosfran@291
|
293 |
|
rosfran@291
|
294 |
return program_info;
|
rosfran@291
|
295 |
}
|
melunko@128
|
296 |
|
melunko@128
|
297 |
GMythStringList*
|
melunko@128
|
298 |
gmyth_program_info_to_string_list (GMythProgramInfo *prog, GMythStringList *slist)
|
melunko@128
|
299 |
{
|
melunko@128
|
300 |
g_return_val_if_fail (prog != NULL, NULL);
|
melunko@128
|
301 |
g_return_val_if_fail (slist != NULL, NULL);
|
melunko@128
|
302 |
|
rosfran@310
|
303 |
gmyth_string_list_append_string (slist, prog->title); /* 0 */
|
rosfran@310
|
304 |
gmyth_string_list_append_string (slist, prog->subtitle); /* 1 */
|
rosfran@310
|
305 |
gmyth_string_list_append_string (slist, prog->description); /* 2 */
|
rosfran@310
|
306 |
gmyth_string_list_append_string (slist, prog->category); /* 3 */
|
rosfran@310
|
307 |
gmyth_string_list_append_string (slist, prog->chanid); /* 4 */
|
rosfran@310
|
308 |
gmyth_string_list_append_string (slist, prog->chanstr); /* 5 */
|
rosfran@310
|
309 |
gmyth_string_list_append_string (slist, prog->chansign); /* 6 */
|
rosfran@310
|
310 |
gmyth_string_list_append_string (slist, prog->channame); /* 7 */
|
rosfran@310
|
311 |
gmyth_string_list_append_string (slist, prog->pathname); /* 8 */
|
rosfran@321
|
312 |
gmyth_string_list_append_int (slist, 0); /* 11 */
|
melunko@128
|
313 |
|
melunko@316
|
314 |
// fixme
|
rosfran@321
|
315 |
//gmyth_string_list_append_int64 (slist, 100/*prog->filesize*/); /* 9 */
|
rosfran@321
|
316 |
gmyth_string_list_append_int64 (slist, 0); /* 11 */
|
melunko@316
|
317 |
|
melunko@316
|
318 |
if (prog->startts)
|
melunko@316
|
319 |
gmyth_string_list_append_int (slist, prog->startts->tv_sec); /* 11 */ //DATETIME_TO_LIST(startts)
|
melunko@316
|
320 |
else
|
melunko@316
|
321 |
gmyth_string_list_append_int (slist, 0);
|
melunko@316
|
322 |
|
melunko@316
|
323 |
if (prog->endts)
|
melunko@316
|
324 |
gmyth_string_list_append_int (slist, prog->endts->tv_sec); /* 12 */ //DATETIME_TO_LIST(endts)
|
melunko@316
|
325 |
else
|
melunko@316
|
326 |
gmyth_string_list_append_int (slist, 0);
|
melunko@316
|
327 |
|
rosfran@310
|
328 |
gmyth_string_list_append_int (slist, prog->duplicate); /* 13 */
|
rosfran@310
|
329 |
gmyth_string_list_append_int (slist, prog->shareable); /* 14 */
|
rosfran@310
|
330 |
gmyth_string_list_append_int (slist, prog->findid); /* 15 */
|
rosfran@310
|
331 |
gmyth_string_list_append_string (slist, prog->hostname); /* 16 */
|
rosfran@310
|
332 |
gmyth_string_list_append_int (slist, prog->sourceid); /* 17 */
|
rosfran@310
|
333 |
gmyth_string_list_append_int (slist, prog->cardid); /* 18 */
|
rosfran@310
|
334 |
gmyth_string_list_append_int (slist, prog->inputid); /* 19 */
|
rosfran@310
|
335 |
gmyth_string_list_append_int (slist, prog->recpriority); /* 20 */
|
rosfran@310
|
336 |
gmyth_string_list_append_int (slist, 0 /*prog->recstatus*/); /* 21 */
|
rosfran@310
|
337 |
gmyth_string_list_append_int (slist, prog->recordid); /* 22 */
|
rosfran@310
|
338 |
gmyth_string_list_append_int (slist, 0 /*prog->rectype*/); /* 23 */
|
rosfran@310
|
339 |
gmyth_string_list_append_int (slist, 0 /*prog->dupin*/); /* 24 */
|
rosfran@310
|
340 |
gmyth_string_list_append_int (slist, 0 /*prog->dupmethod*/); /* 25 */
|
rosfran@310
|
341 |
gmyth_string_list_append_int (slist, prog->recstartts != NULL ? prog->recstartts->tv_sec : 0); /* 26 */ //DATETIME_TO_LIST(recstartts)
|
rosfran@310
|
342 |
gmyth_string_list_append_int (slist, prog->recendts != NULL ? prog->recendts->tv_sec : 0); /* 27 */ //DATETIME_TO_LIST(recendts)
|
rosfran@310
|
343 |
gmyth_string_list_append_int (slist, prog->repeat); /* 28 */
|
rosfran@310
|
344 |
gmyth_string_list_append_int (slist, prog->programflags); /* 29 */
|
rosfran@310
|
345 |
gmyth_string_list_append_char_array (slist, "Default"); /* 30 */ //prog->(recgroup != "") ? recgroup : "Default")
|
rosfran@310
|
346 |
gmyth_string_list_append_int (slist, prog->chancommfree); /* 31 */
|
rosfran@310
|
347 |
gmyth_string_list_append_string (slist, prog->chanOutputFilters); /* 32 */
|
rosfran@310
|
348 |
gmyth_string_list_append_string (slist, prog->seriesid); /* 33 */
|
rosfran@310
|
349 |
gmyth_string_list_append_string (slist, prog->programid); /* 34 */
|
rosfran@321
|
350 |
gmyth_string_list_append_char_array (slist, ""); /* 35 */
|
rosfran@310
|
351 |
gmyth_string_list_append_int (slist, prog->lastmodified != NULL ? prog->lastmodified->tv_sec : 0); /* 36 */ //DATETIME_TO_LIST(lastmodified)
|
rosfran@310
|
352 |
gmyth_string_list_append_int (slist, 0); /* 37 */ //FLOAT_TO_LIST(stars)
|
rosfran@310
|
353 |
gmyth_string_list_append_int (slist, prog->originalAirDate != NULL ? prog->originalAirDate->tv_sec : 0); /* 38 */ //DATETIME_TO_LIST(QDateTime(originalAirDate))
|
rosfran@310
|
354 |
gmyth_string_list_append_int (slist, prog->hasAirDate); /* 39 */
|
rosfran@310
|
355 |
gmyth_string_list_append_char_array (slist, "Default"); /* 40 */ //prog->(playgroup != "") ? playgroup : "Default")
|
rosfran@310
|
356 |
gmyth_string_list_append_int (slist, prog->recpriority2); /* 41 */
|
melunko@128
|
357 |
|
melunko@128
|
358 |
return slist;
|
melunko@128
|
359 |
}
|
melunko@128
|
360 |
|
melunko@128
|
361 |
GMythProgramInfo*
|
rosfran@291
|
362 |
gmyth_program_info_from_string_list ( GMythStringList *slist )
|
melunko@128
|
363 |
{
|
rosfran@291
|
364 |
GMythProgramInfo *prog = gmyth_program_info_new();
|
rosfran@291
|
365 |
|
rosfran@291
|
366 |
g_return_val_if_fail (slist != NULL, NULL);
|
rosfran@302
|
367 |
/*
|
rosfran@302
|
368 |
Unknown
|
rosfran@302
|
369 |
|
rosfran@302
|
370 |
|
rosfran@302
|
371 |
|
rosfran@302
|
372 |
1000
|
rosfran@302
|
373 |
9
|
rosfran@302
|
374 |
1000
|
rosfran@302
|
375 |
Band
|
rosfran@302
|
376 |
/mnt/store//1000_20070125110059.nuv
|
rosfran@302
|
377 |
0
|
rosfran@302
|
378 |
0
|
rosfran@302
|
379 |
1169733659
|
rosfran@302
|
380 |
1169735400
|
rosfran@302
|
381 |
0
|
rosfran@302
|
382 |
0
|
rosfran@302
|
383 |
0
|
rosfran@302
|
384 |
hmelo-desktop
|
rosfran@302
|
385 |
0
|
rosfran@302
|
386 |
1
|
rosfran@302
|
387 |
0
|
rosfran@302
|
388 |
0
|
rosfran@302
|
389 |
-2
|
rosfran@302
|
390 |
0
|
rosfran@302
|
391 |
0
|
rosfran@302
|
392 |
15
|
rosfran@302
|
393 |
6
|
rosfran@302
|
394 |
1169733659
|
rosfran@302
|
395 |
1169735400
|
rosfran@302
|
396 |
0
|
rosfran@302
|
397 |
0
|
rosfran@302
|
398 |
LiveTV
|
rosfran@302
|
399 |
0
|
rosfran@302
|
400 |
|
rosfran@302
|
401 |
|
rosfran@302
|
402 |
|
rosfran@302
|
403 |
1169733659
|
rosfran@302
|
404 |
0.000000
|
rosfran@302
|
405 |
-1
|
rosfran@302
|
406 |
0
|
rosfran@302
|
407 |
Default
|
rosfran@302
|
408 |
0
|
rosfran@302
|
409 |
*/
|
rosfran@292
|
410 |
prog->title = gmyth_string_list_get_string (slist, 0);
|
rosfran@292
|
411 |
prog->subtitle = gmyth_string_list_get_string (slist, 1);
|
rosfran@292
|
412 |
prog->description = gmyth_string_list_get_string (slist, 2);
|
rosfran@292
|
413 |
prog->category = gmyth_string_list_get_string (slist, 3);
|
rosfran@321
|
414 |
//gmyth_string_list_get_string (slist, 4);
|
rosfran@292
|
415 |
prog->chanid = gmyth_string_list_get_string (slist, 4);
|
rosfran@321
|
416 |
prog->channame = gmyth_string_list_get_string (slist, 5);
|
rosfran@321
|
417 |
prog->chanstr = gmyth_string_list_get_string (slist, 6);
|
rosfran@321
|
418 |
prog->chansign = gmyth_string_list_get_string (slist, 7);
|
rosfran@321
|
419 |
prog->pathname = gmyth_string_list_get_string (slist, 8);
|
rosfran@321
|
420 |
//gmyth_string_list_get_int (slist, 9);
|
rosfran@321
|
421 |
|
rosfran@292
|
422 |
prog->filesize = gmyth_string_list_get_int64 (slist, 9);
|
rosfran@291
|
423 |
|
rosfran@307
|
424 |
prog->startts = gmyth_util_string_to_time_val( (gmyth_util_time_to_isoformat(
|
rosfran@321
|
425 |
(time_t)gmyth_string_list_get_int64 (slist, 11) ))->str ); //DATETIME_TO_LIST(startts)
|
rosfran@307
|
426 |
prog->endts = gmyth_util_string_to_time_val( (gmyth_util_time_to_isoformat(
|
rosfran@307
|
427 |
(time_t)gmyth_string_list_get_int (slist, 12) ))->str ); //DATETIME_TO_LIST(endts)
|
rosfran@307
|
428 |
prog->duplicate = gmyth_string_list_get_int (slist, 13);
|
rosfran@307
|
429 |
prog->shareable = gmyth_string_list_get_int (slist, 14);
|
rosfran@307
|
430 |
prog->findid = gmyth_string_list_get_int (slist, 15);
|
rosfran@307
|
431 |
prog->hostname = gmyth_string_list_get_string (slist, 16);
|
rosfran@307
|
432 |
prog->sourceid = gmyth_string_list_get_int (slist, 17);
|
rosfran@307
|
433 |
prog->cardid = gmyth_string_list_get_int (slist, 18);
|
rosfran@307
|
434 |
prog->inputid = gmyth_string_list_get_int (slist, 19);
|
rosfran@307
|
435 |
prog->recpriority = gmyth_string_list_get_int (slist, 20);
|
rosfran@307
|
436 |
prog->reactivate = gmyth_string_list_get_int (slist, 21);
|
rosfran@307
|
437 |
prog->recordid = gmyth_string_list_get_int (slist, 22);
|
rosfran@292
|
438 |
gmyth_string_list_get_int (slist, 23);
|
rosfran@292
|
439 |
gmyth_string_list_get_int (slist, 24);
|
rosfran@307
|
440 |
gmyth_string_list_get_int (slist, 25);
|
rosfran@307
|
441 |
prog->recstartts = gmyth_util_string_to_time_val( (gmyth_util_time_to_isoformat(
|
rosfran@307
|
442 |
(time_t)gmyth_string_list_get_int (slist, 26) ))->str ); //DATETIME_TO_LIST(recstartts)
|
rosfran@307
|
443 |
prog->recendts = gmyth_util_string_to_time_val( (gmyth_util_time_to_isoformat(
|
rosfran@307
|
444 |
(time_t)gmyth_string_list_get_int (slist, 27) ))->str ); //DATETIME_TO_LIST(recendts)
|
rosfran@307
|
445 |
prog->repeat = gmyth_string_list_get_int (slist, 28);
|
rosfran@307
|
446 |
prog->programflags = gmyth_string_list_get_int (slist, 29);
|
rosfran@307
|
447 |
prog->recgroup = gmyth_string_list_get_string (slist, 30); //prog->(recgroup != "") ? recgroup : "Default")
|
rosfran@307
|
448 |
prog->chancommfree = gmyth_string_list_get_int (slist, 31);
|
rosfran@307
|
449 |
prog->chanOutputFilters = gmyth_string_list_get_string (slist, 32);
|
rosfran@307
|
450 |
prog->seriesid = gmyth_string_list_get_string (slist, 33);
|
rosfran@307
|
451 |
prog->programid = gmyth_string_list_get_string (slist, 34);
|
rosfran@310
|
452 |
gmyth_string_list_get_string (slist, 35);
|
rosfran@310
|
453 |
prog->lastmodified = gmyth_util_string_to_time_val( (gmyth_util_time_to_isoformat(
|
rosfran@310
|
454 |
(time_t)gmyth_string_list_get_int (slist, 36) ))->str ); //DATETIME_TO_LIST(lastmodified)
|
rosfran@310
|
455 |
gmyth_string_list_get_int (slist, 37); //FLOAT_TO_LIST(stars)
|
rosfran@310
|
456 |
prog->originalAirDate = gmyth_util_string_to_time_val( (gmyth_util_time_to_isoformat(
|
rosfran@310
|
457 |
(time_t)gmyth_string_list_get_int (slist, 38) ))->str ); //DATETIME_TO_LIST(QDateTime(originalAirDate))
|
rosfran@310
|
458 |
prog->hasAirDate = gmyth_string_list_get_int (slist, 39);
|
rosfran@310
|
459 |
prog->playgroup = gmyth_string_list_get_string (slist, 40); //prog->(playgroup != "") ? playgroup : "Default")
|
rosfran@310
|
460 |
prog->recpriority2 = gmyth_string_list_get_int (slist, 41);
|
rosfran@291
|
461 |
|
rosfran@291
|
462 |
return prog;
|
melunko@128
|
463 |
}
|