# HG changeset patch
# User rosfran
# Date 1175093609 -3600
# Node ID bc13aaf7561d4230974089f4de4885d1091a0a3d
# Parent  a7aba7d166fb840c9e16884b199c776d89f85fde
[svn r472] Changed all the g_debug, g_warning and g_debug calls, to the gmyth_debug status/error printing function.

diff -r a7aba7d166fb -r bc13aaf7561d gmyth/src/gmyth_epg.c
--- a/gmyth/src/gmyth_epg.c	Tue Mar 27 23:57:42 2007 +0100
+++ b/gmyth/src/gmyth_epg.c	Wed Mar 28 15:53:29 2007 +0100
@@ -114,7 +114,7 @@
     }
 
     if (!gmyth_query_connect(gmyth_epg->sqlquery, backend_info)) {
-        g_warning ("[%s] Error while connecting to db", __FUNCTION__);
+        gmyth_debug ("[%s] Error while connecting to db", __FUNCTION__);
         return FALSE;
     }
 
@@ -158,7 +158,7 @@
     (*glist_ptr) = NULL;
 	
     if (msql_res == NULL) {
-        g_warning ("[%s] msql query returned NULL MYSQL_RES", __FUNCTION__);
+        gmyth_debug ("[%s] msql query returned NULL MYSQL_RES", __FUNCTION__);
 		return -1;
     } else {
         MYSQL_ROW row;
@@ -240,7 +240,7 @@
         gmyth_query_process_statement(gmyth_epg->sqlquery, querystr->str);
 
     if (res_set == NULL) {
-        g_warning ("[%s] msql query returned NULL MYSQL_RES", __FUNCTION__);
+        gmyth_debug ("[%s] msql query returned NULL MYSQL_RES", __FUNCTION__);
 		return -1;
     }
 
diff -r a7aba7d166fb -r bc13aaf7561d gmyth/src/gmyth_file_transfer.c
--- a/gmyth/src/gmyth_file_transfer.c	Tue Mar 27 23:57:42 2007 +0100
+++ b/gmyth/src/gmyth_file_transfer.c	Wed Mar 28 15:53:29 2007 +0100
@@ -290,7 +290,7 @@
       ret = FALSE;
     }
   } else {
-    g_warning("Remote transfer control socket already created.\n");
+    gmyth_debug("Remote transfer control socket already created.\n");
   }
   
   gmyth_debug ("Got file with size = %lld.\n", transfer->filesize);
diff -r a7aba7d166fb -r bc13aaf7561d gmyth/src/gmyth_livetv.c
--- a/gmyth/src/gmyth_livetv.c	Tue Mar 27 23:57:42 2007 +0100
+++ b/gmyth/src/gmyth_livetv.c	Wed Mar 28 15:53:29 2007 +0100
@@ -374,7 +374,7 @@
 		res = gmyth_socket_connect_to_backend (livetv->socket, livetv->backend_info->hostname,
 				livetv->backend_info->port, TRUE);
 		if (!res) {
-			g_warning ("[%s] LiveTV can not connect to backend", __FUNCTION__);	
+			gmyth_debug ("[%s] LiveTV can not connect to backend", __FUNCTION__);	
 			res = FALSE;
 			goto error;
 		}
@@ -411,7 +411,7 @@
 	gmyth_socket_close_connection (livetv->socket);
 
 	if ( NULL == livetv->recorder ) {
-		g_warning ("[%s] None remote encoder available", __FUNCTION__);
+		gmyth_debug ("[%s] None remote encoder available", __FUNCTION__);
 		res = FALSE;
 		goto error;
 	}
@@ -419,7 +419,7 @@
 	/* Init remote encoder. Opens its control socket. */
 	res = gmyth_recorder_setup(livetv->recorder);
 	if ( !res ) {
-		g_warning ("[%s] Fail while setting remote encoder\n", __FUNCTION__);
+		gmyth_debug ("[%s] Fail while setting remote encoder\n", __FUNCTION__);
 		res = FALSE;
 		goto error;
 	}
@@ -437,7 +437,7 @@
 	res = gmyth_recorder_spawntv ( livetv->recorder,
 			gmyth_tvchain_get_id(livetv->tvchain) );
 	if (!res) {
-		g_warning ("[%s] Fail while spawn tv\n", __FUNCTION__);
+		gmyth_debug ("[%s] Fail while spawn tv\n", __FUNCTION__);
 		res = FALSE;
 		goto error;
 	}
@@ -455,7 +455,7 @@
 			/* Pauses remote encoder. */
 			res = gmyth_recorder_pause_recording(livetv->recorder);
 			if ( !res ) {
-				g_warning ("[%s] Fail while pausing remote encoder\n", __FUNCTION__);
+				gmyth_debug ("[%s] Fail while pausing remote encoder\n", __FUNCTION__);
 				res = FALSE;
 				goto error;
 			}
@@ -535,7 +535,7 @@
 		/* Get program info from database using chanid and starttime */
 		livetv->proginfo = gmyth_tvchain_get_program_at (livetv->tvchain, tvchain_curr_index++ );
 		if ( livetv->proginfo == NULL ) {
-			g_warning ("[%s] LiveTV not successfully started.\n", __FUNCTION__ );
+			gmyth_debug ("[%s] LiveTV not successfully started.\n", __FUNCTION__ );
 			res = FALSE;
 			goto error;
 		} else {
@@ -561,7 +561,7 @@
 	return res;
 
 error:
-	g_print( "[%s] ERROR running LiveTV setup.\n", __FUNCTION__ );
+	gmyth_debug( "[%s] ERROR running LiveTV setup.\n", __FUNCTION__ );
 
     res = FALSE;
 
@@ -703,7 +703,7 @@
 		livetv->proginfo = prog_info;
 		gmyth_debug ("GMythLiveTV: All requests to backend to start TV were OK, program info changed.");
 	} else {
-		g_warning ("[%s] LiveTV not successfully started on the next program chain.\n", __FUNCTION__ );
+		gmyth_debug ("[%s] LiveTV not successfully started on the next program chain.\n", __FUNCTION__ );
 		goto error;
 	}
 	
@@ -712,7 +712,7 @@
 	return res;
 
 error:
-	g_print( "[%s] ERROR running LiveTV setup.\n", __FUNCTION__ );
+	gmyth_debug( "[%s] ERROR running LiveTV setup.\n", __FUNCTION__ );
 
     res = FALSE;
     
diff -r a7aba7d166fb -r bc13aaf7561d gmyth/src/gmyth_monitor_handler.c
--- a/gmyth/src/gmyth_monitor_handler.c	Tue Mar 27 23:57:42 2007 +0100
+++ b/gmyth/src/gmyth_monitor_handler.c	Wed Mar 28 15:53:29 2007 +0100
@@ -307,7 +307,7 @@
           ret = FALSE;
       }
       else {
-          g_warning("Remote monitor event socket already created.\n");
+          gmyth_debug("Remote monitor event socket already created.\n");
       }
   }
 
diff -r a7aba7d166fb -r bc13aaf7561d gmyth/src/gmyth_recorder.c
--- a/gmyth/src/gmyth_recorder.c	Tue Mar 27 23:57:42 2007 +0100
+++ b/gmyth/src/gmyth_recorder.c	Wed Mar 28 15:53:29 2007 +0100
@@ -916,7 +916,7 @@
     }
 
 #ifndef GMYTHTV_ENABLE_DEBUG
-    g_print( "[%s] Got file position = %lld\n", __FUNCTION__, pos);
+    gmyth_debug( "[%s] Got file position = %lld\n", __FUNCTION__, pos);
 #endif
     
     g_mutex_unlock( recorder->mutex );
@@ -1089,7 +1089,7 @@
  * @return <code>true</code>, if the tuner had been freed.
  */
 gboolean
-gmyth_recorder_free_tuner( GMythRecorder *recorder) {
+gmyth_recorder_free_tuner( GMythRecorder *recorder ) {
     gboolean ret = TRUE;
 
     g_return_val_if_fail( recorder != NULL, FALSE );
diff -r a7aba7d166fb -r bc13aaf7561d gmyth/src/gmyth_stringlist.c
--- a/gmyth/src/gmyth_stringlist.c	Tue Mar 27 23:57:42 2007 +0100
+++ b/gmyth/src/gmyth_stringlist.c	Wed Mar 28 15:53:29 2007 +0100
@@ -345,7 +345,7 @@
     GString *ret;
 
     if (!strlist || !(strlist->glist)) {
-	g_warning ("%s received Null arguments", __FUNCTION__);
+	gmyth_debug ("%s received Null arguments", __FUNCTION__);
 	return NULL;
     }
 
diff -r a7aba7d166fb -r bc13aaf7561d gmyth/src/gmyth_tvchain.c
--- a/gmyth/src/gmyth_tvchain.c	Tue Mar 27 23:57:42 2007 +0100
+++ b/gmyth/src/gmyth_tvchain.c	Wed Mar 28 15:53:29 2007 +0100
@@ -162,7 +162,7 @@
 	    g_free(isodate);	    
 	    g_free( cur_time );
     } else {
-    	g_warning ("[%s] TVchain already initialized", __FUNCTION__);
+    	gmyth_debug ("[%s] TVchain already initialized", __FUNCTION__);
     }
 
     return TRUE;
@@ -210,7 +210,7 @@
 	/* TODO: Reuse gmyth_query already connected from context */
 	gmyth_query = gmyth_query_new ();
 	if (!gmyth_query_connect (gmyth_query, tvchain->backend_info)) {
-		g_warning ("[%s] Could not connect to db", __FUNCTION__);
+		gmyth_debug ("[%s] Could not connect to db", __FUNCTION__);
 		g_mutex_unlock( tvchain->mutex );
 		ret = FALSE;
 		goto done;
@@ -239,7 +239,7 @@
 			entry->inputname = g_string_new (msql_row[8]);
 
 			//m_maxpos = query.value(4).toInt() + 1;
-			g_print( "[%s] Reading TV chain entry (channel %s): [%s, %s, %s]\n", __FUNCTION__, entry->channum->str, entry->chanid->str, 
+			gmyth_debug( "[%s] Reading TV chain entry (channel %s): [%s, %s, %s]\n", __FUNCTION__, entry->channum->str, entry->chanid->str, 
 					(gchar*)msql_row[1], (gchar*)msql_row[2] );
 			
 			/* add this to get the actual start timestamp of the last recording */
@@ -249,7 +249,7 @@
 			tvchain->tvchain_list = g_list_append (tvchain->tvchain_list, entry);			
 		}
 	} else {
-		g_warning ("gmyth_tvchain_reload_all query error!\n");
+		gmyth_debug ("gmyth_tvchain_reload_all query error!\n");
 		g_mutex_unlock( tvchain->mutex );
 
 		ret = FALSE;
@@ -259,7 +259,7 @@
 	g_mutex_unlock( tvchain->mutex );
 	
 	tvchain->cur_pos = gmyth_tvchain_program_is_at (tvchain, tvchain->cur_chanid, tvchain->cur_startts);
-	g_print( "[%s] TVChain current position = %d.\n", __FUNCTION__, tvchain->cur_pos );
+	gmyth_debug( "[%s] TVChain current position = %d.\n", __FUNCTION__, tvchain->cur_pos );
 
 	if (tvchain->cur_pos < 0)
 		tvchain->cur_pos = 0;
@@ -362,7 +362,7 @@
 		gmyth_debug ("[%s] Got TV Chain entry at %d.\n", __FUNCTION__, new_index );
 
 	} else {
-		g_warning ("[%s] failed to get entry at index %d", __FUNCTION__, index);
+		gmyth_debug ("[%s] failed to get entry at index %d", __FUNCTION__, index);
 	}
 
 	return chain_entry;
@@ -382,7 +382,7 @@
 	g_return_val_if_fail( tvchain != NULL, NULL );
 
 	if ( !entry || !tvchain ) {
-		g_warning ("gmyth_tvchain_entry_to_program() received NULL argument");
+		gmyth_debug ("gmyth_tvchain_entry_to_program() received NULL argument");
 		return NULL;
 	}
 
@@ -396,7 +396,7 @@
 	if (proginfo) {
 		proginfo->pathname = g_string_prepend (proginfo->pathname, entry->hostprefix->str);
 	} else {
-		g_warning ("tvchain_entry_to_program( chan id = %s, starttime = %ld) failed!", entry->chanid->str, entry->starttime->tv_sec);
+		gmyth_debug ("tvchain_entry_to_program( chan id = %s, starttime = %ld) failed!", entry->chanid->str, entry->starttime->tv_sec);
 	}
 
 	return proginfo;