1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/branches/gmyth-0.1b/src/gmyth_scheduler.h Wed Feb 14 21:28:49 2007 +0000
1.3 @@ -0,0 +1,169 @@
1.4 +/**
1.5 + * GMyth Library
1.6 + *
1.7 + * @file gmyth/gmyth_scheduler.h
1.8 + *
1.9 + * @brief <p> The scheduler encapsulates all functions for browsing, scheduling
1.10 + * and modifying the recorded content.
1.11 + *
1.12 + * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
1.13 + * @author Alexsandro Jose Virginio dos Santos <alexsandro.santos@indt.org.br>
1.14 + *
1.15 + *//*
1.16 + *
1.17 + * This program is free software; you can redistribute it and/or modify
1.18 + * it under the terms of the GNU Lesser General Public License as published by
1.19 + * the Free Software Foundation; either version 2 of the License, or
1.20 + * (at your option) any later version.
1.21 + *
1.22 + * This program is distributed in the hope that it will be useful,
1.23 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.24 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.25 + * GNU General Public License for more details.
1.26 + *
1.27 + * You should have received a copy of the GNU Lesser General Public License
1.28 + * along with this program; if not, write to the Free Software
1.29 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1.30 + */
1.31 +
1.32 +#ifndef __GMYTH_SCHEDULER_H__
1.33 +#define __GMYTH_SCHEDULER_H__
1.34 +
1.35 +#include <glib-object.h>
1.36 +#include <time.h>
1.37 +
1.38 +#include "gmyth_common.h"
1.39 +#include "gmyth_query.h"
1.40 +#include "gmyth_backendinfo.h"
1.41 +
1.42 +G_BEGIN_DECLS
1.43 +
1.44 +#define GMYTH_SCHEDULER_TYPE (gmyth_scheduler_get_type ())
1.45 +#define GMYTH_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_SCHEDULER_TYPE, GMythScheduler))
1.46 +#define GMYTH_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SCHEDULER_TYPE, GMythSchedulerClass))
1.47 +#define IS_GMYTH_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_SCHEDULER_TYPE))
1.48 +#define IS_GMYTH_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SCHEDULER_TYPE))
1.49 +#define GMYTH_SCHEDULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_SCHEDULER_TYPE, GMythSchedulerClass))
1.50 +
1.51 +
1.52 +typedef struct _GMythScheduler GMythScheduler;
1.53 +typedef struct _GMythSchedulerClass GMythSchedulerClass;
1.54 +
1.55 +struct _GMythSchedulerClass
1.56 +{
1.57 + GObjectClass parent_class;
1.58 +
1.59 + /* callbacks */
1.60 + /* no one for now */
1.61 +};
1.62 +
1.63 +struct _GMythScheduler
1.64 +{
1.65 + GObject parent;
1.66 +
1.67 + unsigned long recordid;
1.68 + unsigned long type;
1.69 + unsigned long search;
1.70 + GString *profile;
1.71 +
1.72 + long dupin;
1.73 + long dupmethod;
1.74 + long autoexpire;
1.75 + short int autotranscode;
1.76 + long transcoder;
1.77 +
1.78 + short int autocommflag;
1.79 + short int autouserjob1;
1.80 + short int autouserjob2;
1.81 + short int autouserjob3;
1.82 + short int autouserjob4;
1.83 +
1.84 + long startoffset;
1.85 + long endoffset;
1.86 + long maxepisodes;
1.87 + long maxnewest;
1.88 +
1.89 + long recpriority;
1.90 + GString *recgroup;
1.91 + GString *playgroup;
1.92 +
1.93 + long prefinput;
1.94 + short int inactive;
1.95 +
1.96 + GString *searchType;
1.97 + GString *searchForWhat;
1.98 +
1.99 + GMythQuery *msqlquery;
1.100 + GMythBackendInfo *backend_info;
1.101 +};
1.102 +
1.103 +typedef struct {
1.104 + gint record_id;
1.105 + gint program_id;
1.106 + gint channel_id;
1.107 +
1.108 + GTimeVal* start_time;
1.109 + GTimeVal* end_time;
1.110 +
1.111 + GString *title;
1.112 + GString *subtitle;
1.113 + GString *description;
1.114 + GString *category;
1.115 +
1.116 +} ScheduleInfo;
1.117 +
1.118 +typedef struct {
1.119 + guint record_id;
1.120 + guint program_id;
1.121 + guint channel_id;
1.122 +
1.123 + GTimeVal* start_time;
1.124 + GTimeVal* end_time;
1.125 +
1.126 + GString *title;
1.127 + GString *subtitle;
1.128 + GString *description;
1.129 + GString *category;
1.130 +
1.131 + GString *basename;
1.132 +
1.133 + guint64 filesize;
1.134 +
1.135 +} RecordedInfo;
1.136 +
1.137 +
1.138 +GType gmyth_scheduler_get_type (void);
1.139 +
1.140 +GMythScheduler* gmyth_scheduler_new ();
1.141 +gboolean gmyth_scheduler_connect (GMythScheduler *scheduler,
1.142 + GMythBackendInfo *backend_info);
1.143 +gboolean gmyth_scheduler_connect_with_timeout (GMythScheduler *scheduler,
1.144 + GMythBackendInfo *backend_info, guint timeout);
1.145 +gboolean gmyth_scheduler_disconnect (GMythScheduler *scheduler);
1.146 +
1.147 +gint gmyth_scheduler_get_schedule_list (GMythScheduler *scheduler,
1.148 + GList **sched_list);
1.149 +gint gmyth_scheduler_get_recorded_list (GMythScheduler *scheduler,
1.150 + GList **rec_list);
1.151 +
1.152 +GMythProgramInfo* gmyth_scheduler_get_recorded (GMythScheduler *scheduler,
1.153 + GString *channel, GTimeVal* starttime);
1.154 +
1.155 +gint gmyth_scheduler_add_schedule(GMythScheduler *scheduler,
1.156 + ScheduleInfo *schedule_info);
1.157 +
1.158 +gint gmyth_scheduler_delete_schedule (GMythScheduler *scheduler,
1.159 + gint record_id);
1.160 +gint gmyth_scheduler_delete_recorded (GMythScheduler *scheduler,
1.161 + gint record_id);
1.162 +
1.163 +void gmyth_scheduler_recorded_info_get_preview (RecordedInfo *info,
1.164 + GByteArray* data);
1.165 +
1.166 +void gmyth_scheduler_schedule_info_free (ScheduleInfo *info);
1.167 +void gmyth_scheduler_recorded_info_free (RecordedInfo *info);
1.168 +
1.169 +G_END_DECLS
1.170 +
1.171 +#endif /* __GMYTH_SCHEDULER_H__ */
1.172 +