4 * @file gmyth/gmyth_file_transfer.h
6 * @brief <p> GMythFileTransfer deals with the file streaming media remote/local
7 * 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_TRANSFER_H__
29 #define __GMYTH_FILE_TRANSFER_H__
31 #include <glib-object.h>
34 #include "gmyth_file.h"
35 #include "gmyth_socket.h"
36 #include "gmyth_uri.h"
37 #include "gmyth_backendinfo.h"
43 #include <sys/socket.h>
47 #define GMYTH_FILE_TRANSFER_TYPE (gmyth_file_transfer_get_type ())
48 #define GMYTH_FILE_TRANSFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_FILE_TRANSFER_TYPE, GMythFileTransfer))
49 #define GMYTH_FILE_TRANSFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_TRANSFER_TYPE, GMythFileTransferClass))
50 #define IS_GMYTH_FILE_TRANSFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_FILE_TRANSFER_TYPE))
51 #define IS_GMYTH_FILE_TRANSFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_TRANSFER_TYPE))
52 #define GMYTH_FILE_TRANSFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_FILE_TRANSFER_TYPE, GMythFileTransferClass))
53 typedef struct _GMythFileTransfer GMythFileTransfer;
54 typedef struct _GMythFileTransferClass GMythFileTransferClass;
55 typedef struct _GMythFileTransferPrivate GMythFileTransferPrivate;
57 struct _GMythFileTransfer
60 GMythFileTransferPrivate *priv;
63 struct _GMythFileTransferClass
65 GMythFileClass parent_class;
68 guint program_info_changed_handler_signal_id;
70 /* signal default handlers */
71 void (*program_info_changed_handler) (GMythFileTransfer * transfer,
73 gpointer livetv_recorder);
77 GType gmyth_file_transfer_get_type(void);
78 GMythFileTransfer *gmyth_file_transfer_new(GMythBackendInfo * backend_info);
79 gchar *gmyth_file_transfer_get_file_name(GMythFileTransfer * transfer);
80 gboolean gmyth_file_transfer_open(GMythFileTransfer * transfer,
81 const gchar * filename);
82 void gmyth_file_transfer_close(GMythFileTransfer * transfer);
83 gboolean gmyth_file_transfer_is_open(GMythFileTransfer * transfer);
86 gmyth_file_transfer_read(GMythFileTransfer * transfer,
87 GByteArray * data, gint size,
88 gboolean read_unlimited);
89 gint64 gmyth_file_transfer_seek(GMythFileTransfer * transfer, guint64 pos,
91 gboolean gmyth_file_transfer_settimeout(GMythFileTransfer * transfer,
93 guint64 gmyth_file_transfer_get_filesize(GMythFileTransfer * transfer);
95 void gmyth_file_transfer_emit_program_info_changed_signal(GMythFileTransfer *
102 #endif /* __GMYTH_FILE_TRANSFER_H__ */