# HG changeset patch
# User renatofilho
# Date 1164724439 0
# Node ID acb4ff7d7d0c2c979352fda91321f8e678f2dfb3
# Parent  d183df7d845947f411014d04b14eff7a4d979fa2
[svn r130] -replaced g_print to g_debug

diff -r d183df7d8459 -r acb4ff7d7d0c gmyth/src/Makefile.am
--- a/gmyth/src/Makefile.am	Tue Nov 28 14:01:20 2006 +0000
+++ b/gmyth/src/Makefile.am	Tue Nov 28 14:33:59 2006 +0000
@@ -5,7 +5,7 @@
 libgmyth_la_SOURCES = 			\
 	gmyth_common.c				\
 	gmyth_epg.c 				\
-	gmyth_recorder.c		\
+	gmyth_recorder.c			\
 	gmyth_remote_util.c			\
 	gmyth_tvchain.c				\
 	gmyth_scheduler.c 			\
@@ -13,7 +13,7 @@
 	gmyth_query.c				\
 	gmyth_socket.c				\
 	gmyth_stringlist.c			\
-	gmyth_file_transfer.c			\
+	gmyth_file_transfer.c		\
 	gmyth_livetv.c				\
 	gmyth_backendinfo.c			\
 	gmyth_programinfo.c			\
@@ -25,7 +25,7 @@
 	$(GOBJECT_CFLAGS)			\
 	$(GST_CFLAGS) 				\
 	$(GSTBASE_CFLAGS)			\
-	$(GSTPLUGINSBASE_CFLAGS)			\
+	$(GSTPLUGINSBASE_CFLAGS)	\
 	$(MYSQL_CFLAGS)				\
 	-g3 -O0
 
@@ -36,7 +36,7 @@
 	-export-dynamic 			\
 	$(MYSQL_LIBS) 				\
 	$(GST_LIBS) 				\
-	$(GSTBASE_LIBS)			\
+	$(GSTBASE_LIBS)				\
 	$(GSTPLUGINS_LIBS)
 
 libgmyth_includedir = 			\
diff -r d183df7d8459 -r acb4ff7d7d0c gmyth/src/gmyth_file_transfer.c
--- a/gmyth/src/gmyth_file_transfer.c	Tue Nov 28 14:01:20 2006 +0000
+++ b/gmyth/src/gmyth_file_transfer.c	Tue Nov 28 14:33:59 2006 +0000
@@ -215,7 +215,7 @@
   	ret = FALSE;
   	goto clean_up;
   }
-  g_print ("Listening on Monitor socket...!\n");
+  g_debug ("Listening on Monitor socket...!\n");
   	
   //condition = g_io_channel_get_buffer_condition( io_channel );
   
@@ -228,7 +228,7 @@
   
   gsize len = 0;
   if (condition & G_IO_HUP) {
-    g_print ("Read end of pipe died!\n");
+    g_debug ("Read end of pipe died!\n");
     ret = FALSE;
     goto clean_up;
   }
@@ -242,7 +242,7 @@
       io_status = g_io_channel_read_chars( io_channel, trash + recv, 
       		GMYTHTV_BUFFER_SIZE, &len, &error);
 
-      g_print( "[%s] Received data buffer from IO binary channel... %d bytes gone!\n", 
+      g_debug ( "[%s] Received data buffer from IO binary channel... %d bytes gone!\n", 
       		__FUNCTION__, len );
       		
       recv += len;
@@ -258,10 +258,10 @@
   }
   //ret = g_io_channel_read_chars ( source, &msg, &len, NULL, &err);
   if ( io_status == G_IO_STATUS_ERROR ) {
-    g_print ("[%s] Error reading: %s\n", __FUNCTION__, error != NULL ? error->message : "" );
+    g_debug ("[%s] Error reading: %s\n", __FUNCTION__, error != NULL ? error->message : "" );
     ret = FALSE;
   }
-  g_print ("\n[%s]\tEVENT: Read %d bytes: %s\n\n", __FUNCTION__, len, trash != NULL ? trash : "[no event data]" );
+  g_debug ("\n[%s]\tEVENT: Read %d bytes: %s\n\n", __FUNCTION__, len, trash != NULL ? trash : "[no event data]" );
 
   //g_cond_signal( io_watcher_cond );
   
@@ -285,7 +285,7 @@
 
   gmyth_socket_send_command( transfer->event_sock, base_str );
   GString *resp = gmyth_socket_receive_response( transfer->event_sock );
-  g_print( "[%s] Got Monitor response from %s: %s\n", __FUNCTION__, base_str->str, resp->str );
+  g_debug ( "[%s] Got Monitor response from %s: %s\n", __FUNCTION__, base_str->str, resp->str );
   //g_thread_create( (GThreadFunc)myth_control_sock_listener, transfer->event_sock->sd_io_ch, TRUE, NULL );
   io_watcher_context = g_main_context_default();
   //GMainLoop *loop = g_main_loop_new( NULL, TRUE );
@@ -310,7 +310,7 @@
     goto cleanup;
   }
 */
-  g_print( "[%s]\tOK! Starting listener on the MONITOR event socket...\n", __FUNCTION__ );
+  g_debug ( "[%s]\tOK! Starting listener on the MONITOR event socket...\n", __FUNCTION__ );
   
   //g_main_loop_run( loop );
 
@@ -379,7 +379,7 @@
           transfer->file_id, transfer->filesize );
 
   if (transfer->filesize < 0 ) {
-      g_print( "[%s] Got filesize equals to %llu is lesser than 0 [invalid stream file]\n", __FUNCTION__, transfer->filesize );
+      g_debug ( "[%s] Got filesize equals to %llu is lesser than 0 [invalid stream file]\n", __FUNCTION__, transfer->filesize );
       g_object_unref(transfer->sock);
       transfer->sock = NULL;
       return FALSE;
@@ -486,7 +486,7 @@
 
   gint64 retval = gmyth_string_list_get_int64(strlist, 0);
   transfer->readposition = retval;
-  g_print( "[%s] got reading position pointer from the streaming = %lld\n", 
+  g_debug ( "[%s] got reading position pointer from the streaming = %lld\n", 
       __FUNCTION__, retval );
 
   myth_control_release_context( );
@@ -571,7 +571,7 @@
 
   io_status = g_io_channel_set_encoding( io_channel, NULL, &error );
   if ( io_status == G_IO_STATUS_NORMAL )
-    g_print( "[%s] Setting encoding to binary data socket).\n", __FUNCTION__ );
+    g_debug ( "[%s] Setting encoding to binary data socket).\n", __FUNCTION__ );
 
   io_cond = g_io_channel_get_buffer_condition( io_channel );  
 
@@ -609,7 +609,7 @@
     if ( strlist != NULL && gmyth_string_list_length( strlist ) > 0 ) { 
 	bytes_sent = gmyth_string_list_get_int( strlist,  0 ); // -1 on backend error
 
-	g_print( "[%s] got SENT buffer message = %d\n", __FUNCTION__, bytes_sent );
+	g_debug ( "[%s] got SENT buffer message = %d\n", __FUNCTION__, bytes_sent );
       	if ( bytes_sent != 0 ) {
       		
       		data_buffer = g_new0( gchar, bytes_sent );    
diff -r d183df7d8459 -r acb4ff7d7d0c gmyth/src/gmyth_scheduler.c
--- a/gmyth/src/gmyth_scheduler.c	Tue Nov 28 14:01:20 2006 +0000
+++ b/gmyth/src/gmyth_scheduler.c	Tue Nov 28 14:33:59 2006 +0000
@@ -258,7 +258,7 @@
     
     g_string_printf (query_str, 
     	"SELECT recordid,programid,chanid,starttime,progstart,"
-    	"endtime,progend,title,subtitle,description,category,basename FROM recorded;");
+    	"endtime,progend,title,subtitle,description,category,basename FROM recorded WHERE recgroup != 'LiveTV'");
 
 	if (scheduler->msqlquery == NULL) {
 		g_warning ("[%s] Scheduler db connection not initialized", __FUNCTION__);
@@ -628,3 +628,48 @@
     g_string_free(datastr, TRUE);
     g_object_unref(strlist);
 }
+
+void
+gmyth_scheduler_record_info_get_preview (RecordedInfo *info, GByteArray* data)
+{
+}
+
+void
+gmyth_scheduler_record_info_free (RecordedInfo *info)
+{
+    if (info->title != NULL)
+        g_string_free (info->title, TRUE);
+
+    if (info->subtitle != NULL)
+        g_string_free (info->subtitle, TRUE);
+
+    if (info->description != NULL)
+        g_string_free (info->description, TRUE);
+
+    if (info->category != NULL)
+        g_string_free (info->category, TRUE);
+
+    if (info->basename != NULL)
+        g_string_free (info->basename, TRUE);
+
+    g_free (info);
+}
+
+void
+gmyth_scheduler_schedule_info_free (ScheduleInfo *info)
+{
+    if (info->title != NULL)
+        g_string_free (info->title, TRUE);
+
+    if (info->subtitle != NULL)
+        g_string_free (info->subtitle, TRUE);
+
+    if (info->description != NULL)
+        g_string_free (info->description, TRUE);
+
+    if (info->category != NULL)
+        g_string_free (info->category, TRUE);
+
+    g_free (info);
+}
+
diff -r d183df7d8459 -r acb4ff7d7d0c gmyth/src/gmyth_socket.c
--- a/gmyth/src/gmyth_socket.c	Tue Nov 28 14:01:20 2006 +0000
+++ b/gmyth/src/gmyth_socket.c	Tue Nov 28 14:33:59 2006 +0000
@@ -627,7 +627,7 @@
     }
 
     g_static_mutex_lock( &mutex );
-    g_print ("[%s] Sending command to backend: %s\n", __FUNCTION__, command->str);
+    g_debug ("[%s] Sending command to backend: %s\n", __FUNCTION__, command->str);
 
     /*
        io_cond = g_io_channel_get_buffer_condition( gmyth_socket->sd_io_ch );
@@ -641,11 +641,11 @@
 
     buffer = g_strnfill( BUFLEN, ' ' );
     snprintf( buffer, MYTH_PROTOCOL_FIELD_SIZE+1, "%-8d", command->len);
-    g_print( "[%s] buffer = [%s]\n", __FUNCTION__, buffer  );
+    g_debug ( "[%s] buffer = [%s]\n", __FUNCTION__, buffer  );
 
     command = g_string_prepend(command, buffer);
 
-    g_print( "[%s] command = [%s]\n", __FUNCTION__, command->str  );
+    g_debug ( "[%s] command = [%s]\n", __FUNCTION__, command->str  );
 
     /* write bytes to socket */    
     io_status = g_io_channel_write_chars( gmyth_socket->sd_io_ch, command->str, 
@@ -786,7 +786,7 @@
 	    if (new_version!=NULL) {
 		++new_version; /* skip ']' character */
 		if ( new_version != NULL ) {
-		    g_print( "[%s] got MythTV version = %s.\n", __FUNCTION__, new_version );
+		    g_debug ( "[%s] got MythTV version = %s.\n", __FUNCTION__, new_version );
 		    mythtv_version = (gint)g_ascii_strtoull( g_strdup( new_version ), NULL, 10 );
 		    /* do reconnection to the socket (socket is closed if the MythTV version was wrong) */
 		    gmyth_socket_connect( gmyth_socket, gmyth_socket->hostname, gmyth_socket->port );
@@ -870,7 +870,7 @@
     /* verify if the input (read) buffer is ready to receive data */
     io_cond = g_io_channel_get_buffer_condition( gmyth_socket->sd_io_ch );
 
-    g_print ( "[%s] Bytes read = %d\n", __FUNCTION__, bytes_read );
+    g_debug ( "[%s] Bytes read = %d\n", __FUNCTION__, bytes_read );
 
     if( (io_status == G_IO_STATUS_ERROR) || (bytes_read <= 0) ) {
 		g_warning ("[%s] Error in mythprotocol response from backend\n", __FUNCTION__);
@@ -885,7 +885,7 @@
 		if ( ( io_cond & G_IO_IN ) != 0 ) {
 	
 		    snprintf( buffer, MYTH_PROTOCOL_FIELD_SIZE+1, "%-8s", g_strdup(buffer));
-		    g_print( "[%s] buffer = [%s]\n", __FUNCTION__, buffer  );
+		    g_debug ( "[%s] buffer = [%s]\n", __FUNCTION__, buffer  );
 	
 		    /* removes trailing whitespace */
 		    buffer = g_strstrip( buffer );
@@ -937,7 +937,7 @@
 
     ptr_array = g_ptr_array_sized_new(g_list_length(str_list->glist));
 
-    g_print( "[%s] Number of parameters = %d\n", __FUNCTION__, g_list_length(str_list->glist) );    
+    g_debug ( "[%s] Number of parameters = %d\n", __FUNCTION__, g_list_length(str_list->glist) );    
 
     // FIXME: change this implementation!
     tmp_list = str_list->glist;
@@ -954,7 +954,7 @@
 
     g_static_mutex_unlock( &mutex );
 
-    g_print( "[%s]\t\tSending the String list = %s\n", __FUNCTION__, str_array );
+    g_debug ( "[%s]\t\tSending the String list = %s\n", __FUNCTION__, str_array );
 
     // Sends message to backend	
     // TODO: implement looping to send remaining data, and add timeout testing!