gmyth/src/gmyth_file.h
author renatofilho
Tue Jun 19 22:01:13 2007 +0100 (2007-06-19)
branchtrunk
changeset 755 4b5efa290285
parent 754 cb885ee44618
permissions -rwxr-xr-x
[svn r761] create function to get recorded inf; fixe some headers indent
     1 /**
     2  * GMyth Library
     3  *
     4  * @file gmyth/gmyth_file.h
     5  * 
     6  * @brief <p> GMythFile is the parent GMObject that deals with the file streaming 
     7  * media remote/local transfering to the MythTV frontend.
     8  *
     9  * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    10  * @author Rosfran Lins Borges <rosfran.borges@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_FILE_H__
    29 #define __GMYTH_FILE_H__
    30 
    31 #include <glib-object.h>
    32 #include <glib.h>
    33 
    34 #include "gmyth_uri.h"
    35 #include "gmyth_backendinfo.h"
    36 
    37 #include <stdio.h>
    38 #include <stdlib.h>
    39 #include <string.h>
    40 #include <netdb.h>
    41 #include <sys/socket.h>
    42 #include <unistd.h>
    43 
    44 G_BEGIN_DECLS
    45 #define GMYTH_FILE_TYPE               (gmyth_file_get_type ())
    46 #define GMYTH_FILE(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_FILE_TYPE, GMythFile))
    47 #define GMYTH_FILE_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_TYPE, GMythFileClass))
    48 #define IS_GMYTH_FILE(obj)            (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_FILE_TYPE))
    49 #define IS_GMYTH_FILE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_TYPE))
    50 #define GMYTH_FILE_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_FILE_TYPE, GMythFileClass))
    51 
    52 typedef enum {
    53     GMYTH_FILE_READ_OK = 0,
    54     GMYTH_FILE_READ_NEXT_PROG_CHAIN = 1,
    55     GMYTH_FILE_READ_ERROR = 2,
    56     GMYTH_FILE_READ_EOF = 3
    57 } GMythFileReadResult;
    58 
    59 typedef struct _GMythFile GMythFile;
    60 typedef struct _GMythFileClass GMythFileClass;
    61 typedef struct _GMythFilePrivate GMythFilePrivate;
    62 
    63 struct _GMythFile {
    64     GObject         parent;
    65     GMythFilePrivate *priv;
    66 };
    67 
    68 struct _GMythFileClass {
    69     GObjectClass    parent_class;
    70 };
    71 
    72 GType           gmyth_file_get_type                 (void);
    73 GMythFile      *gmyth_file_new                      (GMythBackendInfo   *backend_info);
    74 gchar          *gmyth_file_get_file_name            (GMythFile          *file);
    75 void            gmyth_file_set_file_name            (GMythFile          *file,
    76                                                      const gchar        *filename);
    77 gboolean        gmyth_file_setup                    (GMythFile          *file, 
    78                                                      const gchar        *filename);
    79 void            gmyth_file_close                    (GMythFile          *file);
    80 gboolean        gmyth_file_is_open                  (GMythFile          *file);
    81 guint64         gmyth_file_get_filesize             (GMythFile          *file);
    82 void            gmyth_file_set_filesize             (GMythFile          *file,
    83                                                      guint64            filesize);
    84 gint64          gmyth_file_get_offset               (GMythFile          *file);
    85 void            gmyth_file_set_offset               (GMythFile          *file, 
    86                                                      gint64             offset);
    87 gchar          *gmyth_file_get_uri                  (GMythFile          *file);
    88 
    89 G_END_DECLS
    90 #endif                          /* __GMYTH_FILE_H__ */