4 * @file gmyth/gmyth_file.h
6 * @brief <p> GMythFile is the parent GMObject that deals with the file streaming
7 * media remote/local transfering to the MythTV frontend.
9 * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
10 * @author Rosfran Lins Borges <rosfran.borges@indt.org.br>
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.
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.
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
28 #ifndef __GMYTH_FILE_H__
29 #define __GMYTH_FILE_H__
31 #include <glib-object.h>
34 #include "gmyth_uri.h"
35 #include "gmyth_backendinfo.h"
41 #include <sys/socket.h>
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))
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;
59 typedef struct _GMythFile GMythFile;
60 typedef struct _GMythFileClass GMythFileClass;
61 typedef struct _GMythFilePrivate GMythFilePrivate;
65 GMythFilePrivate *priv;
68 struct _GMythFileClass {
69 GObjectClass parent_class;
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,
84 gint64 gmyth_file_get_offset (GMythFile *file);
85 void gmyth_file_set_offset (GMythFile *file,
87 gchar *gmyth_file_get_uri (GMythFile *file);
90 #endif /* __GMYTH_FILE_H__ */