[svn r477] Added functions to get the channel's list from the MythTV, using the normal backend server messages.
1.1 --- a/gmyth/src/gmyth_livetv.c Fri Mar 30 23:07:54 2007 +0100
1.2 +++ b/gmyth/src/gmyth_livetv.c Fri Mar 30 23:09:39 2007 +0100
1.3 @@ -460,13 +460,13 @@
1.4 goto error;
1.5 }
1.6
1.7 - if ( gmyth_recorder_check_channel_name( livetv->recorder, channel ) )
1.8 - {
1.9 - if ( gmyth_recorder_set_channel_name( livetv->recorder, channel ) )
1.10 - {
1.11 - gmyth_debug( "Channel changed!!! [%s].\n", channel );
1.12 - }
1.13 - }
1.14 + if ( gmyth_recorder_check_channel_name( livetv->recorder, channel ) )
1.15 + {
1.16 + if ( gmyth_recorder_set_channel_name( livetv->recorder, channel ) )
1.17 + {
1.18 + gmyth_debug( "Channel changed!!! [%s].\n", channel );
1.19 + }
1.20 + }
1.21
1.22 } /* if - changes the channel number */
1.23
2.1 --- a/gmyth/src/gmyth_recorder.c Fri Mar 30 23:07:54 2007 +0100
2.2 +++ b/gmyth/src/gmyth_recorder.c Fri Mar 30 23:09:39 2007 +0100
2.3 @@ -585,6 +585,37 @@
2.4 return ret;
2.5 }
2.6
2.7 +/**
2.8 + * Gets the channel's list from the MythTV backend server.
2.9 + *
2.10 + * @param recorder The GMythRecorder instance.
2.11 + *
2.12 + * @return a GList* instance with all the channel names.
2.13 + */
2.14 +GList*
2.15 +gmyth_recorder_get_channel_list(GMythRecorder *recorder ) {
2.16 +
2.17 + GList* channel_list = NULL;
2.18 + gchar* channel = NULL;
2.19 + guint i;
2.20 +
2.21 + for ( i = 0; i < 1000; i++ )
2.22 + {
2.23 + channel = g_strdup_printf( "%u", i );
2.24 +
2.25 + if ( gmyth_recorder_check_channel_name( recorder, channel ) )
2.26 + {
2.27 + channel_list = g_list_append( channel_list, g_strdup( channel ) );
2.28 + }
2.29 +
2.30 + g_free( channel );
2.31 +
2.32 + } /* for - channel list */
2.33 +
2.34 + return channel_list;
2.35 +
2.36 +}
2.37 +
2.38 /** Send a PAUSE command request to the backend, to pause streaming on another
2.39 * TV content channel.
2.40 *
3.1 --- a/gmyth/src/gmyth_recorder.h Fri Mar 30 23:07:54 2007 +0100
3.2 +++ b/gmyth/src/gmyth_recorder.h Fri Mar 30 23:09:39 2007 +0100
3.3 @@ -126,6 +126,8 @@
3.4
3.5 gboolean gmyth_recorder_change_channel (GMythRecorder *recorder,
3.6 const GMythRecorderChannelChangeDirection direction);
3.7 +
3.8 +GList* gmyth_recorder_get_channel_list(GMythRecorder *recorder );
3.9
3.10 gboolean gmyth_recorder_pause_recording ( GMythRecorder *recorder );
3.11