[svn r440] Removed dependency to LiveTV on File Transfer; changed FileTransfer to use directly the Recorder MythTV messages and queries.
1.1 --- a/gmyth/src/gmyth_file_transfer.c Thu Mar 22 20:22:38 2007 +0000
1.2 +++ b/gmyth/src/gmyth_file_transfer.c Thu Mar 22 22:02:12 2007 +0000
1.3 @@ -36,7 +36,7 @@
1.4 #endif
1.5
1.6 #include "gmyth_file_transfer.h"
1.7 -#include "gmyth_livetv.h"
1.8 +#include "gmyth_recorder.h"
1.9 #include "gmyth_util.h"
1.10 #include "gmyth_socket.h"
1.11 #include "gmyth_stringlist.h"
1.12 @@ -90,7 +90,7 @@
1.13
1.14 struct _GMythFileTransferPrivate {
1.15
1.16 - GMythLiveTV *livetv;
1.17 + GMythRecorder *recorder;
1.18
1.19 gboolean do_next_program_chain;
1.20
1.21 @@ -103,7 +103,7 @@
1.22 static void gmyth_file_transfer_finalize (GObject *object);
1.23
1.24 static void gmyth_file_transfer_program_info_changed( GMythFileTransfer *transfer,
1.25 - gint msg_code, gpointer livetv_transfer );
1.26 + gint msg_code, gpointer livetv_recorder );
1.27
1.28 static gboolean gmyth_connect_to_backend (GMythFileTransfer *transfer);
1.29
1.30 @@ -157,7 +157,7 @@
1.31 transfer->priv = GMYTH_FILE_TRANSFER_GET_PRIVATE(transfer);
1.32
1.33 transfer->priv->do_next_program_chain = FALSE;
1.34 - transfer->priv->livetv = NULL;
1.35 + transfer->priv->recorder = NULL;
1.36
1.37 transfer->control_sock = NULL;
1.38 transfer->sock = NULL;
1.39 @@ -193,10 +193,10 @@
1.40 transfer->sock = NULL;
1.41 }
1.42
1.43 - if ( transfer->priv->livetv != NULL )
1.44 + if ( transfer->priv->recorder != NULL )
1.45 {
1.46 - g_object_unref( transfer->priv->livetv );
1.47 - transfer->priv->livetv = NULL;
1.48 + g_object_unref( transfer->priv->recorder );
1.49 + transfer->priv->recorder = NULL;
1.50 }
1.51
1.52 /*
1.53 @@ -420,7 +420,7 @@
1.54 */
1.55 void
1.56 gmyth_file_transfer_emit_program_info_changed_signal ( GMythFileTransfer *transfer, gint msg_code,
1.57 - gpointer live_tv )
1.58 + gpointer live_tv_recorder )
1.59 {
1.60 /*
1.61 g_signal_emit_by_name ( G_OBJECT(transfer),
1.62 @@ -433,7 +433,7 @@
1.63 g_signal_emit ( transfer,
1.64 GMYTH_FILE_TRANSFER_GET_CLASS (transfer)->program_info_changed_handler_signal_id,
1.65 0, /* details */
1.66 - msg_code, live_tv );
1.67 + msg_code, live_tv_recorder );
1.68
1.69 }
1.70
1.71 @@ -734,7 +734,7 @@
1.72 strlist = NULL;
1.73 break;
1.74 }
1.75 - } else if ( !read_unlimited || !(transfer->priv != NULL && transfer->priv->livetv != NULL &&
1.76 + } else if ( !read_unlimited || !(transfer->priv != NULL && transfer->priv->recorder != NULL &&
1.77 transfer->priv->do_next_program_chain) ) {
1.78 total_read = GMYTHTV_FILE_TRANSFER_READ_ERROR;
1.79 g_object_unref (strlist);
1.80 @@ -753,7 +753,7 @@
1.81 gmyth_debug( "Trying to move to the next program chain..." );
1.82 transfer->priv = GMYTH_FILE_TRANSFER_GET_PRIVATE(transfer);
1.83
1.84 - if ( transfer->priv != NULL && transfer->priv->livetv != NULL &&
1.85 + if ( transfer->priv != NULL && transfer->priv->recorder != NULL &&
1.86 transfer->priv->do_next_program_chain )
1.87 {
1.88
1.89 @@ -761,8 +761,8 @@
1.90
1.91 //g_mutex_lock( transfer->mutex );
1.92
1.93 - //ret = gmyth_livetv_next_program_chain( transfer->priv->livetv );
1.94 - GMythProgramInfo *prog_info = gmyth_recorder_get_current_program_info( transfer->priv->livetv->recorder );
1.95 + //ret = gmyth_livetv_next_program_chain( transfer->priv->recorder );
1.96 + GMythProgramInfo *prog_info = gmyth_recorder_get_current_program_info( transfer->priv->recorder );
1.97
1.98 if ( prog_info != NULL && prog_info->pathname != NULL && strlen( prog_info->pathname->str ) > 0 &&
1.99 g_ascii_strcasecmp( prog_info->pathname->str, transfer->filename ) != 0 )
1.100 @@ -800,21 +800,23 @@
1.101
1.102 static void
1.103 gmyth_file_transfer_program_info_changed( GMythFileTransfer *transfer,
1.104 - gint msg_code, gpointer livetv_transfer )
1.105 + gint msg_code, gpointer livetv_recorder )
1.106 {
1.107 - GMythLiveTV *livetv = GMYTH_LIVETV( livetv_transfer );
1.108 + GMythRecorder *recorder = GMYTH_RECORDER( livetv_recorder );
1.109
1.110 gmyth_debug( "Program info changed! ( file transfer orig. = %p, ptr. = [%s], user data = [%s] )", transfer,
1.111 - livetv_transfer != NULL ? "[NOT NULL]" : "[NULL]", livetv != NULL ? "[NOT NULL]" : "[NULL]" );
1.112 + livetv_recorder != NULL ? "[NOT NULL]" : "[NULL]", livetv != NULL ? "[NOT NULL]" : "[NULL]" );
1.113
1.114 - if ( livetv != NULL && transfer == livetv->file_transfer )
1.115 + if ( NULL != recorder )
1.116 {
1.117 gmyth_debug( "YES, the requested program info movement on the LiveTV transfer is authentical!" );
1.118 }
1.119
1.120 transfer->priv = GMYTH_FILE_TRANSFER_GET_PRIVATE(transfer);
1.121
1.122 - transfer->priv->livetv = livetv;
1.123 + g_object_ref(recorder);
1.124 +
1.125 + transfer->priv->recorder = recorder;
1.126 transfer->priv->do_next_program_chain = TRUE;
1.127
1.128 }
2.1 --- a/gmyth/src/gmyth_file_transfer.h Thu Mar 22 20:22:38 2007 +0000
2.2 +++ b/gmyth/src/gmyth_file_transfer.h Thu Mar 22 22:02:12 2007 +0000
2.3 @@ -69,7 +69,7 @@
2.4
2.5 /* signal default handlers */
2.6 void (*program_info_changed_handler) ( GMythFileTransfer *transfer,
2.7 - gint msg_code, gpointer livetv_transfer );
2.8 + gint msg_code, gpointer livetv_recorder );
2.9 };
2.10
2.11 struct _GMythFileTransfer
2.12 @@ -114,8 +114,8 @@
2.13 guint64 gmyth_file_transfer_get_filesize (GMythFileTransfer *transfer);
2.14
2.15 void gmyth_file_transfer_emit_program_info_changed_signal ( GMythFileTransfer *transfer,
2.16 - gint msg_code,
2.17 - gpointer live_tv );
2.18 + gint msg_code,
2.19 + gpointer live_tv_recorder );
2.20
2.21 G_END_DECLS
2.22
3.1 --- a/gmyth/src/gmyth_livetv.c Thu Mar 22 20:22:38 2007 +0000
3.2 +++ b/gmyth/src/gmyth_livetv.c Thu Mar 22 22:02:12 2007 +0000
3.3 @@ -203,16 +203,11 @@
3.4 if ( live_tv->file_transfer != NULL )
3.5 {
3.6 gmyth_debug( "Emitting signal to the FileTransfer... [ \"program-info-changed \" ]" );
3.7 - /*
3.8 - GMythProgramInfo* prog_info = gmyth_recorder_get_current_program_info( live_tv->recorder );
3.9 - if ( prog_info != NULL )
3.10 - live_tv->proginfo = prog_info;
3.11 - */
3.12
3.13 gmyth_file_transfer_emit_program_info_changed_signal( live_tv->file_transfer,
3.14 - msg_code, (gpointer)live_tv );
3.15 + msg_code, (gpointer)(live_tv->recorder) );
3.16
3.17 - /* gmyth_livetv_monitor_handler_stop( live_tv ); */
3.18 + /* gmyth_livetv_monitor_handler_stop( live_tv ); */
3.19 } else
3.20 gmyth_debug( "LIVETV file_transfer is NULL!!! Cannot move to the next program chain event received.\n");
3.21 }
3.22 @@ -229,16 +224,10 @@
3.23 if ( live_tv->file_transfer != NULL )
3.24 {
3.25 gmyth_debug( "Emitting signal to the FileTransfer... [ \"backend-done-recording\" ]" );
3.26 - /*
3.27 - GMythProgramInfo* prog_info = gmyth_recorder_get_current_program_info( live_tv->recorder );
3.28 - if ( prog_info != NULL )
3.29 - live_tv->proginfo = prog_info;
3.30 - */
3.31
3.32 gmyth_file_transfer_emit_program_info_changed_signal( live_tv->file_transfer,
3.33 - msg_code, (gpointer)live_tv );
3.34 + msg_code, (gpointer)(live_tv->recorder) );
3.35
3.36 - //gmyth_livetv_monitor_handler_stop( live_tv );
3.37 } else
3.38 gmyth_debug( "LIVETV file_transfer is NULL!!! Cannot move to the next program chain event received.\n");
3.39 }