renatofilho@320: /**
renatofilho@320: * GMyth Library
renatofilho@320: *
renatofilho@320: * @file gmyth/gmyth_scheduler.h
renatofilho@320: *
renatofilho@320: * @brief
The scheduler encapsulates all functions for browsing, scheduling
renatofilho@320: * and modifying the recorded content.
renatofilho@320: *
renatofilho@320: * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
renatofilho@320: * @author Alexsandro Jose Virginio dos Santos
renatofilho@320: *
renatofilho@320: *//*
renatofilho@320: *
renatofilho@320: * This program is free software; you can redistribute it and/or modify
renatofilho@320: * it under the terms of the GNU Lesser General Public License as published by
renatofilho@320: * the Free Software Foundation; either version 2 of the License, or
renatofilho@320: * (at your option) any later version.
renatofilho@320: *
renatofilho@320: * This program is distributed in the hope that it will be useful,
renatofilho@320: * but WITHOUT ANY WARRANTY; without even the implied warranty of
renatofilho@320: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
renatofilho@320: * GNU General Public License for more details.
renatofilho@320: *
renatofilho@320: * You should have received a copy of the GNU Lesser General Public License
renatofilho@320: * along with this program; if not, write to the Free Software
renatofilho@320: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
renatofilho@320: */
renatofilho@320:
renatofilho@320: #ifndef __GMYTH_SCHEDULER_H__
renatofilho@320: #define __GMYTH_SCHEDULER_H__
renatofilho@320:
renatofilho@320: #include
renatofilho@320: #include
renatofilho@320:
renatofilho@320: #include "gmyth_common.h"
renatofilho@320: #include "gmyth_query.h"
renatofilho@320: #include "gmyth_backendinfo.h"
renatofilho@320:
renatofilho@320: G_BEGIN_DECLS
renatofilho@320:
renatofilho@320: #define GMYTH_SCHEDULER_TYPE (gmyth_scheduler_get_type ())
renatofilho@320: #define GMYTH_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_SCHEDULER_TYPE, GMythScheduler))
renatofilho@320: #define GMYTH_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SCHEDULER_TYPE, GMythSchedulerClass))
renatofilho@320: #define IS_GMYTH_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_SCHEDULER_TYPE))
renatofilho@320: #define IS_GMYTH_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SCHEDULER_TYPE))
renatofilho@320: #define GMYTH_SCHEDULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_SCHEDULER_TYPE, GMythSchedulerClass))
renatofilho@320:
renatofilho@320:
renatofilho@320: typedef struct _GMythScheduler GMythScheduler;
renatofilho@320: typedef struct _GMythSchedulerClass GMythSchedulerClass;
renatofilho@320:
renatofilho@320: struct _GMythSchedulerClass
renatofilho@320: {
renatofilho@320: GObjectClass parent_class;
renatofilho@320:
renatofilho@320: /* callbacks */
renatofilho@320: /* no one for now */
renatofilho@320: };
renatofilho@320:
renatofilho@320: struct _GMythScheduler
renatofilho@320: {
renatofilho@320: GObject parent;
renatofilho@320:
renatofilho@320: unsigned long recordid;
renatofilho@320: unsigned long type;
renatofilho@320: unsigned long search;
renatofilho@320: GString *profile;
renatofilho@320:
renatofilho@320: long dupin;
renatofilho@320: long dupmethod;
renatofilho@320: long autoexpire;
renatofilho@320: short int autotranscode;
renatofilho@320: long transcoder;
renatofilho@320:
renatofilho@320: short int autocommflag;
renatofilho@320: short int autouserjob1;
renatofilho@320: short int autouserjob2;
renatofilho@320: short int autouserjob3;
renatofilho@320: short int autouserjob4;
renatofilho@320:
renatofilho@320: long startoffset;
renatofilho@320: long endoffset;
renatofilho@320: long maxepisodes;
renatofilho@320: long maxnewest;
renatofilho@320:
renatofilho@320: long recpriority;
renatofilho@320: GString *recgroup;
renatofilho@320: GString *playgroup;
renatofilho@320:
renatofilho@320: long prefinput;
renatofilho@320: short int inactive;
renatofilho@320:
renatofilho@320: GString *searchType;
renatofilho@320: GString *searchForWhat;
renatofilho@320:
renatofilho@320: GMythQuery *msqlquery;
renatofilho@320: GMythBackendInfo *backend_info;
renatofilho@320: };
renatofilho@320:
renatofilho@320: typedef struct {
renatofilho@320: gint record_id;
renatofilho@320: gint program_id;
renatofilho@320: gint channel_id;
renatofilho@320:
renatofilho@320: GTimeVal* start_time;
renatofilho@320: GTimeVal* end_time;
renatofilho@320:
renatofilho@320: GString *title;
renatofilho@320: GString *subtitle;
renatofilho@320: GString *description;
renatofilho@320: GString *category;
renatofilho@320:
renatofilho@320: } ScheduleInfo;
renatofilho@320:
renatofilho@320: typedef struct {
renatofilho@320: guint record_id;
renatofilho@320: guint program_id;
renatofilho@320: guint channel_id;
renatofilho@320:
renatofilho@320: GTimeVal* start_time;
renatofilho@320: GTimeVal* end_time;
renatofilho@320:
renatofilho@320: GString *title;
renatofilho@320: GString *subtitle;
renatofilho@320: GString *description;
renatofilho@320: GString *category;
renatofilho@320:
renatofilho@320: GString *basename;
renatofilho@320:
renatofilho@320: guint64 filesize;
renatofilho@320:
renatofilho@320: } RecordedInfo;
renatofilho@320:
renatofilho@320:
renatofilho@320: GType gmyth_scheduler_get_type (void);
renatofilho@320:
renatofilho@320: GMythScheduler* gmyth_scheduler_new ();
renatofilho@320: gboolean gmyth_scheduler_connect (GMythScheduler *scheduler,
renatofilho@320: GMythBackendInfo *backend_info);
renatofilho@320: gboolean gmyth_scheduler_connect_with_timeout (GMythScheduler *scheduler,
renatofilho@320: GMythBackendInfo *backend_info, guint timeout);
renatofilho@320: gboolean gmyth_scheduler_disconnect (GMythScheduler *scheduler);
renatofilho@320:
renatofilho@320: gint gmyth_scheduler_get_schedule_list (GMythScheduler *scheduler,
renatofilho@320: GList **sched_list);
renatofilho@320: gint gmyth_scheduler_get_recorded_list (GMythScheduler *scheduler,
renatofilho@320: GList **rec_list);
renatofilho@320:
renatofilho@320: GMythProgramInfo* gmyth_scheduler_get_recorded (GMythScheduler *scheduler,
renatofilho@320: GString *channel, GTimeVal* starttime);
renatofilho@320:
renatofilho@320: gint gmyth_scheduler_add_schedule(GMythScheduler *scheduler,
renatofilho@320: ScheduleInfo *schedule_info);
renatofilho@320:
renatofilho@320: gint gmyth_scheduler_delete_schedule (GMythScheduler *scheduler,
renatofilho@320: gint record_id);
renatofilho@320: gint gmyth_scheduler_delete_recorded (GMythScheduler *scheduler,
renatofilho@320: gint record_id);
renatofilho@320:
renatofilho@320: void gmyth_scheduler_recorded_info_get_preview (RecordedInfo *info,
renatofilho@320: GByteArray* data);
renatofilho@320:
renatofilho@320: void gmyth_scheduler_schedule_info_free (ScheduleInfo *info);
renatofilho@320: void gmyth_scheduler_recorded_info_free (RecordedInfo *info);
renatofilho@320:
renatofilho@320: G_END_DECLS
renatofilho@320:
renatofilho@320: #endif /* __GMYTH_SCHEDULER_H__ */
renatofilho@320: