[svn r485] Exprimental function to get all the channel names.
1.1 --- a/gmyth/src/gmyth_util.c Mon Apr 02 20:05:56 2007 +0100
1.2 +++ b/gmyth/src/gmyth_util.c Mon Apr 02 20:48:43 2007 +0100
1.3 @@ -560,13 +560,29 @@
1.4
1.5 g_return_val_if_fail (backend_info != NULL, FALSE);
1.6
1.7 - recorder = gmyth_recorder_new ( -1, g_string_new( gmyth_backend_info_get_hostname( backend_info ) ),
1.8 + recorder = gmyth_recorder_new ( 0, g_string_new( gmyth_backend_info_get_hostname( backend_info ) ),
1.9 gmyth_backend_info_get_port( backend_info ) );
1.10 res = gmyth_recorder_setup (recorder);
1.11
1.12 if (res == TRUE) {
1.13 - channel_list = gmyth_recorder_get_channel_list( recorder );
1.14 - }
1.15 + GList* channel_list_strs = gmyth_recorder_get_channel_list( recorder );
1.16 + GList* ch = NULL;
1.17 + GMythChannelInfo* channel_info = NULL;
1.18 +
1.19 + for ( ch = channel_list_strs; ch != NULL; ch = g_list_next(ch) )
1.20 + {
1.21 + channel_info = g_new0(GMythChannelInfo, 1);
1.22 + channel_info->channel_ID = 0;
1.23 + channel_info->channel_num = g_string_new ( g_strdup( (gchar*)ch->data ) );
1.24 + channel_info->channel_name = g_string_new ("");
1.25 + gmyth_debug("Printing channel info... (%s)", channel_info->channel_num->str );
1.26 + channel_list = g_list_append( channel_list, channel_info );
1.27 + } /* for */
1.28 +
1.29 + //if ( channel_info != NULL )
1.30 + // g_free( channel_info );
1.31 +
1.32 + } /* if */
1.33
1.34 g_object_unref (recorder);
1.35