# HG changeset patch # User rosfran # Date 1175543323 -3600 # Node ID f6fc378c70e543e530d7339478f2ef69e6bc25f5 # Parent 5e1afa4a66e80a78f41014fdc99b4d03ced18a26 [svn r485] Exprimental function to get all the channel names. diff -r 5e1afa4a66e8 -r f6fc378c70e5 gmyth/src/gmyth_util.c --- a/gmyth/src/gmyth_util.c Mon Apr 02 20:05:56 2007 +0100 +++ b/gmyth/src/gmyth_util.c Mon Apr 02 20:48:43 2007 +0100 @@ -560,13 +560,29 @@ g_return_val_if_fail (backend_info != NULL, FALSE); - recorder = gmyth_recorder_new ( -1, g_string_new( gmyth_backend_info_get_hostname( backend_info ) ), + recorder = gmyth_recorder_new ( 0, g_string_new( gmyth_backend_info_get_hostname( backend_info ) ), gmyth_backend_info_get_port( backend_info ) ); res = gmyth_recorder_setup (recorder); if (res == TRUE) { - channel_list = gmyth_recorder_get_channel_list( recorder ); - } + GList* channel_list_strs = gmyth_recorder_get_channel_list( recorder ); + GList* ch = NULL; + GMythChannelInfo* channel_info = NULL; + + for ( ch = channel_list_strs; ch != NULL; ch = g_list_next(ch) ) + { + channel_info = g_new0(GMythChannelInfo, 1); + channel_info->channel_ID = 0; + channel_info->channel_num = g_string_new ( g_strdup( (gchar*)ch->data ) ); + channel_info->channel_name = g_string_new (""); + gmyth_debug("Printing channel info... (%s)", channel_info->channel_num->str ); + channel_list = g_list_append( channel_list, channel_info ); + } /* for */ + + //if ( channel_info != NULL ) + // g_free( channel_info ); + + } /* if */ g_object_unref (recorder);