# HG changeset patch # User rosfran # Date 1174600932 0 # Node ID 116e4fac8e96c5833f2f2837fbd723b53e493930 # Parent 6bdbc6757eea7e8215efc1ca520722529b577a8f [svn r440] Removed dependency to LiveTV on File Transfer; changed FileTransfer to use directly the Recorder MythTV messages and queries. diff -r 6bdbc6757eea -r 116e4fac8e96 gmyth/src/gmyth_file_transfer.c --- a/gmyth/src/gmyth_file_transfer.c Thu Mar 22 20:22:38 2007 +0000 +++ b/gmyth/src/gmyth_file_transfer.c Thu Mar 22 22:02:12 2007 +0000 @@ -36,7 +36,7 @@ #endif #include "gmyth_file_transfer.h" -#include "gmyth_livetv.h" +#include "gmyth_recorder.h" #include "gmyth_util.h" #include "gmyth_socket.h" #include "gmyth_stringlist.h" @@ -90,7 +90,7 @@ struct _GMythFileTransferPrivate { - GMythLiveTV *livetv; + GMythRecorder *recorder; gboolean do_next_program_chain; @@ -103,7 +103,7 @@ static void gmyth_file_transfer_finalize (GObject *object); static void gmyth_file_transfer_program_info_changed( GMythFileTransfer *transfer, - gint msg_code, gpointer livetv_transfer ); + gint msg_code, gpointer livetv_recorder ); static gboolean gmyth_connect_to_backend (GMythFileTransfer *transfer); @@ -157,7 +157,7 @@ transfer->priv = GMYTH_FILE_TRANSFER_GET_PRIVATE(transfer); transfer->priv->do_next_program_chain = FALSE; - transfer->priv->livetv = NULL; + transfer->priv->recorder = NULL; transfer->control_sock = NULL; transfer->sock = NULL; @@ -193,10 +193,10 @@ transfer->sock = NULL; } - if ( transfer->priv->livetv != NULL ) + if ( transfer->priv->recorder != NULL ) { - g_object_unref( transfer->priv->livetv ); - transfer->priv->livetv = NULL; + g_object_unref( transfer->priv->recorder ); + transfer->priv->recorder = NULL; } /* @@ -420,7 +420,7 @@ */ void gmyth_file_transfer_emit_program_info_changed_signal ( GMythFileTransfer *transfer, gint msg_code, - gpointer live_tv ) + gpointer live_tv_recorder ) { /* g_signal_emit_by_name ( G_OBJECT(transfer), @@ -433,7 +433,7 @@ g_signal_emit ( transfer, GMYTH_FILE_TRANSFER_GET_CLASS (transfer)->program_info_changed_handler_signal_id, 0, /* details */ - msg_code, live_tv ); + msg_code, live_tv_recorder ); } @@ -734,7 +734,7 @@ strlist = NULL; break; } - } else if ( !read_unlimited || !(transfer->priv != NULL && transfer->priv->livetv != NULL && + } else if ( !read_unlimited || !(transfer->priv != NULL && transfer->priv->recorder != NULL && transfer->priv->do_next_program_chain) ) { total_read = GMYTHTV_FILE_TRANSFER_READ_ERROR; g_object_unref (strlist); @@ -753,7 +753,7 @@ gmyth_debug( "Trying to move to the next program chain..." ); transfer->priv = GMYTH_FILE_TRANSFER_GET_PRIVATE(transfer); - if ( transfer->priv != NULL && transfer->priv->livetv != NULL && + if ( transfer->priv != NULL && transfer->priv->recorder != NULL && transfer->priv->do_next_program_chain ) { @@ -761,8 +761,8 @@ //g_mutex_lock( transfer->mutex ); - //ret = gmyth_livetv_next_program_chain( transfer->priv->livetv ); - GMythProgramInfo *prog_info = gmyth_recorder_get_current_program_info( transfer->priv->livetv->recorder ); + //ret = gmyth_livetv_next_program_chain( transfer->priv->recorder ); + GMythProgramInfo *prog_info = gmyth_recorder_get_current_program_info( transfer->priv->recorder ); if ( prog_info != NULL && prog_info->pathname != NULL && strlen( prog_info->pathname->str ) > 0 && g_ascii_strcasecmp( prog_info->pathname->str, transfer->filename ) != 0 ) @@ -800,21 +800,23 @@ static void gmyth_file_transfer_program_info_changed( GMythFileTransfer *transfer, - gint msg_code, gpointer livetv_transfer ) + gint msg_code, gpointer livetv_recorder ) { - GMythLiveTV *livetv = GMYTH_LIVETV( livetv_transfer ); + GMythRecorder *recorder = GMYTH_RECORDER( livetv_recorder ); gmyth_debug( "Program info changed! ( file transfer orig. = %p, ptr. = [%s], user data = [%s] )", transfer, - livetv_transfer != NULL ? "[NOT NULL]" : "[NULL]", livetv != NULL ? "[NOT NULL]" : "[NULL]" ); + livetv_recorder != NULL ? "[NOT NULL]" : "[NULL]", livetv != NULL ? "[NOT NULL]" : "[NULL]" ); - if ( livetv != NULL && transfer == livetv->file_transfer ) + if ( NULL != recorder ) { gmyth_debug( "YES, the requested program info movement on the LiveTV transfer is authentical!" ); } transfer->priv = GMYTH_FILE_TRANSFER_GET_PRIVATE(transfer); - transfer->priv->livetv = livetv; + g_object_ref(recorder); + + transfer->priv->recorder = recorder; transfer->priv->do_next_program_chain = TRUE; } diff -r 6bdbc6757eea -r 116e4fac8e96 gmyth/src/gmyth_file_transfer.h --- a/gmyth/src/gmyth_file_transfer.h Thu Mar 22 20:22:38 2007 +0000 +++ b/gmyth/src/gmyth_file_transfer.h Thu Mar 22 22:02:12 2007 +0000 @@ -69,7 +69,7 @@ /* signal default handlers */ void (*program_info_changed_handler) ( GMythFileTransfer *transfer, - gint msg_code, gpointer livetv_transfer ); + gint msg_code, gpointer livetv_recorder ); }; struct _GMythFileTransfer @@ -114,8 +114,8 @@ guint64 gmyth_file_transfer_get_filesize (GMythFileTransfer *transfer); void gmyth_file_transfer_emit_program_info_changed_signal ( GMythFileTransfer *transfer, - gint msg_code, - gpointer live_tv ); + gint msg_code, + gpointer live_tv_recorder ); G_END_DECLS diff -r 6bdbc6757eea -r 116e4fac8e96 gmyth/src/gmyth_livetv.c --- a/gmyth/src/gmyth_livetv.c Thu Mar 22 20:22:38 2007 +0000 +++ b/gmyth/src/gmyth_livetv.c Thu Mar 22 22:02:12 2007 +0000 @@ -203,16 +203,11 @@ if ( live_tv->file_transfer != NULL ) { gmyth_debug( "Emitting signal to the FileTransfer... [ \"program-info-changed \" ]" ); - /* - GMythProgramInfo* prog_info = gmyth_recorder_get_current_program_info( live_tv->recorder ); - if ( prog_info != NULL ) - live_tv->proginfo = prog_info; - */ gmyth_file_transfer_emit_program_info_changed_signal( live_tv->file_transfer, - msg_code, (gpointer)live_tv ); + msg_code, (gpointer)(live_tv->recorder) ); - /* gmyth_livetv_monitor_handler_stop( live_tv ); */ + /* gmyth_livetv_monitor_handler_stop( live_tv ); */ } else gmyth_debug( "LIVETV file_transfer is NULL!!! Cannot move to the next program chain event received.\n"); } @@ -229,16 +224,10 @@ if ( live_tv->file_transfer != NULL ) { gmyth_debug( "Emitting signal to the FileTransfer... [ \"backend-done-recording\" ]" ); - /* - GMythProgramInfo* prog_info = gmyth_recorder_get_current_program_info( live_tv->recorder ); - if ( prog_info != NULL ) - live_tv->proginfo = prog_info; - */ gmyth_file_transfer_emit_program_info_changed_signal( live_tv->file_transfer, - msg_code, (gpointer)live_tv ); + msg_code, (gpointer)(live_tv->recorder) ); - //gmyth_livetv_monitor_handler_stop( live_tv ); } else gmyth_debug( "LIVETV file_transfer is NULL!!! Cannot move to the next program chain event received.\n"); }