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