branches/gmyth-0.1b/src/gmyth_scheduler.h
author morphbr
Sat Feb 10 20:01:54 2007 +0000 (2007-02-10)
branchtrunk
changeset 349 7005e696052c
permissions -rw-r--r--
[svn r351] - Bug fix in gmyth_util.c: included support for time without seconds in gmyth_util_string_to_time_val_fmt (XML format from backend)
- Bug fix in gmyth_http.c: fixed bug when there are no channels
- gmyth_vlc.c/h: included support to specify a port when connecting to VLC
- tests: fixed vlc test file regarding the fix above
created script to compile http test app
renatofilho@320
     1
/**
renatofilho@320
     2
 * GMyth Library
renatofilho@320
     3
 *
renatofilho@320
     4
 * @file gmyth/gmyth_scheduler.h
renatofilho@320
     5
 * 
renatofilho@320
     6
 * @brief <p> The scheduler encapsulates all functions for browsing, scheduling
renatofilho@320
     7
 * and modifying the recorded content.
renatofilho@320
     8
 *
renatofilho@320
     9
 * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
renatofilho@320
    10
 * @author Alexsandro Jose Virginio dos Santos <alexsandro.santos@indt.org.br>
renatofilho@320
    11
 *
renatofilho@320
    12
 *//*
renatofilho@320
    13
 * 
renatofilho@320
    14
 * This program is free software; you can redistribute it and/or modify
renatofilho@320
    15
 * it under the terms of the GNU Lesser General Public License as published by
renatofilho@320
    16
 * the Free Software Foundation; either version 2 of the License, or
renatofilho@320
    17
 * (at your option) any later version.
renatofilho@320
    18
 *
renatofilho@320
    19
 * This program is distributed in the hope that it will be useful,
renatofilho@320
    20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
renatofilho@320
    21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
renatofilho@320
    22
 * GNU General Public License for more details.
renatofilho@320
    23
 *
renatofilho@320
    24
 * You should have received a copy of the GNU Lesser General Public License
renatofilho@320
    25
 * along with this program; if not, write to the Free Software
renatofilho@320
    26
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
renatofilho@320
    27
 */
renatofilho@320
    28
renatofilho@320
    29
#ifndef __GMYTH_SCHEDULER_H__
renatofilho@320
    30
#define __GMYTH_SCHEDULER_H__
renatofilho@320
    31
renatofilho@320
    32
#include <glib-object.h>
renatofilho@320
    33
#include <time.h>
renatofilho@320
    34
renatofilho@320
    35
#include "gmyth_common.h"
renatofilho@320
    36
#include "gmyth_query.h"
renatofilho@320
    37
#include "gmyth_backendinfo.h"
renatofilho@320
    38
renatofilho@320
    39
G_BEGIN_DECLS
renatofilho@320
    40
renatofilho@320
    41
#define GMYTH_SCHEDULER_TYPE               (gmyth_scheduler_get_type ())
renatofilho@320
    42
#define GMYTH_SCHEDULER(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_SCHEDULER_TYPE, GMythScheduler))
renatofilho@320
    43
#define GMYTH_SCHEDULER_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SCHEDULER_TYPE, GMythSchedulerClass))
renatofilho@320
    44
#define IS_GMYTH_SCHEDULER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_SCHEDULER_TYPE))
renatofilho@320
    45
#define IS_GMYTH_SCHEDULER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SCHEDULER_TYPE))
renatofilho@320
    46
#define GMYTH_SCHEDULER_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_SCHEDULER_TYPE, GMythSchedulerClass))
renatofilho@320
    47
renatofilho@320
    48
renatofilho@320
    49
typedef struct _GMythScheduler         GMythScheduler;
renatofilho@320
    50
typedef struct _GMythSchedulerClass    GMythSchedulerClass;
renatofilho@320
    51
renatofilho@320
    52
struct _GMythSchedulerClass
renatofilho@320
    53
{
renatofilho@320
    54
  GObjectClass parent_class;
renatofilho@320
    55
renatofilho@320
    56
  /* callbacks */
renatofilho@320
    57
  /* no one for now */
renatofilho@320
    58
};
renatofilho@320
    59
renatofilho@320
    60
struct _GMythScheduler
renatofilho@320
    61
{
renatofilho@320
    62
    GObject parent;
renatofilho@320
    63
renatofilho@320
    64
  	unsigned long recordid;
renatofilho@320
    65
    unsigned long type;
renatofilho@320
    66
    unsigned long search;
renatofilho@320
    67
    GString *profile;
renatofilho@320
    68
    
renatofilho@320
    69
    long dupin;
renatofilho@320
    70
    long dupmethod;
renatofilho@320
    71
    long autoexpire;
renatofilho@320
    72
    short int autotranscode;
renatofilho@320
    73
    long transcoder;
renatofilho@320
    74
    
renatofilho@320
    75
    short int autocommflag;
renatofilho@320
    76
    short int autouserjob1;
renatofilho@320
    77
    short int autouserjob2;
renatofilho@320
    78
    short int autouserjob3;
renatofilho@320
    79
    short int autouserjob4;
renatofilho@320
    80
    
renatofilho@320
    81
    long startoffset;
renatofilho@320
    82
    long endoffset;
renatofilho@320
    83
    long maxepisodes;
renatofilho@320
    84
    long maxnewest;
renatofilho@320
    85
    
renatofilho@320
    86
    long recpriority;
renatofilho@320
    87
    GString *recgroup;
renatofilho@320
    88
    GString *playgroup;
renatofilho@320
    89
    
renatofilho@320
    90
    long prefinput;
renatofilho@320
    91
    short int inactive;
renatofilho@320
    92
    
renatofilho@320
    93
    GString *searchType;
renatofilho@320
    94
    GString *searchForWhat;
renatofilho@320
    95
    
renatofilho@320
    96
    GMythQuery *msqlquery;
renatofilho@320
    97
    GMythBackendInfo *backend_info;
renatofilho@320
    98
};
renatofilho@320
    99
renatofilho@320
   100
typedef struct {
renatofilho@320
   101
	gint    record_id;
renatofilho@320
   102
	gint    program_id;
renatofilho@320
   103
	gint    channel_id;
renatofilho@320
   104
	
renatofilho@320
   105
  GTimeVal* start_time;
renatofilho@320
   106
	GTimeVal* end_time;
renatofilho@320
   107
    
renatofilho@320
   108
	GString *title;
renatofilho@320
   109
	GString *subtitle;
renatofilho@320
   110
	GString *description;
renatofilho@320
   111
	GString *category;
renatofilho@320
   112
    
renatofilho@320
   113
} ScheduleInfo;
renatofilho@320
   114
renatofilho@320
   115
typedef struct {
renatofilho@320
   116
    guint    record_id;
renatofilho@320
   117
    guint    program_id;
renatofilho@320
   118
    guint    channel_id;
renatofilho@320
   119
renatofilho@320
   120
    GTimeVal*  start_time;
renatofilho@320
   121
    GTimeVal*  end_time;
renatofilho@320
   122
renatofilho@320
   123
    GString *title;
renatofilho@320
   124
    GString *subtitle;
renatofilho@320
   125
    GString *description;
renatofilho@320
   126
    GString *category;
renatofilho@320
   127
    
renatofilho@320
   128
    GString *basename;
renatofilho@320
   129
renatofilho@320
   130
    guint64 filesize;
renatofilho@320
   131
    
renatofilho@320
   132
} RecordedInfo;
renatofilho@320
   133
renatofilho@320
   134
renatofilho@320
   135
GType           gmyth_scheduler_get_type (void);
renatofilho@320
   136
renatofilho@320
   137
GMythScheduler* gmyth_scheduler_new ();
renatofilho@320
   138
gboolean        gmyth_scheduler_connect      (GMythScheduler *scheduler, 
renatofilho@320
   139
                                              GMythBackendInfo *backend_info);
renatofilho@320
   140
gboolean        gmyth_scheduler_connect_with_timeout      (GMythScheduler *scheduler, 
renatofilho@320
   141
                                       		GMythBackendInfo *backend_info, guint timeout);
renatofilho@320
   142
gboolean        gmyth_scheduler_disconnect   (GMythScheduler *scheduler);
renatofilho@320
   143
renatofilho@320
   144
gint            gmyth_scheduler_get_schedule_list (GMythScheduler *scheduler, 
renatofilho@320
   145
                                                   GList **sched_list);
renatofilho@320
   146
gint            gmyth_scheduler_get_recorded_list (GMythScheduler *scheduler, 
renatofilho@320
   147
                                                   GList **rec_list);
renatofilho@320
   148
renatofilho@320
   149
GMythProgramInfo* gmyth_scheduler_get_recorded (GMythScheduler *scheduler, 
renatofilho@320
   150
                                        		GString *channel, GTimeVal* starttime);
renatofilho@320
   151
renatofilho@320
   152
gint            gmyth_scheduler_add_schedule(GMythScheduler *scheduler, 
renatofilho@320
   153
                                             ScheduleInfo *schedule_info);
renatofilho@320
   154
renatofilho@320
   155
gint            gmyth_scheduler_delete_schedule (GMythScheduler *scheduler, 
renatofilho@320
   156
                                                 gint record_id);
renatofilho@320
   157
gint            gmyth_scheduler_delete_recorded (GMythScheduler *scheduler, 
renatofilho@320
   158
                                                 gint record_id);
renatofilho@320
   159
renatofilho@320
   160
void            gmyth_scheduler_recorded_info_get_preview (RecordedInfo *info, 
renatofilho@320
   161
                                                           GByteArray* data);
renatofilho@320
   162
renatofilho@320
   163
void            gmyth_scheduler_schedule_info_free (ScheduleInfo *info);
renatofilho@320
   164
void            gmyth_scheduler_recorded_info_free (RecordedInfo *info);
renatofilho@320
   165
renatofilho@320
   166
G_END_DECLS
renatofilho@320
   167
renatofilho@320
   168
#endif /* __GMYTH_SCHEDULER_H__ */
renatofilho@320
   169