1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/gmyth/gmyth/gmyth_file_transfer.h Mon Feb 25 17:51:43 2008 +0000
1.3 @@ -0,0 +1,111 @@
1.4 +/**
1.5 + * GMyth Library
1.6 + *
1.7 + * @file gmyth/gmyth_file_transfer.h
1.8 + *
1.9 + * @brief <p> GMythFileTransfer deals with the file streaming media remote/local
1.10 + * transfering to the MythTV frontend.
1.11 + *
1.12 + * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
1.13 + * @author Rosfran Lins Borges <rosfran.borges@indt.org.br>
1.14 + *
1.15 + *
1.16 + * This program is free software; you can redistribute it and/or modify
1.17 + * it under the terms of the GNU Lesser General Public License as published by
1.18 + * the Free Software Foundation; either version 2 of the License, or
1.19 + * (at your option) any later version.
1.20 + *
1.21 + * This program is distributed in the hope that it will be useful,
1.22 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.23 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.24 + * GNU General Public License for more details.
1.25 + *
1.26 + * You should have received a copy of the GNU Lesser General Public License
1.27 + * along with this program; if not, write to the Free Software
1.28 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1.29 + */
1.30 +
1.31 +#ifndef __GMYTH_FILE_TRANSFER_H__
1.32 +#define __GMYTH_FILE_TRANSFER_H__
1.33 +
1.34 +#include <glib-object.h>
1.35 +#include <glib.h>
1.36 +
1.37 +#include "gmyth_file.h"
1.38 +#include "gmyth_socket.h"
1.39 +#include "gmyth_uri.h"
1.40 +#include "gmyth_backendinfo.h"
1.41 +
1.42 +#include <stdio.h>
1.43 +#include <stdlib.h>
1.44 +#include <string.h>
1.45 +#include <netdb.h>
1.46 +#include <sys/socket.h>
1.47 +#include <unistd.h>
1.48 +
1.49 +G_BEGIN_DECLS
1.50 +#define GMYTH_FILE_TRANSFER_TYPE (gmyth_file_transfer_get_type ())
1.51 +#define GMYTH_FILE_TRANSFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_FILE_TRANSFER_TYPE, GMythFileTransfer))
1.52 +#define GMYTH_FILE_TRANSFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_TRANSFER_TYPE, GMythFileTransferClass))
1.53 +#define IS_GMYTH_FILE_TRANSFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_FILE_TRANSFER_TYPE))
1.54 +#define IS_GMYTH_FILE_TRANSFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_TRANSFER_TYPE))
1.55 +#define GMYTH_FILE_TRANSFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_FILE_TRANSFER_TYPE, GMythFileTransferClass))
1.56 +typedef struct _GMythFileTransfer GMythFileTransfer;
1.57 +typedef struct _GMythFileTransferClass GMythFileTransferClass;
1.58 +typedef struct _GMythFileTransferPrivate GMythFileTransferPrivate;
1.59 +
1.60 +struct _GMythFileTransfer {
1.61 + GMythFile parent;
1.62 + GMythFileTransferPrivate *priv;
1.63 +};
1.64 +
1.65 +struct _GMythFileTransferClass {
1.66 + GMythFileClass parent_class;
1.67 +
1.68 + /*
1.69 + * callbacks
1.70 + */
1.71 + guint program_info_changed_handler_signal_id;
1.72 +
1.73 + /*
1.74 + * signal default handlers
1.75 + */
1.76 + void (*program_info_changed_handler) (GMythFileTransfer *
1.77 + transfer,
1.78 + gint msg_code,
1.79 + gpointer
1.80 + livetv_recorder);
1.81 +};
1.82 +
1.83 +
1.84 +GType gmyth_file_transfer_get_type(void);
1.85 +GMythFileTransfer *gmyth_file_transfer_new(GMythBackendInfo *
1.86 + backend_info);
1.87 +gchar *gmyth_file_transfer_get_file_name(GMythFileTransfer *
1.88 + transfer);
1.89 +gboolean gmyth_file_transfer_open(GMythFileTransfer * transfer,
1.90 + const gchar * filename);
1.91 +void gmyth_file_transfer_close(GMythFileTransfer * transfer);
1.92 +gboolean gmyth_file_transfer_is_open(GMythFileTransfer * transfer);
1.93 +
1.94 +GMythFileReadResult
1.95 +gmyth_file_transfer_read(GMythFileTransfer * transfer,
1.96 + GByteArray * data, gint size,
1.97 + gboolean read_unlimited);
1.98 +gint64 gmyth_file_transfer_seek(GMythFileTransfer * transfer,
1.99 + guint64 pos, gint whence);
1.100 +gboolean gmyth_file_transfer_settimeout(GMythFileTransfer *
1.101 + transfer, gboolean fast);
1.102 +guint64 gmyth_file_transfer_get_filesize(GMythFileTransfer *
1.103 + transfer);
1.104 +
1.105 +void
1.106 + gmyth_file_transfer_emit_program_info_changed_signal(GMythFileTransfer *
1.107 + transfer,
1.108 + gint
1.109 + msg_code,
1.110 + gpointer
1.111 + live_tv_recorder);
1.112 +
1.113 +G_END_DECLS
1.114 +#endif /* __GMYTH_FILE_TRANSFER_H__ */