gmyth/src/gmyth_file_transfer.h
author renatofilho
Thu Jun 14 18:19:52 2007 +0100 (2007-06-14)
branchtrunk
changeset 750 312d6bc514f3
parent 701 2f28edb4d804
child 754 cb885ee44618
permissions -rwxr-xr-x
[svn r756] fixed indent using GNU Style
     1 /**
     2  * GMyth Library
     3  *
     4  * @file gmyth/gmyth_file_transfer.h
     5  * 
     6  * @brief <p> GMythFileTransfer deals with the file streaming media remote/local
     7  * 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_TRANSFER_H__
    29 #define __GMYTH_FILE_TRANSFER_H__
    30 
    31 #include <glib-object.h>
    32 #include <glib.h>
    33 
    34 #include "gmyth_file.h"
    35 #include "gmyth_socket.h"
    36 #include "gmyth_uri.h"
    37 #include "gmyth_backendinfo.h"
    38 
    39 #include <stdio.h>
    40 #include <stdlib.h>
    41 #include <string.h>
    42 #include <netdb.h>
    43 #include <sys/socket.h>
    44 #include <unistd.h>
    45 
    46 G_BEGIN_DECLS
    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;
    56 
    57 struct _GMythFileTransfer
    58 {
    59   GMythFile parent;
    60   GMythFileTransferPrivate *priv;
    61 };
    62 
    63 struct _GMythFileTransferClass
    64 {
    65   GMythFileClass parent_class;
    66 
    67  /* callbacks */
    68   guint program_info_changed_handler_signal_id;
    69 
    70  /* signal default handlers */
    71   void (*program_info_changed_handler) (GMythFileTransfer * transfer,
    72 										gint msg_code,
    73 										gpointer livetv_recorder);
    74 };
    75 
    76 
    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);
    84 
    85 GMythFileReadResult
    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,
    90 								gint whence);
    91 gboolean gmyth_file_transfer_settimeout(GMythFileTransfer * transfer,
    92 										gboolean fast);
    93 guint64 gmyth_file_transfer_get_filesize(GMythFileTransfer * transfer);
    94 
    95 void gmyth_file_transfer_emit_program_info_changed_signal(GMythFileTransfer *
    96 														  transfer,
    97 														  gint msg_code,
    98 														  gpointer
    99 														  live_tv_recorder);
   100 
   101 G_END_DECLS
   102 #endif /* __GMYTH_FILE_TRANSFER_H__ */