[svn r535] Fixed to the older GMythFileTransfer revision (no GObject inheritance). trunk
authorrosfran
Thu Apr 12 14:58:13 2007 +0100 (2007-04-12)
branchtrunk
changeset 530ad51640dd2cd
parent 529 dfa28b22a36c
child 531 81cdff5d7452
[svn r535] Fixed to the older GMythFileTransfer revision (no GObject inheritance).
gmyth/src/gmyth_file.c
gmyth/src/gmyth_file_transfer.c
gmyth/src/gmyth_file_transfer.h
gmyth/src/gmyth_uri.c
     1.1 --- a/gmyth/src/gmyth_file.c	Thu Apr 12 13:22:53 2007 +0100
     1.2 +++ b/gmyth/src/gmyth_file.c	Thu Apr 12 14:58:13 2007 +0100
     1.3 @@ -219,7 +219,7 @@
     1.4      g_return_if_fail( file != NULL );
     1.5      g_return_if_fail( filename != NULL );
     1.6      
     1.7 -    g_object_set (G_OBJECT (file), "filename", &filename, NULL);
     1.8 +    g_object_set (G_OBJECT (file), "filename", &filename, NULL);    
     1.9  
    1.10  }
    1.11  
    1.12 @@ -369,11 +369,12 @@
    1.13                break;
    1.14            }
    1.15      
    1.16 -          if (priv->filename != NULL) {
    1.17 -            g_free (priv->filename);
    1.18 -            priv->filename = NULL;
    1.19 -          }
    1.20 -          priv->filename = g_value_dup_string (value);    
    1.21 +          //if (priv->filename != NULL) {
    1.22 +          //  g_free (priv->filename);
    1.23 +          //  priv->filename = NULL;
    1.24 +          //}
    1.25 +          priv->filename = g_value_dup_string (value);
    1.26 +          gmyth_debug( "Changed the filename to [%s]!", priv->filename );
    1.27            break;
    1.28          }
    1.29          case PROP_GMYTH_FILE_OFFSET:
    1.30 @@ -392,11 +393,12 @@
    1.31                break;
    1.32            }
    1.33      
    1.34 -          if (priv->backend_info != NULL) {
    1.35 -            g_object_unref (priv->backend_info);
    1.36 -            priv->backend_info = NULL;
    1.37 -          }
    1.38 +          //if (priv->backend_info != NULL) {
    1.39 +          //  g_object_unref (priv->backend_info);
    1.40 +          // priv->backend_info = NULL;
    1.41 +          //}          
    1.42            priv->backend_info = g_value_get_object (value);
    1.43 +          gmyth_debug( "Changed the backend info to [%s]!", gmyth_backend_info_get_hostname( priv->backend_info ) );
    1.44            break;
    1.45          }
    1.46          case PROP_GMYTH_FILE_FILEID:
    1.47 @@ -420,6 +422,7 @@
    1.48    switch (prop_id) {
    1.49      case PROP_GMYTH_FILE_FILENAME:
    1.50      {
    1.51 +      gmyth_debug( "Got the filename to [%s]!", priv->filename );
    1.52        g_value_set_string (value, priv->filename);
    1.53        break;
    1.54      }
     2.1 --- a/gmyth/src/gmyth_file_transfer.c	Thu Apr 12 13:22:53 2007 +0100
     2.2 +++ b/gmyth/src/gmyth_file_transfer.c	Thu Apr 12 14:58:13 2007 +0100
     2.3 @@ -69,20 +69,26 @@
     2.4  };
     2.5  
     2.6  struct _GMythFileTransferPrivate {
     2.7 -	GMythRecorder  *recorder;
     2.8 +	GMythRecorder *recorder;
     2.9  	
    2.10 -	gboolean       do_next_program_chain;
    2.11 -	gboolean       disposed;
    2.12 -    gboolean       livetv_wait;
    2.13 +	gboolean do_next_program_chain;
    2.14 +	gboolean disposed;
    2.15 +    gboolean livetv_wait;
    2.16 +    gint64 offset;
    2.17 +    guint64 filesize;
    2.18  
    2.19 +	/* Myth URI structure */
    2.20 +	gchar                   *filename;
    2.21 +	GMythBackendInfo        *backend_info;
    2.22 +	
    2.23  	/* MythTV version number */	
    2.24 -	gint           mythtv_version;
    2.25 +	gint 					mythtv_version;
    2.26  
    2.27  	/* socket descriptors */
    2.28 -	GMythSocket    *control_sock;
    2.29 -	GMythSocket    *sock;
    2.30 -	GMutex         *mutex;
    2.31 -	gint           file_id;
    2.32 +	GMythSocket 			*control_sock;
    2.33 +	GMythSocket 			*sock;
    2.34 +	GMutex 					*mutex;
    2.35 +	gint 					file_id;
    2.36  };
    2.37  
    2.38  static void gmyth_file_transfer_class_init          (GMythFileTransferClass *klass);
    2.39 @@ -95,7 +101,7 @@
    2.40  static gboolean _control_acquire_context            (GMythFileTransfer *transfer, gboolean do_wait);
    2.41  static gboolean _control_release_context            (GMythFileTransfer *transfer);
    2.42  
    2.43 -G_DEFINE_TYPE(GMythFileTransfer, gmyth_file_transfer, GMYTH_FILE_TYPE)
    2.44 +G_DEFINE_TYPE(GMythFileTransfer, gmyth_file_transfer, G_TYPE_OBJECT)
    2.45  
    2.46  static void
    2.47  gmyth_file_transfer_class_init (GMythFileTransferClass *klass)
    2.48 @@ -175,11 +181,21 @@
    2.49          priv->sock = NULL;
    2.50      }
    2.51  
    2.52 +    if (priv->backend_info != NULL ) {
    2.53 +        g_object_unref (priv->backend_info );
    2.54 +        priv->backend_info = NULL;
    2.55 +    }
    2.56 +
    2.57      if (priv->recorder != NULL ) {
    2.58          g_object_unref (priv->recorder );
    2.59          priv->recorder = NULL;
    2.60      }
    2.61 -    
    2.62 +
    2.63 +    if (priv->filename != NULL ) {
    2.64 +        g_free (priv->filename );
    2.65 +        priv->filename = NULL;
    2.66 +    }
    2.67 +
    2.68      G_OBJECT_CLASS (gmyth_file_transfer_parent_class)->dispose (object);
    2.69  }
    2.70  
    2.71 @@ -202,24 +218,20 @@
    2.72  GMythFileTransfer*
    2.73  gmyth_file_transfer_new (GMythBackendInfo *backend_info)
    2.74  {
    2.75 -    GMythFileTransfer *transfer = GMYTH_FILE_TRANSFER (g_object_new (GMYTH_FILE_TRANSFER_TYPE, NULL));
    2.76 -    
    2.77 -    backend_info = g_object_ref( backend_info );
    2.78 -    
    2.79 -    g_object_set (G_OBJECT (transfer), "backend-info", &backend_info, NULL);
    2.80 +  GMythFileTransfer *transfer = GMYTH_FILE_TRANSFER (g_object_new (GMYTH_FILE_TRANSFER_TYPE, NULL));
    2.81 +  GMythFileTransferPrivate *priv = GMYTH_FILE_TRANSFER_GET_PRIVATE (transfer);
    2.82    
    2.83 -    return transfer;
    2.84 +  priv->backend_info = g_object_ref (backend_info);
    2.85 +  return transfer;
    2.86  }
    2.87  
    2.88  
    2.89  gchar*
    2.90  gmyth_file_transfer_get_file_name (GMythFileTransfer *transfer)
    2.91  {
    2.92 -    gchar *filename;
    2.93 -    
    2.94 -    g_object_get( G_OBJECT(transfer), "filename", &filename, NULL );
    2.95 +    GMythFileTransferPrivate *priv = GMYTH_FILE_TRANSFER_GET_PRIVATE (transfer);
    2.96  
    2.97 -    return g_strdup (filename);
    2.98 +    return g_strdup (priv->filename);
    2.99  }
   2.100  
   2.101  /** 
   2.102 @@ -232,24 +244,18 @@
   2.103  GMythFileTransfer* 
   2.104  gmyth_file_transfer_new_with_uri (const gchar* uri_str)
   2.105  {
   2.106 -    GMythFileTransfer *transfer = GMYTH_FILE_TRANSFER (g_object_new (GMYTH_FILE_TRANSFER_TYPE, NULL));
   2.107 -    gmyth_debug( "URI str = %s", uri_str );
   2.108 -    GMythBackendInfo *backend_info = gmyth_backend_info_new_with_uri (uri_str);
   2.109 -    /*
   2.110 -    GValue val = {0,};
   2.111 -    g_value_init (&val, G_TYPE_OBJECT);
   2.112 -    g_value_set_object (&val, gmyth_backend_info_new_with_uri (uri_str));
   2.113 -    */
   2.114 -    g_object_set(G_OBJECT (transfer), "backend-info", &backend_info, NULL);
   2.115 +  GMythFileTransfer *transfer = GMYTH_FILE_TRANSFER (g_object_new (GMYTH_FILE_TRANSFER_TYPE, NULL));
   2.116 +  GMythFileTransferPrivate *priv = GMYTH_FILE_TRANSFER_GET_PRIVATE (transfer);
   2.117  
   2.118 -    return transfer;
   2.119 +  priv->backend_info = gmyth_backend_info_new_with_uri (uri_str);
   2.120 +  return transfer;
   2.121  }
   2.122  
   2.123  /** 
   2.124   * Open a File Transfer connection in order to get a remote file.
   2.125   * 
   2.126   * @param transfer The actual File Transfer instance. 
   2.127 - * @param filename The file name of the remote file to be transferred to the client.
   2.128 + * @param filename The file name of the remote file to be transfered to the client.
   2.129   * 
   2.130   * @return <code>true</code>, if the connection opening had been done successfully. 
   2.131   */
   2.132 @@ -258,27 +264,30 @@
   2.133  {
   2.134      gboolean ret = TRUE;
   2.135      GMythFileTransferPrivate *priv;
   2.136 -    gchar *fname = NULL;
   2.137    
   2.138      g_return_val_if_fail (transfer != NULL, FALSE);
   2.139      g_return_val_if_fail (filename != NULL && strlen(filename) > 0, FALSE);
   2.140  
   2.141      priv = GMYTH_FILE_TRANSFER_GET_PRIVATE (transfer);
   2.142 -    
   2.143 -    //if ( )
   2.144 -    gmyth_file_set_file_name( GMYTH_FILE(transfer), filename );
   2.145 +
   2.146 +    if (priv->filename != NULL)
   2.147 +    {
   2.148 +        gmyth_file_transfer_close (transfer);
   2.149 +    }
   2.150 +
   2.151 +    priv->filename = g_strdup( filename );
   2.152  
   2.153      /* configure the control socket */
   2.154      if (priv->control_sock == NULL) { 
   2.155          if (!_connect_to_backend (transfer)) {
   2.156 -            gmyth_debug ("Connection to backend failed (Control Socket).");
   2.157 +            gmyth_debug ("Connection to backend failed (Control Socket).\n");
   2.158              ret = FALSE;
   2.159          }
   2.160      } else {
   2.161 -        gmyth_debug("Remote transfer control socket already created.");
   2.162 +        gmyth_debug("Remote transfer control socket already created.\n");
   2.163      }
   2.164    
   2.165 -    gmyth_debug ("Got file with size = %lld.\n", gmyth_file_get_filesize(GMYTH_FILE(transfer)));
   2.166 +    gmyth_debug ("Got file with size = %lld.\n", priv->filesize);
   2.167  
   2.168      return ret;
   2.169  }
   2.170 @@ -298,15 +307,13 @@
   2.171      GMythStringList *strlist = NULL; 
   2.172      gboolean ret = TRUE;
   2.173      GMythFileTransferPrivate *priv;
   2.174 -    GMythBackendInfo *backend_info;
   2.175  
   2.176      g_return_val_if_fail (transfer != NULL, FALSE );
   2.177 -    
   2.178 -    g_object_get( GMYTH_FILE(transfer), "backend-info", &backend_info, NULL );
   2.179  
   2.180      priv = GMYTH_FILE_TRANSFER_GET_PRIVATE (transfer);
   2.181      _control_acquire_context (transfer, TRUE);
   2.182  
   2.183 +
   2.184      /* Creates the control socket */
   2.185  
   2.186      if (priv->control_sock != NULL) {
   2.187 @@ -319,7 +326,7 @@
   2.188    	priv->control_sock = gmyth_socket_new();
   2.189      // Connects the socket, send Mythtv ANN command and verify Mythtv protocol version 
   2.190  	if (!gmyth_socket_connect_to_backend (priv->control_sock,
   2.191 -    	    backend_info->hostname, backend_info->port, TRUE)) {
   2.192 +    	    priv->backend_info->hostname, priv->backend_info->port, TRUE)) {
   2.193  	
   2.194  	    g_object_unref (priv->control_sock);
   2.195  	    priv->control_sock = NULL;
   2.196 @@ -333,8 +340,8 @@
   2.197      }  
   2.198  
   2.199      priv->sock = gmyth_socket_new ();
   2.200 -	gmyth_socket_connect (priv->sock, backend_info->hostname, backend_info->port);
   2.201 -	gmyth_debug ("Connecting file transfer... (%s, %d)", backend_info->hostname, backend_info->port);	  
   2.202 +	gmyth_socket_connect (priv->sock, priv->backend_info->hostname, priv->backend_info->port);
   2.203 +	gmyth_debug ("Connecting file transfer... (%s, %d)", priv->backend_info->hostname, priv->backend_info->port);	  
   2.204    
   2.205  	strlist = gmyth_string_list_new();
   2.206  	hostname = gmyth_socket_get_local_hostname();
   2.207 @@ -345,7 +352,7 @@
   2.208  	    g_string_printf (base_str, "ANN FileTransfer %s", hostname->str);
   2.209  	
   2.210      gmyth_string_list_append_string (strlist, base_str );
   2.211 -	gmyth_string_list_append_char_array (strlist, gmyth_file_get_file_name(GMYTH_FILE(transfer)));
   2.212 +	gmyth_string_list_append_char_array (strlist, priv->filename);
   2.213  	
   2.214  	gmyth_socket_write_stringlist (priv->sock, strlist );
   2.215  	gmyth_socket_read_stringlist (priv->sock, strlist );
   2.216 @@ -354,14 +361,13 @@
   2.217  	priv->file_id = gmyth_string_list_get_int (strlist, 1);
   2.218  	
   2.219  	/* Myth URI stream file size - decoded using two 8-bytes sequences (64 bits/long long types) */
   2.220 -	gmyth_file_set_filesize( GMYTH_FILE(transfer), gmyth_util_decode_long_long (strlist, 2) );
   2.221 +	priv->filesize = gmyth_util_decode_long_long (strlist, 2);
   2.222  	
   2.223 -	gmyth_debug ( "***** Received: recordernum = %d, filesize = %" G_GUINT64_FORMAT "\n",
   2.224 -	          priv->file_id, gmyth_file_get_filesize(GMYTH_FILE(transfer)) );
   2.225 +	gmyth_debug ( "[%s] ***** Received: recordernum = %d, filesize = %" G_GUINT64_FORMAT "\n", __FUNCTION__,
   2.226 +	          priv->file_id, priv->filesize );
   2.227  	
   2.228 -	if ( gmyth_file_get_filesize(GMYTH_FILE(transfer)) < 0 ) {
   2.229 -	    gmyth_debug ( "Got filesize equals to %llu is lesser than 0 [invalid stream file]\n", 
   2.230 -                gmyth_file_get_filesize(GMYTH_FILE(transfer)) );
   2.231 +	if (priv->filesize < 0 ) {
   2.232 +	    gmyth_debug ( "[%s] Got filesize equals to %llu is lesser than 0 [invalid stream file]\n", __FUNCTION__, priv->filesize);
   2.233  	    g_object_unref (priv->sock);
   2.234  	    priv->sock = NULL;
   2.235  	    ret = FALSE;
   2.236 @@ -488,6 +494,11 @@
   2.237          priv->control_sock = NULL;
   2.238      } 
   2.239  
   2.240 +    if (priv->filename) {
   2.241 +        g_free (priv->filename);
   2.242 +        priv->filename = NULL;
   2.243 +    }
   2.244 +
   2.245      _control_release_context (transfer);
   2.246  }
   2.247  
   2.248 @@ -528,13 +539,14 @@
   2.249      if (pos > 0 )
   2.250          gmyth_string_list_append_uint64 (strlist, pos);
   2.251      else
   2.252 -        gmyth_string_list_append_uint64 (strlist, gmyth_file_get_offset( GMYTH_FILE(transfer) ) );
   2.253 +        gmyth_string_list_append_uint64 (strlist, priv->offset);
   2.254  
   2.255      gmyth_socket_sendreceive_stringlist (priv->control_sock, strlist);
   2.256  
   2.257      gint64 retval = gmyth_string_list_get_int64 (strlist, 0);
   2.258 -    gmyth_file_set_offset( GMYTH_FILE(transfer), retval );
   2.259 -    gmyth_debug ( "Got reading position pointer from the streaming = %lld\n", retval );
   2.260 +    priv->offset = retval;
   2.261 +    gmyth_debug ( "[%s] got reading position pointer from the streaming = %lld\n", 
   2.262 +        __FUNCTION__, retval );
   2.263  
   2.264      g_object_unref (strlist);
   2.265      g_string_free (query, TRUE);
   2.266 @@ -599,13 +611,13 @@
   2.267   * @return The actual block size (in bytes) returned by REQUEST_BLOCK message,
   2.268   * 				or the error code. 
   2.269   */
   2.270 -GMythFileReadResult 
   2.271 +GMythFileTransferReadResult 
   2.272  gmyth_file_transfer_read(GMythFileTransfer *transfer, GByteArray *data, gint size, gboolean read_unlimited)
   2.273  {
   2.274      gint bytes_sent = 0;
   2.275      gsize bytes_read = 0;
   2.276      gint64 total_read = 0;
   2.277 -    GMythFileReadResult retval = GMYTH_FILE_READ_OK;
   2.278 +    GMythFileTransferReadResult retval = GMYTH_FILE_TRANSFER_READ_OK;
   2.279      GMythFileTransferPrivate *priv;
   2.280  
   2.281      GError *error = NULL;
   2.282 @@ -624,7 +636,7 @@
   2.283      GString *query;
   2.284  
   2.285      g_return_val_if_fail (transfer != NULL, FALSE);
   2.286 -    g_return_val_if_fail (data != NULL, GMYTH_FILE_READ_ERROR);
   2.287 +    g_return_val_if_fail (data != NULL, GMYTH_FILE_TRANSFER_READ_ERROR);
   2.288  
   2.289      priv = GMYTH_FILE_TRANSFER_GET_PRIVATE (transfer);
   2.290  
   2.291 @@ -642,12 +654,12 @@
   2.292      io_cond_control = g_io_channel_get_buffer_condition( io_channel );
   2.293      if (priv->sock == NULL || ( io_status == G_IO_STATUS_ERROR ) ) {
   2.294          g_printerr( "gmyth_file_transfer_read(): Called with no raw socket.\n" );
   2.295 -        return GMYTH_FILE_READ_ERROR;
   2.296 +        return GMYTH_FILE_TRANSFER_READ_ERROR;
   2.297      }
   2.298  
   2.299      if (priv->control_sock == NULL || ( io_status_control == G_IO_STATUS_ERROR ) ) {
   2.300          g_printerr( "gmyth_file_transfer_read(): Called with no control socket.\n" );
   2.301 -        return GMYTH_FILE_READ_ERROR;
   2.302 +        return GMYTH_FILE_TRANSFER_READ_ERROR;
   2.303      }
   2.304  
   2.305      query = g_string_new (GMYTHTV_QUERY_HEADER);
   2.306 @@ -696,24 +708,22 @@
   2.307              gmyth_debug ("Error on io_channel");
   2.308              g_free (data_buffer);
   2.309              g_object_unref (strlist);
   2.310 -            retval = GMYTH_FILE_READ_ERROR;
   2.311 +            retval = GMYTH_FILE_TRANSFER_READ_ERROR;
   2.312              goto error;
   2.313          }
   2.314  
   2.315          /* append new data to the increasing byte array */
   2.316          data = g_byte_array_append (data, (const guint8*)data_buffer, bytes_read);
   2.317 -        gmyth_file_set_offset( GMYTH_FILE(transfer),  
   2.318 -                gmyth_file_get_offset( GMYTH_FILE(transfer) ) + bytes_read );
   2.319 +        priv->offset += bytes_read;
   2.320  
   2.321 -        if ( !read_unlimited && ( gmyth_file_get_filesize( GMYTH_FILE(transfer) ) > 0 ) && 
   2.322 -                ( gmyth_file_get_offset( GMYTH_FILE(transfer) ) == gmyth_file_get_filesize( GMYTH_FILE(transfer) ) ) ) {
   2.323 -            retval = GMYTH_FILE_READ_EOF;
   2.324 +        if (!read_unlimited && (priv->filesize > 0) && (priv->offset == priv->filesize)) {
   2.325 +            retval = GMYTH_FILE_TRANSFER_READ_EOF;
   2.326              goto error;
   2.327          }
   2.328          
   2.329          g_free (data_buffer);
   2.330      } else { 
   2.331 -        retval = GMYTH_FILE_READ_ERROR;
   2.332 +        retval = GMYTH_FILE_TRANSFER_READ_ERROR;
   2.333      }
   2.334  
   2.335      if (strlist!=NULL)
   2.336 @@ -734,12 +744,11 @@
   2.337  		if (priv->recorder != NULL &&
   2.338  			priv->do_next_program_chain)
   2.339  		{
   2.340 -		    retval = GMYTH_FILE_READ_NEXT_PROG_CHAIN;
   2.341 +		    retval = GMYTH_FILE_TRANSFER_READ_NEXT_PROG_CHAIN;
   2.342  	  		GMythProgramInfo *prog_info = gmyth_recorder_get_current_program_info (priv->recorder);
   2.343  	  		
   2.344  	  		if (prog_info != NULL && prog_info->pathname != NULL && strlen( prog_info->pathname->str ) > 0 &&
   2.345 -	  						g_ascii_strcasecmp( prog_info->pathname->str, 
   2.346 -                                    gmyth_file_get_file_name( GMYTH_FILE(transfer) ) ) != 0 )
   2.347 +	  						g_ascii_strcasecmp( prog_info->pathname->str, priv->filename ) != 0 )
   2.348  	  			ret = gmyth_file_transfer_open (transfer, g_strrstr( prog_info->pathname->str, "/" ) );
   2.349  	  		
   2.350  	  		if (prog_info != NULL )
   2.351 @@ -749,7 +758,7 @@
   2.352  				gmyth_debug( "Cannot change to the next program info!" );
   2.353  			else
   2.354  				gmyth_debug( "OK!!! MOVED to the next program info [%s]!", 
   2.355 -										gmyth_file_get_file_name( GMYTH_FILE(transfer) ) );						
   2.356 +										priv->filename );						
   2.357  		}
   2.358  
   2.359      } /* if */
   2.360 @@ -766,12 +775,12 @@
   2.361      }
   2.362    
   2.363      if ( total_read > 0 )
   2.364 -  	    gmyth_file_set_offset( GMYTH_FILE(transfer), 
   2.365 -                gmyth_file_get_offset( GMYTH_FILE(transfer) ) + total_read );  	
   2.366 +  	    priv->offset += total_read;  	
   2.367    	
   2.368      return retval;
   2.369  }
   2.370  
   2.371 +
   2.372  static void 
   2.373  _file_transfer_program_info_changed( GMythFileTransfer *transfer, 
   2.374  									gint msg_code, gpointer livetv_recorder )
   2.375 @@ -855,11 +864,10 @@
   2.376  guint64
   2.377  gmyth_file_transfer_get_filesize (GMythFileTransfer *transfer)
   2.378  {
   2.379 -    guint64 filesize;
   2.380 -    
   2.381 +    GMythFileTransferPrivate *priv;
   2.382 +
   2.383      g_return_val_if_fail (transfer != NULL, 0);
   2.384 -    
   2.385 -    g_object_get( GMYTH_FILE(transfer), "filesize", &filesize, NULL );
   2.386  
   2.387 -    return filesize;
   2.388 +    priv = GMYTH_FILE_TRANSFER_GET_PRIVATE (transfer);
   2.389 +    return priv->filesize;
   2.390  }
     3.1 --- a/gmyth/src/gmyth_file_transfer.h	Thu Apr 12 13:22:53 2007 +0100
     3.2 +++ b/gmyth/src/gmyth_file_transfer.h	Thu Apr 12 14:58:13 2007 +0100
     3.3 @@ -32,7 +32,6 @@
     3.4  #include <glib-object.h>
     3.5  #include <glib.h>
     3.6  
     3.7 -#include "gmyth_file.h"
     3.8  #include "gmyth_socket.h"
     3.9  #include "gmyth_uri.h"
    3.10  #include "gmyth_backendinfo.h"
    3.11 @@ -53,18 +52,27 @@
    3.12  #define IS_GMYTH_FILE_TRANSFER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_TRANSFER_TYPE))
    3.13  #define GMYTH_FILE_TRANSFER_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_FILE_TRANSFER_TYPE, GMythFileTransferClass))
    3.14  
    3.15 +typedef enum {
    3.16 +    GMYTH_FILE_TRANSFER_READ_OK                 = 0,
    3.17 +	GMYTH_FILE_TRANSFER_READ_NEXT_PROG_CHAIN    = 1,
    3.18 +	GMYTH_FILE_TRANSFER_READ_ERROR              = 2,
    3.19 +	GMYTH_FILE_TRANSFER_READ_EOF                = 3
    3.20 +} GMythFileTransferReadResult;
    3.21 +
    3.22 +
    3.23  typedef struct _GMythFileTransfer         GMythFileTransfer;
    3.24  typedef struct _GMythFileTransferClass    GMythFileTransferClass;
    3.25  typedef struct _GMythFileTransferPrivate  GMythFileTransferPrivate;
    3.26  
    3.27  struct _GMythFileTransfer
    3.28  {
    3.29 -	GMythFile 				parent;
    3.30 +	GObject 				parent;
    3.31  };
    3.32  
    3.33 +
    3.34  struct _GMythFileTransferClass
    3.35  {
    3.36 -	GMythFileClass parent_class;
    3.37 +	GObjectClass parent_class;
    3.38  
    3.39  	/* callbacks */
    3.40  	guint program_info_changed_handler_signal_id;
    3.41 @@ -82,7 +90,7 @@
    3.42                                  					     const gchar* filename);
    3.43  void                gmyth_file_transfer_close           (GMythFileTransfer *transfer);
    3.44  gboolean            gmyth_file_transfer_is_open         (GMythFileTransfer *transfer);
    3.45 -GMythFileReadResult
    3.46 +GMythFileTransferReadResult
    3.47                      gmyth_file_transfer_read            (GMythFileTransfer *transfer, 
    3.48                                                           GByteArray *data, 
    3.49                                                           gint size, 
     4.1 --- a/gmyth/src/gmyth_uri.c	Thu Apr 12 13:22:53 2007 +0100
     4.2 +++ b/gmyth/src/gmyth_uri.c	Thu Apr 12 14:58:13 2007 +0100
     4.3 @@ -374,7 +374,6 @@
     4.4  		uri->fragment = g_string_new_len (value+currIdx+sharpIdx+1, uriLen-(currIdx+sharpIdx+1));
     4.5  	}	
     4.6  
     4.7 -    /*
     4.8  	gmyth_debug( "[%s] GMythURI: host = %s, port = %d, path = %s, query = %s, fragment = %s, "\
     4.9        			 "user = %s, password = %s.\n", __FUNCTION__, 
    4.10                   gmyth_uri_print_field( uri->host ), uri->port,
    4.11 @@ -383,7 +382,6 @@
    4.12                   gmyth_uri_print_field( uri->fragment ), 
    4.13                   gmyth_uri_print_field ( uri->user ), 
    4.14                   gmyth_uri_print_field( uri->password ) );
    4.15 -                 */
    4.16  
    4.17  }
    4.18  
    4.19 @@ -421,7 +419,9 @@
    4.20  	
    4.21  	if ( ret )
    4.22  		gmyth_debug( "This URI is a LiveTV recording..." );
    4.23 -	
    4.24 +    else
    4.25 +        gmyth_debug( "This URI is a stored remote recording." );
    4.26 +    
    4.27  	return ret;
    4.28  	
    4.29  }