[svn r21] - created maemo-ui; trunk
authorrenatofilho
Thu Sep 28 16:02:14 2006 +0100 (2006-09-28)
branchtrunk
changeset 207174e23f7617
parent 19 7c409a042a9a
child 21 3c4daefe377f
[svn r21] - created maemo-ui;
gmyth/src/gmyth_tvplayer.c
gmyth/src/gmyth_tvplayer.h
gmyth/src/mmyth_main.c
maemo-ui/pixmaps/Makefile.am
maemo-ui/pixmaps/Makefile.in
maemo-ui/pixmaps/mmyth_logo.png
maemo-ui/src/Makefile.am
maemo-ui/src/Makefile.in
maemo-ui/src/mmyth_epg_grid_view.c
maemo-ui/src/mmyth_epg_grid_view.h
maemo-ui/src/mmyth_epg_grid_widget.c
maemo-ui/src/mmyth_epg_grid_widget.h
maemo-ui/src/mmyth_main.c
maemo-ui/src/mmyth_recordui.c
maemo-ui/src/mmyth_recordui.h
maemo-ui/src/mmyth_schedulerui.c
maemo-ui/src/mmyth_schedulerui.h
maemo-ui/src/mmyth_tvplayer.c
maemo-ui/src/mmyth_tvplayer.h
maemo-ui/src/mmyth_ui.c
maemo-ui/src/mmyth_ui.h
maemo-ui/src/mmyth_uicommon.c
maemo-ui/src/mmyth_uicommon.h
maemo-ui/src/mmyth_uisettings.c
maemo-ui/src/mmyth_uisettings.h
maemo-ui/src/mmyth_videoplayer.c
maemo-ui/src/mmyth_videoplayer.h
maemo-ui/src/svn-commit.tmp
     1.1 --- a/gmyth/src/gmyth_tvplayer.c	Thu Sep 28 15:57:27 2006 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,684 +0,0 @@
     1.4 -/**
     1.5 - * GMyth Library
     1.6 - *
     1.7 - * @file gmyth/gmyth_tvplayer.c
     1.8 - * 
     1.9 - * @brief <p> This component provides playback of the remote A/V using
    1.10 - * GStreamer.
    1.11 - * 
    1.12 - * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    1.13 - * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
    1.14 - *
    1.15 - *//*
    1.16 - * 
    1.17 - * This program is free software; you can redistribute it and/or modify
    1.18 - * it under the terms of the GNU Lesser General Public License as published by
    1.19 - * the Free Software Foundation; either version 2 of the License, or
    1.20 - * (at your option) any later version.
    1.21 - *
    1.22 - * This program is distributed in the hope that it will be useful,
    1.23 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.24 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.25 - * GNU General Public License for more details.
    1.26 - *
    1.27 - * You should have received a copy of the GNU Lesser General Public License
    1.28 - * along with this program; if not, write to the Free Software
    1.29 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.30 - */
    1.31 -
    1.32 -#include "gmyth_tvplayer.h"
    1.33 - 
    1.34 -#include <gdk/gdkx.h>
    1.35 -
    1.36 -#include "gmyth_context.h"
    1.37 -#include "gmyth_remote_util.h"
    1.38 -
    1.39 -typedef struct _GstPlayerWindowStateChange
    1.40 -{
    1.41 -    GstElement *play;
    1.42 -    GstState old_state, new_state;
    1.43 -    GMythTVPlayer *tvplayer;
    1.44 -} GstPlayerWindowStateChange;
    1.45 -
    1.46 -typedef struct _GstPlayerWindowTagFound
    1.47 -{
    1.48 -    GstElement *play;
    1.49 -    GstTagList *taglist;
    1.50 -    GMythTVPlayer *tvplayer;
    1.51 -} GstPlayerWindowTagFound;
    1.52 -
    1.53 -/*
    1.54 -static gboolean idle_state (gpointer data);
    1.55 -*/
    1.56 -static gboolean bus_call (GstBus * bus, GstMessage * msg, gpointer data);
    1.57 -
    1.58 -static void gmyth_tvplayer_class_init          (GMythTVPlayerClass *klass);
    1.59 -static void gmyth_tvplayer_init                (GMythTVPlayer *object);
    1.60 -
    1.61 -static void gmyth_tvplayer_dispose  (GObject *object);
    1.62 -static void gmyth_tvplayer_finalize (GObject *object);
    1.63 -
    1.64 -G_DEFINE_TYPE(GMythTVPlayer, gmyth_tvplayer, G_TYPE_OBJECT)
    1.65 -
    1.66 -static gboolean gmyth_tvplayer_create_pipeline (GMythTVPlayer* tvplayer);
    1.67 -static void     new_pad_cb (GstElement *element, 
    1.68 -                            GstPad *pad, gpointer data);
    1.69 -
    1.70 -static gboolean expose_cb (GtkWidget * widget, 
    1.71 -                           GdkEventExpose * event, 
    1.72 -                           gpointer user_data);
    1.73 -
    1.74 -static void
    1.75 -gmyth_tvplayer_class_init (GMythTVPlayerClass *klass)
    1.76 -{
    1.77 -	GObjectClass *gobject_class;
    1.78 -
    1.79 -    gobject_class = (GObjectClass *) klass;
    1.80 -	
    1.81 -    gobject_class->dispose  = gmyth_tvplayer_dispose;
    1.82 -    gobject_class->finalize = gmyth_tvplayer_finalize;	
    1.83 -}
    1.84 -
    1.85 -static void
    1.86 -new_pad_cb (GstElement *element, GstPad *pad, gpointer data)
    1.87 -{
    1.88 -	GMythTVPlayer *tvplayer = GMYTH_TVPLAYER (data);
    1.89 -	GstPadLinkReturn ret;
    1.90 -	char *s;
    1.91 -	
    1.92 -	s = gst_caps_to_string (pad->caps);
    1.93 -
    1.94 -	if ( s[0] == 'a') {
    1.95 -		ret = gst_pad_link (pad, gst_element_get_pad (tvplayer->audioqueue, "sink"));
    1.96 -	} else {
    1.97 -		ret = gst_pad_link (pad, gst_element_get_pad (tvplayer->videoqueue, "sink")); 
    1.98 -	}
    1.99 -	
   1.100 -	g_free(s);
   1.101 -}
   1.102 -
   1.103 -static gboolean
   1.104 -expose_cb (GtkWidget * widget, GdkEventExpose * event, gpointer user_data)
   1.105 -{
   1.106 -    GMythTVPlayer *tvplayer = GMYTH_TVPLAYER (user_data);
   1.107 -
   1.108 -	if (tvplayer && tvplayer->videow) {
   1.109 -	    gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (tvplayer->gst_videosink),
   1.110 -                                  GDK_WINDOW_XWINDOW (widget->window));
   1.111 -		return TRUE;
   1.112 -	}
   1.113 -	
   1.114 -	g_warning ("GMythTVPlayer expose called before setting video window\n");
   1.115 -	
   1.116 -    return FALSE;
   1.117 -}
   1.118 -
   1.119 -static void
   1.120 -gmyth_tvplayer_init (GMythTVPlayer *tvplayer)
   1.121 -{
   1.122 -    tvplayer->gst_pipeline = NULL;
   1.123 -    tvplayer->gst_source = NULL;
   1.124 -    tvplayer->gst_videodec = NULL;
   1.125 -    tvplayer->gst_videosink = NULL;
   1.126 -    tvplayer->videoqueue = NULL;
   1.127 -    tvplayer->audioqueue = NULL;
   1.128 -    
   1.129 -    /* GTKWidget for rendering the video */
   1.130 -    tvplayer->videow = NULL;
   1.131 -	tvplayer->expose_handler = 0;
   1.132 -	    
   1.133 -	tvplayer->backend_hostname = NULL;
   1.134 -	tvplayer->backend_port = 0;
   1.135 -	tvplayer->local_hostname = NULL;
   1.136 -
   1.137 -	tvplayer->remote_encoder = NULL;
   1.138 -	tvplayer->tvchain = NULL;
   1.139 -	tvplayer->proginfo = NULL;
   1.140 -}
   1.141 -
   1.142 -static void
   1.143 -gmyth_tvplayer_dispose (GObject *object)
   1.144 -{
   1.145 -
   1.146 -	G_OBJECT_CLASS (gmyth_tvplayer_parent_class)->dispose (object);
   1.147 -}
   1.148 -
   1.149 -static void
   1.150 -gmyth_tvplayer_finalize (GObject *object)
   1.151 -{
   1.152 -	g_signal_handlers_destroy (object);
   1.153 -
   1.154 -	GMythTVPlayer *tvplayer = GMYTH_TVPLAYER (object);
   1.155 -
   1.156 -	g_debug ("[%s] Finalizing tvplayer", __FUNCTION__);
   1.157 -	
   1.158 -	if (tvplayer->videow != NULL) {
   1.159 -		if (g_signal_handler_is_connected (tvplayer->videow, 
   1.160 -						tvplayer->expose_handler)) {
   1.161 -			g_signal_handler_disconnect (tvplayer->videow,
   1.162 -				tvplayer->expose_handler);
   1.163 -		}
   1.164 -		g_object_unref (tvplayer->videow);
   1.165 -	}
   1.166 -	
   1.167 -	if ( tvplayer->remote_encoder != NULL )
   1.168 -		g_object_unref (tvplayer->remote_encoder);
   1.169 -	if ( tvplayer->tvchain != NULL )
   1.170 -		g_object_unref (tvplayer->tvchain);
   1.171 -	if ( tvplayer->proginfo != NULL )
   1.172 -		g_object_unref (tvplayer->proginfo);	
   1.173 -
   1.174 -	// Release Gstreamer elements
   1.175 -	if ( tvplayer->gst_pipeline != NULL )
   1.176 -		g_object_unref (tvplayer->gst_pipeline);	
   1.177 -	if ( tvplayer->gst_source != NULL )
   1.178 -		g_object_unref (tvplayer->gst_source);	
   1.179 -	if ( tvplayer->gst_videodec != NULL )
   1.180 -		g_object_unref (tvplayer->gst_videodec);	
   1.181 -	if ( tvplayer->gst_videosink != NULL )
   1.182 -		g_object_unref (tvplayer->gst_videosink);	
   1.183 -	if ( tvplayer->videoqueue != NULL )
   1.184 -		g_object_unref (tvplayer->videoqueue);	
   1.185 -	if ( tvplayer->audioqueue != NULL )
   1.186 -		g_object_unref (tvplayer->audioqueue);	
   1.187 -
   1.188 -	G_OBJECT_CLASS (gmyth_tvplayer_parent_class)->finalize (object);
   1.189 -}
   1.190 -
   1.191 -/** Creates a new instance of GMythTVPlayer. 
   1.192 - * 
   1.193 - * @return a new instance of GMythTVPlayer.
   1.194 - */
   1.195 -GMythTVPlayer *
   1.196 -gmyth_tvplayer_new ()
   1.197 -{
   1.198 -    GMythTVPlayer *tvplayer = 
   1.199 -        GMYTH_TVPLAYER (g_object_new(GMYTH_TVPLAYER_TYPE, NULL));
   1.200 -    
   1.201 -    return tvplayer;
   1.202 -}
   1.203 -
   1.204 -/** Initializes the tv player.
   1.205 - *
   1.206 - * @param tvplayer the object instance.
   1.207 - * @return gboolean TRUE if the pipeline was created 
   1.208 - * successfully, FALSE otherwise.
   1.209 - */
   1.210 -gboolean
   1.211 -gmyth_tvplayer_initialize (GMythTVPlayer *tvplayer)
   1.212 -{
   1.213 -	
   1.214 -    if (!gmyth_tvplayer_create_pipeline (tvplayer)) {
   1.215 -    	g_warning ("[%s] Error while creating pipeline. TV Player not initialized", __FUNCTION__);
   1.216 -		return FALSE;
   1.217 -	} else {
   1.218 -		g_debug ("[%s] GStreamer pipeline created", __FUNCTION__);	
   1.219 -    }
   1.220 -
   1.221 -	return TRUE;
   1.222 -}
   1.223 -
   1.224 -/** Creates the GStreamer pipeline used by the player.
   1.225 - *
   1.226 - * @param tvplayer the object instance.
   1.227 - * @return gboolean TRUE if the pipeline was created 
   1.228 - * successfully, FALSE otherwise.
   1.229 - */
   1.230 -static gboolean
   1.231 -gmyth_tvplayer_create_pipeline (GMythTVPlayer* tvplayer)
   1.232 -{
   1.233 -    GstElement *pipeline;
   1.234 -    GstElement *source, *parser;
   1.235 -    GstElement *videodec, *videosink;
   1.236 -#ifndef MAEMO_PLATFORM    
   1.237 -    GstElement *audiodec, *audioconv;
   1.238 -#endif
   1.239 -    GstElement *audiosink;
   1.240 -    GstElement *videoqueue, *audioqueue;
   1.241 -
   1.242 -    g_debug ("GMythTVPlayer: Setting the Gstreamer pipeline\n");
   1.243 -	
   1.244 -    pipeline = gst_pipeline_new ("video-player");
   1.245 -    source = gst_element_factory_make ("mythtvsrc", "myth-source");
   1.246 -    parser = gst_element_factory_make ("ffdemux_nuv", "nuv-demux");
   1.247 -
   1.248 -    /* Gstreamer Video elements */
   1.249 -    videoqueue = gst_element_factory_make ("queue", "video-queue");
   1.250 -    videodec = gst_element_factory_make ("ffdec_mpeg4", "video-decoder");
   1.251 -#ifdef MAEMO_PLATFORM
   1.252 -    videosink = gst_element_factory_make ("sdlvideosink", "image-output");
   1.253 -#else
   1.254 -    videosink = gst_element_factory_make ("xvimagesink", "image-output");
   1.255 -#endif
   1.256 -    
   1.257 -    /* Gstreamer Audio elements */
   1.258 -    audioqueue = gst_element_factory_make ("queue", "audio-queue");    
   1.259 -#ifdef MAEMO_PLATFORM    
   1.260 -    audiosink = gst_element_factory_make ("dspmp3sink", "audio-output");
   1.261 -#else    
   1.262 -    audiodec = gst_element_factory_make ("ffdec_mp3", "audio-decoder");
   1.263 -    audioconv = gst_element_factory_make ("audioconvert", "audio-converter");
   1.264 -    audiosink = gst_element_factory_make ("alsasink", "audio-output");
   1.265 -#endif    
   1.266 -    
   1.267 -    if (!(pipeline && source && parser && videodec && videosink) ||
   1.268 -    	!(videoqueue && audioqueue && audiosink)) {
   1.269 -        /* FIXME: hanlde the error correctly */
   1.270 -        /* video_alignment is not being created (below) 
   1.271 -           and is causing problems to the ui */
   1.272 -
   1.273 -	    tvplayer->gst_pipeline = NULL;
   1.274 -	    tvplayer->gst_videodec = NULL;
   1.275 -	    tvplayer->gst_videosink = NULL;
   1.276 -           
   1.277 -        g_warning ("GstElement creation error!\n");
   1.278 -        return FALSE;
   1.279 -    }
   1.280 -
   1.281 -#ifndef MAEMO_PLATFORM    
   1.282 -    if (!(audiodec && audioconv)) {
   1.283 -        g_warning ("GstElement for audio stream creation error!");
   1.284 -        return FALSE;
   1.285 -    }
   1.286 -#endif    
   1.287 -    
   1.288 -    
   1.289 -    tvplayer->gst_pipeline = pipeline;
   1.290 -    tvplayer->gst_source = source;
   1.291 -    tvplayer->gst_videodec = videodec;
   1.292 -    tvplayer->gst_videosink = videosink;
   1.293 -    g_object_ref (tvplayer->gst_pipeline);
   1.294 -    g_object_ref (tvplayer->gst_source);
   1.295 -    g_object_ref (tvplayer->gst_videodec);
   1.296 -    g_object_ref (tvplayer->gst_videosink);
   1.297 -
   1.298 -    tvplayer->videoqueue = videoqueue;
   1.299 -    tvplayer->audioqueue = audioqueue;
   1.300 -    g_object_ref (tvplayer->videoqueue);
   1.301 -    g_object_ref (tvplayer->audioqueue);
   1.302 -   	
   1.303 -    g_object_set (G_OBJECT (videosink), "sync", TRUE, NULL);
   1.304 -    g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
   1.305 -
   1.306 -    gst_bus_add_watch (gst_pipeline_get_bus (GST_PIPELINE (tvplayer->gst_pipeline)),
   1.307 -                       bus_call, tvplayer);
   1.308 -
   1.309 -    gst_bin_add_many (GST_BIN (pipeline), source, parser, videoqueue,
   1.310 -    			videodec, videosink, audioqueue, audiodec, audioconv, audiosink, NULL);
   1.311 -
   1.312 -    {
   1.313 -//        GstCaps *rtpcaps = gst_caps_new_simple ("application/x-rtp", NULL);
   1.314 -//        gst_element_link_filtered(source, parser, rtpcaps);
   1.315 -    }
   1.316 -    
   1.317 -    gst_element_link (source, parser);
   1.318 -    gst_element_link_many (videoqueue, videodec, videosink, NULL);
   1.319 -    gst_element_link_many (audioqueue, audiodec, audioconv, audiosink, NULL);
   1.320 -    
   1.321 -    g_signal_connect (parser, "pad-added", G_CALLBACK (new_pad_cb), tvplayer);
   1.322 -    
   1.323 -    return TRUE;
   1.324 -}
   1.325 -
   1.326 -/** Configures the backend and the tv player 
   1.327 - * for playing the recorded content A/V.
   1.328 - *
   1.329 - * FIXME: Change filename to program info or other structure about the recorded
   1.330 - *
   1.331 - * @param tvplayer the object instance.
   1.332 - * @param filename the file uri of the recorded content to be played.
   1.333 - * @return TRUE if successfull, FALSE if any error happens.
   1.334 - */
   1.335 -gboolean
   1.336 -gmyth_tvplayer_record_setup (GMythTVPlayer *tvplayer, gchar *filename)
   1.337 -{
   1.338 -	GMythSettings *msettings = gmyth_context_get_settings();
   1.339 -	
   1.340 -	// FIXME: we should receive the uri instead of filename
   1.341 -	GString *hostname = gmyth_settings_get_backend_hostname (msettings);
   1.342 -	int port = gmyth_settings_get_backend_port(msettings);
   1.343 -	
   1.344 -	GString *fullpath = g_string_new ("myth://");
   1.345 -	g_string_append_printf (fullpath, "%s:%d/%s", hostname->str, port, filename);
   1.346 -	
   1.347 -	tvplayer->is_livetv = FALSE;
   1.348 -
   1.349 -	g_debug ("[%s] Setting record uri to gstreamer pipeline to %s", __FUNCTION__, fullpath->str);
   1.350 -		
   1.351 -    g_object_set (G_OBJECT (tvplayer->gst_source), "location",
   1.352 -          fullpath->str, NULL);
   1.353 -          
   1.354 -    return TRUE;
   1.355 -}
   1.356 -
   1.357 -/** Configures the backend and the tv player 
   1.358 - * for playing the live tv.
   1.359 - *
   1.360 - * @param tvplayer the object instance.
   1.361 - * @return TRUE if successfull, FALSE if any error happens.
   1.362 - */
   1.363 -gboolean
   1.364 -gmyth_tvplayer_livetv_setup (GMythTVPlayer *tvplayer)
   1.365 -{
   1.366 -	GMythSettings *msettings = gmyth_context_get_settings ();
   1.367 -	gboolean res = TRUE;
   1.368 -
   1.369 -	res = gmyth_context_check_connection();
   1.370 -	if (!res) {
   1.371 -		g_warning ("[%s] LiveTV can not connect to backend", __FUNCTION__);	
   1.372 -		res = FALSE;
   1.373 -		goto error;
   1.374 -	}
   1.375 -
   1.376 -	tvplayer->backend_hostname = gmyth_settings_get_backend_hostname(msettings);
   1.377 -	tvplayer->backend_port = gmyth_settings_get_backend_port (msettings);
   1.378 -
   1.379 -	tvplayer->local_hostname  = g_string_new("");    
   1.380 -	gmyth_context_get_local_hostname (tvplayer->local_hostname);
   1.381 -
   1.382 -	if ( tvplayer->local_hostname == NULL ) {
   1.383 -		res = FALSE;
   1.384 -		goto error;
   1.385 -	}
   1.386 -
   1.387 -	// Gets the remote encoder num
   1.388 -	tvplayer->remote_encoder = remote_request_next_free_recorder (-1);
   1.389 -
   1.390 -	if ( tvplayer->remote_encoder == NULL ) {
   1.391 -		g_warning ("[%s] None remote encoder available", __FUNCTION__);
   1.392 -		res = FALSE;
   1.393 -		goto error;
   1.394 -	}
   1.395 -
   1.396 -	// Creates livetv chain handler
   1.397 -	tvplayer->tvchain = GMYTH_TVCHAIN ( g_object_new(GMYTH_TVCHAIN_TYPE, NULL) );
   1.398 -	gmyth_tvchain_initialize ( tvplayer->tvchain, tvplayer->local_hostname );
   1.399 -
   1.400 -	if ( tvplayer->tvchain == NULL || tvplayer->tvchain->tvchain_id == NULL ) {
   1.401 -		res = FALSE;
   1.402 -		goto error;
   1.403 -	}
   1.404 -
   1.405 -	// Init remote encoder. Opens its control socket.
   1.406 -	res = gmyth_remote_encoder_setup(tvplayer->remote_encoder);
   1.407 -	if ( !res ) {
   1.408 -		g_warning ("[%s] Fail while setting remote encoder\n", __FUNCTION__);
   1.409 -		res = FALSE;
   1.410 -		goto error;
   1.411 -	}
   1.412 -	// Spawn live tv. Uses the socket to send mythprotocol data to start livetv in the backend (remotelly)
   1.413 -	res = gmyth_remote_encoder_spawntv ( tvplayer->remote_encoder,
   1.414 -			gmyth_tvchain_get_id(tvplayer->tvchain) );
   1.415 -	if (!res) {
   1.416 -		g_warning ("[%s] Fail while spawn tv\n", __FUNCTION__);
   1.417 -		res = FALSE;
   1.418 -		goto error;
   1.419 -	}
   1.420 -
   1.421 -	// Reload all TV chain from Mysql database.
   1.422 -	gmyth_tvchain_reload_all (tvplayer->tvchain);
   1.423 -
   1.424 -	if ( tvplayer->tvchain == NULL ) {
   1.425 -		res = FALSE;
   1.426 -		goto error;
   1.427 -	}
   1.428 -
   1.429 -	// Get program info from database using chanid and starttime
   1.430 -	tvplayer->proginfo = gmyth_tvchain_get_program_at (tvplayer->tvchain, -1);
   1.431 -	if ( tvplayer->proginfo == NULL ) {
   1.432 -		g_warning ("[%s] LiveTV not successfully started.\n", __FUNCTION__ );
   1.433 -		res = FALSE;
   1.434 -		goto error;
   1.435 -	} else {
   1.436 -		g_debug ("[%s] MythLiveTV: All requests to backend to start TV were OK.\n", __FUNCTION__ );
   1.437 -	}
   1.438 -
   1.439 -	return res;
   1.440 -
   1.441 -error:
   1.442 -	if ( tvplayer->backend_hostname != NULL ) {
   1.443 -		g_string_free( tvplayer->backend_hostname, TRUE );
   1.444 -		res = FALSE;
   1.445 -	}
   1.446 -
   1.447 -	if ( tvplayer->local_hostname != NULL ) {
   1.448 -		g_string_free( tvplayer->local_hostname, TRUE );
   1.449 -		res = FALSE;
   1.450 -	}
   1.451 -
   1.452 -	if ( tvplayer->remote_encoder != NULL ) {
   1.453 -		g_object_unref (tvplayer->remote_encoder);
   1.454 -		tvplayer->remote_encoder = NULL;
   1.455 -	}
   1.456 -
   1.457 -	if ( tvplayer->tvchain != NULL ) {
   1.458 -		g_object_unref (tvplayer->tvchain);
   1.459 -		tvplayer->tvchain = NULL;
   1.460 -	}
   1.461 -
   1.462 -	if ( tvplayer->proginfo != NULL ) {
   1.463 -		g_object_unref (tvplayer->proginfo);
   1.464 -		tvplayer->proginfo = NULL;
   1.465 -	}
   1.466 -
   1.467 -	return res;
   1.468 -
   1.469 -}
   1.470 -
   1.471 -/** Sets the GTK video widget for the tv player. 
   1.472 - *
   1.473 - * @param tvplayer the object instance.
   1.474 - * @param videow the GTK video window.
   1.475 - * @return TRUE if successfull, FALSE if any error happens.
   1.476 - */
   1.477 -gboolean
   1.478 -gmyth_tvplayer_set_widget (GMythTVPlayer *tvplayer, GtkWidget *videow)
   1.479 -{
   1.480 -	tvplayer->videow = videow;
   1.481 -	g_object_ref (videow);
   1.482 -	
   1.483 -	g_debug ("[%s] Setting widget for tv player render", __FUNCTION__);
   1.484 -	
   1.485 -    tvplayer->expose_handler = g_signal_connect (tvplayer->videow, "expose-event", 
   1.486 -                                                 G_CALLBACK (expose_cb), tvplayer);
   1.487 -
   1.488 -    //g_signal_connect(miptv_ui->videow, "size_request", G_CALLBACK(cb_preferred_video_size), miptv_ui);
   1.489 -
   1.490 -    return TRUE;
   1.491 -}
   1.492 -
   1.493 -static gboolean
   1.494 -bus_call (GstBus * bus, GstMessage * msg, gpointer data)
   1.495 -{
   1.496 -    //GMythTVPlayer *tvplayer = GMYTH_TVPLAYER ( data );
   1.497 -    //GMainLoop *loop = tvplayer->loop;
   1.498 -
   1.499 -    switch (GST_MESSAGE_TYPE (msg)) {
   1.500 -        case GST_MESSAGE_EOS:
   1.501 -			printf ("End of stream\n");
   1.502 -            //g_idle_add ((GSourceFunc) idle_eos, data);
   1.503 -            gst_element_set_state ( GST_ELEMENT (GST_MESSAGE_SRC (msg)), GST_STATE_NULL );
   1.504 -	    gst_element_set_locked_state ( GST_ELEMENT (GST_MESSAGE_SRC (msg)), FALSE );
   1.505 -            break;
   1.506 -        case GST_MESSAGE_ERROR:
   1.507 -        {
   1.508 -                gchar *debug;
   1.509 -                GError *err;
   1.510 -
   1.511 -                gst_message_parse_error (msg, &err, &debug);
   1.512 -                g_free (debug);
   1.513 -
   1.514 -                printf ("Error: %s\n", err->message);
   1.515 -                g_error_free (err);
   1.516 -
   1.517 -                //g_main_loop_quit (loop);
   1.518 -        }
   1.519 -            break;
   1.520 -        default:
   1.521 -            printf (gst_message_type_get_name (GST_MESSAGE_TYPE (msg)));
   1.522 -            printf ("\n");
   1.523 -            break;
   1.524 -    }
   1.525 -
   1.526 -    return TRUE;
   1.527 -}
   1.528 -
   1.529 -
   1.530 -#if 0
   1.531 -static gboolean
   1.532 -idle_state (gpointer data)
   1.533 -{
   1.534 -    GstPlayerWindowStateChange *st = data;
   1.535 -
   1.536 -    if (st->old_state == GST_STATE_PLAYING) {
   1.537 -        if (st->miptv_ui->idle_id != 0) {
   1.538 -            g_source_remove (st->miptv_ui->idle_id);
   1.539 -            st->miptv_ui->idle_id = 0;
   1.540 -        }
   1.541 -    }
   1.542 -    else if (st->new_state == GST_STATE_PLAYING) {
   1.543 -        if (st->miptv_ui->idle_id != 0)
   1.544 -            g_source_remove (st->miptv_ui->idle_id);
   1.545 -
   1.546 -        st->miptv_ui->idle_id = g_idle_add (cb_iterate, st->miptv_ui);
   1.547 -    }
   1.548 -
   1.549 -    /* new movie loaded? */
   1.550 -    if (st->old_state == GST_STATE_READY && st->new_state > GST_STATE_READY) {
   1.551 -
   1.552 -        /* gboolean have_video = FALSE; */
   1.553 -
   1.554 -        gtk_widget_show (st->miptv_ui->videow);
   1.555 -
   1.556 -        gtk_window_resize (GTK_WINDOW (st->miptv_ui->main_window), 1, 1);
   1.557 -
   1.558 -    }
   1.559 -
   1.560 -    /* discarded movie? */
   1.561 -    if (st->old_state > GST_STATE_READY && st->new_state == GST_STATE_READY) {
   1.562 -
   1.563 -        if (st->miptv_ui->tagcache) {
   1.564 -            gst_tag_list_free (st->miptv_ui->tagcache);
   1.565 -            st->miptv_ui->tagcache = NULL;
   1.566 -        }
   1.567 -    }
   1.568 -
   1.569 -    gst_object_unref (GST_OBJECT (st->play));
   1.570 -    //g_object_unref (G_OBJECT (st->win));
   1.571 -    g_free (st);
   1.572 -
   1.573 -    /* once */
   1.574 -    return FALSE;
   1.575 -}
   1.576 -
   1.577 -#endif
   1.578 -
   1.579 -/** Stops playing the current A/V.
   1.580 - *
   1.581 - * FIXME: How to proceed differently between livetv 
   1.582 - * and recorded content?
   1.583 - *
   1.584 - * @param tvplayer the object instance.
   1.585 - * @return void 
   1.586 - */
   1.587 -void
   1.588 -gmyth_tvplayer_stop_playing (GMythTVPlayer *tvplayer) 
   1.589 -{
   1.590 -    g_debug ("[%s] Setting gstreamer pipeline state to NULL", __FUNCTION__);
   1.591 -
   1.592 -    gst_element_set_state (tvplayer->gst_pipeline, GST_STATE_NULL);
   1.593 -    
   1.594 -    if (tvplayer->is_livetv) {
   1.595 -	    if (!gmyth_remote_encoder_stop_livetv (tvplayer->remote_encoder)) {
   1.596 -	    	g_warning ("[%s] Error while stoping remote encoder", __FUNCTION__);	
   1.597 -	    }
   1.598 -    }
   1.599 -}
   1.600 -
   1.601 -/** Queries if the tvplayer is active playing A/V content.
   1.602 - *
   1.603 - * @param tvplayer the object instance.
   1.604 - * @return TRUE if the tvplayer is active, FALSE otherwise.
   1.605 - */
   1.606 -gboolean
   1.607 -gmyth_tvplayer_is_playing (GMythTVPlayer *tvplayer)
   1.608 -{
   1.609 -	return (GST_STATE (tvplayer->gst_pipeline) == GST_STATE_PLAYING);
   1.610 -}
   1.611 -
   1.612 -/** Static function that sets the tvplayer state to PLAYING.
   1.613 - *
   1.614 - * @param tvplayer the object instance.
   1.615 - * @return TRUE if the tvplayer is active, FALSE otherwise.
   1.616 - */
   1.617 -static gboolean
   1.618 -idle_play (gpointer data)
   1.619 -{
   1.620 -    GMythTVPlayer *tvplayer = GMYTH_TVPLAYER (data);
   1.621 -
   1.622 -	g_debug ("GMythTVPlayer: Setting pipeline state to PLAYING\n");
   1.623 -
   1.624 -    gst_element_set_state (tvplayer->gst_pipeline, GST_STATE_PLAYING);
   1.625 -
   1.626 -    return FALSE;
   1.627 -}
   1.628 -
   1.629 -/** Start playing A/V with the tvplayer attributes.
   1.630 - *
   1.631 - * @param tvplayer the object instance.
   1.632 - */
   1.633 -void
   1.634 -gmyth_tvplayer_start_playing (GMythTVPlayer *tvplayer)
   1.635 -{
   1.636 -
   1.637 -	// FIXME: Move this to livetv_setup??
   1.638 -	if (tvplayer->is_livetv) {
   1.639 -
   1.640 -	#if 0
   1.641 -		if (!tvplayer || !(tvplayer->proginfo) || !(tvplayer->local_hostname)
   1.642 -				|| !(tvplayer->gst_source)) {
   1.643 -			g_warning ("GMythtvPlayer not ready to start playing\n");		
   1.644 -		}
   1.645 -
   1.646 -		if (!(tvplayer->proginfo->pathname)) {
   1.647 -			g_warning ("[%s] Playback url is null, could not play the myth content", __FUNCTION__);
   1.648 -			return;
   1.649 -		}
   1.650 -
   1.651 -		g_debug ("GMythTVPlayer: Start playing %s", tvplayer->proginfo->pathname->str);
   1.652 -#endif
   1.653 -		g_object_set (G_OBJECT (tvplayer->gst_source), "mythtv-live",
   1.654 -				TRUE, NULL);
   1.655 -#if 0
   1.656 -		if ( tvplayer->tvchain != NULL ) {
   1.657 -			GString *str_chainid = gmyth_tvchain_get_id(tvplayer->tvchain);
   1.658 -			g_print( "[%s]\tCHAIN ID: %s\n", __FUNCTION__, str_chainid->str );
   1.659 -
   1.660 -			g_object_set (G_OBJECT (tvplayer->gst_source), "mythtv-live-chainid", 
   1.661 -					g_strdup( str_chainid->str ), NULL);      
   1.662 -			if ( str_chainid!=NULL)
   1.663 -				g_string_free( str_chainid, FALSE );
   1.664 -		}
   1.665 -
   1.666 -		if ( tvplayer->remote_encoder != NULL )	
   1.667 -			g_object_set (G_OBJECT (tvplayer->gst_source), "mythtv-live-id",
   1.668 -					tvplayer->remote_encoder->recorder_num, NULL );
   1.669 -		g_debug ("[%s] Setting location to %s", __FUNCTION__, 
   1.670 -				tvplayer->proginfo->pathname->str);
   1.671 -
   1.672 -		/* Sets the gstreamer properties acording to the service access address */
   1.673 -		g_object_set (G_OBJECT (tvplayer->gst_source), "location",
   1.674 -				tvplayer->proginfo->pathname->str, NULL);              
   1.675 -#endif
   1.676 -	}
   1.677 -
   1.678 -	g_object_set (G_OBJECT (tvplayer->gst_source), "mythtv-version",
   1.679 -              MYTHTV_VERSION_DEFAULT, NULL);
   1.680 -
   1.681 -    g_object_set (G_OBJECT (tvplayer->gst_source), "mythtv-debug",
   1.682 -              TRUE, NULL);
   1.683 -
   1.684 -    g_idle_add (idle_play, tvplayer);
   1.685 -
   1.686 -}
   1.687 -
     2.1 --- a/gmyth/src/gmyth_tvplayer.h	Thu Sep 28 15:57:27 2006 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,112 +0,0 @@
     2.4 -/**
     2.5 - * GMyth Library
     2.6 - *
     2.7 - * @file gmyth/gmyth_tvplayer.h
     2.8 - * 
     2.9 - * @brief <p> This component provides playback of the remote A/V using
    2.10 - * GStreamer.
    2.11 - * 
    2.12 - * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    2.13 - * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
    2.14 - *
    2.15 - *//*
    2.16 - * 
    2.17 - * This program is free software; you can redistribute it and/or modify
    2.18 - * it under the terms of the GNU Lesser General Public License as published by
    2.19 - * the Free Software Foundation; either version 2 of the License, or
    2.20 - * (at your option) any later version.
    2.21 - *
    2.22 - * This program is distributed in the hope that it will be useful,
    2.23 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.24 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2.25 - * GNU General Public License for more details.
    2.26 - *
    2.27 - * You should have received a copy of the GNU Lesser General Public License
    2.28 - * along with this program; if not, write to the Free Software
    2.29 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    2.30 - */
    2.31 -
    2.32 -#ifndef GMYTH_TVPLAYER_H_
    2.33 -#define GMYTH_TVPLAYER_H_
    2.34 -
    2.35 -#include <glib-object.h>
    2.36 -#include <gtk/gtk.h>
    2.37 -
    2.38 -/* GStreamer includes */
    2.39 -#include <gst/gst.h>
    2.40 -#include <gst/interfaces/xoverlay.h>
    2.41 -
    2.42 -#include "gmyth_remote_encoder.h"
    2.43 -#include "gmyth_tvchain.h"
    2.44 -#include "gmyth_common.h"
    2.45 -
    2.46 -G_BEGIN_DECLS
    2.47 -
    2.48 -#define GMYTH_TVPLAYER_TYPE               (gmyth_tvplayer_get_type ())
    2.49 -#define GMYTH_TVPLAYER(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_TVPLAYER_TYPE, GMythTVPlayer))
    2.50 -#define GMYTH_TVPLAYER_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_TVPLAYER_TYPE, GMythTVPlayerClass))
    2.51 -#define IS_GMYTH_TVPLAYER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_TVPLAYER_TYPE))
    2.52 -#define IS_GMYTH_TVPLAYER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_TVPLAYER_TYPE))
    2.53 -#define GMYTH_TVPLAYER_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_TVPLAYER_TYPE, GMythTVPlayerClass))
    2.54 -
    2.55 -
    2.56 -typedef struct _GMythTVPlayer         GMythTVPlayer;
    2.57 -typedef struct _GMythTVPlayerClass    GMythTVPlayerClass;
    2.58 -
    2.59 -struct _GMythTVPlayerClass
    2.60 -{
    2.61 -    GObjectClass parent_class;
    2.62 -
    2.63 -      /* callbacks */
    2.64 -      /*  no one for now */
    2.65 -};
    2.66 -
    2.67 -struct _GMythTVPlayer
    2.68 -{
    2.69 -    GObject parent;
    2.70 -    
    2.71 -    GstElement *gst_pipeline;
    2.72 -    GstElement *gst_source;
    2.73 -    GstElement *gst_videodec;
    2.74 -    GstElement *gst_videosink;
    2.75 -    GstElement *videoqueue;
    2.76 -    GstElement *audioqueue;
    2.77 -    
    2.78 -    gulong expose_handler;
    2.79 -//    GMainLoop *loop;
    2.80 -    
    2.81 -    GtkWidget *videow;
    2.82 -
    2.83 -	/* Backend connection related variables */
    2.84 -	GString *backend_hostname;
    2.85 -	gint backend_port;
    2.86 -	GString *local_hostname;
    2.87 -
    2.88 -	GMythRemoteEncoder *remote_encoder;
    2.89 -	GMythTVChain *tvchain;
    2.90 -	GMythProgramInfo *proginfo;
    2.91 -	
    2.92 -	gboolean is_livetv;
    2.93 -};
    2.94 -
    2.95 -
    2.96 -GType          gmyth_tvplayer_get_type (void);
    2.97 -
    2.98 -GMythTVPlayer* gmyth_tvplayer_new ();
    2.99 -gboolean       gmyth_tvplayer_initialize (GMythTVPlayer *tvplayer);
   2.100 -
   2.101 -void           gmyth_tvplayer_start_playing   (GMythTVPlayer *tvplayer);
   2.102 -void           gmyth_tvplayer_stop_playing    (GMythTVPlayer *tvplayer);
   2.103 -
   2.104 -gboolean       gmyth_tvplayer_set_widget   (GMythTVPlayer *tvplayer, 
   2.105 -                                            GtkWidget *videow);
   2.106 -
   2.107 -gboolean       gmyth_tvplayer_is_playing   (GMythTVPlayer *tvplayer);
   2.108 -
   2.109 -gboolean       gmyth_tvplayer_record_setup (GMythTVPlayer *tvplayer, 
   2.110 -                                            gchar *filename);
   2.111 -gboolean       gmyth_tvplayer_livetv_setup (GMythTVPlayer *tvplayer);
   2.112 -
   2.113 -G_END_DECLS
   2.114 -
   2.115 -#endif /*GMYTH_TVPLAYER_H_*/
     3.1 --- a/gmyth/src/mmyth_main.c	Thu Sep 28 15:57:27 2006 +0100
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,103 +0,0 @@
     3.4 -
     3.5 -#include <gtk/gtk.h>
     3.6 -
     3.7 -#include "config.h"
     3.8 -
     3.9 -#ifdef MAEMO_PLATFORM
    3.10 -#include "hildon-widgets/hildon-program.h"
    3.11 -#include "hildon-widgets/hildon-window.h"
    3.12 -#endif
    3.13 -
    3.14 -#include "gmyth_remote_encoder.h"
    3.15 -#include "gmyth_settings.h"
    3.16 -#include "gmyth_context.h"
    3.17 -#include "gmyth_tvchain.h"
    3.18 -#include "gmyth_tvplayer.h"
    3.19 -#include "gmyth_remote_util.h"
    3.20 -
    3.21 -#include "mmyth_ui.h"
    3.22 -
    3.23 -static void
    3.24 -cb_destroy (GtkWidget * widget, gpointer data)
    3.25 -{
    3.26 -    MMythUi *mmyth_ui = (MMythUi *) data;
    3.27 -
    3.28 -    if (mmyth_ui->tvplayer != NULL) {
    3.29 -    	if (gmyth_tvplayer_is_playing (mmyth_ui->tvplayer) )
    3.30 -    		gmyth_tvplayer_stop_playing (mmyth_ui->tvplayer);
    3.31 -    }
    3.32 -
    3.33 -	mmyth_ui_finalize (mmyth_ui);
    3.34 -	
    3.35 -    gtk_main_quit ();
    3.36 -}
    3.37 -
    3.38 -#ifdef NDEBUG
    3.39 -static void
    3.40 -debug_error_func( const gchar*log_domain, GLogLevelFlags log_level, const gchar *message,
    3.41 -	gpointer user_data )
    3.42 -
    3.43 -{
    3.44 -	/* leave this with NO print out messages, once you need to disable debug messages! */
    3.45 -	//g_print ( "[%s] DEBUG messages disabled!\n", __FUNCTION__ );
    3.46 -}
    3.47 -#endif
    3.48 -
    3.49 -gint
    3.50 -main (gint argc, gchar * argv[])
    3.51 -{
    3.52 -    GtkWidget *window;
    3.53 -    MMythUi *mmyth_ui;
    3.54 -#ifdef MAEMO_PLATFORM
    3.55 -    HildonProgram *program = NULL;
    3.56 -#endif
    3.57 -
    3.58 -    /* init threads */
    3.59 -    g_thread_init (NULL);
    3.60 -
    3.61 -    /* Initializes GTK */
    3.62 -    gtk_init (&argc, &argv);
    3.63 -    gst_init (&argc, &argv);
    3.64 -#ifdef NDEBUG
    3.65 - g_log_set_default_handler( debug_error_func, NULL );
    3.66 -#endif
    3.67 -
    3.68 -    /* Init libmmyth context */
    3.69 -    gmyth_context_initialize ();
    3.70 -	
    3.71 -#ifndef MAEMO_PLATFORM
    3.72 -    /* create the main window */
    3.73 -    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    3.74 -    gtk_widget_set_size_request (window, MAIN_WINDOW_WIDTH, MAIN_WINDOW_HEIGHT);
    3.75 -    gtk_window_set_title (GTK_WINDOW (window), "Mythtv Frontend");
    3.76 -#else
    3.77 -    /* Creating Hildonized main view */
    3.78 -    program = HILDON_PROGRAM(hildon_program_get_instance());
    3.79 -    window = hildon_window_new();
    3.80 -
    3.81 -    //g_signal_connect(G_OBJECT(window), "delete_event", gtk_main_quit, NULL);
    3.82 -
    3.83 -    hildon_program_add_window(program, HILDON_WINDOW (window));
    3.84 -    g_set_application_name("Maemo Mythtv"); 
    3.85 -#endif
    3.86 -   
    3.87 -    /* Initializes MMyth Widgets */
    3.88 -#ifdef MAEMO_PLATFORM
    3.89 -    mmyth_ui = mmyth_ui_initialize (program, window);
    3.90 -#else    
    3.91 -    mmyth_ui = mmyth_ui_initialize (window);
    3.92 -#endif
    3.93 -    
    3.94 -    //mmyth_ui->loop = g_main_loop_new (NULL, FALSE);
    3.95 -
    3.96 -    /* Connect destroy signal handling */
    3.97 -    g_signal_connect (window, "destroy", G_CALLBACK (cb_destroy), mmyth_ui);
    3.98 -
    3.99 -    /* Shows main window and start gtk loop */
   3.100 -    gtk_widget_show (window);
   3.101 -
   3.102 -    gtk_main ();
   3.103 -
   3.104 -    return 0;
   3.105 -}
   3.106 -
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/maemo-ui/pixmaps/Makefile.am	Thu Sep 28 16:02:14 2006 +0100
     4.3 @@ -0,0 +1,11 @@
     4.4 +# Adding the application icon
     4.5 +#icondir = $(datadir)/mmyth/pixmaps
     4.6 +#icon_DATA = \
     4.7 +#	mmyth.png
     4.8 +
     4.9 +
    4.10 +# Adding the application resources
    4.11 +pixmapdir = $(pkgdatadir)/pixmaps
    4.12 +pixmap_DATA = mmyth_logo.png
    4.13 +
    4.14 +EXTRA_DIST = $(pixmap_DATA)
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/maemo-ui/pixmaps/Makefile.in	Thu Sep 28 16:02:14 2006 +0100
     5.3 @@ -0,0 +1,438 @@
     5.4 +# Makefile.in generated by automake 1.9.6 from Makefile.am.
     5.5 +# @configure_input@
     5.6 +
     5.7 +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
     5.8 +# 2003, 2004, 2005  Free Software Foundation, Inc.
     5.9 +# This Makefile.in is free software; the Free Software Foundation
    5.10 +# gives unlimited permission to copy and/or distribute it,
    5.11 +# with or without modifications, as long as this notice is preserved.
    5.12 +
    5.13 +# This program is distributed in the hope that it will be useful,
    5.14 +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    5.15 +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    5.16 +# PARTICULAR PURPOSE.
    5.17 +
    5.18 +@SET_MAKE@
    5.19 +
    5.20 +# Adding the application icon
    5.21 +#icondir = $(datadir)/mmyth/pixmaps
    5.22 +#icon_DATA = \
    5.23 +#	mmyth.png
    5.24 +
    5.25 +srcdir = @srcdir@
    5.26 +top_srcdir = @top_srcdir@
    5.27 +VPATH = @srcdir@
    5.28 +pkgdatadir = $(datadir)/@PACKAGE@
    5.29 +pkglibdir = $(libdir)/@PACKAGE@
    5.30 +pkgincludedir = $(includedir)/@PACKAGE@
    5.31 +top_builddir = ..
    5.32 +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
    5.33 +INSTALL = @INSTALL@
    5.34 +install_sh_DATA = $(install_sh) -c -m 644
    5.35 +install_sh_PROGRAM = $(install_sh) -c
    5.36 +install_sh_SCRIPT = $(install_sh) -c
    5.37 +INSTALL_HEADER = $(INSTALL_DATA)
    5.38 +transform = $(program_transform_name)
    5.39 +NORMAL_INSTALL = :
    5.40 +PRE_INSTALL = :
    5.41 +POST_INSTALL = :
    5.42 +NORMAL_UNINSTALL = :
    5.43 +PRE_UNINSTALL = :
    5.44 +POST_UNINSTALL = :
    5.45 +build_triplet = @build@
    5.46 +host_triplet = @host@
    5.47 +subdir = pixmaps
    5.48 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
    5.49 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    5.50 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_doxygen.m4 \
    5.51 +	$(top_srcdir)/m4/as-version.m4 $(top_srcdir)/configure.ac
    5.52 +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    5.53 +	$(ACLOCAL_M4)
    5.54 +mkinstalldirs = $(install_sh) -d
    5.55 +CONFIG_HEADER = $(top_builddir)/config.h
    5.56 +CONFIG_CLEAN_FILES =
    5.57 +SOURCES =
    5.58 +DIST_SOURCES =
    5.59 +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
    5.60 +am__vpath_adj = case $$p in \
    5.61 +    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
    5.62 +    *) f=$$p;; \
    5.63 +  esac;
    5.64 +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
    5.65 +am__installdirs = "$(DESTDIR)$(pixmapdir)"
    5.66 +pixmapDATA_INSTALL = $(INSTALL_DATA)
    5.67 +DATA = $(pixmap_DATA)
    5.68 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    5.69 +ACLOCAL = @ACLOCAL@
    5.70 +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
    5.71 +AMDEP_FALSE = @AMDEP_FALSE@
    5.72 +AMDEP_TRUE = @AMDEP_TRUE@
    5.73 +AMTAR = @AMTAR@
    5.74 +AR = @AR@
    5.75 +AUTOCONF = @AUTOCONF@
    5.76 +AUTOHEADER = @AUTOHEADER@
    5.77 +AUTOMAKE = @AUTOMAKE@
    5.78 +AWK = @AWK@
    5.79 +CC = @CC@
    5.80 +CCDEPMODE = @CCDEPMODE@
    5.81 +CFLAGS = @CFLAGS@
    5.82 +CPP = @CPP@
    5.83 +CPPFLAGS = @CPPFLAGS@
    5.84 +CXX = @CXX@
    5.85 +CXXCPP = @CXXCPP@
    5.86 +CXXDEPMODE = @CXXDEPMODE@
    5.87 +CXXFLAGS = @CXXFLAGS@
    5.88 +CYGPATH_W = @CYGPATH_W@
    5.89 +DEFS = @DEFS@
    5.90 +DEPDIR = @DEPDIR@
    5.91 +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@
    5.92 +DX_COND_chi_FALSE = @DX_COND_chi_FALSE@
    5.93 +DX_COND_chi_TRUE = @DX_COND_chi_TRUE@
    5.94 +DX_COND_chm_FALSE = @DX_COND_chm_FALSE@
    5.95 +DX_COND_chm_TRUE = @DX_COND_chm_TRUE@
    5.96 +DX_COND_doc_FALSE = @DX_COND_doc_FALSE@
    5.97 +DX_COND_doc_TRUE = @DX_COND_doc_TRUE@
    5.98 +DX_COND_dot_FALSE = @DX_COND_dot_FALSE@
    5.99 +DX_COND_dot_TRUE = @DX_COND_dot_TRUE@
   5.100 +DX_COND_html_FALSE = @DX_COND_html_FALSE@
   5.101 +DX_COND_html_TRUE = @DX_COND_html_TRUE@
   5.102 +DX_COND_latex_FALSE = @DX_COND_latex_FALSE@
   5.103 +DX_COND_latex_TRUE = @DX_COND_latex_TRUE@
   5.104 +DX_COND_man_FALSE = @DX_COND_man_FALSE@
   5.105 +DX_COND_man_TRUE = @DX_COND_man_TRUE@
   5.106 +DX_COND_pdf_FALSE = @DX_COND_pdf_FALSE@
   5.107 +DX_COND_pdf_TRUE = @DX_COND_pdf_TRUE@
   5.108 +DX_COND_ps_FALSE = @DX_COND_ps_FALSE@
   5.109 +DX_COND_ps_TRUE = @DX_COND_ps_TRUE@
   5.110 +DX_COND_rtf_FALSE = @DX_COND_rtf_FALSE@
   5.111 +DX_COND_rtf_TRUE = @DX_COND_rtf_TRUE@
   5.112 +DX_COND_xml_FALSE = @DX_COND_xml_FALSE@
   5.113 +DX_COND_xml_TRUE = @DX_COND_xml_TRUE@
   5.114 +DX_CONFIG = @DX_CONFIG@
   5.115 +DX_DOCDIR = @DX_DOCDIR@
   5.116 +DX_DOT = @DX_DOT@
   5.117 +DX_DOXYGEN = @DX_DOXYGEN@
   5.118 +DX_DVIPS = @DX_DVIPS@
   5.119 +DX_EGREP = @DX_EGREP@
   5.120 +DX_ENV = @DX_ENV@
   5.121 +DX_FLAG_chi = @DX_FLAG_chi@
   5.122 +DX_FLAG_chm = @DX_FLAG_chm@
   5.123 +DX_FLAG_doc = @DX_FLAG_doc@
   5.124 +DX_FLAG_dot = @DX_FLAG_dot@
   5.125 +DX_FLAG_html = @DX_FLAG_html@
   5.126 +DX_FLAG_man = @DX_FLAG_man@
   5.127 +DX_FLAG_pdf = @DX_FLAG_pdf@
   5.128 +DX_FLAG_ps = @DX_FLAG_ps@
   5.129 +DX_FLAG_rtf = @DX_FLAG_rtf@
   5.130 +DX_FLAG_xml = @DX_FLAG_xml@
   5.131 +DX_HHC = @DX_HHC@
   5.132 +DX_LATEX = @DX_LATEX@
   5.133 +DX_MAKEINDEX = @DX_MAKEINDEX@
   5.134 +DX_PDFLATEX = @DX_PDFLATEX@
   5.135 +DX_PERL = @DX_PERL@
   5.136 +DX_PROJECT = @DX_PROJECT@
   5.137 +ECHO = @ECHO@
   5.138 +ECHO_C = @ECHO_C@
   5.139 +ECHO_N = @ECHO_N@
   5.140 +ECHO_T = @ECHO_T@
   5.141 +EGREP = @EGREP@
   5.142 +EXEEXT = @EXEEXT@
   5.143 +F77 = @F77@
   5.144 +FFLAGS = @FFLAGS@
   5.145 +GLIB_CFLAGS = @GLIB_CFLAGS@
   5.146 +GLIB_LIBS = @GLIB_LIBS@
   5.147 +GMYTH_MAJORMINOR = @GMYTH_MAJORMINOR@
   5.148 +GMYTH_MAJOR_VERSION = @GMYTH_MAJOR_VERSION@
   5.149 +GMYTH_MICRO_VERSION = @GMYTH_MICRO_VERSION@
   5.150 +GMYTH_MINOR_VERSION = @GMYTH_MINOR_VERSION@
   5.151 +GMYTH_NANO_VERSION = @GMYTH_NANO_VERSION@
   5.152 +GMYTH_RELEASE = @GMYTH_RELEASE@
   5.153 +GMYTH_VERSION = @GMYTH_VERSION@
   5.154 +GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
   5.155 +GOBJECT_LIBS = @GOBJECT_LIBS@
   5.156 +GREP = @GREP@
   5.157 +GSTBASE_CFLAGS = @GSTBASE_CFLAGS@
   5.158 +GSTBASE_LIBS = @GSTBASE_LIBS@
   5.159 +GST_CFLAGS = @GST_CFLAGS@
   5.160 +GST_LIBS = @GST_LIBS@
   5.161 +GST_MAJORMINOR = @GST_MAJORMINOR@
   5.162 +GTK_CFLAGS = @GTK_CFLAGS@
   5.163 +GTK_LIBS = @GTK_LIBS@
   5.164 +HAVE_PKGCONFIG = @HAVE_PKGCONFIG@
   5.165 +HILDON_CFLAGS = @HILDON_CFLAGS@
   5.166 +HILDON_LIBS = @HILDON_LIBS@
   5.167 +INSTALL_DATA = @INSTALL_DATA@
   5.168 +INSTALL_PROGRAM = @INSTALL_PROGRAM@
   5.169 +INSTALL_SCRIPT = @INSTALL_SCRIPT@
   5.170 +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   5.171 +LDFLAGS = @LDFLAGS@
   5.172 +LIBGMYTH_CFLAGS = @LIBGMYTH_CFLAGS@
   5.173 +LIBGMYTH_LIBS = @LIBGMYTH_LIBS@
   5.174 +LIBOBJS = @LIBOBJS@
   5.175 +LIBS = @LIBS@
   5.176 +LIBTOOL = @LIBTOOL@
   5.177 +LIBXML_CFLAGS = @LIBXML_CFLAGS@
   5.178 +LIBXML_LIBS = @LIBXML_LIBS@
   5.179 +LN_S = @LN_S@
   5.180 +LTLIBOBJS = @LTLIBOBJS@
   5.181 +MAEMO_PLATFORM_FALSE = @MAEMO_PLATFORM_FALSE@
   5.182 +MAEMO_PLATFORM_TRUE = @MAEMO_PLATFORM_TRUE@
   5.183 +MAINT = @MAINT@
   5.184 +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
   5.185 +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
   5.186 +MAKEINFO = @MAKEINFO@
   5.187 +MYSQL_CFLAGS = @MYSQL_CFLAGS@
   5.188 +MYSQL_LIBS = @MYSQL_LIBS@
   5.189 +NDEBUG_FALSE = @NDEBUG_FALSE@
   5.190 +NDEBUG_TRUE = @NDEBUG_TRUE@
   5.191 +OBJEXT = @OBJEXT@
   5.192 +PACKAGE = @PACKAGE@
   5.193 +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   5.194 +PACKAGE_NAME = @PACKAGE_NAME@
   5.195 +PACKAGE_STRING = @PACKAGE_STRING@
   5.196 +PACKAGE_TARNAME = @PACKAGE_TARNAME@
   5.197 +PACKAGE_VERSION = @PACKAGE_VERSION@
   5.198 +PATH_SEPARATOR = @PATH_SEPARATOR@
   5.199 +PKG_CONFIG = @PKG_CONFIG@
   5.200 +RANLIB = @RANLIB@
   5.201 +SET_MAKE = @SET_MAKE@
   5.202 +SHELL = @SHELL@
   5.203 +STRIP = @STRIP@
   5.204 +VERSION = @VERSION@
   5.205 +WITH_GTK_FALSE = @WITH_GTK_FALSE@
   5.206 +WITH_GTK_TRUE = @WITH_GTK_TRUE@
   5.207 +ac_ct_CC = @ac_ct_CC@
   5.208 +ac_ct_CXX = @ac_ct_CXX@
   5.209 +ac_ct_F77 = @ac_ct_F77@
   5.210 +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
   5.211 +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
   5.212 +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
   5.213 +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
   5.214 +am__include = @am__include@
   5.215 +am__leading_dot = @am__leading_dot@
   5.216 +am__quote = @am__quote@
   5.217 +am__tar = @am__tar@
   5.218 +am__untar = @am__untar@
   5.219 +bindir = @bindir@
   5.220 +build = @build@
   5.221 +build_alias = @build_alias@
   5.222 +build_cpu = @build_cpu@
   5.223 +build_os = @build_os@
   5.224 +build_vendor = @build_vendor@
   5.225 +datadir = @datadir@
   5.226 +datarootdir = @datarootdir@
   5.227 +docdir = @docdir@
   5.228 +dvidir = @dvidir@
   5.229 +exec_prefix = @exec_prefix@
   5.230 +host = @host@
   5.231 +host_alias = @host_alias@
   5.232 +host_cpu = @host_cpu@
   5.233 +host_os = @host_os@
   5.234 +host_vendor = @host_vendor@
   5.235 +htmldir = @htmldir@
   5.236 +includedir = @includedir@
   5.237 +infodir = @infodir@
   5.238 +install_sh = @install_sh@
   5.239 +libdir = @libdir@
   5.240 +libexecdir = @libexecdir@
   5.241 +localedir = @localedir@
   5.242 +localstatedir = @localstatedir@
   5.243 +mandir = @mandir@
   5.244 +mkdir_p = @mkdir_p@
   5.245 +oldincludedir = @oldincludedir@
   5.246 +pdfdir = @pdfdir@
   5.247 +prefix = @prefix@
   5.248 +program_transform_name = @program_transform_name@
   5.249 +psdir = @psdir@
   5.250 +sbindir = @sbindir@
   5.251 +sharedstatedir = @sharedstatedir@
   5.252 +sysconfdir = @sysconfdir@
   5.253 +target_alias = @target_alias@
   5.254 +
   5.255 +# Adding the application resources
   5.256 +pixmapdir = $(pkgdatadir)/pixmaps
   5.257 +pixmap_DATA = mmyth_logo.png
   5.258 +EXTRA_DIST = $(pixmap_DATA)
   5.259 +all: all-am
   5.260 +
   5.261 +.SUFFIXES:
   5.262 +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
   5.263 +	@for dep in $?; do \
   5.264 +	  case '$(am__configure_deps)' in \
   5.265 +	    *$$dep*) \
   5.266 +	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
   5.267 +		&& exit 0; \
   5.268 +	      exit 1;; \
   5.269 +	  esac; \
   5.270 +	done; \
   5.271 +	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  pixmaps/Makefile'; \
   5.272 +	cd $(top_srcdir) && \
   5.273 +	  $(AUTOMAKE) --gnu  pixmaps/Makefile
   5.274 +.PRECIOUS: Makefile
   5.275 +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
   5.276 +	@case '$?' in \
   5.277 +	  *config.status*) \
   5.278 +	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
   5.279 +	  *) \
   5.280 +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
   5.281 +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
   5.282 +	esac;
   5.283 +
   5.284 +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
   5.285 +	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   5.286 +
   5.287 +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
   5.288 +	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   5.289 +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
   5.290 +	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   5.291 +
   5.292 +mostlyclean-libtool:
   5.293 +	-rm -f *.lo
   5.294 +
   5.295 +clean-libtool:
   5.296 +	-rm -rf .libs _libs
   5.297 +
   5.298 +distclean-libtool:
   5.299 +	-rm -f libtool
   5.300 +uninstall-info-am:
   5.301 +install-pixmapDATA: $(pixmap_DATA)
   5.302 +	@$(NORMAL_INSTALL)
   5.303 +	test -z "$(pixmapdir)" || $(mkdir_p) "$(DESTDIR)$(pixmapdir)"
   5.304 +	@list='$(pixmap_DATA)'; for p in $$list; do \
   5.305 +	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
   5.306 +	  f=$(am__strip_dir) \
   5.307 +	  echo " $(pixmapDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pixmapdir)/$$f'"; \
   5.308 +	  $(pixmapDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pixmapdir)/$$f"; \
   5.309 +	done
   5.310 +
   5.311 +uninstall-pixmapDATA:
   5.312 +	@$(NORMAL_UNINSTALL)
   5.313 +	@list='$(pixmap_DATA)'; for p in $$list; do \
   5.314 +	  f=$(am__strip_dir) \
   5.315 +	  echo " rm -f '$(DESTDIR)$(pixmapdir)/$$f'"; \
   5.316 +	  rm -f "$(DESTDIR)$(pixmapdir)/$$f"; \
   5.317 +	done
   5.318 +tags: TAGS
   5.319 +TAGS:
   5.320 +
   5.321 +ctags: CTAGS
   5.322 +CTAGS:
   5.323 +
   5.324 +
   5.325 +distdir: $(DISTFILES)
   5.326 +	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
   5.327 +	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
   5.328 +	list='$(DISTFILES)'; for file in $$list; do \
   5.329 +	  case $$file in \
   5.330 +	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
   5.331 +	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
   5.332 +	  esac; \
   5.333 +	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
   5.334 +	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
   5.335 +	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
   5.336 +	    dir="/$$dir"; \
   5.337 +	    $(mkdir_p) "$(distdir)$$dir"; \
   5.338 +	  else \
   5.339 +	    dir=''; \
   5.340 +	  fi; \
   5.341 +	  if test -d $$d/$$file; then \
   5.342 +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
   5.343 +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
   5.344 +	    fi; \
   5.345 +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
   5.346 +	  else \
   5.347 +	    test -f $(distdir)/$$file \
   5.348 +	    || cp -p $$d/$$file $(distdir)/$$file \
   5.349 +	    || exit 1; \
   5.350 +	  fi; \
   5.351 +	done
   5.352 +check-am: all-am
   5.353 +check: check-am
   5.354 +all-am: Makefile $(DATA)
   5.355 +installdirs:
   5.356 +	for dir in "$(DESTDIR)$(pixmapdir)"; do \
   5.357 +	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
   5.358 +	done
   5.359 +install: install-am
   5.360 +install-exec: install-exec-am
   5.361 +install-data: install-data-am
   5.362 +uninstall: uninstall-am
   5.363 +
   5.364 +install-am: all-am
   5.365 +	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
   5.366 +
   5.367 +installcheck: installcheck-am
   5.368 +install-strip:
   5.369 +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
   5.370 +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
   5.371 +	  `test -z '$(STRIP)' || \
   5.372 +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
   5.373 +mostlyclean-generic:
   5.374 +
   5.375 +clean-generic:
   5.376 +
   5.377 +distclean-generic:
   5.378 +	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
   5.379 +
   5.380 +maintainer-clean-generic:
   5.381 +	@echo "This command is intended for maintainers to use"
   5.382 +	@echo "it deletes files that may require special tools to rebuild."
   5.383 +clean: clean-am
   5.384 +
   5.385 +clean-am: clean-generic clean-libtool mostlyclean-am
   5.386 +
   5.387 +distclean: distclean-am
   5.388 +	-rm -f Makefile
   5.389 +distclean-am: clean-am distclean-generic distclean-libtool
   5.390 +
   5.391 +dvi: dvi-am
   5.392 +
   5.393 +dvi-am:
   5.394 +
   5.395 +html: html-am
   5.396 +
   5.397 +info: info-am
   5.398 +
   5.399 +info-am:
   5.400 +
   5.401 +install-data-am: install-pixmapDATA
   5.402 +
   5.403 +install-exec-am:
   5.404 +
   5.405 +install-info: install-info-am
   5.406 +
   5.407 +install-man:
   5.408 +
   5.409 +installcheck-am:
   5.410 +
   5.411 +maintainer-clean: maintainer-clean-am
   5.412 +	-rm -f Makefile
   5.413 +maintainer-clean-am: distclean-am maintainer-clean-generic
   5.414 +
   5.415 +mostlyclean: mostlyclean-am
   5.416 +
   5.417 +mostlyclean-am: mostlyclean-generic mostlyclean-libtool
   5.418 +
   5.419 +pdf: pdf-am
   5.420 +
   5.421 +pdf-am:
   5.422 +
   5.423 +ps: ps-am
   5.424 +
   5.425 +ps-am:
   5.426 +
   5.427 +uninstall-am: uninstall-info-am uninstall-pixmapDATA
   5.428 +
   5.429 +.PHONY: all all-am check check-am clean clean-generic clean-libtool \
   5.430 +	distclean distclean-generic distclean-libtool distdir dvi \
   5.431 +	dvi-am html html-am info info-am install install-am \
   5.432 +	install-data install-data-am install-exec install-exec-am \
   5.433 +	install-info install-info-am install-man install-pixmapDATA \
   5.434 +	install-strip installcheck installcheck-am installdirs \
   5.435 +	maintainer-clean maintainer-clean-generic mostlyclean \
   5.436 +	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
   5.437 +	uninstall uninstall-am uninstall-info-am uninstall-pixmapDATA
   5.438 +
   5.439 +# Tell versions [3.59,3.63) of GNU make to not export all variables.
   5.440 +# Otherwise a system limit (for SysV at least) may be exceeded.
   5.441 +.NOEXPORT:
     6.1 Binary file maemo-ui/pixmaps/mmyth_logo.png has changed
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/maemo-ui/src/Makefile.am	Thu Sep 28 16:02:14 2006 +0100
     7.3 @@ -0,0 +1,28 @@
     7.4 +bin_PROGRAMS = mmyth
     7.5 +
     7.6 +mmyth_SOURCES =	\
     7.7 +		mmyth_main.c			\
     7.8 +		mmyth_ui.c				\
     7.9 +		mmyth_uicommon.c		\
    7.10 +		mmyth_epg_grid_view.c	\
    7.11 +		mmyth_epg_grid_widget.c	\
    7.12 +		mmyth_recordui.c		\
    7.13 +		mmyth_uisettings.c		\
    7.14 +		mmyth_schedulerui.c		\
    7.15 +		mmyth_tvplayer.c
    7.16 +
    7.17 +mmyth_CFLAGS = \
    7.18 +		$(GTK_CFLAGS) \
    7.19 +		$(GLIB_CFLAGS) \
    7.20 +		$(GST_CFLAGS) \
    7.21 +		$(MYSQL_CFLAGS) \
    7.22 +		$(LIBGMYTH_CFLAGS) \
    7.23 +		-I$(top_srcdir)/src \
    7.24 +		-DDATA_DIR=\""$(pkgdatadir)"\" \
    7.25 +		-DPIX_DIR=\""$(pkgdatadir)/pixmaps/"\" \
    7.26 +		-DICON_DIR=\""$(datadir)/pixmaps/"\" \
    7.27 +		-g3 -O0
    7.28 +
    7.29 +mmyth_LDADD = 	\
    7.30 +		$(LIBGMYTH_LIBS)
    7.31 +
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/maemo-ui/src/Makefile.in	Thu Sep 28 16:02:14 2006 +0100
     8.3 @@ -0,0 +1,699 @@
     8.4 +# Makefile.in generated by automake 1.9.6 from Makefile.am.
     8.5 +# @configure_input@
     8.6 +
     8.7 +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
     8.8 +# 2003, 2004, 2005  Free Software Foundation, Inc.
     8.9 +# This Makefile.in is free software; the Free Software Foundation
    8.10 +# gives unlimited permission to copy and/or distribute it,
    8.11 +# with or without modifications, as long as this notice is preserved.
    8.12 +
    8.13 +# This program is distributed in the hope that it will be useful,
    8.14 +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
    8.15 +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
    8.16 +# PARTICULAR PURPOSE.
    8.17 +
    8.18 +@SET_MAKE@
    8.19 +
    8.20 +srcdir = @srcdir@
    8.21 +top_srcdir = @top_srcdir@
    8.22 +VPATH = @srcdir@
    8.23 +pkgdatadir = $(datadir)/@PACKAGE@
    8.24 +pkglibdir = $(libdir)/@PACKAGE@
    8.25 +pkgincludedir = $(includedir)/@PACKAGE@
    8.26 +top_builddir = ..
    8.27 +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
    8.28 +INSTALL = @INSTALL@
    8.29 +install_sh_DATA = $(install_sh) -c -m 644
    8.30 +install_sh_PROGRAM = $(install_sh) -c
    8.31 +install_sh_SCRIPT = $(install_sh) -c
    8.32 +INSTALL_HEADER = $(INSTALL_DATA)
    8.33 +transform = $(program_transform_name)
    8.34 +NORMAL_INSTALL = :
    8.35 +PRE_INSTALL = :
    8.36 +POST_INSTALL = :
    8.37 +NORMAL_UNINSTALL = :
    8.38 +PRE_UNINSTALL = :
    8.39 +POST_UNINSTALL = :
    8.40 +build_triplet = @build@
    8.41 +host_triplet = @host@
    8.42 +bin_PROGRAMS = mmyth$(EXEEXT)
    8.43 +subdir = src
    8.44 +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
    8.45 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
    8.46 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_doxygen.m4 \
    8.47 +	$(top_srcdir)/m4/as-version.m4 $(top_srcdir)/configure.ac
    8.48 +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
    8.49 +	$(ACLOCAL_M4)
    8.50 +mkinstalldirs = $(install_sh) -d
    8.51 +CONFIG_HEADER = $(top_builddir)/config.h
    8.52 +CONFIG_CLEAN_FILES =
    8.53 +am__installdirs = "$(DESTDIR)$(bindir)"
    8.54 +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
    8.55 +PROGRAMS = $(bin_PROGRAMS)
    8.56 +am_mmyth_OBJECTS = mmyth-mmyth_main.$(OBJEXT) mmyth-mmyth_ui.$(OBJEXT) \
    8.57 +	mmyth-mmyth_uicommon.$(OBJEXT) \
    8.58 +	mmyth-mmyth_epg_grid_view.$(OBJEXT) \
    8.59 +	mmyth-mmyth_epg_grid_widget.$(OBJEXT) \
    8.60 +	mmyth-mmyth_recordui.$(OBJEXT) \
    8.61 +	mmyth-mmyth_uisettings.$(OBJEXT) \
    8.62 +	mmyth-mmyth_schedulerui.$(OBJEXT) \
    8.63 +	mmyth-mmyth_tvplayer.$(OBJEXT)
    8.64 +mmyth_OBJECTS = $(am_mmyth_OBJECTS)
    8.65 +am__DEPENDENCIES_1 =
    8.66 +mmyth_DEPENDENCIES = $(am__DEPENDENCIES_1)
    8.67 +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
    8.68 +depcomp = $(SHELL) $(top_srcdir)/depcomp
    8.69 +am__depfiles_maybe = depfiles
    8.70 +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
    8.71 +	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
    8.72 +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
    8.73 +	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
    8.74 +	$(AM_CFLAGS) $(CFLAGS)
    8.75 +CCLD = $(CC)
    8.76 +LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
    8.77 +	$(AM_LDFLAGS) $(LDFLAGS) -o $@
    8.78 +SOURCES = $(mmyth_SOURCES)
    8.79 +DIST_SOURCES = $(mmyth_SOURCES)
    8.80 +ETAGS = etags
    8.81 +CTAGS = ctags
    8.82 +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    8.83 +ACLOCAL = @ACLOCAL@
    8.84 +ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@
    8.85 +AMDEP_FALSE = @AMDEP_FALSE@
    8.86 +AMDEP_TRUE = @AMDEP_TRUE@
    8.87 +AMTAR = @AMTAR@
    8.88 +AR = @AR@
    8.89 +AUTOCONF = @AUTOCONF@
    8.90 +AUTOHEADER = @AUTOHEADER@
    8.91 +AUTOMAKE = @AUTOMAKE@
    8.92 +AWK = @AWK@
    8.93 +CC = @CC@
    8.94 +CCDEPMODE = @CCDEPMODE@
    8.95 +CFLAGS = @CFLAGS@
    8.96 +CPP = @CPP@
    8.97 +CPPFLAGS = @CPPFLAGS@
    8.98 +CXX = @CXX@
    8.99 +CXXCPP = @CXXCPP@
   8.100 +CXXDEPMODE = @CXXDEPMODE@
   8.101 +CXXFLAGS = @CXXFLAGS@
   8.102 +CYGPATH_W = @CYGPATH_W@
   8.103 +DEFS = @DEFS@
   8.104 +DEPDIR = @DEPDIR@
   8.105 +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@
   8.106 +DX_COND_chi_FALSE = @DX_COND_chi_FALSE@
   8.107 +DX_COND_chi_TRUE = @DX_COND_chi_TRUE@
   8.108 +DX_COND_chm_FALSE = @DX_COND_chm_FALSE@
   8.109 +DX_COND_chm_TRUE = @DX_COND_chm_TRUE@
   8.110 +DX_COND_doc_FALSE = @DX_COND_doc_FALSE@
   8.111 +DX_COND_doc_TRUE = @DX_COND_doc_TRUE@
   8.112 +DX_COND_dot_FALSE = @DX_COND_dot_FALSE@
   8.113 +DX_COND_dot_TRUE = @DX_COND_dot_TRUE@
   8.114 +DX_COND_html_FALSE = @DX_COND_html_FALSE@
   8.115 +DX_COND_html_TRUE = @DX_COND_html_TRUE@
   8.116 +DX_COND_latex_FALSE = @DX_COND_latex_FALSE@
   8.117 +DX_COND_latex_TRUE = @DX_COND_latex_TRUE@
   8.118 +DX_COND_man_FALSE = @DX_COND_man_FALSE@
   8.119 +DX_COND_man_TRUE = @DX_COND_man_TRUE@
   8.120 +DX_COND_pdf_FALSE = @DX_COND_pdf_FALSE@
   8.121 +DX_COND_pdf_TRUE = @DX_COND_pdf_TRUE@
   8.122 +DX_COND_ps_FALSE = @DX_COND_ps_FALSE@
   8.123 +DX_COND_ps_TRUE = @DX_COND_ps_TRUE@
   8.124 +DX_COND_rtf_FALSE = @DX_COND_rtf_FALSE@
   8.125 +DX_COND_rtf_TRUE = @DX_COND_rtf_TRUE@
   8.126 +DX_COND_xml_FALSE = @DX_COND_xml_FALSE@
   8.127 +DX_COND_xml_TRUE = @DX_COND_xml_TRUE@
   8.128 +DX_CONFIG = @DX_CONFIG@
   8.129 +DX_DOCDIR = @DX_DOCDIR@
   8.130 +DX_DOT = @DX_DOT@
   8.131 +DX_DOXYGEN = @DX_DOXYGEN@
   8.132 +DX_DVIPS = @DX_DVIPS@
   8.133 +DX_EGREP = @DX_EGREP@
   8.134 +DX_ENV = @DX_ENV@
   8.135 +DX_FLAG_chi = @DX_FLAG_chi@
   8.136 +DX_FLAG_chm = @DX_FLAG_chm@
   8.137 +DX_FLAG_doc = @DX_FLAG_doc@
   8.138 +DX_FLAG_dot = @DX_FLAG_dot@
   8.139 +DX_FLAG_html = @DX_FLAG_html@
   8.140 +DX_FLAG_man = @DX_FLAG_man@
   8.141 +DX_FLAG_pdf = @DX_FLAG_pdf@
   8.142 +DX_FLAG_ps = @DX_FLAG_ps@
   8.143 +DX_FLAG_rtf = @DX_FLAG_rtf@
   8.144 +DX_FLAG_xml = @DX_FLAG_xml@
   8.145 +DX_HHC = @DX_HHC@
   8.146 +DX_LATEX = @DX_LATEX@
   8.147 +DX_MAKEINDEX = @DX_MAKEINDEX@
   8.148 +DX_PDFLATEX = @DX_PDFLATEX@
   8.149 +DX_PERL = @DX_PERL@
   8.150 +DX_PROJECT = @DX_PROJECT@
   8.151 +ECHO = @ECHO@
   8.152 +ECHO_C = @ECHO_C@
   8.153 +ECHO_N = @ECHO_N@
   8.154 +ECHO_T = @ECHO_T@
   8.155 +EGREP = @EGREP@
   8.156 +EXEEXT = @EXEEXT@
   8.157 +F77 = @F77@
   8.158 +FFLAGS = @FFLAGS@
   8.159 +GLIB_CFLAGS = @GLIB_CFLAGS@
   8.160 +GLIB_LIBS = @GLIB_LIBS@
   8.161 +GMYTH_MAJORMINOR = @GMYTH_MAJORMINOR@
   8.162 +GMYTH_MAJOR_VERSION = @GMYTH_MAJOR_VERSION@
   8.163 +GMYTH_MICRO_VERSION = @GMYTH_MICRO_VERSION@
   8.164 +GMYTH_MINOR_VERSION = @GMYTH_MINOR_VERSION@
   8.165 +GMYTH_NANO_VERSION = @GMYTH_NANO_VERSION@
   8.166 +GMYTH_RELEASE = @GMYTH_RELEASE@
   8.167 +GMYTH_VERSION = @GMYTH_VERSION@
   8.168 +GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
   8.169 +GOBJECT_LIBS = @GOBJECT_LIBS@
   8.170 +GREP = @GREP@
   8.171 +GSTBASE_CFLAGS = @GSTBASE_CFLAGS@
   8.172 +GSTBASE_LIBS = @GSTBASE_LIBS@
   8.173 +GST_CFLAGS = @GST_CFLAGS@
   8.174 +GST_LIBS = @GST_LIBS@
   8.175 +GST_MAJORMINOR = @GST_MAJORMINOR@
   8.176 +GTK_CFLAGS = @GTK_CFLAGS@
   8.177 +GTK_LIBS = @GTK_LIBS@
   8.178 +HAVE_PKGCONFIG = @HAVE_PKGCONFIG@
   8.179 +HILDON_CFLAGS = @HILDON_CFLAGS@
   8.180 +HILDON_LIBS = @HILDON_LIBS@
   8.181 +INSTALL_DATA = @INSTALL_DATA@
   8.182 +INSTALL_PROGRAM = @INSTALL_PROGRAM@
   8.183 +INSTALL_SCRIPT = @INSTALL_SCRIPT@
   8.184 +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
   8.185 +LDFLAGS = @LDFLAGS@
   8.186 +LIBGMYTH_CFLAGS = @LIBGMYTH_CFLAGS@
   8.187 +LIBGMYTH_LIBS = @LIBGMYTH_LIBS@
   8.188 +LIBOBJS = @LIBOBJS@
   8.189 +LIBS = @LIBS@
   8.190 +LIBTOOL = @LIBTOOL@
   8.191 +LIBXML_CFLAGS = @LIBXML_CFLAGS@
   8.192 +LIBXML_LIBS = @LIBXML_LIBS@
   8.193 +LN_S = @LN_S@
   8.194 +LTLIBOBJS = @LTLIBOBJS@
   8.195 +MAEMO_PLATFORM_FALSE = @MAEMO_PLATFORM_FALSE@
   8.196 +MAEMO_PLATFORM_TRUE = @MAEMO_PLATFORM_TRUE@
   8.197 +MAINT = @MAINT@
   8.198 +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
   8.199 +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
   8.200 +MAKEINFO = @MAKEINFO@
   8.201 +MYSQL_CFLAGS = @MYSQL_CFLAGS@
   8.202 +MYSQL_LIBS = @MYSQL_LIBS@
   8.203 +NDEBUG_FALSE = @NDEBUG_FALSE@
   8.204 +NDEBUG_TRUE = @NDEBUG_TRUE@
   8.205 +OBJEXT = @OBJEXT@
   8.206 +PACKAGE = @PACKAGE@
   8.207 +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
   8.208 +PACKAGE_NAME = @PACKAGE_NAME@
   8.209 +PACKAGE_STRING = @PACKAGE_STRING@
   8.210 +PACKAGE_TARNAME = @PACKAGE_TARNAME@
   8.211 +PACKAGE_VERSION = @PACKAGE_VERSION@
   8.212 +PATH_SEPARATOR = @PATH_SEPARATOR@
   8.213 +PKG_CONFIG = @PKG_CONFIG@
   8.214 +RANLIB = @RANLIB@
   8.215 +SET_MAKE = @SET_MAKE@
   8.216 +SHELL = @SHELL@
   8.217 +STRIP = @STRIP@
   8.218 +VERSION = @VERSION@
   8.219 +WITH_GTK_FALSE = @WITH_GTK_FALSE@
   8.220 +WITH_GTK_TRUE = @WITH_GTK_TRUE@
   8.221 +ac_ct_CC = @ac_ct_CC@
   8.222 +ac_ct_CXX = @ac_ct_CXX@
   8.223 +ac_ct_F77 = @ac_ct_F77@
   8.224 +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
   8.225 +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
   8.226 +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
   8.227 +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
   8.228 +am__include = @am__include@
   8.229 +am__leading_dot = @am__leading_dot@
   8.230 +am__quote = @am__quote@
   8.231 +am__tar = @am__tar@
   8.232 +am__untar = @am__untar@
   8.233 +bindir = @bindir@
   8.234 +build = @build@
   8.235 +build_alias = @build_alias@
   8.236 +build_cpu = @build_cpu@
   8.237 +build_os = @build_os@
   8.238 +build_vendor = @build_vendor@
   8.239 +datadir = @datadir@
   8.240 +datarootdir = @datarootdir@
   8.241 +docdir = @docdir@
   8.242 +dvidir = @dvidir@
   8.243 +exec_prefix = @exec_prefix@
   8.244 +host = @host@
   8.245 +host_alias = @host_alias@
   8.246 +host_cpu = @host_cpu@
   8.247 +host_os = @host_os@
   8.248 +host_vendor = @host_vendor@
   8.249 +htmldir = @htmldir@
   8.250 +includedir = @includedir@
   8.251 +infodir = @infodir@
   8.252 +install_sh = @install_sh@
   8.253 +libdir = @libdir@
   8.254 +libexecdir = @libexecdir@
   8.255 +localedir = @localedir@
   8.256 +localstatedir = @localstatedir@
   8.257 +mandir = @mandir@
   8.258 +mkdir_p = @mkdir_p@
   8.259 +oldincludedir = @oldincludedir@
   8.260 +pdfdir = @pdfdir@
   8.261 +prefix = @prefix@
   8.262 +program_transform_name = @program_transform_name@
   8.263 +psdir = @psdir@
   8.264 +sbindir = @sbindir@
   8.265 +sharedstatedir = @sharedstatedir@
   8.266 +sysconfdir = @sysconfdir@
   8.267 +target_alias = @target_alias@
   8.268 +mmyth_SOURCES = \
   8.269 +		mmyth_main.c			\
   8.270 +		mmyth_ui.c				\
   8.271 +		mmyth_uicommon.c		\
   8.272 +		mmyth_epg_grid_view.c	\
   8.273 +		mmyth_epg_grid_widget.c	\
   8.274 +		mmyth_recordui.c		\
   8.275 +		mmyth_uisettings.c		\
   8.276 +		mmyth_schedulerui.c		\
   8.277 +		mmyth_tvplayer.c
   8.278 +
   8.279 +mmyth_CFLAGS = \
   8.280 +		$(GTK_CFLAGS) \
   8.281 +		$(GLIB_CFLAGS) \
   8.282 +		$(GST_CFLAGS) \
   8.283 +		$(MYSQL_CFLAGS) \
   8.284 +		$(LIBGMYTH_CFLAGS) \
   8.285 +		-I$(top_srcdir)/src \
   8.286 +		-DDATA_DIR=\""$(pkgdatadir)"\" \
   8.287 +		-DPIX_DIR=\""$(pkgdatadir)/pixmaps/"\" \
   8.288 +		-DICON_DIR=\""$(datadir)/pixmaps/"\" \
   8.289 +		-g3 -O0
   8.290 +
   8.291 +mmyth_LDADD = \
   8.292 +		$(LIBGMYTH_LIBS)
   8.293 +
   8.294 +all: all-am
   8.295 +
   8.296 +.SUFFIXES:
   8.297 +.SUFFIXES: .c .lo .o .obj
   8.298 +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
   8.299 +	@for dep in $?; do \
   8.300 +	  case '$(am__configure_deps)' in \
   8.301 +	    *$$dep*) \
   8.302 +	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
   8.303 +		&& exit 0; \
   8.304 +	      exit 1;; \
   8.305 +	  esac; \
   8.306 +	done; \
   8.307 +	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/Makefile'; \
   8.308 +	cd $(top_srcdir) && \
   8.309 +	  $(AUTOMAKE) --gnu  src/Makefile
   8.310 +.PRECIOUS: Makefile
   8.311 +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
   8.312 +	@case '$?' in \
   8.313 +	  *config.status*) \
   8.314 +	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
   8.315 +	  *) \
   8.316 +	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
   8.317 +	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
   8.318 +	esac;
   8.319 +
   8.320 +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
   8.321 +	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   8.322 +
   8.323 +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
   8.324 +	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   8.325 +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
   8.326 +	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
   8.327 +install-binPROGRAMS: $(bin_PROGRAMS)
   8.328 +	@$(NORMAL_INSTALL)
   8.329 +	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
   8.330 +	@list='$(bin_PROGRAMS)'; for p in $$list; do \
   8.331 +	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
   8.332 +	  if test -f $$p \
   8.333 +	     || test -f $$p1 \
   8.334 +	  ; then \
   8.335 +	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
   8.336 +	   echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
   8.337 +	   $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
   8.338 +	  else :; fi; \
   8.339 +	done
   8.340 +
   8.341 +uninstall-binPROGRAMS:
   8.342 +	@$(NORMAL_UNINSTALL)
   8.343 +	@list='$(bin_PROGRAMS)'; for p in $$list; do \
   8.344 +	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
   8.345 +	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
   8.346 +	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
   8.347 +	done
   8.348 +
   8.349 +clean-binPROGRAMS:
   8.350 +	@list='$(bin_PROGRAMS)'; for p in $$list; do \
   8.351 +	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
   8.352 +	  echo " rm -f $$p $$f"; \
   8.353 +	  rm -f $$p $$f ; \
   8.354 +	done
   8.355 +mmyth$(EXEEXT): $(mmyth_OBJECTS) $(mmyth_DEPENDENCIES) 
   8.356 +	@rm -f mmyth$(EXEEXT)
   8.357 +	$(LINK) $(mmyth_LDFLAGS) $(mmyth_OBJECTS) $(mmyth_LDADD) $(LIBS)
   8.358 +
   8.359 +mostlyclean-compile:
   8.360 +	-rm -f *.$(OBJEXT)
   8.361 +
   8.362 +distclean-compile:
   8.363 +	-rm -f *.tab.c
   8.364 +
   8.365 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmyth-mmyth_epg_grid_view.Po@am__quote@
   8.366 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmyth-mmyth_epg_grid_widget.Po@am__quote@
   8.367 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmyth-mmyth_main.Po@am__quote@
   8.368 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmyth-mmyth_recordui.Po@am__quote@
   8.369 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmyth-mmyth_schedulerui.Po@am__quote@
   8.370 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmyth-mmyth_tvplayer.Po@am__quote@
   8.371 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmyth-mmyth_ui.Po@am__quote@
   8.372 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmyth-mmyth_uicommon.Po@am__quote@
   8.373 +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmyth-mmyth_uisettings.Po@am__quote@
   8.374 +
   8.375 +.c.o:
   8.376 +@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
   8.377 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
   8.378 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
   8.379 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.380 +@am__fastdepCC_FALSE@	$(COMPILE) -c $<
   8.381 +
   8.382 +.c.obj:
   8.383 +@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
   8.384 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
   8.385 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
   8.386 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.387 +@am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
   8.388 +
   8.389 +.c.lo:
   8.390 +@am__fastdepCC_TRUE@	if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
   8.391 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
   8.392 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
   8.393 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.394 +@am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
   8.395 +
   8.396 +mmyth-mmyth_main.o: mmyth_main.c
   8.397 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_main.o -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_main.Tpo" -c -o mmyth-mmyth_main.o `test -f 'mmyth_main.c' || echo '$(srcdir)/'`mmyth_main.c; \
   8.398 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_main.Tpo" "$(DEPDIR)/mmyth-mmyth_main.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_main.Tpo"; exit 1; fi
   8.399 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_main.c' object='mmyth-mmyth_main.o' libtool=no @AMDEPBACKSLASH@
   8.400 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.401 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_main.o `test -f 'mmyth_main.c' || echo '$(srcdir)/'`mmyth_main.c
   8.402 +
   8.403 +mmyth-mmyth_main.obj: mmyth_main.c
   8.404 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_main.obj -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_main.Tpo" -c -o mmyth-mmyth_main.obj `if test -f 'mmyth_main.c'; then $(CYGPATH_W) 'mmyth_main.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_main.c'; fi`; \
   8.405 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_main.Tpo" "$(DEPDIR)/mmyth-mmyth_main.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_main.Tpo"; exit 1; fi
   8.406 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_main.c' object='mmyth-mmyth_main.obj' libtool=no @AMDEPBACKSLASH@
   8.407 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.408 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_main.obj `if test -f 'mmyth_main.c'; then $(CYGPATH_W) 'mmyth_main.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_main.c'; fi`
   8.409 +
   8.410 +mmyth-mmyth_ui.o: mmyth_ui.c
   8.411 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_ui.o -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_ui.Tpo" -c -o mmyth-mmyth_ui.o `test -f 'mmyth_ui.c' || echo '$(srcdir)/'`mmyth_ui.c; \
   8.412 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_ui.Tpo" "$(DEPDIR)/mmyth-mmyth_ui.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_ui.Tpo"; exit 1; fi
   8.413 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_ui.c' object='mmyth-mmyth_ui.o' libtool=no @AMDEPBACKSLASH@
   8.414 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.415 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_ui.o `test -f 'mmyth_ui.c' || echo '$(srcdir)/'`mmyth_ui.c
   8.416 +
   8.417 +mmyth-mmyth_ui.obj: mmyth_ui.c
   8.418 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_ui.obj -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_ui.Tpo" -c -o mmyth-mmyth_ui.obj `if test -f 'mmyth_ui.c'; then $(CYGPATH_W) 'mmyth_ui.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_ui.c'; fi`; \
   8.419 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_ui.Tpo" "$(DEPDIR)/mmyth-mmyth_ui.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_ui.Tpo"; exit 1; fi
   8.420 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_ui.c' object='mmyth-mmyth_ui.obj' libtool=no @AMDEPBACKSLASH@
   8.421 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.422 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_ui.obj `if test -f 'mmyth_ui.c'; then $(CYGPATH_W) 'mmyth_ui.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_ui.c'; fi`
   8.423 +
   8.424 +mmyth-mmyth_uicommon.o: mmyth_uicommon.c
   8.425 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_uicommon.o -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_uicommon.Tpo" -c -o mmyth-mmyth_uicommon.o `test -f 'mmyth_uicommon.c' || echo '$(srcdir)/'`mmyth_uicommon.c; \
   8.426 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_uicommon.Tpo" "$(DEPDIR)/mmyth-mmyth_uicommon.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_uicommon.Tpo"; exit 1; fi
   8.427 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_uicommon.c' object='mmyth-mmyth_uicommon.o' libtool=no @AMDEPBACKSLASH@
   8.428 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.429 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_uicommon.o `test -f 'mmyth_uicommon.c' || echo '$(srcdir)/'`mmyth_uicommon.c
   8.430 +
   8.431 +mmyth-mmyth_uicommon.obj: mmyth_uicommon.c
   8.432 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_uicommon.obj -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_uicommon.Tpo" -c -o mmyth-mmyth_uicommon.obj `if test -f 'mmyth_uicommon.c'; then $(CYGPATH_W) 'mmyth_uicommon.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_uicommon.c'; fi`; \
   8.433 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_uicommon.Tpo" "$(DEPDIR)/mmyth-mmyth_uicommon.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_uicommon.Tpo"; exit 1; fi
   8.434 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_uicommon.c' object='mmyth-mmyth_uicommon.obj' libtool=no @AMDEPBACKSLASH@
   8.435 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.436 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_uicommon.obj `if test -f 'mmyth_uicommon.c'; then $(CYGPATH_W) 'mmyth_uicommon.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_uicommon.c'; fi`
   8.437 +
   8.438 +mmyth-mmyth_epg_grid_view.o: mmyth_epg_grid_view.c
   8.439 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_epg_grid_view.o -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_epg_grid_view.Tpo" -c -o mmyth-mmyth_epg_grid_view.o `test -f 'mmyth_epg_grid_view.c' || echo '$(srcdir)/'`mmyth_epg_grid_view.c; \
   8.440 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_epg_grid_view.Tpo" "$(DEPDIR)/mmyth-mmyth_epg_grid_view.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_epg_grid_view.Tpo"; exit 1; fi
   8.441 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_epg_grid_view.c' object='mmyth-mmyth_epg_grid_view.o' libtool=no @AMDEPBACKSLASH@
   8.442 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.443 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_epg_grid_view.o `test -f 'mmyth_epg_grid_view.c' || echo '$(srcdir)/'`mmyth_epg_grid_view.c
   8.444 +
   8.445 +mmyth-mmyth_epg_grid_view.obj: mmyth_epg_grid_view.c
   8.446 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_epg_grid_view.obj -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_epg_grid_view.Tpo" -c -o mmyth-mmyth_epg_grid_view.obj `if test -f 'mmyth_epg_grid_view.c'; then $(CYGPATH_W) 'mmyth_epg_grid_view.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_epg_grid_view.c'; fi`; \
   8.447 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_epg_grid_view.Tpo" "$(DEPDIR)/mmyth-mmyth_epg_grid_view.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_epg_grid_view.Tpo"; exit 1; fi
   8.448 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_epg_grid_view.c' object='mmyth-mmyth_epg_grid_view.obj' libtool=no @AMDEPBACKSLASH@
   8.449 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.450 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_epg_grid_view.obj `if test -f 'mmyth_epg_grid_view.c'; then $(CYGPATH_W) 'mmyth_epg_grid_view.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_epg_grid_view.c'; fi`
   8.451 +
   8.452 +mmyth-mmyth_epg_grid_widget.o: mmyth_epg_grid_widget.c
   8.453 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_epg_grid_widget.o -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_epg_grid_widget.Tpo" -c -o mmyth-mmyth_epg_grid_widget.o `test -f 'mmyth_epg_grid_widget.c' || echo '$(srcdir)/'`mmyth_epg_grid_widget.c; \
   8.454 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_epg_grid_widget.Tpo" "$(DEPDIR)/mmyth-mmyth_epg_grid_widget.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_epg_grid_widget.Tpo"; exit 1; fi
   8.455 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_epg_grid_widget.c' object='mmyth-mmyth_epg_grid_widget.o' libtool=no @AMDEPBACKSLASH@
   8.456 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.457 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_epg_grid_widget.o `test -f 'mmyth_epg_grid_widget.c' || echo '$(srcdir)/'`mmyth_epg_grid_widget.c
   8.458 +
   8.459 +mmyth-mmyth_epg_grid_widget.obj: mmyth_epg_grid_widget.c
   8.460 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_epg_grid_widget.obj -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_epg_grid_widget.Tpo" -c -o mmyth-mmyth_epg_grid_widget.obj `if test -f 'mmyth_epg_grid_widget.c'; then $(CYGPATH_W) 'mmyth_epg_grid_widget.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_epg_grid_widget.c'; fi`; \
   8.461 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_epg_grid_widget.Tpo" "$(DEPDIR)/mmyth-mmyth_epg_grid_widget.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_epg_grid_widget.Tpo"; exit 1; fi
   8.462 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_epg_grid_widget.c' object='mmyth-mmyth_epg_grid_widget.obj' libtool=no @AMDEPBACKSLASH@
   8.463 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.464 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_epg_grid_widget.obj `if test -f 'mmyth_epg_grid_widget.c'; then $(CYGPATH_W) 'mmyth_epg_grid_widget.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_epg_grid_widget.c'; fi`
   8.465 +
   8.466 +mmyth-mmyth_recordui.o: mmyth_recordui.c
   8.467 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_recordui.o -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_recordui.Tpo" -c -o mmyth-mmyth_recordui.o `test -f 'mmyth_recordui.c' || echo '$(srcdir)/'`mmyth_recordui.c; \
   8.468 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_recordui.Tpo" "$(DEPDIR)/mmyth-mmyth_recordui.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_recordui.Tpo"; exit 1; fi
   8.469 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_recordui.c' object='mmyth-mmyth_recordui.o' libtool=no @AMDEPBACKSLASH@
   8.470 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.471 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_recordui.o `test -f 'mmyth_recordui.c' || echo '$(srcdir)/'`mmyth_recordui.c
   8.472 +
   8.473 +mmyth-mmyth_recordui.obj: mmyth_recordui.c
   8.474 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_recordui.obj -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_recordui.Tpo" -c -o mmyth-mmyth_recordui.obj `if test -f 'mmyth_recordui.c'; then $(CYGPATH_W) 'mmyth_recordui.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_recordui.c'; fi`; \
   8.475 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_recordui.Tpo" "$(DEPDIR)/mmyth-mmyth_recordui.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_recordui.Tpo"; exit 1; fi
   8.476 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_recordui.c' object='mmyth-mmyth_recordui.obj' libtool=no @AMDEPBACKSLASH@
   8.477 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.478 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_recordui.obj `if test -f 'mmyth_recordui.c'; then $(CYGPATH_W) 'mmyth_recordui.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_recordui.c'; fi`
   8.479 +
   8.480 +mmyth-mmyth_uisettings.o: mmyth_uisettings.c
   8.481 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_uisettings.o -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_uisettings.Tpo" -c -o mmyth-mmyth_uisettings.o `test -f 'mmyth_uisettings.c' || echo '$(srcdir)/'`mmyth_uisettings.c; \
   8.482 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_uisettings.Tpo" "$(DEPDIR)/mmyth-mmyth_uisettings.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_uisettings.Tpo"; exit 1; fi
   8.483 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_uisettings.c' object='mmyth-mmyth_uisettings.o' libtool=no @AMDEPBACKSLASH@
   8.484 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.485 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_uisettings.o `test -f 'mmyth_uisettings.c' || echo '$(srcdir)/'`mmyth_uisettings.c
   8.486 +
   8.487 +mmyth-mmyth_uisettings.obj: mmyth_uisettings.c
   8.488 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_uisettings.obj -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_uisettings.Tpo" -c -o mmyth-mmyth_uisettings.obj `if test -f 'mmyth_uisettings.c'; then $(CYGPATH_W) 'mmyth_uisettings.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_uisettings.c'; fi`; \
   8.489 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_uisettings.Tpo" "$(DEPDIR)/mmyth-mmyth_uisettings.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_uisettings.Tpo"; exit 1; fi
   8.490 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_uisettings.c' object='mmyth-mmyth_uisettings.obj' libtool=no @AMDEPBACKSLASH@
   8.491 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.492 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_uisettings.obj `if test -f 'mmyth_uisettings.c'; then $(CYGPATH_W) 'mmyth_uisettings.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_uisettings.c'; fi`
   8.493 +
   8.494 +mmyth-mmyth_schedulerui.o: mmyth_schedulerui.c
   8.495 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_schedulerui.o -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_schedulerui.Tpo" -c -o mmyth-mmyth_schedulerui.o `test -f 'mmyth_schedulerui.c' || echo '$(srcdir)/'`mmyth_schedulerui.c; \
   8.496 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_schedulerui.Tpo" "$(DEPDIR)/mmyth-mmyth_schedulerui.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_schedulerui.Tpo"; exit 1; fi
   8.497 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_schedulerui.c' object='mmyth-mmyth_schedulerui.o' libtool=no @AMDEPBACKSLASH@
   8.498 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.499 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_schedulerui.o `test -f 'mmyth_schedulerui.c' || echo '$(srcdir)/'`mmyth_schedulerui.c
   8.500 +
   8.501 +mmyth-mmyth_schedulerui.obj: mmyth_schedulerui.c
   8.502 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_schedulerui.obj -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_schedulerui.Tpo" -c -o mmyth-mmyth_schedulerui.obj `if test -f 'mmyth_schedulerui.c'; then $(CYGPATH_W) 'mmyth_schedulerui.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_schedulerui.c'; fi`; \
   8.503 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_schedulerui.Tpo" "$(DEPDIR)/mmyth-mmyth_schedulerui.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_schedulerui.Tpo"; exit 1; fi
   8.504 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_schedulerui.c' object='mmyth-mmyth_schedulerui.obj' libtool=no @AMDEPBACKSLASH@
   8.505 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.506 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_schedulerui.obj `if test -f 'mmyth_schedulerui.c'; then $(CYGPATH_W) 'mmyth_schedulerui.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_schedulerui.c'; fi`
   8.507 +
   8.508 +mmyth-mmyth_tvplayer.o: mmyth_tvplayer.c
   8.509 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_tvplayer.o -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_tvplayer.Tpo" -c -o mmyth-mmyth_tvplayer.o `test -f 'mmyth_tvplayer.c' || echo '$(srcdir)/'`mmyth_tvplayer.c; \
   8.510 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_tvplayer.Tpo" "$(DEPDIR)/mmyth-mmyth_tvplayer.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_tvplayer.Tpo"; exit 1; fi
   8.511 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_tvplayer.c' object='mmyth-mmyth_tvplayer.o' libtool=no @AMDEPBACKSLASH@
   8.512 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.513 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_tvplayer.o `test -f 'mmyth_tvplayer.c' || echo '$(srcdir)/'`mmyth_tvplayer.c
   8.514 +
   8.515 +mmyth-mmyth_tvplayer.obj: mmyth_tvplayer.c
   8.516 +@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -MT mmyth-mmyth_tvplayer.obj -MD -MP -MF "$(DEPDIR)/mmyth-mmyth_tvplayer.Tpo" -c -o mmyth-mmyth_tvplayer.obj `if test -f 'mmyth_tvplayer.c'; then $(CYGPATH_W) 'mmyth_tvplayer.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_tvplayer.c'; fi`; \
   8.517 +@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/mmyth-mmyth_tvplayer.Tpo" "$(DEPDIR)/mmyth-mmyth_tvplayer.Po"; else rm -f "$(DEPDIR)/mmyth-mmyth_tvplayer.Tpo"; exit 1; fi
   8.518 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='mmyth_tvplayer.c' object='mmyth-mmyth_tvplayer.obj' libtool=no @AMDEPBACKSLASH@
   8.519 +@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
   8.520 +@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mmyth_CFLAGS) $(CFLAGS) -c -o mmyth-mmyth_tvplayer.obj `if test -f 'mmyth_tvplayer.c'; then $(CYGPATH_W) 'mmyth_tvplayer.c'; else $(CYGPATH_W) '$(srcdir)/mmyth_tvplayer.c'; fi`
   8.521 +
   8.522 +mostlyclean-libtool:
   8.523 +	-rm -f *.lo
   8.524 +
   8.525 +clean-libtool:
   8.526 +	-rm -rf .libs _libs
   8.527 +
   8.528 +distclean-libtool:
   8.529 +	-rm -f libtool
   8.530 +uninstall-info-am:
   8.531 +
   8.532 +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
   8.533 +	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
   8.534 +	unique=`for i in $$list; do \
   8.535 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   8.536 +	  done | \
   8.537 +	  $(AWK) '    { files[$$0] = 1; } \
   8.538 +	       END { for (i in files) print i; }'`; \
   8.539 +	mkid -fID $$unique
   8.540 +tags: TAGS
   8.541 +
   8.542 +TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   8.543 +		$(TAGS_FILES) $(LISP)
   8.544 +	tags=; \
   8.545 +	here=`pwd`; \
   8.546 +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   8.547 +	unique=`for i in $$list; do \
   8.548 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   8.549 +	  done | \
   8.550 +	  $(AWK) '    { files[$$0] = 1; } \
   8.551 +	       END { for (i in files) print i; }'`; \
   8.552 +	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
   8.553 +	  test -n "$$unique" || unique=$$empty_fix; \
   8.554 +	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
   8.555 +	    $$tags $$unique; \
   8.556 +	fi
   8.557 +ctags: CTAGS
   8.558 +CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
   8.559 +		$(TAGS_FILES) $(LISP)
   8.560 +	tags=; \
   8.561 +	here=`pwd`; \
   8.562 +	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
   8.563 +	unique=`for i in $$list; do \
   8.564 +	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
   8.565 +	  done | \
   8.566 +	  $(AWK) '    { files[$$0] = 1; } \
   8.567 +	       END { for (i in files) print i; }'`; \
   8.568 +	test -z "$(CTAGS_ARGS)$$tags$$unique" \
   8.569 +	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
   8.570 +	     $$tags $$unique
   8.571 +
   8.572 +GTAGS:
   8.573 +	here=`$(am__cd) $(top_builddir) && pwd` \
   8.574 +	  && cd $(top_srcdir) \
   8.575 +	  && gtags -i $(GTAGS_ARGS) $$here
   8.576 +
   8.577 +distclean-tags:
   8.578 +	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
   8.579 +
   8.580 +distdir: $(DISTFILES)
   8.581 +	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
   8.582 +	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
   8.583 +	list='$(DISTFILES)'; for file in $$list; do \
   8.584 +	  case $$file in \
   8.585 +	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
   8.586 +	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
   8.587 +	  esac; \
   8.588 +	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
   8.589 +	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
   8.590 +	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
   8.591 +	    dir="/$$dir"; \
   8.592 +	    $(mkdir_p) "$(distdir)$$dir"; \
   8.593 +	  else \
   8.594 +	    dir=''; \
   8.595 +	  fi; \
   8.596 +	  if test -d $$d/$$file; then \
   8.597 +	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
   8.598 +	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
   8.599 +	    fi; \
   8.600 +	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
   8.601 +	  else \
   8.602 +	    test -f $(distdir)/$$file \
   8.603 +	    || cp -p $$d/$$file $(distdir)/$$file \
   8.604 +	    || exit 1; \
   8.605 +	  fi; \
   8.606 +	done
   8.607 +check-am: all-am
   8.608 +check: check-am
   8.609 +all-am: Makefile $(PROGRAMS)
   8.610 +installdirs:
   8.611 +	for dir in "$(DESTDIR)$(bindir)"; do \
   8.612 +	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
   8.613 +	done
   8.614 +install: install-am
   8.615 +install-exec: install-exec-am
   8.616 +install-data: install-data-am
   8.617 +uninstall: uninstall-am
   8.618 +
   8.619 +install-am: all-am
   8.620 +	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
   8.621 +
   8.622 +installcheck: installcheck-am
   8.623 +install-strip:
   8.624 +	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
   8.625 +	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
   8.626 +	  `test -z '$(STRIP)' || \
   8.627 +	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
   8.628 +mostlyclean-generic:
   8.629 +
   8.630 +clean-generic:
   8.631 +
   8.632 +distclean-generic:
   8.633 +	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
   8.634 +
   8.635 +maintainer-clean-generic:
   8.636 +	@echo "This command is intended for maintainers to use"
   8.637 +	@echo "it deletes files that may require special tools to rebuild."
   8.638 +clean: clean-am
   8.639 +
   8.640 +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
   8.641 +
   8.642 +distclean: distclean-am
   8.643 +	-rm -rf ./$(DEPDIR)
   8.644 +	-rm -f Makefile
   8.645 +distclean-am: clean-am distclean-compile distclean-generic \
   8.646 +	distclean-libtool distclean-tags
   8.647 +
   8.648 +dvi: dvi-am
   8.649 +
   8.650 +dvi-am:
   8.651 +
   8.652 +html: html-am
   8.653 +
   8.654 +info: info-am
   8.655 +
   8.656 +info-am:
   8.657 +
   8.658 +install-data-am:
   8.659 +
   8.660 +install-exec-am: install-binPROGRAMS
   8.661 +
   8.662 +install-info: install-info-am
   8.663 +
   8.664 +install-man:
   8.665 +
   8.666 +installcheck-am:
   8.667 +
   8.668 +maintainer-clean: maintainer-clean-am
   8.669 +	-rm -rf ./$(DEPDIR)
   8.670 +	-rm -f Makefile
   8.671 +maintainer-clean-am: distclean-am maintainer-clean-generic
   8.672 +
   8.673 +mostlyclean: mostlyclean-am
   8.674 +
   8.675 +mostlyclean-am: mostlyclean-compile mostlyclean-generic \
   8.676 +	mostlyclean-libtool
   8.677 +
   8.678 +pdf: pdf-am
   8.679 +
   8.680 +pdf-am:
   8.681 +
   8.682 +ps: ps-am
   8.683 +
   8.684 +ps-am:
   8.685 +
   8.686 +uninstall-am: uninstall-binPROGRAMS uninstall-info-am
   8.687 +
   8.688 +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
   8.689 +	clean-generic clean-libtool ctags distclean distclean-compile \
   8.690 +	distclean-generic distclean-libtool distclean-tags distdir dvi \
   8.691 +	dvi-am html html-am info info-am install install-am \
   8.692 +	install-binPROGRAMS install-data install-data-am install-exec \
   8.693 +	install-exec-am install-info install-info-am install-man \
   8.694 +	install-strip installcheck installcheck-am installdirs \
   8.695 +	maintainer-clean maintainer-clean-generic mostlyclean \
   8.696 +	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
   8.697 +	pdf pdf-am ps ps-am tags uninstall uninstall-am \
   8.698 +	uninstall-binPROGRAMS uninstall-info-am
   8.699 +
   8.700 +# Tell versions [3.59,3.63) of GNU make to not export all variables.
   8.701 +# Otherwise a system limit (for SysV at least) may be exceeded.
   8.702 +.NOEXPORT:
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/maemo-ui/src/mmyth_epg_grid_view.c	Thu Sep 28 16:02:14 2006 +0100
     9.3 @@ -0,0 +1,213 @@
     9.4 +#include <string.h>
     9.5 +#include <stdlib.h>
     9.6 +#include <gtk/gtk.h>
     9.7 +#include <gdk/gdkkeysyms.h>
     9.8 +#include <time.h>
     9.9 +
    9.10 +#include "mmyth_epg_grid_view.h"
    9.11 +#include "mmyth_epg_grid_widget.h"
    9.12 +
    9.13 +/* Service genre */
    9.14 +#define GENRE_MIN               0
    9.15 +#define GENRE_MAX               10
    9.16 +#define GENRE_UNDEFINED         0
    9.17 +#define GENRE_MOVIE             1
    9.18 +#define GENRE_NEWS              2
    9.19 +#define GENRE_SHOW              3
    9.20 +#define GENRE_SPORTS            4
    9.21 +#define GENRE_CHILDREN          5
    9.22 +#define GENRE_MUSIC             6
    9.23 +#define GENRE_CULTURE           7
    9.24 +#define GENRE_SOCIAL            8
    9.25 +#define GENRE_EDUCATION         9
    9.26 +#define GENRE_LEISURE           10
    9.27 +
    9.28 +#define NRO_HOURS 3
    9.29 +
    9.30 +/* Function prototypes*/
    9.31 +static void update_service_details(MMythEpgGridWidget *object, 
    9.32 +                                   gpointer arg1, gpointer user_data);
    9.33 +static gboolean key_press_epg_grid_view(GtkWidget * widget, 
    9.34 +                                        GdkEventKey * event, 
    9.35 +                                        gpointer user_data);
    9.36 +
    9.37 +static GtkWidget *mmyth_epg_grid_widget = NULL;
    9.38 +
    9.39 +/* is a GtkEventBox */
    9.40 +static GtkWidget *program_details_area = NULL;
    9.41 +static GtkWidget *details_main_hbox = NULL;
    9.42 +static GtkWidget *details_vbox = NULL;
    9.43 +static GtkWidget *details_logo_vbox = NULL;
    9.44 +
    9.45 +/* update signal callback from MMythEpgGridWidget */
    9.46 +static void
    9.47 +update_service_details(MMythEpgGridWidget *object, gpointer arg1, gpointer user_data) 
    9.48 +{
    9.49 +	g_return_if_fail(arg1 != NULL);
    9.50 +
    9.51 +	EpgGridItem *epg_grid_item = (EpgGridItem *) arg1;
    9.52 +	
    9.53 +	gchar sel_prog_desc[100] = "<big><b>";
    9.54 +	gchar time_buffer[50];
    9.55 +
    9.56 +    /* FIXME: get first content from content_list*/
    9.57 +    GMythProgramInfo *proginfo = (GMythProgramInfo *) epg_grid_item->proginfo;
    9.58 +
    9.59 +    if(proginfo) {
    9.60 +        GString *prog_name = proginfo->title;    
    9.61 +        GString *service_name = proginfo->chanid;
    9.62 +           
    9.63 +    	if(details_vbox != NULL)
    9.64 +  	        gtk_container_remove (GTK_CONTAINER (details_main_hbox), details_vbox);	
    9.65 +    
    9.66 +        /* update service description */
    9.67 +        strcat(sel_prog_desc, service_name->str);
    9.68 +        strcat(sel_prog_desc, "</b></big>");
    9.69 +    
    9.70 +        GtkWidget *fst_line_lbl = gtk_label_new(NULL);
    9.71 +        gtk_misc_set_alignment (GTK_MISC(fst_line_lbl), 0.0, 0.0); 
    9.72 +        gtk_label_set_markup(GTK_LABEL(fst_line_lbl), sel_prog_desc);     
    9.73 +
    9.74 +        /* freeing char[] */
    9.75 +        sel_prog_desc[0] = 0;
    9.76 +        strcat(sel_prog_desc, "\t");
    9.77 +        strcat(sel_prog_desc, prog_name->str);    
    9.78 +            	        		
    9.79 +        struct tm loctime_start, loctime_end;
    9.80 +    
    9.81 +        // Convert it to local time representation. 
    9.82 +        /* FIXME: conversion from time to localtime is different
    9.83 +        in different machines */
    9.84 +        long int schedule_start_time = proginfo->startts;
    9.85 +        long int schedule_end_time   = proginfo->endts;
    9.86 +    
    9.87 +        if (localtime_r(&schedule_start_time, &loctime_start) == NULL) {
    9.88 +            g_warning ("localtime_r error in mmyth_epg_grid_view!\n");
    9.89 +        }
    9.90 +    
    9.91 +        #if 0 
    9.92 +            fprintf (stderr, asctime (loctime_start)); 
    9.93 +        #endif
    9.94 +    
    9.95 +        strftime (time_buffer, 100, "  %H:%M - ", &loctime_start);
    9.96 +        strcat(sel_prog_desc, time_buffer );
    9.97 +    
    9.98 +        if (localtime_r(&schedule_end_time, &loctime_end) == NULL) {
    9.99 +            g_warning ("localtime_r error in mmyth_epg_grid_view!\n");
   9.100 +        }
   9.101 +
   9.102 +        #if 0
   9.103 +            fprintf (stderr, asctime (loctime_end));     		    
   9.104 +        #endif
   9.105 +    
   9.106 +        strftime (time_buffer, 100, "%H:%M\n", &loctime_end);
   9.107 +        strcat(sel_prog_desc, time_buffer );
   9.108 +    
   9.109 +        GtkWidget *snd_line_lbl = gtk_label_new(NULL);
   9.110 +        gtk_misc_set_alignment (GTK_MISC(snd_line_lbl), 0.0, 0.0); 
   9.111 +        gtk_label_set_markup(GTK_LABEL(snd_line_lbl), sel_prog_desc);     
   9.112 +    
   9.113 +        // add the current selected program description to the label
   9.114 +        details_vbox = gtk_vbox_new(FALSE, 0);
   9.115 +        GtkWidget *fst_line_hbox = gtk_hbox_new(FALSE, 0);        
   9.116 +        
   9.117 +        gtk_box_pack_start (GTK_BOX (fst_line_hbox),
   9.118 +                            fst_line_lbl, FALSE, FALSE, 6);
   9.119 +        gtk_box_pack_start (GTK_BOX (details_vbox),
   9.120 +                            fst_line_hbox, FALSE, FALSE, 0);
   9.121 +        gtk_box_pack_start (GTK_BOX (details_vbox),
   9.122 +                            snd_line_lbl, FALSE, FALSE, 0);
   9.123 +        gtk_box_pack_start (GTK_BOX (details_main_hbox),
   9.124 +                            details_vbox, FALSE, FALSE, 0);
   9.125 +        
   9.126 +        gtk_widget_show_all(details_main_hbox);
   9.127 +    }        
   9.128 +}
   9.129 +
   9.130 +/* Callback for hardware keys */
   9.131 +static gboolean
   9.132 +key_press_epg_grid_view(GtkWidget * widget, 
   9.133 +                        GdkEventKey * event, gpointer user_data)
   9.134 +{
   9.135 +    MMythEpgGridWidget *mmyth_epg_grid_widget = (MMythEpgGridWidget *) user_data;
   9.136 +
   9.137 +    return mmyth_epg_grid_widget_key_press(mmyth_epg_grid_widget, widget, event); 
   9.138 +}
   9.139 +
   9.140 +GtkWidget *
   9.141 +epg_grid_view_new (MMythUi* mmyth_ui) 
   9.142 +{
   9.143 +    GtkWidget *scrolled_window;
   9.144 +    scrolled_window = gtk_scrolled_window_new (NULL, NULL);
   9.145 +    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
   9.146 +                                    GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);                   
   9.147 +    
   9.148 +    gtk_widget_modify_bg(scrolled_window, GTK_STATE_NORMAL, &main_bg_color);  
   9.149 +    
   9.150 +    GtkWidget *main_vbox = gtk_vbox_new (FALSE, 0);      
   9.151 +    //gtk_container_set_border_width(main_vbox, 4);        
   9.152 +    
   9.153 +    GtkWidget *details_event_box = gtk_event_box_new();               
   9.154 +    gtk_widget_modify_bg(details_event_box, GTK_STATE_NORMAL, &main_bg_color);  
   9.155 +    
   9.156 +    program_details_area = gtk_vbox_new (FALSE, 0);
   9.157 +    gtk_container_add (GTK_CONTAINER (details_event_box),
   9.158 +                       program_details_area);   
   9.159 +    gtk_container_set_border_width(GTK_CONTAINER (program_details_area), 4);        
   9.160 +
   9.161 +	details_main_hbox = gtk_hbox_new (FALSE, 10);    
   9.162 +
   9.163 +	gtk_box_pack_start (GTK_BOX (program_details_area),
   9.164 +	                    details_main_hbox, FALSE, FALSE, 0);                    
   9.165 +	                    
   9.166 +	details_logo_vbox = gtk_vbox_new (FALSE, 0);      	 
   9.167 +    
   9.168 +	GtkWidget *details_desc_vbox = gtk_vbox_new (FALSE, 0);      
   9.169 +
   9.170 +    gtk_box_pack_start (GTK_BOX (details_main_hbox),
   9.171 +	                    details_desc_vbox, FALSE, FALSE, 0);                    
   9.172 +    gtk_box_pack_start (GTK_BOX (details_main_hbox),
   9.173 +	                    details_logo_vbox, FALSE, FALSE, 0);                    	
   9.174 +	
   9.175 +    gtk_widget_set_size_request (program_details_area, -1, 120);          
   9.176 +    
   9.177 +    mmyth_epg_grid_widget = mmyth_epg_grid_widget_new();
   9.178 +    g_signal_connect(mmyth_epg_grid_widget, "selection_updated", 
   9.179 +                     G_CALLBACK (update_service_details), NULL);    
   9.180 +
   9.181 +    /* select by default the first service */
   9.182 +    /* depends on mount services */
   9.183 +    if (MMYTH_EPG_GRID_WIDGET(mmyth_epg_grid_widget)->epg_view_model) {
   9.184 +	    GList *fst_service = (GList *) 
   9.185 +	    	MMYTH_EPG_GRID_WIDGET(mmyth_epg_grid_widget)->epg_view_model->data;
   9.186 +    	mmyth_epg_grid_widget_update_service(MMYTH_EPG_GRID_WIDGET(mmyth_epg_grid_widget),
   9.187 +                                         fst_service);
   9.188 +    }
   9.189 +    
   9.190 +    gtk_box_pack_start (GTK_BOX (main_vbox),
   9.191 +                        details_event_box, FALSE, FALSE, 0); 
   9.192 +    gtk_box_pack_start (GTK_BOX (main_vbox),
   9.193 +                        gtk_hseparator_new(), FALSE, FALSE, 0);         
   9.194 +    gtk_box_pack_start (GTK_BOX (main_vbox),
   9.195 +                        mmyth_epg_grid_widget, FALSE, FALSE, 0);                    
   9.196 +
   9.197 +    gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window),
   9.198 +                                           main_vbox);    
   9.199 +    
   9.200 +    /* Add hardware button listener to application */
   9.201 +    g_signal_connect(mmyth_ui->main_window, "key_press_event", 
   9.202 +                     G_CALLBACK (key_press_epg_grid_view), mmyth_epg_grid_widget);    
   9.203 +
   9.204 +    gtk_widget_show_all (scrolled_window);
   9.205 +    
   9.206 +    return scrolled_window;
   9.207 +}
   9.208 +
   9.209 +/*
   9.210 +DVBHScheduleEvent * 
   9.211 +mmyth_epg_grid_view_get_selected_schedule()
   9.212 +{
   9.213 +    return mmyth_epg_grid_get_selected_schedule
   9.214 +            (MMYTH_EPG_GRID_WIDGET(mmyth_epg_grid_widget));
   9.215 +}
   9.216 +*/
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/maemo-ui/src/mmyth_epg_grid_view.h	Thu Sep 28 16:02:14 2006 +0100
    10.3 @@ -0,0 +1,8 @@
    10.4 +#ifndef MMYTH_ESG_GRID_VIEW_H_
    10.5 +#define MMYTH_ESG_GRID_VIEW_H_
    10.6 +
    10.7 +#include "mmyth_ui.h"
    10.8 +
    10.9 +GtkWidget *epg_grid_view_new(MMythUi * mmyth_ui);
   10.10 +
   10.11 +#endif /* MMYTH_ESG_GRID_VIEW_H_ */
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/maemo-ui/src/mmyth_epg_grid_widget.c	Thu Sep 28 16:02:14 2006 +0100
    11.3 @@ -0,0 +1,622 @@
    11.4 +#include <gtk/gtksignal.h>
    11.5 +#include <gdk/gdkevents.h>
    11.6 +#include <gdk/gdkkeysyms.h>
    11.7 +
    11.8 +#include "mmyth_uicommon.h"
    11.9 +#include "mmyth_epg_grid_widget.h"
   11.10 +
   11.11 +#include "gmyth_util.h" 
   11.12 +#include "gmyth_epg.h"
   11.13 +
   11.14 +#define PIXELS_HOUR 105
   11.15 +#define PROGRAM_SEPARATION 2
   11.16 +
   11.17 +enum {
   11.18 +  SELECTION_UPDATED_SIGNAL,
   11.19 +  LAST_SIGNAL
   11.20 +};
   11.21 +
   11.22 +struct _MMythEpgGridWidgetPrivate {
   11.23 +    /* private widget components */
   11.24 +    GtkWidget *epg_channels_vbox;
   11.25 +    GtkWidget *epg_programs_vbox;
   11.26 + 
   11.27 +    GHashTable *service_model_hash;
   11.28 +    
   11.29 +    /* guidegrid attributes */
   11.30 +    gboolean show_favorites;
   11.31 +    gint current_start_channel_id;
   11.32 +    
   11.33 +    time_t current_start_time;
   11.34 +    time_t current_end_time;
   11.35 +
   11.36 +    guint selected_channel_index;
   11.37 +    
   11.38 +    /* GList of ProgramInfo for each Channel */
   11.39 +    GList * program_list[MAX_DISPLAY_CHANS];
   11.40 +    GList * channel_list;
   11.41 +    
   11.42 +    GMythEPG *mmyth_epg;
   11.43 +    
   11.44 +    gint DISPLAY_CHANS;
   11.45 +};
   11.46 +
   11.47 +static void mmyth_epg_grid_widget_class_init          (MMythEpgGridWidgetClass *klass);
   11.48 +static void mmyth_epg_grid_widget_init                (MMythEpgGridWidget *object);
   11.49 +static void mmyth_epg_grid_widget_private_init        (MMythEpgGridWidgetPrivate *private);
   11.50 +static void mmyth_epg_grid_widget_mount_services      (MMythEpgGridWidget *object, 
   11.51 +                                                       int start_time, int end_time);
   11.52 +static void mmyth_epg_grid_widget_mount_header        (MMythEpgGridWidget *object);
   11.53 +static void mmyth_epg_grid_widget_clicked             (GtkWidget* widget, 
   11.54 +                                                       GdkEventExpose *event, 
   11.55 +                                                       gpointer data);
   11.56 +static GtkWidget *create_event_box_lbl                (gchar *str, int width, 
   11.57 +                                                       const GdkColor *bg_color, 
   11.58 +                                                       const GdkColor *fg_color);
   11.59 +
   11.60 +static void mmyth_epg_grid_widget_fill_programinfos(MMythEpgGridWidgetPrivate *private);
   11.61 +static void mmyth_epg_grid_widget_fill_program_row_infos(
   11.62 +                    MMythEpgGridWidgetPrivate *private, 
   11.63 +                    unsigned int chanNum, unsigned int row);
   11.64 +
   11.65 +static gint mmyth_epg_grid_widget_signals[LAST_SIGNAL] = { 0 };
   11.66 +
   11.67 +G_DEFINE_TYPE(MMythEpgGridWidget, mmyth_epg_grid_widget, GTK_TYPE_EVENT_BOX)
   11.68 +    
   11.69 +static void
   11.70 +mmyth_epg_grid_widget_class_init (MMythEpgGridWidgetClass *klass)
   11.71 +{
   11.72 +  g_type_class_add_private (klass, sizeof (MMythEpgGridWidgetPrivate));
   11.73 +  
   11.74 +  mmyth_epg_grid_widget_signals[SELECTION_UPDATED_SIGNAL] = g_signal_new (
   11.75 +                     "selection_updated",
   11.76 +					 G_TYPE_FROM_CLASS(klass), 
   11.77 +					 G_SIGNAL_RUN_FIRST,
   11.78 +					 0,
   11.79 +                     NULL,
   11.80 +                     NULL,
   11.81 +					 g_cclosure_marshal_VOID__POINTER, 
   11.82 +                     G_TYPE_NONE, 
   11.83 +                     1,
   11.84 +                     G_TYPE_POINTER);
   11.85 +}
   11.86 +
   11.87 +static void 
   11.88 +mmyth_epg_grid_widget_private_init (MMythEpgGridWidgetPrivate *private)
   11.89 +{
   11.90 +    time_t cur_time;
   11.91 +    
   11.92 +    g_return_if_fail(private != NULL);     
   11.93 +
   11.94 +    private->epg_channels_vbox   = NULL;
   11.95 +    private->epg_programs_vbox   = NULL;
   11.96 +    private->service_model_hash  = NULL;
   11.97 +
   11.98 +    private->show_favorites = FALSE;
   11.99 +    private->current_start_channel_id = -1;
  11.100 +
  11.101 +    /* Selected the first diplayable channel initially */
  11.102 +    private->selected_channel_index = 0;
  11.103 +        
  11.104 +    /* TODO fix the current start/end time */
  11.105 +    private->current_start_time = time(&cur_time);
  11.106 +    private->current_end_time = time(&cur_time) + 10800;   
  11.107 +    
  11.108 +    private->DISPLAY_CHANS = MAX_DISPLAY_CHANS;
  11.109 +    
  11.110 +    // TODO: Close the epg and unref it in dispose call
  11.111 +    private->mmyth_epg = gmyth_epg_new ();
  11.112 +    if (!gmyth_epg_connect (private->mmyth_epg)) {
  11.113 +    	g_warning ("[%s] Could not connect mysql handler to db", __FUNCTION__);
  11.114 +    	g_object_unref (private->mmyth_epg);
  11.115 +    	private->mmyth_epg = NULL;
  11.116 +    }
  11.117 +}
  11.118 +
  11.119 +static void
  11.120 +mmyth_epg_grid_widget_init (MMythEpgGridWidget *mmyth_epg_grid_widget)
  11.121 +{
  11.122 +    MMythEpgGridWidgetPrivate *private = 
  11.123 +        MMYTH_EPG_GRID_WIDGET_GET_PRIVATE(mmyth_epg_grid_widget);
  11.124 +    
  11.125 +    /* init private fields */
  11.126 +    mmyth_epg_grid_widget_private_init(private);
  11.127 +
  11.128 +    mmyth_epg_grid_widget->epg_view_model      = NULL;
  11.129 +    mmyth_epg_grid_widget->selected_grid_item  = NULL;
  11.130 +
  11.131 +    GtkWidget *epg_event_box = GTK_WIDGET(mmyth_epg_grid_widget);
  11.132 +    gtk_widget_modify_bg(epg_event_box, GTK_STATE_NORMAL, &main_bg_color);
  11.133 +    gtk_widget_set_size_request (epg_event_box, 0, 125);
  11.134 +    
  11.135 +    GtkWidget *epg_main_hbox = gtk_hbox_new (FALSE, 10);
  11.136 +    gtk_container_set_border_width(GTK_CONTAINER (epg_main_hbox), 10);
  11.137 +    
  11.138 +    gtk_container_add (GTK_CONTAINER (epg_event_box),
  11.139 +                       epg_main_hbox);
  11.140 +		        
  11.141 +    /* channels vbox */
  11.142 +    GtkWidget *epg_channels_vbox = gtk_vbox_new (FALSE, 3); 
  11.143 +    private->epg_channels_vbox = epg_channels_vbox; 
  11.144 +
  11.145 +    /* programs vbox */
  11.146 +    GtkWidget *epg_programs_vbox = gtk_vbox_new (FALSE, 3);
  11.147 +    private->epg_programs_vbox = epg_programs_vbox;
  11.148 +    
  11.149 +    /* packing start */
  11.150 +    gtk_box_pack_start (GTK_BOX (epg_main_hbox),
  11.151 +	                epg_channels_vbox, FALSE, FALSE, 0);
  11.152 +    gtk_box_pack_start (GTK_BOX (epg_main_hbox),
  11.153 +                        epg_programs_vbox, FALSE, FALSE, 0);
  11.154 +
  11.155 +    /* table header (first line) */  
  11.156 +    mmyth_epg_grid_widget_mount_header(mmyth_epg_grid_widget);                 
  11.157 +    
  11.158 +    /* service programs */ 
  11.159 +    /* mount service programs with current time */
  11.160 +    mmyth_epg_grid_widget_mount_services(mmyth_epg_grid_widget, 
  11.161 +                                         private->current_start_time,
  11.162 +                                         private->current_end_time);                                           
  11.163 +}
  11.164 +
  11.165 +GtkWidget*
  11.166 +mmyth_epg_grid_widget_new ()
  11.167 +{
  11.168 +  return GTK_WIDGET ( gtk_type_new (mmyth_epg_grid_widget_get_type ()));
  11.169 +}
  11.170 +
  11.171 +static void
  11.172 +mmyth_epg_grid_widget_mount_services(MMythEpgGridWidget *mmyth_epg_grid_widget, 
  11.173 +                                     int start_time, int end_time)
  11.174 +{
  11.175 +    GList *proglist;
  11.176 +    GList *channel_list = NULL;
  11.177 +    GMythChannelInfo *channel_info;
  11.178 +
  11.179 +    int chanid;
  11.180 +    MMythEpgGridWidgetPrivate *private = 
  11.181 +        MMYTH_EPG_GRID_WIDGET_GET_PRIVATE(mmyth_epg_grid_widget);
  11.182 +	
  11.183 +	// update view_model
  11.184 +	/* FIXME shallow free or recursive? */
  11.185 +	if(mmyth_epg_grid_widget->epg_view_model != NULL) {
  11.186 +		g_list_free(mmyth_epg_grid_widget->epg_view_model);
  11.187 +		mmyth_epg_grid_widget->epg_view_model = NULL;
  11.188 +	}
  11.189 +	
  11.190 +	if(private->service_model_hash != NULL) {
  11.191 +		g_hash_table_destroy(private->service_model_hash);
  11.192 +	}
  11.193 +
  11.194 +	private->service_model_hash = g_hash_table_new(NULL, NULL);
  11.195 +
  11.196 +    /* fill program infos from db */
  11.197 +    mmyth_epg_grid_widget_fill_programinfos(private);
  11.198 +    
  11.199 +    channel_list = private->channel_list;
  11.200 + 
  11.201 +    /* for each channel get_programs() */
  11.202 +    for (chanid=0; channel_list &&
  11.203 +                   chanid < private->DISPLAY_CHANS; chanid++) {
  11.204 +        proglist = (GList *) private->program_list[chanid];        
  11.205 +    
  11.206 +        channel_info = (GMythChannelInfo *) channel_list->data;
  11.207 +        channel_list = g_list_next(channel_list);        
  11.208 +
  11.209 +        /* Service Title*/
  11.210 +        GString *name = NULL;
  11.211 +        if (channel_info->channel_name)
  11.212 +        	name = g_string_new (channel_info->channel_name->str);
  11.213 +		
  11.214 +		GdkColor title_bg_color;
  11.215 +		title_bg_color.red = 5000;
  11.216 +		title_bg_color.green = 9000;
  11.217 +		title_bg_color.blue = 40000;        
  11.218 +		
  11.219 +		GdkColor title_fg_color;
  11.220 +		title_fg_color.red = 60000;
  11.221 +		title_fg_color.green = 60000;
  11.222 +		title_fg_color.blue = 60000;        
  11.223 +		
  11.224 +		GtkWidget *event_box_channel = create_event_box_lbl(
  11.225 +                                                        name->str, 90, 
  11.226 +									                    &title_bg_color, 
  11.227 +									                    &title_fg_color);
  11.228 +
  11.229 +        gtk_box_pack_start (GTK_BOX (private->epg_channels_vbox),
  11.230 +		                    event_box_channel, FALSE, FALSE, 0);
  11.231 +
  11.232 +  		GtkWidget *epg_line_hbox = gtk_hbox_new (FALSE, 0);      
  11.233 +
  11.234 +	    GdkColor bg_color;
  11.235 +	    bg_color.red = 5000;
  11.236 +	    bg_color.green = 30000;
  11.237 +	    bg_color.blue = 60000;        
  11.238 +	
  11.239 +	    GdkColor fg_color;
  11.240 +	    fg_color.red = 60000;
  11.241 +	    fg_color.green = 60000;
  11.242 +	    fg_color.blue = 60000;        
  11.243 +		
  11.244 +		/* Content parsing */
  11.245 +        GList *epg_grid_list = NULL;
  11.246 +
  11.247 +        GMythProgramInfo *proginfo;
  11.248 +        int pixel_count = 0;
  11.249 +        for (; proglist; proglist = proglist->next) {
  11.250 +            proginfo = (GMythProgramInfo *) proglist->data;
  11.251 +            
  11.252 +            GString *content_name = proginfo->title;
  11.253 +                    
  11.254 +       	    int initial_time, last_time, duration;
  11.255 +
  11.256 +            int schedule_start_time = proginfo->startts;
  11.257 +            int schedule_end_time   = proginfo->endts;
  11.258 +
  11.259 +	        initial_time = 
  11.260 +                (schedule_start_time < start_time) ? start_time : schedule_start_time;
  11.261 +            last_time = (schedule_end_time > end_time) ? end_time : schedule_end_time;
  11.262 +	        duration = last_time - initial_time;
  11.263 +		    
  11.264 +            // Verify program time 
  11.265 +            #if 0
  11.266 +			    g_debug ("ServiceID: %d, ScheduleID: %d\n", service->id, schedule->id);
  11.267 +                fprintf (stderr, "program time\nfrom = %d, to = %d\n", 
  11.268 +                         schedule->validFrom, schedule->validTo); 
  11.269 +                
  11.270 +                struct tm loctime;
  11.271 +    
  11.272 +                /* Convert it to local time representation. */
  11.273 +                if (localtime_r((time_t *)&schedule->validFrom, &loctime) == NULL) {
  11.274 +                    g_warning ("localtime_r error in mmyth_epg_grid_widget!\n");
  11.275 +                    return NULL;
  11.276 +                }            
  11.277 +                fprintf (stderr, asctime (&loctime)); 
  11.278 +                
  11.279 +                if (localtime_r((time_t *)&schedule->validTo, &loctime) == NULL) {
  11.280 +                    g_warning ("localtime_r error in mmyth_epg_grid_widget!\n");
  11.281 +                    return NULL;
  11.282 +                } 
  11.283 +                fprintf (stderr, asctime (&loctime)); 
  11.284 +            #endif
  11.285 +    		
  11.286 +    	    /* fprintf(stderr, "duration = %d\n", duration); */
  11.287 +    	    double duration_hour = duration / (double) 3600.0;
  11.288 +    	    /* fprintf(stderr, "duration_hour = %lf\n", duration_hour); */
  11.289 +    		
  11.290 +            int size = PIXELS_HOUR * duration_hour;
  11.291 +                
  11.292 +            /* complete hour */
  11.293 +            /* FIXME: UGLY WRONG HACK TO ALIGN PROGRAM TIME!!!*/
  11.294 +            if(last_time%3600 != 0) {
  11.295 +                size -= PROGRAM_SEPARATION;                
  11.296 +            }
  11.297 +            if(initial_time%3600 != 0) {
  11.298 +                size -= PROGRAM_SEPARATION;                
  11.299 +            }
  11.300 +
  11.301 +            pixel_count += size + PROGRAM_SEPARATION;
  11.302 +	        GtkWidget *event_box = create_event_box_lbl(content_name->str, 
  11.303 +							  size, &bg_color, 
  11.304 +							  &fg_color);
  11.305 +							  gtk_widget_add_events(event_box, 
  11.306 +							  GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
  11.307 +            
  11.308 +            /* create EpgGridItem */
  11.309 +            EpgGridItem *epg_grid_item = g_new(EpgGridItem, 1);
  11.310 +            epg_grid_item->proginfo  = proginfo;
  11.311 +            epg_grid_item->event_box = event_box;
  11.312 +            epg_grid_item->object    = mmyth_epg_grid_widget;
  11.313 +            
  11.314 +            epg_grid_list = g_list_prepend(epg_grid_list, (gpointer) epg_grid_item);                                   		                        
  11.315 +
  11.316 +     	    gtk_box_pack_start (GTK_BOX (epg_line_hbox),
  11.317 +	                            event_box, FALSE, FALSE, PROGRAM_SEPARATION);
  11.318 +	                                 
  11.319 +   	        g_signal_connect (G_OBJECT (event_box), "button-press-event",
  11.320 +		                      G_CALLBACK (mmyth_epg_grid_widget_clicked), 
  11.321 +                              (gpointer*) epg_grid_list);
  11.322 +        }
  11.323 +#if 0
  11.324 +        printf("chaind = %d!!!!" chanid);fflush(stdout);
  11.325 +#endif        
  11.326 +
  11.327 +        if(!epg_grid_list) {
  11.328 +            /* No programs for current channel */
  11.329 +            /* FIXME: size HARDCODED */
  11.330 +            GtkWidget *event_box = create_event_box_lbl("No program list available",
  11.331 +                              PIXELS_HOUR * 3, &bg_color,
  11.332 +                              &fg_color);
  11.333 +                              gtk_widget_add_events(event_box,
  11.334 +                              GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
  11.335 +
  11.336 +            /* create EpgGridItem */
  11.337 +            EpgGridItem *epg_grid_item = g_new(EpgGridItem, 1);
  11.338 +            epg_grid_item->proginfo  = NULL;
  11.339 +            epg_grid_item->event_box = event_box;
  11.340 +            epg_grid_item->object    = mmyth_epg_grid_widget;
  11.341 +
  11.342 +            epg_grid_list = g_list_prepend(epg_grid_list, (gpointer) epg_grid_item);
  11.343 +            
  11.344 +            gtk_box_pack_start (GTK_BOX (epg_line_hbox),
  11.345 +	                            event_box, FALSE, FALSE, PROGRAM_SEPARATION);            	
  11.346 +	                                 
  11.347 +   	        g_signal_connect (G_OBJECT (event_box), "button-press-event",
  11.348 +		                      G_CALLBACK (mmyth_epg_grid_widget_clicked),
  11.349 +                              (gpointer*) epg_grid_list);
  11.350 +        }
  11.351 +
  11.352 +        epg_grid_list = g_list_reverse(epg_grid_list);
  11.353 +        mmyth_epg_grid_widget->epg_view_model = 
  11.354 +              g_list_append(mmyth_epg_grid_widget->epg_view_model, epg_grid_list);
  11.355 +        
  11.356 +	    gtk_box_pack_start (GTK_BOX (private->epg_programs_vbox),
  11.357 +	                        epg_line_hbox, FALSE, FALSE,  0);                    		    		
  11.358 +    }
  11.359 +}
  11.360 +
  11.361 +static void
  11.362 +mmyth_epg_grid_widget_mount_header(MMythEpgGridWidget *mmyth_epg_grid_widget)
  11.363 +{	          	    
  11.364 +    MMythEpgGridWidgetPrivate *private = 
  11.365 +        MMYTH_EPG_GRID_WIDGET_GET_PRIVATE(mmyth_epg_grid_widget);
  11.366 +    
  11.367 +    struct tm hour_tm;
  11.368 +    const gchar name_title[] = "Today";    
  11.369 +    GtkWidget * lbl_title = gtk_label_new(name_title);
  11.370 +
  11.371 +    gtk_misc_set_alignment (GTK_MISC(lbl_title), 0.0, 0.5);
  11.372 +    
  11.373 +    gtk_box_pack_start (GTK_BOX (private->epg_channels_vbox),
  11.374 +                        lbl_title, FALSE, FALSE, 0);
  11.375 +
  11.376 +	/* hours title line */
  11.377 +    GtkWidget *epg_programs_hours_hbox = gtk_hbox_new (TRUE, 0); 
  11.378 +
  11.379 +    if (localtime_r((time_t *)&private->current_start_time, &hour_tm) == NULL) {
  11.380 +        g_warning ("localtime_r error in mmyth_epg_grid_widget!\n");
  11.381 +        return NULL;
  11.382 +    }    
  11.383 +
  11.384 +    if (hour_tm.tm_min>30) {
  11.385 +        hour_tm.tm_min = 30;
  11.386 +    } else if (hour_tm.tm_min>0) {
  11.387 +        hour_tm.tm_min = 0;
  11.388 +    }
  11.389 +        
  11.390 +    gchar hour1_str[10];
  11.391 +    strftime(hour1_str, 8, "%H:%M", &hour_tm);
  11.392 +    GtkWidget * lbl_hour1 = gtk_label_new(hour1_str);
  11.393 +    gtk_misc_set_alignment (GTK_MISC(lbl_hour1), 0.0, 0.5);    
  11.394 +	
  11.395 +    hour_tm.tm_hour++;
  11.396 +    gchar hour2_str[10];    
  11.397 +    strftime(hour2_str, 8, "%H:%M", &hour_tm);
  11.398 +    GtkWidget * lbl_hour2 = gtk_label_new(hour2_str);
  11.399 +    gtk_misc_set_alignment (GTK_MISC(lbl_hour2), 0.0, 0.5);        
  11.400 +
  11.401 +    hour_tm.tm_hour++;
  11.402 +	gchar hour3_str[10];    
  11.403 +    strftime(hour3_str, 8, "%H:%M", &hour_tm);
  11.404 +    GtkWidget * lbl_hour3 = gtk_label_new(hour3_str);
  11.405 +    gtk_misc_set_alignment (GTK_MISC(lbl_hour3), 0.0, 0.5);        
  11.406 +    
  11.407 +    gtk_box_pack_start (GTK_BOX (epg_programs_hours_hbox),
  11.408 +                        lbl_hour1, TRUE, TRUE, 0);                    
  11.409 +    gtk_box_pack_start (GTK_BOX (epg_programs_hours_hbox),
  11.410 +                        lbl_hour2, TRUE, TRUE, 0);                    
  11.411 +    gtk_box_pack_start (GTK_BOX (epg_programs_hours_hbox),
  11.412 +                        lbl_hour3, TRUE, TRUE, 0); 
  11.413 + 
  11.414 +    gtk_box_pack_start (GTK_BOX (private->epg_programs_vbox),
  11.415 +                        epg_programs_hours_hbox, FALSE, FALSE, 0);                        
  11.416 +}
  11.417 +
  11.418 +/******************************************************************************
  11.419 + *              INTERNAL CALLBACKS FOR STATE CHANGE                           *
  11.420 + *****************************************************************************/
  11.421 +static void 
  11.422 +mmyth_epg_grid_widget_deselect_service(MMythEpgGridWidget *mmyth_epg_grid_widget)
  11.423 +{
  11.424 +	EpgGridItem *epg_grid_item;
  11.425 +	
  11.426 +  	/* deselect*/
  11.427 +    if(mmyth_epg_grid_widget->selected_grid_item != NULL) {
  11.428 +    	epg_grid_item = 
  11.429 +            (EpgGridItem*) mmyth_epg_grid_widget->selected_grid_item->data;
  11.430 +    	gtk_widget_set_state(GTK_WIDGET(epg_grid_item->event_box), GTK_STATE_NORMAL);
  11.431 +    }            
  11.432 +}
  11.433 +
  11.434 +static void 
  11.435 +mmyth_epg_grid_widget_clicked (GtkWidget* widget, 
  11.436 +                               GdkEventExpose *event, gpointer data)
  11.437 +{           
  11.438 +    g_return_if_fail(data != NULL);
  11.439 +
  11.440 +    GList *epg_grid_item_list = (GList *) data;
  11.441 +    EpgGridItem *epg_grid_item = (EpgGridItem *) epg_grid_item_list->data;
  11.442 +
  11.443 +    /* update the selected service */
  11.444 +    mmyth_epg_grid_widget_update_service( epg_grid_item->object, (GList*) data );       
  11.445 +}
  11.446 +
  11.447 +void
  11.448 +mmyth_epg_grid_widget_update_service(MMythEpgGridWidget * object,
  11.449 +                                     GList *selected_grid_list)
  11.450 +{
  11.451 +    g_return_if_fail(object != NULL);
  11.452 +    g_return_if_fail(selected_grid_list != NULL);
  11.453 +		
  11.454 +	EpgGridItem *epg_grid_item = (EpgGridItem *) selected_grid_list->data;
  11.455 +
  11.456 +    mmyth_epg_grid_widget_deselect_service(epg_grid_item->object);
  11.457 +
  11.458 +    /* updating current selected schedule_item and schedule_list*/
  11.459 +    object->selected_grid_item = selected_grid_list;
  11.460 +    
  11.461 +    /* set state of the event box */
  11.462 +    gtk_widget_set_state(GTK_WIDGET(epg_grid_item->event_box), GTK_STATE_SELECTED);
  11.463 +    /* emit update signal for listeners */
  11.464 +    g_signal_emit(object, 
  11.465 +                  mmyth_epg_grid_widget_signals[SELECTION_UPDATED_SIGNAL],
  11.466 +                  0,
  11.467 +                  (gpointer) epg_grid_item);
  11.468 +}
  11.469 +
  11.470 +static GtkWidget * 
  11.471 +create_event_box_lbl(gchar *str, int width, const GdkColor *bg_color, 
  11.472 +                     const GdkColor *fg_color) 
  11.473 +{
  11.474 +    GtkWidget *event_box = gtk_event_box_new();
  11.475 +	GtkWidget *lbl = gtk_label_new(str);
  11.476 +    gtk_label_set_ellipsize(GTK_LABEL(lbl), PANGO_ELLIPSIZE_END);
  11.477 +
  11.478 +    gtk_widget_modify_bg(event_box, GTK_STATE_NORMAL, bg_color);    
  11.479 +    gtk_widget_modify_fg(lbl, GTK_STATE_NORMAL, fg_color);    
  11.480 +    
  11.481 +    /* selected colors are const*/
  11.482 +    GdkColor selected_bg_color;
  11.483 +    selected_bg_color.red = 100;
  11.484 +    selected_bg_color.green = 40000;
  11.485 +    selected_bg_color.blue = 100;        
  11.486 +
  11.487 +    GdkColor selected_fg_color;
  11.488 +    selected_fg_color.red = 100;
  11.489 +    selected_fg_color.green = 100;
  11.490 +    selected_fg_color.blue = 100;        
  11.491 +            
  11.492 +    gtk_widget_modify_bg(event_box, GTK_STATE_SELECTED, &selected_bg_color);    
  11.493 +    gtk_widget_modify_fg(lbl, GTK_STATE_SELECTED, &selected_fg_color);    
  11.494 +    
  11.495 +    gtk_misc_set_alignment (GTK_MISC(lbl), 0.0, 0.5);    
  11.496 +	gtk_container_add (GTK_CONTAINER (event_box),
  11.497 +                       lbl);
  11.498 +	gtk_widget_set_size_request(event_box, width, -1);
  11.499 +	                       
  11.500 +    return event_box;
  11.501 +}
  11.502 +
  11.503 +/******************************************************************************
  11.504 + *                            METHODS                                         *
  11.505 + *****************************************************************************/
  11.506 +
  11.507 +/* Callback for hardware keys */
  11.508 +gboolean
  11.509 +mmyth_epg_grid_widget_key_press (MMythEpgGridWidget * object, 
  11.510 +                                 GtkWidget * widget, GdkEventKey * event)
  11.511 +{
  11.512 +    MMythEpgGridWidgetPrivate *private = 
  11.513 +        MMYTH_EPG_GRID_WIDGET_GET_PRIVATE(object);
  11.514 +  
  11.515 +    EpgGridItem *epg_grid_item;
  11.516 +    GList *tmp;
  11.517 +    
  11.518 +    /* List of selected_grid_item */
  11.519 +    GList *selected_view_model;
  11.520 +    
  11.521 +    gint channel_index;
  11.522 +    
  11.523 +	if(object->selected_grid_item == NULL) {
  11.524 +        g_warning ("No program selected");
  11.525 +	    return FALSE;
  11.526 +	} 
  11.527 +    
  11.528 +    epg_grid_item = (EpgGridItem*) object->selected_grid_item->data;    
  11.529 +    
  11.530 +    channel_index = private->selected_channel_index;
  11.531 +    
  11.532 +    switch (event->keyval) {
  11.533 +        case GDK_Up:        
  11.534 +            selected_view_model = g_list_nth( object->epg_view_model, channel_index - 1 );
  11.535 +            if(selected_view_model != NULL) {
  11.536 +                private->selected_channel_index = channel_index - 1;
  11.537 +   	            tmp = (GList *) selected_view_model->data;               
  11.538 +                /* TODO: select a better centralized item 
  11.539 +                   currently is picking the 1st or last item */
  11.540 +                if(g_list_next(object->selected_grid_item) == NULL &&
  11.541 +                   g_list_previous(object->selected_grid_item) != NULL) {
  11.542 +                    /* in this case the new selected will be the last */ 
  11.543 +                    tmp = g_list_last(tmp);
  11.544 +                }
  11.545 +
  11.546 +	            /* update the selected service */
  11.547 +                mmyth_epg_grid_widget_update_service( object, tmp );
  11.548 +            }    
  11.549 +        return TRUE;         
  11.550 +        case GDK_Down:
  11.551 +            selected_view_model = g_list_nth( object->epg_view_model, channel_index + 1 );            
  11.552 +            if(selected_view_model != NULL) {   	            
  11.553 +                private->selected_channel_index = channel_index + 1;
  11.554 +   	            tmp = (GList *) selected_view_model->data;
  11.555 +                /* TODO: select a better centralized item 
  11.556 +                   currently is picking the 1st or last item */
  11.557 +                if(g_list_next(object->selected_grid_item) == NULL &&
  11.558 +                   g_list_previous(object->selected_grid_item) != NULL) {
  11.559 +                    /* in this case the new selected will be the last */ 
  11.560 +                    tmp = g_list_last(tmp);
  11.561 +                }
  11.562 +
  11.563 +	            /* update the selected service */
  11.564 +                mmyth_epg_grid_widget_update_service( object, tmp );
  11.565 +            }
  11.566 +        return TRUE;        
  11.567 +        case GDK_Left:    
  11.568 +            tmp = g_list_previous( object->selected_grid_item );
  11.569 +            if(tmp != NULL) {
  11.570 +	            /* update the selected service */
  11.571 +                mmyth_epg_grid_widget_update_service( object, tmp );
  11.572 +            }
  11.573 +        return TRUE;        
  11.574 +        case GDK_Right:
  11.575 +            tmp = g_list_next( object->selected_grid_item );
  11.576 +            if(tmp != NULL) {
  11.577 +	            /* update the selected service */
  11.578 +                mmyth_epg_grid_widget_update_service( object, tmp );
  11.579 +            }
  11.580 +        return TRUE;        
  11.581 +	    default:
  11.582 +	    return TRUE;
  11.583 +    }
  11.584 +    
  11.585 +    return FALSE;
  11.586 +}
  11.587 +
  11.588 +static void 
  11.589 +mmyth_epg_grid_widget_fill_programinfos (MMythEpgGridWidgetPrivate *private)
  11.590 +{
  11.591 +    GList *channels_list = NULL;
  11.592 +    int y;
  11.593 +
  11.594 +    if ((private->mmyth_epg != NULL) &&
  11.595 +	   	(gmyth_epg_get_channel_list (private->mmyth_epg, &channels_list) < 0 )) {
  11.596 +			private->channel_list = NULL;
  11.597 +			return;
  11.598 +    }
  11.599 +    
  11.600 +    private->channel_list = channels_list;
  11.601 +    
  11.602 +    for (y = 0; y < private->DISPLAY_CHANS && channels_list; y++) {
  11.603 +        GMythChannelInfo *channel_info = (GMythChannelInfo *) channels_list->data;
  11.604 +
  11.605 +        mmyth_epg_grid_widget_fill_program_row_infos(
  11.606 +                            private, channel_info->channel_ID, y);
  11.607 +
  11.608 +        channels_list = g_list_next (channels_list);
  11.609 +    }
  11.610 +}
  11.611 +
  11.612 +static void 
  11.613 +mmyth_epg_grid_widget_fill_program_row_infos(MMythEpgGridWidgetPrivate *private,
  11.614 +                                             guint chanNum, guint row)
  11.615 +{    
  11.616 +    gint res =  gmyth_epg_get_program_list (private->mmyth_epg,
  11.617 +    					&(private->program_list[row]),
  11.618 +                        chanNum, private->current_start_time, 
  11.619 +                        private->current_end_time);
  11.620 +                        
  11.621 +    if (res < 0) {
  11.622 +    	g_warning ("[%s] Error while retrieving epg programs", __FUNCTION__);
  11.623 +    }
  11.624 +}
  11.625 +    
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/maemo-ui/src/mmyth_epg_grid_widget.h	Thu Sep 28 16:02:14 2006 +0100
    12.3 @@ -0,0 +1,74 @@
    12.4 +#ifndef __MMYTH_EPG_GRID_WIDGET_H__
    12.5 +#define __MMYTH_EPG_GRID_WIDGET_H__
    12.6 +
    12.7 +#include <glib-object.h>
    12.8 +#include <gdk/gdk.h>
    12.9 +#include <gtk/gtkvbox.h>
   12.10 +#include <gtk/gtkeventbox.h>
   12.11 +
   12.12 +#include "gmyth_common.h"
   12.13 +
   12.14 +#define MAX_DISPLAY_CHANS 4
   12.15 +
   12.16 +G_BEGIN_DECLS
   12.17 +
   12.18 +#define MMYTH_EPG_GRID_WIDGET_TYPE               (mmyth_epg_grid_widget_get_type ())
   12.19 +#define MMYTH_EPG_GRID_WIDGET(obj)               (GTK_CHECK_CAST ((obj), MMYTH_EPG_GRID_WIDGET_TYPE, MMythEpgGridWidget))
   12.20 +#define MMYTH_EPG_GRID_WIDGET_CLASS(klass)       (GTK_CHECK_CLASS_CAST ((klass), MMYTH_EPG_GRID_WIDGET_TYPE, MMythEpgGridWidgetClass))
   12.21 +#define IS_MMYTH_EPG_GRID_WIDGET(obj)            (GTK_CHECK_TYPE ((obj), MMYTH_EPG_GRID_WIDGET_TYPE))
   12.22 +#define IS_MMYTH_EPG_GRID_WIDGET_CLASS(klass)    (GTK_CHECK_CLASS_TYPE ((klass), MMYTH_EPG_GRID_WIDGET_TYPE))
   12.23 +#define MMYTH_EPG_GRID_WIDGET_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), MMYTH_EPG_GRID_WIDGET_TYPE, MMythEpgGridWidgetClass))
   12.24 +#define MMYTH_EPG_GRID_WIDGET_GET_PRIVATE(obj)   (G_TYPE_INSTANCE_GET_PRIVATE ((obj), MMYTH_EPG_GRID_WIDGET_TYPE, MMythEpgGridWidgetPrivate))
   12.25 +
   12.26 +
   12.27 +typedef struct _MMythEpgGridWidget         MMythEpgGridWidget;
   12.28 +typedef struct _MMythEpgGridWidgetClass    MMythEpgGridWidgetClass;
   12.29 +typedef struct _MMythEpgGridWidgetPrivate  MMythEpgGridWidgetPrivate;
   12.30 +
   12.31 +struct _MMythEpgGridWidgetClass
   12.32 +{
   12.33 +  GtkEventBoxClass parent_class;
   12.34 +
   12.35 +  /* callbacks */
   12.36 +  /* no one for now */
   12.37 +};
   12.38 +
   12.39 +struct _MMythEpgGridWidget
   12.40 +{
   12.41 +    GtkEventBox event_box;
   12.42 +
   12.43 +    /* Selected Widgets Logic*/
   12.44 +    /* List os Service Model in the current view
   12.45 +     * the data of this list are GList for the programs
   12.46 +     * of each service */
   12.47 +    GList *epg_view_model;
   12.48 +
   12.49 +    /* Selected Schedule Item*/
   12.50 +    GList *selected_grid_item;  
   12.51 +};
   12.52 +
   12.53 +
   12.54 +GType          mmyth_epg_grid_widget_get_type        (void);
   12.55 +GtkWidget*     mmyth_epg_grid_widget_new             (void);
   12.56 +/*DVBHScheduleEvent*    mmyth_epg_grid_get_selected_schedule  (MMythEpgGridWidget * object);*/
   12.57 +void           mmyth_epg_grid_widget_update_service  (MMythEpgGridWidget * object, 
   12.58 +                                                      GList *epg_grid_item_node);
   12.59 +gboolean       mmyth_epg_grid_widget_key_press       (MMythEpgGridWidget * object, 
   12.60 +                                                      GtkWidget * widget, 
   12.61 +                                                      GdkEventKey * event);
   12.62 +
   12.63 +typedef struct _EpgGridItem EpgGridItem;
   12.64 +
   12.65 +/* FIXME: auxiliary struct */
   12.66 +struct _EpgGridItem {
   12.67 +
   12.68 +    GMythProgramInfo *proginfo;
   12.69 +    GtkWidget *event_box;
   12.70 +
   12.71 +    /* for callback purposes */
   12.72 +    MMythEpgGridWidget *object;
   12.73 +};
   12.74 +
   12.75 +G_END_DECLS
   12.76 +
   12.77 +#endif /* __MMYTH_EPG_GRID_WIDGET_H__ */
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/maemo-ui/src/mmyth_main.c	Thu Sep 28 16:02:14 2006 +0100
    13.3 @@ -0,0 +1,104 @@
    13.4 +
    13.5 +#include <gtk/gtk.h>
    13.6 +
    13.7 +#include "config.h"
    13.8 +
    13.9 +#ifdef MAEMO_PLATFORM
   13.10 +#include "hildon-widgets/hildon-program.h"
   13.11 +#include "hildon-widgets/hildon-window.h"
   13.12 +#endif
   13.13 +
   13.14 +
   13.15 +#include "gmyth_remote_encoder.h"
   13.16 +#include "gmyth_settings.h"
   13.17 +#include "gmyth_context.h"
   13.18 +#include "gmyth_tvchain.h"
   13.19 +#include "gmyth_remote_util.h"
   13.20 +
   13.21 +#include "mmyth_ui.h"
   13.22 +#include "mmyth_tvplayer.h"
   13.23 +
   13.24 +static void
   13.25 +cb_destroy (GtkWidget * widget, gpointer data)
   13.26 +{
   13.27 +    MMythUi *mmyth_ui = (MMythUi *) data;
   13.28 +
   13.29 +    if (mmyth_ui->tvplayer != NULL) {
   13.30 +    	if (mmyth_tvplayer_is_playing (mmyth_ui->tvplayer) )
   13.31 +    		mmyth_tvplayer_stop_playing (mmyth_ui->tvplayer);
   13.32 +    }
   13.33 +
   13.34 +	mmyth_ui_finalize (mmyth_ui);
   13.35 +	
   13.36 +    gtk_main_quit ();
   13.37 +}
   13.38 +
   13.39 +#ifdef NDEBUG
   13.40 +static void
   13.41 +debug_error_func( const gchar*log_domain, GLogLevelFlags log_level, const gchar *message,
   13.42 +	gpointer user_data )
   13.43 +
   13.44 +{
   13.45 +	/* leave this with NO print out messages, once you need to disable debug messages! */
   13.46 +	//g_print ( "[%s] DEBUG messages disabled!\n", __FUNCTION__ );
   13.47 +}
   13.48 +#endif
   13.49 +
   13.50 +gint
   13.51 +main (gint argc, gchar * argv[])
   13.52 +{
   13.53 +    GtkWidget *window;
   13.54 +    MMythUi *mmyth_ui;
   13.55 +#ifdef MAEMO_PLATFORM
   13.56 +    HildonProgram *program = NULL;
   13.57 +#endif
   13.58 +
   13.59 +    /* init threads */
   13.60 +    g_thread_init (NULL);
   13.61 +
   13.62 +    /* Initializes GTK */
   13.63 +    gtk_init (&argc, &argv);
   13.64 +    gst_init (&argc, &argv);
   13.65 +#ifdef NDEBUG
   13.66 + g_log_set_default_handler( debug_error_func, NULL );
   13.67 +#endif
   13.68 +
   13.69 +    /* Init libmmyth context */
   13.70 +    gmyth_context_initialize ();
   13.71 +	
   13.72 +#ifndef MAEMO_PLATFORM
   13.73 +    /* create the main window */
   13.74 +    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   13.75 +    gtk_widget_set_size_request (window, MAIN_WINDOW_WIDTH, MAIN_WINDOW_HEIGHT);
   13.76 +    gtk_window_set_title (GTK_WINDOW (window), "Mythtv Frontend");
   13.77 +#else
   13.78 +    /* Creating Hildonized main view */
   13.79 +    program = HILDON_PROGRAM(hildon_program_get_instance());
   13.80 +    window = hildon_window_new();
   13.81 +
   13.82 +    //g_signal_connect(G_OBJECT(window), "delete_event", gtk_main_quit, NULL);
   13.83 +
   13.84 +    hildon_program_add_window(program, HILDON_WINDOW (window));
   13.85 +    g_set_application_name("Maemo Mythtv"); 
   13.86 +#endif
   13.87 +   
   13.88 +    /* Initializes MMyth Widgets */
   13.89 +#ifdef MAEMO_PLATFORM
   13.90 +    mmyth_ui = mmyth_ui_initialize (program, window);
   13.91 +#else    
   13.92 +    mmyth_ui = mmyth_ui_initialize (window);
   13.93 +#endif
   13.94 +    
   13.95 +    //mmyth_ui->loop = g_main_loop_new (NULL, FALSE);
   13.96 +
   13.97 +    /* Connect destroy signal handling */
   13.98 +    g_signal_connect (window, "destroy", G_CALLBACK (cb_destroy), mmyth_ui);
   13.99 +
  13.100 +    /* Shows main window and start gtk loop */
  13.101 +    gtk_widget_show (window);
  13.102 +
  13.103 +    gtk_main ();
  13.104 +
  13.105 +    return 0;
  13.106 +}
  13.107 +
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/maemo-ui/src/mmyth_recordui.c	Thu Sep 28 16:02:14 2006 +0100
    14.3 @@ -0,0 +1,332 @@
    14.4 +#include<gtk/gtk.h>
    14.5 +#include<glib.h>
    14.6 +#include <sys/types.h>
    14.7 +#include <sys/stat.h>
    14.8 +#include <unistd.h>
    14.9 +#include <string.h>
   14.10 +#include <stdio.h>
   14.11 +#include <stdlib.h>
   14.12 +
   14.13 +#include "mmyth_ui.h"
   14.14 +#include "mmyth_recordui.h"
   14.15 +
   14.16 +/* GMyth library includes */
   14.17 +#include "gmyth_scheduler.h"
   14.18 +#include "gmyth_util.h"
   14.19 +
   14.20 +enum {
   14.21 +	START_DATE_COLUMN = 0,
   14.22 +	TITLE_COLUMN,
   14.23 +	CHAN_ID_COLUMN,
   14.24 +	END_TIME_COLUMN,
   14.25 +	RECORD_ID_COLUMN,
   14.26 +	BASENAME_COLUMN,
   14.27 +	N_COLUMNS
   14.28 +};
   14.29 +
   14.30 +gboolean
   14.31 +mmyth_recordui_reload_all (MMythRecordUI *recordui)
   14.32 +{
   14.33 +	gboolean res = FALSE;
   14.34 +
   14.35 +	res = mmyth_recordui_reload_schedule (recordui);
   14.36 +		
   14.37 +	res = res & mmyth_recordui_reload_record (recordui);
   14.38 +	
   14.39 +	
   14.40 +	if (!res)
   14.41 +		g_warning ("[%s] Error while reloading schedule and recording content", __FUNCTION__);
   14.42 +		
   14.43 +	return res;
   14.44 +}
   14.45 +
   14.46 +gboolean
   14.47 +mmyth_recordui_reload_schedule (MMythRecordUI *recordui)
   14.48 +{
   14.49 +	gint new_row = 0;
   14.50 +	ScheduleInfo *schedule_info;
   14.51 +	GList *schedule_list;
   14.52 +	GtkTreeIter iter;
   14.53 +    GString *start_date_time = NULL;
   14.54 +    GString *end_date_time = NULL;
   14.55 +    GString *str_aux = g_string_new("");
   14.56 +	gint res;
   14.57 +
   14.58 +	gtk_tree_store_clear(recordui->sch_tree_store);	
   14.59 +
   14.60 +	res = gmyth_scheduler_get_schedule_list(recordui->scheduler, &(schedule_list));
   14.61 +	if (res < 0) {
   14.62 +		g_warning ("[%s] Retrieved NULL list of scheduled data from database", 
   14.63 +                   __FUNCTION__);
   14.64 +		return FALSE;
   14.65 +	}
   14.66 +
   14.67 +	for ( ; schedule_list; schedule_list = schedule_list->next) {
   14.68 + 	  	schedule_info = (ScheduleInfo*) schedule_list->data;
   14.69 +
   14.70 +  	  	gtk_tree_store_insert(recordui->sch_tree_store, &iter, NULL, new_row++);
   14.71 +        
   14.72 +        start_date_time = gmyth_util_time_to_string(schedule_info->start_time);
   14.73 +        end_date_time = gmyth_util_time_to_string(schedule_info->end_time);
   14.74 +        
   14.75 +        g_string_printf(str_aux, "%d", schedule_info->channel_id);
   14.76 +        
   14.77 +	  	gtk_tree_store_set(recordui->sch_tree_store, &iter,
   14.78 +	  		START_DATE_COLUMN, start_date_time->str, 
   14.79 +	  		TITLE_COLUMN, schedule_info->title->str,
   14.80 +	  		CHAN_ID_COLUMN, str_aux->str,
   14.81 +	  		END_TIME_COLUMN, end_date_time->str, //It doesn't appear
   14.82 +	  		RECORD_ID_COLUMN, schedule_info->record_id, 
   14.83 +			-1); //the last line is a hidden item to be used in searching tasks
   14.84 + 	}
   14.85 +  	
   14.86 +  	g_debug ("[%s] %d lines added to schedule list UI", __FUNCTION__, new_row);
   14.87 +  	
   14.88 +    /* free allocated memory */
   14.89 +    if(!start_date_time)
   14.90 +        g_string_free(start_date_time, FALSE);
   14.91 +    if(!end_date_time)
   14.92 +        g_string_free(end_date_time, FALSE);
   14.93 +    g_string_free(str_aux,  FALSE);
   14.94 +    
   14.95 +  	return TRUE;
   14.96 +}
   14.97 +
   14.98 +gboolean
   14.99 +mmyth_recordui_reload_record (MMythRecordUI *recordui)
  14.100 +{
  14.101 +	gint new_row = 0;
  14.102 +	RecordedInfo *recorded_info;
  14.103 +	GList *record_list = NULL;
  14.104 +	GtkTreeIter iter;
  14.105 +    GString *start_date_time = NULL;
  14.106 +    GString *end_date_time = NULL;
  14.107 +    GString *str_aux = g_string_new("");
  14.108 +	gint res;
  14.109 +	
  14.110 +	gtk_tree_store_clear(recordui->rec_tree_store);		
  14.111 +
  14.112 +	res = gmyth_scheduler_get_recorded_list(recordui->scheduler, &record_list);
  14.113 +	if (res < 0) {
  14.114 +		g_warning ("[%s] Retrieved NULL list of recorded data from database", __FUNCTION__);
  14.115 +		return FALSE;
  14.116 +	}
  14.117 +	
  14.118 +	for (; record_list; record_list = record_list->next) {
  14.119 + 	  	recorded_info = (RecordedInfo*) record_list->data;
  14.120 +
  14.121 +  	  	gtk_tree_store_insert(recordui->rec_tree_store, &iter, NULL, new_row++);
  14.122 +
  14.123 +        start_date_time = gmyth_util_time_to_string(recorded_info->start_time);
  14.124 +        end_date_time = gmyth_util_time_to_string(recorded_info->end_time);
  14.125 +
  14.126 +        g_string_printf(str_aux, "%d", recorded_info->channel_id);
  14.127 +
  14.128 +	  	gtk_tree_store_set(recordui->rec_tree_store, &iter,
  14.129 +	  		START_DATE_COLUMN, start_date_time->str, 
  14.130 +	  		TITLE_COLUMN, recorded_info->title->str,
  14.131 +	  		CHAN_ID_COLUMN, str_aux->str,
  14.132 +	  		END_TIME_COLUMN, end_date_time->str, //It doesn't appear
  14.133 +	  		RECORD_ID_COLUMN, recorded_info->record_id,
  14.134 +			BASENAME_COLUMN, recorded_info->basename->str, -1); 
  14.135 +            //the last line is a hidden item to be used in searching tasks	  		
  14.136 +  	}
  14.137 +  	
  14.138 +  	g_debug ("[%s] %d lines added to record list UI", __FUNCTION__, new_row);
  14.139 +  	  	
  14.140 +  	return TRUE;
  14.141 +}
  14.142 +
  14.143 +
  14.144 +MMythRecordUI*
  14.145 +mmyth_recordui_new(void)
  14.146 +{
  14.147 +	MMythRecordUI *recordui = g_new0 (MMythRecordUI, 1);
  14.148 +	
  14.149 +	recordui->scrolled_window = gtk_scrolled_window_new (NULL, NULL);
  14.150 +	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (recordui->scrolled_window),
  14.151 +			GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  14.152 +
  14.153 +	recordui->viewport = gtk_viewport_new (NULL, NULL);
  14.154 +  	gtk_container_add (GTK_CONTAINER (recordui->scrolled_window), recordui->viewport);
  14.155 +
  14.156 +  	recordui->notebook = gtk_notebook_new ();
  14.157 +  	gtk_container_set_border_width (GTK_CONTAINER (recordui->notebook), 1);
  14.158 +  	gtk_notebook_set_scrollable (GTK_NOTEBOOK (recordui->notebook), TRUE);
  14.159 +  	gtk_notebook_popup_enable (GTK_NOTEBOOK (recordui->notebook));
  14.160 +  	gtk_container_add (GTK_CONTAINER (recordui->viewport), recordui->notebook);
  14.161 +  	gtk_notebook_popup_disable(GTK_NOTEBOOK (recordui->notebook));
  14.162 +
  14.163 +	/* Schedule tab */
  14.164 +  	recordui->sch_scrolled_window = gtk_scrolled_window_new (NULL, NULL);
  14.165 +  	gtk_container_add (GTK_CONTAINER (recordui->notebook), recordui->sch_scrolled_window);
  14.166 +  	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (recordui->sch_scrolled_window), 
  14.167 +                                    GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  14.168 +  	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (recordui->sch_scrolled_window), 
  14.169 +                                         GTK_SHADOW_IN);
  14.170 +
  14.171 +    /* The basename column in the sched_tree_store is not being used*/
  14.172 +  	recordui->sch_tree_store = 
  14.173 +        gtk_tree_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING,
  14.174 +  		                    G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING );
  14.175 +    
  14.176 +  	recordui->sch_treeview = 
  14.177 +        gtk_tree_view_new_with_model(GTK_TREE_MODEL(recordui->sch_tree_store));
  14.178 +  	gtk_container_add (GTK_CONTAINER (recordui->sch_scrolled_window), 
  14.179 +                       recordui->sch_treeview);
  14.180 +  	recordui->sch_renderer = gtk_cell_renderer_text_new();
  14.181 +  	//g_object_set(G_OBJECT(renderer1), "foreground", "green", "background", "black", NULL);
  14.182 +  	recordui->sch_column1 = 
  14.183 +        gtk_tree_view_column_new_with_attributes("Start time", recordui->sch_renderer, 
  14.184 +                                                 "text", START_DATE_COLUMN, NULL);
  14.185 +  	gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->sch_treeview), 
  14.186 +                                recordui->sch_column1); 
  14.187 +  	recordui->sch_column2 = 
  14.188 +        gtk_tree_view_column_new_with_attributes("Title", recordui->sch_renderer, 
  14.189 +                                                 "text", TITLE_COLUMN, NULL);
  14.190 +  	gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->sch_treeview), 
  14.191 +                                recordui->sch_column2);
  14.192 +  	recordui->sch_column3 = 
  14.193 +        gtk_tree_view_column_new_with_attributes("Channel", recordui->sch_renderer, 
  14.194 +                                                 "text", CHAN_ID_COLUMN, NULL);
  14.195 +  	gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->sch_treeview), 
  14.196 +                                recordui->sch_column3);
  14.197 +  	gtk_tree_view_column_set_resizable(recordui->sch_column1, TRUE);
  14.198 +  	gtk_tree_view_column_set_resizable(recordui->sch_column2, TRUE);
  14.199 +  	gtk_tree_view_column_set_resizable(recordui->sch_column3, TRUE);
  14.200 +  	gtk_tree_view_column_set_reorderable(recordui->sch_column1, TRUE);
  14.201 +  	gtk_tree_view_column_set_reorderable(recordui->sch_column2, TRUE);
  14.202 +  	gtk_tree_view_column_set_reorderable(recordui->sch_column3, TRUE);  	  	  	  	
  14.203 +//  recordui->sch_column4 = 
  14.204 +//      gtk_tree_view_column_new_with_attributes("", recordui->sch_renderer, "text", END_TIME_COLUMN, NULL);
  14.205 +//  gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->sch_treeview), 
  14.206 +//                                            recordui->sch_column4);
  14.207 +
  14.208 +  	recordui->sch_label = gtk_label_new (("Schedule"));
  14.209 +  	gtk_notebook_set_tab_label (GTK_NOTEBOOK (recordui->notebook), 
  14.210 +                                gtk_notebook_get_nth_page (
  14.211 +                                               GTK_NOTEBOOK (recordui->notebook), 0), 
  14.212 +                                recordui->sch_label);
  14.213 +
  14.214 +  // Record items  tab
  14.215 +  //   g_object_set(G_OBJECT(renderer2), "foreground", "blue", NULL);
  14.216 +  	recordui->rec_scrolled_window = gtk_scrolled_window_new (NULL, NULL);
  14.217 +  	gtk_container_add (GTK_CONTAINER (recordui->notebook), 
  14.218 +                       recordui->rec_scrolled_window);
  14.219 +  	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (recordui->rec_scrolled_window), 
  14.220 +                                    GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  14.221 +  	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (recordui->rec_scrolled_window), 
  14.222 +                                         GTK_SHADOW_IN);
  14.223 +
  14.224 +  	recordui->rec_tree_store = 
  14.225 +        gtk_tree_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING,
  14.226 +                	        G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING);
  14.227 +  	recordui->rec_treeview = 
  14.228 +        gtk_tree_view_new_with_model(GTK_TREE_MODEL(recordui->rec_tree_store));
  14.229 +  	gtk_container_add (GTK_CONTAINER (recordui->rec_scrolled_window), 
  14.230 +                       recordui->rec_treeview);
  14.231 +  	recordui->rec_renderer = gtk_cell_renderer_text_new();
  14.232 +  	//g_object_set(G_OBJECT(renderer1), "foreground", "green", "background", "black", NULL);
  14.233 + 
  14.234 +  	recordui->rec_column1 = 
  14.235 +        gtk_tree_view_column_new_with_attributes("Start time", recordui->rec_renderer, 
  14.236 +                                                 "text", START_DATE_COLUMN, NULL);
  14.237 +  	gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->rec_treeview), 
  14.238 +                                recordui->rec_column1);
  14.239 +  	recordui->rec_column2 = 
  14.240 +        gtk_tree_view_column_new_with_attributes("Title", recordui->rec_renderer, 
  14.241 +                                                 "text", TITLE_COLUMN, NULL);
  14.242 +  	gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->rec_treeview), 
  14.243 +                                recordui->rec_column2);
  14.244 +  	recordui->rec_column3 = 
  14.245 +        gtk_tree_view_column_new_with_attributes("Channel", recordui->rec_renderer, 
  14.246 +                                                 "text", CHAN_ID_COLUMN, NULL);
  14.247 +  	gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->rec_treeview), 
  14.248 +                                recordui->rec_column3);
  14.249 +  	gtk_tree_view_column_set_resizable(recordui->rec_column1, TRUE);
  14.250 +  	gtk_tree_view_column_set_resizable(recordui->rec_column2, TRUE);
  14.251 +  	gtk_tree_view_column_set_resizable(recordui->rec_column3, TRUE);
  14.252 +  	gtk_tree_view_column_set_reorderable(recordui->rec_column1, TRUE);
  14.253 +  	gtk_tree_view_column_set_reorderable(recordui->rec_column2, TRUE);
  14.254 +  	gtk_tree_view_column_set_reorderable(recordui->rec_column3, TRUE);
  14.255 +//  recordui->rec_column4 = gtk_tree_view_column_new_with_attributes("", recordui->rec_renderer, "text", END_TIME_COLUMN, NULL);
  14.256 +//  gtk_tree_view_append_column(GTK_TREE_VIEW(recordui->rec_treeview), recordui->rec_column4);
  14.257 +
  14.258 +  	recordui->rec_label = gtk_label_new (("Recorded"));
  14.259 +  	gtk_notebook_set_tab_label (GTK_NOTEBOOK (recordui->notebook), 
  14.260 +                                gtk_notebook_get_nth_page (
  14.261 +                                      GTK_NOTEBOOK (recordui->notebook), 1), 
  14.262 +                                recordui->rec_label);
  14.263 +  
  14.264 +  	// Gets the mmyth scheduler manager
  14.265 +  	recordui->scheduler = gmyth_scheduler_new ();
  14.266 +    
  14.267 +    /* init connection to the backend */
  14.268 +    gmyth_scheduler_connect (recordui->scheduler);
  14.269 +    
  14.270 +	return recordui;
  14.271 +}
  14.272 +
  14.273 +void
  14.274 +mmyth_recordui_free (MMythRecordUI *recordui)
  14.275 +{
  14.276 +	// FIXME: Release memory here!
  14.277 +    /* close connection to the backend */
  14.278 +    gmyth_scheduler_disconnect (recordui->scheduler);
  14.279 +}
  14.280 +
  14.281 +void
  14.282 +mmyth_recordui_delete_selected (GtkButton *button, MMythRecordUI *recordui)
  14.283 +{
  14.284 +	GtkTreeSelection *selection;
  14.285 +	GtkTreeModel *list_store;
  14.286 +	GtkTreeIter iter;
  14.287 +	int index;
  14.288 +	int curr_page = 0;
  14.289 +	
  14.290 +	curr_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(recordui->notebook));
  14.291 +
  14.292 +	if ( curr_page == 0) {
  14.293 +		selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(recordui->sch_treeview));
  14.294 +		if (selection != NULL) {
  14.295 +			gtk_tree_selection_get_selected(selection, &list_store, &iter);
  14.296 +			gtk_tree_model_get(list_store, &iter, RECORD_ID_COLUMN, &index, -1);
  14.297 +			gmyth_scheduler_delete_schedule(recordui->scheduler, index);
  14.298 +			mmyth_recordui_reload_schedule (recordui);
  14.299 +			return;
  14.300 +		}
  14.301 +			
  14.302 +	} else if (curr_page == 1) {
  14.303 +		selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(recordui->rec_treeview));
  14.304 +		if (selection != NULL) {
  14.305 +			gtk_tree_selection_get_selected(selection, &list_store, &iter);
  14.306 +			gtk_tree_model_get(list_store, &iter, RECORD_ID_COLUMN, &index, -1);
  14.307 +			gmyth_scheduler_delete_recorded(recordui->scheduler, index);
  14.308 +			mmyth_recordui_reload_record (recordui);
  14.309 +			return;
  14.310 +		}
  14.311 +	}
  14.312 +	
  14.313 +	g_warning ("[%s] None element was removed from the list", __FUNCTION__);
  14.314 +}
  14.315 +
  14.316 +/* FIXME: change this function name, it is returning the 
  14.317 + * basename_column that represents the nuv filename of 
  14.318 + * the recorded content */
  14.319 +gchar*
  14.320 +mmyth_recordui_get_selected_recorded (MMythRecordUI *recordui)
  14.321 +{
  14.322 +	GtkTreeSelection *selection = NULL;
  14.323 +	GtkTreeModel *list_store = NULL;
  14.324 +	GtkTreeIter iter;
  14.325 +	gchar *path = NULL;
  14.326 +
  14.327 +	/* returning nuv filename, basename_column */
  14.328 +	selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(recordui->rec_treeview));
  14.329 +	if (gtk_tree_selection_get_selected (selection, &list_store, &iter)) {
  14.330 +		gtk_tree_model_get(list_store, &iter, BASENAME_COLUMN, &path, -1);
  14.331 +	}
  14.332 +
  14.333 +	// FIXME: MOVE THIS TO OTHER PLACE
  14.334 +	return path;
  14.335 +}
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/maemo-ui/src/mmyth_recordui.h	Thu Sep 28 16:02:14 2006 +0100
    15.3 @@ -0,0 +1,48 @@
    15.4 +#ifndef MMYTH_RECORD_H_
    15.5 +#define MMYTH_RECORD_H_
    15.6 +
    15.7 +#include "gmyth_scheduler.h"
    15.8 +
    15.9 +typedef struct _MMythRecordUI
   15.10 +{
   15.11 +	GtkWidget *scrolled_window;
   15.12 +	GtkWidget *viewport;
   15.13 +	GtkWidget *notebook;
   15.14 +	
   15.15 +	GtkWidget *rec_scrolled_window;
   15.16 +	GtkWidget *sch_scrolled_window;
   15.17 +	GtkWidget *rec_treeview;
   15.18 +	GtkWidget *sch_treeview;
   15.19 +	GtkWidget *rec_label;
   15.20 +	GtkWidget *sch_label;
   15.21 +	
   15.22 +	GtkTreeViewColumn *rec_column1;
   15.23 +	GtkTreeViewColumn *rec_column2;
   15.24 +	GtkTreeViewColumn *rec_column3;
   15.25 +	GtkTreeViewColumn *rec_column4;
   15.26 +	GtkTreeViewColumn *sch_column1;
   15.27 +	GtkTreeViewColumn *sch_column2;
   15.28 +	GtkTreeViewColumn *sch_column3;
   15.29 +	GtkTreeViewColumn *sch_column4;
   15.30 +	
   15.31 +	GtkCellRenderer *rec_renderer;
   15.32 +	GtkCellRenderer *sch_renderer;
   15.33 +
   15.34 +	GtkTreeStore *sch_tree_store;
   15.35 +	GtkTreeStore *rec_tree_store;
   15.36 +	
   15.37 +	GMythScheduler *scheduler;
   15.38 +	
   15.39 +} MMythRecordUI;
   15.40 +
   15.41 +MMythRecordUI* mmyth_recordui_new(void);
   15.42 +void mmyth_recordui_free (MMythRecordUI *recordui);
   15.43 +
   15.44 +void mmyth_recordui_delete_selected (GtkButton *button, MMythRecordUI *recordui);
   15.45 +gboolean mmyth_recordui_reload_all (MMythRecordUI *recordui);
   15.46 +gboolean mmyth_recordui_reload_schedule (MMythRecordUI *recordui);
   15.47 +gboolean mmyth_recordui_reload_record (MMythRecordUI *recordui);
   15.48 +
   15.49 +gchar* mmyth_recordui_get_selected_recorded (MMythRecordUI *recordui);
   15.50 +
   15.51 +#endif /*MMYTH_RECORD_H_*/
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/maemo-ui/src/mmyth_schedulerui.c	Thu Sep 28 16:02:14 2006 +0100
    16.3 @@ -0,0 +1,368 @@
    16.4 +#include <gtk/gtk.h>
    16.5 +#include <glib.h>
    16.6 +#include <glib/gprintf.h>
    16.7 +#include <sys/types.h>
    16.8 +#include <sys/stat.h>
    16.9 +#include <unistd.h>
   16.10 +#include <string.h>
   16.11 +#include <stdio.h>
   16.12 +
   16.13 +#include "mmyth_ui.h"
   16.14 +#include "mmyth_uicommon.h"
   16.15 +#include "mmyth_recordui.h"
   16.16 +#include "mmyth_schedulerui.h"
   16.17 +
   16.18 +/* GMyth library includes */
   16.19 +#include "gmyth_scheduler.h"
   16.20 +#include "gmyth_common.h"
   16.21 +#include "gmyth_epg.h"
   16.22 +
   16.23 +static void run_calendar_dialog (GtkButton *button, gpointer data);
   16.24 +
   16.25 +static void add_channel_field (MMythSchedulerUI *scheduler_ui, GtkWidget *vbox);
   16.26 +static void add_time_field (MMythSchedulerUI *scheduler_ui, GtkWidget *vbox);
   16.27 +static void add_date_field (MMythSchedulerUI *scheduler_ui, GtkWidget *vbox);
   16.28 +static void add_duration_field (MMythSchedulerUI *scheduler_ui, GtkWidget *vbox);
   16.29 +static void add_frequency_field (MMythSchedulerUI *scheduler_ui, GtkWidget *vbox);
   16.30 +static void add_title_field (MMythSchedulerUI *scheduler_ui, GtkWidget *vbox);
   16.31 +
   16.32 +MMythSchedulerUI*
   16.33 +mmyth_schedulerui_new (void)
   16.34 +{
   16.35 +	GtkWidget *scrolledwindow;	
   16.36 +	GtkWidget *viewport;	
   16.37 +	GtkWidget *head_hbox;
   16.38 +	GtkWidget *fields_vbox;
   16.39 +	GtkWidget *hseparator;
   16.40 +	GtkWidget *label;
   16.41 +
   16.42 +	MMythSchedulerUI *scheduler_ui = g_new0 (MMythSchedulerUI, 1);
   16.43 +	
   16.44 +	scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
   16.45 +	scheduler_ui->main_widget = scrolledwindow;
   16.46 +	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow),
   16.47 +  			GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
   16.48 +
   16.49 +	//Is this needed?  
   16.50 +	viewport = gtk_viewport_new (NULL, NULL);
   16.51 +	gtk_container_add (GTK_CONTAINER (scrolledwindow), viewport);
   16.52 +
   16.53 +	//Is this needed?
   16.54 +	head_hbox = gtk_hbox_new (FALSE, 0);
   16.55 +	gtk_container_add (GTK_CONTAINER (viewport), head_hbox);
   16.56 +
   16.57 +	fields_vbox = gtk_vbox_new (FALSE, 0);
   16.58 +	gtk_box_pack_start (GTK_BOX (head_hbox), fields_vbox, TRUE, TRUE, 0);
   16.59 +	gtk_container_set_border_width (GTK_CONTAINER (fields_vbox), 10);
   16.60 +
   16.61 +	label = gtk_label_new_with_mnemonic (("Manual Schedule Recording"));
   16.62 +	gtk_box_pack_start (GTK_BOX (fields_vbox), label, FALSE, FALSE, 0);
   16.63 +	gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
   16.64 +
   16.65 +	hseparator = gtk_hseparator_new ();
   16.66 +	gtk_box_pack_start (GTK_BOX (fields_vbox), hseparator, FALSE, TRUE, 0);
   16.67 +
   16.68 +	add_channel_field (scheduler_ui, fields_vbox);
   16.69 +	add_time_field (scheduler_ui, fields_vbox);
   16.70 +	add_date_field (scheduler_ui, fields_vbox);
   16.71 +	add_duration_field (scheduler_ui, fields_vbox);
   16.72 +	add_frequency_field (scheduler_ui, fields_vbox);
   16.73 +	add_title_field (scheduler_ui, fields_vbox);
   16.74 +	
   16.75 +	return scheduler_ui;
   16.76 +}
   16.77 +
   16.78 +static void
   16.79 +set_date_from_calendar (GtkCalendar *calendar, gpointer data)
   16.80 +{
   16.81 +	char sched_date[24];
   16.82 +
   16.83 +	MMythSchedulerUI *scheduler_ui = (MMythSchedulerUI*) data;
   16.84 +
   16.85 +	// FIXME: Change this, save another value instead of month_temp, day_temp, ...	
   16.86 +	gtk_calendar_get_date(GTK_CALENDAR(calendar), 
   16.87 +		&(scheduler_ui->year_temp), &(scheduler_ui->month_temp), &(scheduler_ui->day_temp));
   16.88 +
   16.89 +	sched_date[23]='\0';
   16.90 +	g_sprintf(sched_date, "%04d %02d %02d (yyyy mm dd)",
   16.91 +		scheduler_ui->year_temp, scheduler_ui->month_temp+1, scheduler_ui->day_temp);
   16.92 +
   16.93 +	gtk_button_set_label(GTK_BUTTON(scheduler_ui->date_button), sched_date);
   16.94 +
   16.95 +	gtk_widget_destroy(scheduler_ui->calendar_dialog);
   16.96 +	scheduler_ui->calendar_dialog = NULL;
   16.97 +	scheduler_ui->calendar = NULL;
   16.98 +}
   16.99 +
  16.100 +//calendar
  16.101 +static void
  16.102 +run_calendar_dialog (GtkButton *button, gpointer data)
  16.103 +{
  16.104 +
  16.105 +	GtkWidget *dialog_vbox;
  16.106 +	MMythSchedulerUI *scheduler_ui = (MMythSchedulerUI*) data;
  16.107 +
  16.108 +	// calendar_dialog and calendar are been released at set_date_from_calendar ()
  16.109 +	scheduler_ui->calendar_dialog = gtk_dialog_new ();
  16.110 +	gtk_container_set_border_width (GTK_CONTAINER (scheduler_ui->calendar_dialog), 1);
  16.111 +  	gtk_window_set_title (GTK_WINDOW (scheduler_ui->calendar_dialog), "Select starting date");
  16.112 +  	gtk_window_set_position (GTK_WINDOW (scheduler_ui->calendar_dialog), GTK_WIN_POS_CENTER);
  16.113 +	gtk_window_set_decorated (GTK_WINDOW (scheduler_ui->calendar_dialog), FALSE);
  16.114 +
  16.115 +	dialog_vbox = GTK_DIALOG (scheduler_ui->calendar_dialog)->vbox;
  16.116 +
  16.117 +	scheduler_ui->calendar = gtk_calendar_new ();
  16.118 +
  16.119 +	gtk_box_pack_start (GTK_BOX (dialog_vbox), scheduler_ui->calendar, TRUE, TRUE, 0);
  16.120 +	gtk_calendar_display_options (GTK_CALENDAR (scheduler_ui->calendar),
  16.121 +        GTK_CALENDAR_SHOW_HEADING | GTK_CALENDAR_SHOW_DAY_NAMES);
  16.122 +
  16.123 +	gtk_widget_show_all (scheduler_ui->calendar_dialog);
  16.124 +
  16.125 +	g_signal_connect (G_OBJECT (scheduler_ui->calendar), "day-selected-double-click",
  16.126 +                      G_CALLBACK (set_date_from_calendar), data);
  16.127 +}
  16.128 +
  16.129 +
  16.130 +gboolean
  16.131 +mmyth_schedulerui_save (MMythSchedulerUI *scheduler_ui)
  16.132 +{
  16.133 +    GMythScheduler *scheduler;
  16.134 +	ScheduleInfo *schedule_info;
  16.135 +	GMythChannelInfo *channel_info;
  16.136 +
  16.137 +	GList *clist;
  16.138 +	gint index, duration;
  16.139 +    gint frequency;
  16.140 +    struct tm start_tm;
  16.141 +	
  16.142 +	schedule_info = g_new0(ScheduleInfo, 1);
  16.143 +    if(schedule_info == NULL) {
  16.144 +        g_warning ("Error allocating memory");
  16.145 +        return FALSE;
  16.146 +    }
  16.147 +        
  16.148 +    clist = scheduler_ui->channel_list;
  16.149 +      
  16.150 +    index = gtk_combo_box_get_active(GTK_COMBO_BOX(scheduler_ui->channel_combobox));
  16.151 +
  16.152 +    if (clist != NULL)
  16.153 +		clist = g_list_nth(clist, index);
  16.154 +    
  16.155 +    if (clist) {
  16.156 +	    g_debug ("[%s] New schedule: %d", __FUNCTION__, index);
  16.157 +    } else {
  16.158 +	    g_warning ("[%s] Error when adding new schedule", __FUNCTION__);
  16.159 +	    return FALSE;
  16.160 +    }
  16.161 +    
  16.162 +    channel_info = clist->data;
  16.163 +    
  16.164 +    /* initialize schedule_info */
  16.165 +    schedule_info->channel_id = channel_info->channel_ID;
  16.166 +    
  16.167 +    start_tm.tm_hour = 
  16.168 +        (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(scheduler_ui->hour_spinbutton));
  16.169 +	start_tm.tm_min = 
  16.170 +        (int)gtk_spin_button_get_value(GTK_SPIN_BUTTON(scheduler_ui->min_spinbutton));
  16.171 +    start_tm.tm_sec = 0;
  16.172 +
  16.173 +	start_tm.tm_mday = (gint)scheduler_ui->day_temp;
  16.174 +	start_tm.tm_mon =  (gint)scheduler_ui->month_temp;
  16.175 +	start_tm.tm_year = (gint)scheduler_ui->year_temp - 1900; //years since 1900
  16.176 +
  16.177 +    schedule_info->start_time = timelocal(&start_tm);
  16.178 +    if (schedule_info->start_time == (time_t)(-1)) {
  16.179 +        g_warning ("timelocal error!\n");
  16.180 +        return FALSE;
  16.181 +    }
  16.182 +
  16.183 +	duration = (gint) gtk_spin_button_get_value(
  16.184 +                        GTK_SPIN_BUTTON(scheduler_ui->duration_spinbutton));
  16.185 +    schedule_info->end_time = schedule_info->start_time + (duration*60);
  16.186 +
  16.187 +    /* TODO: frequency is not implemented yet */
  16.188 +	frequency = gtk_combo_box_get_active(GTK_COMBO_BOX(scheduler_ui->freq_combobox));
  16.189 +
  16.190 +	schedule_info->title = g_string_new("");
  16.191 +	g_string_printf(schedule_info->title, "%s", 
  16.192 +                    gtk_entry_get_text(GTK_ENTRY(scheduler_ui->title_entry)));
  16.193 +	
  16.194 +    /* FIXME: Architecture change to reuse the scheduler created in the recordui! */
  16.195 +    scheduler = gmyth_scheduler_new ();
  16.196 +
  16.197 +    gmyth_scheduler_connect(scheduler);
  16.198 +
  16.199 +    /* FIXME: set record_id = -1 to add a new schedule */
  16.200 +    schedule_info->record_id = -1;
  16.201 +    gmyth_scheduler_add_schedule (scheduler, schedule_info);
  16.202 +
  16.203 +    gmyth_scheduler_disconnect(scheduler);
  16.204 +    
  16.205 +    /* free allocated memory */
  16.206 +    g_object_unref (scheduler);
  16.207 +    g_free (schedule_info);
  16.208 +	
  16.209 +    return TRUE;
  16.210 +} 
  16.211 +
  16.212 +static GtkWidget*
  16.213 +add_line (GtkWidget *vbox, const gchar *str)
  16.214 +{
  16.215 +	GtkWidget *label;
  16.216 +	GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
  16.217 +
  16.218 +	gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
  16.219 +	gtk_container_set_border_width (GTK_CONTAINER (hbox), 3);
  16.220 +	
  16.221 +	label = gtk_label_new (str);
  16.222 +	gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
  16.223 +	gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);	
  16.224 +
  16.225 +	return hbox;
  16.226 +}
  16.227 +
  16.228 +static void
  16.229 +add_channel_field (MMythSchedulerUI *scheduler_ui, GtkWidget *vbox)
  16.230 +{
  16.231 +	GtkWidget *combobox;
  16.232 +	
  16.233 +	GtkWidget *hbox = add_line (vbox, "Channel:    ");
  16.234 +	
  16.235 +	combobox = gtk_combo_box_new_text ();
  16.236 +
  16.237 +	scheduler_ui->channel_combobox = combobox;
  16.238 +	gtk_box_pack_start (GTK_BOX (hbox), combobox, FALSE, FALSE, 0);
  16.239 +			
  16.240 +	GMythEPG *mmyth_epg = gmyth_epg_new ();
  16.241 +	if (!gmyth_epg_connect (mmyth_epg)) {
  16.242 +		// FIXME: Without this list the scheduler UI should not be shown!
  16.243 +		g_warning ("[%s] Error when getting list of channels", __FUNCTION__);
  16.244 +	}
  16.245 +  	
  16.246 +	if (gmyth_epg_get_channel_list (mmyth_epg, &(scheduler_ui->channel_list)) < 0) {
  16.247 +		g_debug ("[%s] Error while trying to retrieve channel list", __FUNCTION__);
  16.248 +	} else {
  16.249 + 		GList *clist =  scheduler_ui->channel_list;
  16.250 +		GMythChannelInfo *channel_info;
  16.251 +
  16.252 +		while (clist != NULL) {
  16.253 +  	  		channel_info = clist->data;
  16.254 +  	  		clist = clist->next;
  16.255 +  	  		gtk_combo_box_append_text (GTK_COMBO_BOX (scheduler_ui->channel_combobox), 
  16.256 +                                       (channel_info->channel_name->str));
  16.257 +  		}
  16.258 +
  16.259 +       gtk_combo_box_set_active(GTK_COMBO_BOX (scheduler_ui->channel_combobox), 0);
  16.260 +  	}
  16.261 +}
  16.262 +
  16.263 +static void
  16.264 +add_time_field (MMythSchedulerUI *scheduler_ui, GtkWidget *vbox)
  16.265 +{
  16.266 +	GtkWidget *label;
  16.267 +	GtkObject *spinbutton_adj;
  16.268 +	GtkWidget *hbox = add_line (vbox, "Time:         ");
  16.269 +
  16.270 +	time_t real_time;
  16.271 +	struct tm sched_time;
  16.272 +
  16.273 +	time(&real_time);
  16.274 +
  16.275 +    if (localtime_r((time_t *)&real_time, &sched_time) == NULL) {
  16.276 +        g_warning ("localtime_r error in mmyth_epg_grid_view!\n");
  16.277 +        return NULL;
  16.278 +    }
  16.279 + 
  16.280 +	if (sched_time.tm_min>30){
  16.281 +  		sched_time.tm_hour = sched_time.tm_hour+1;
  16.282 +  		sched_time.tm_min = 0;
  16.283 +	} else if (sched_time.tm_min>0) {
  16.284 +  		sched_time.tm_min = 30;
  16.285 +	}
  16.286 +
  16.287 +  	scheduler_ui->year_temp = (guint)sched_time.tm_year + 1900;
  16.288 +  	scheduler_ui->month_temp = (guint)sched_time.tm_mon;
  16.289 +  	scheduler_ui->day_temp = (guint)sched_time.tm_mday;
  16.290 +   
  16.291 +	//hour entry
  16.292 +	spinbutton_adj = gtk_adjustment_new (sched_time.tm_hour, 00, 23, 1, 10, 10);
  16.293 +	scheduler_ui->hour_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_adj), 1, 0);
  16.294 +	gtk_box_pack_start (GTK_BOX (hbox), scheduler_ui->hour_spinbutton, FALSE, FALSE, 0);
  16.295 +
  16.296 +	label = gtk_label_new ((" : "));
  16.297 +	gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
  16.298 +	gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT);
  16.299 +	gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
  16.300 +
  16.301 +	//minute entry
  16.302 +	spinbutton_adj = gtk_adjustment_new (sched_time.tm_min, 0, 59, 1, 10, 10);
  16.303 +	scheduler_ui->min_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_adj), 1, 0);
  16.304 +	gtk_box_pack_start (GTK_BOX (hbox), scheduler_ui->min_spinbutton, FALSE, FALSE, 0);
  16.305 +
  16.306 +	label = gtk_label_new ((" (hh:mm)"));
  16.307 +
  16.308 +	gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
  16.309 +
  16.310 +}	
  16.311 +
  16.312 +static void
  16.313 +add_date_field (MMythSchedulerUI *scheduler_ui, GtkWidget *vbox)
  16.314 +{
  16.315 +	char sched_date[24];
  16.316 +	GtkWidget *hbox = add_line (vbox, "Date:        ");
  16.317 +		
  16.318 +	//sched_date = ctime(&real_time);
  16.319 +  	g_sprintf (sched_date, "%04d %02d %02d (yyyy mm dd)", scheduler_ui->year_temp, scheduler_ui->month_temp+1, scheduler_ui->day_temp);
  16.320 +  	sched_date[23]='\0';
  16.321 +  
  16.322 +  	scheduler_ui->date_button = gtk_button_new_with_label (sched_date);
  16.323 +  	gtk_box_pack_start (GTK_BOX (hbox), scheduler_ui->date_button, FALSE, FALSE, 0);
  16.324 +  	gtk_button_set_relief (GTK_BUTTON (scheduler_ui->date_button), GTK_RELIEF_NONE);
  16.325 +
  16.326 +	g_signal_connect (G_OBJECT (scheduler_ui->date_button), "clicked",
  16.327 +                      G_CALLBACK (run_calendar_dialog), scheduler_ui);
  16.328 +
  16.329 +}
  16.330 +
  16.331 +static void
  16.332 +add_duration_field (MMythSchedulerUI *scheduler_ui, GtkWidget *vbox)
  16.333 +{
  16.334 +	GtkWidget *hbox = add_line (vbox, "Duration:   ");
  16.335 +	GtkWidget *label;
  16.336 +	GtkObject *spinbutton_adj;
  16.337 +	
  16.338 +	spinbutton_adj = gtk_adjustment_new (60, 5, 360, 5, 60, 60);
  16.339 +  	scheduler_ui->duration_spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_adj), 1, 0);
  16.340 +  	gtk_box_pack_start (GTK_BOX (hbox), scheduler_ui->duration_spinbutton, FALSE, TRUE, 0);
  16.341 +  	gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (scheduler_ui->duration_spinbutton), TRUE);
  16.342 +
  16.343 +	label = gtk_label_new ((" (minutes)     "));
  16.344 +  	gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
  16.345 +}
  16.346 +
  16.347 +static void
  16.348 +add_frequency_field (MMythSchedulerUI *scheduler_ui, GtkWidget *vbox)
  16.349 +{
  16.350 +	
  16.351 +	GtkWidget *hbox = add_line (vbox, "Frequency: ");	
  16.352 +	
  16.353 +	scheduler_ui->freq_combobox = gtk_combo_box_new_text ();
  16.354 +	gtk_box_pack_start (GTK_BOX (hbox), scheduler_ui->freq_combobox, FALSE, FALSE, 0);
  16.355 +	gtk_combo_box_append_text (GTK_COMBO_BOX (scheduler_ui->freq_combobox), ("Only this day               "));
  16.356 +	gtk_combo_box_append_text (GTK_COMBO_BOX (scheduler_ui->freq_combobox), ("Daily                            "));
  16.357 +	gtk_combo_box_append_text (GTK_COMBO_BOX (scheduler_ui->freq_combobox), ("Weekly                         "));
  16.358 +	gtk_combo_box_set_active(GTK_COMBO_BOX (scheduler_ui->freq_combobox), 0);
  16.359 +
  16.360 +}
  16.361 +
  16.362 +static void
  16.363 +add_title_field (MMythSchedulerUI *scheduler_ui, GtkWidget *vbox)
  16.364 +{
  16.365 +	GtkWidget *hbox = add_line (vbox, "Title:           ");
  16.366 +	
  16.367 +  	scheduler_ui->title_entry = gtk_entry_new ();
  16.368 +  	gtk_box_pack_start (GTK_BOX (hbox), scheduler_ui->title_entry, FALSE, FALSE, 0);
  16.369 +  	gtk_entry_set_text (GTK_ENTRY (scheduler_ui->title_entry), "(Optional)");
  16.370 +	
  16.371 +}
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/maemo-ui/src/mmyth_schedulerui.h	Thu Sep 28 16:02:14 2006 +0100
    17.3 @@ -0,0 +1,45 @@
    17.4 +#ifndef MMYTH_SCHEDULERECORDING_H_
    17.5 +#define MMYTH_SCHEDULERECORDING_H_
    17.6 +
    17.7 +#include <glib.h>
    17.8 +
    17.9 +typedef struct _MMythSchedulerUI {
   17.10 +	
   17.11 +	GList *channel_list;
   17.12 +	
   17.13 +	GtkWidget *main_widget;
   17.14 +
   17.15 +	GtkWidget *channel_combobox;
   17.16 +	GtkWidget *freq_combobox;
   17.17 +	GtkWidget *hour_spinbutton;
   17.18 +	GtkWidget *min_spinbutton;
   17.19 +	GtkWidget *duration_spinbutton;
   17.20 +	GtkWidget *title_entry;
   17.21 +	GtkWidget *date_button;
   17.22 +
   17.23 +	GtkWidget *calendar_dialog;
   17.24 +	GtkWidget *calendar;
   17.25 +	
   17.26 +	guint year_temp, month_temp, day_temp;
   17.27 +} MMythSchedulerUI;
   17.28 +
   17.29 +typedef struct {
   17.30 +    long int channel_id;
   17.31 +
   17.32 +    struct tm start_tm;
   17.33 +
   17.34 +    int duration;
   17.35 +    int frequency;
   17.36 +
   17.37 +    GString *title;
   17.38 +
   17.39 +} ScheduleEntry;
   17.40 +
   17.41 +MMythSchedulerUI* mmyth_schedulerui_new (void);
   17.42 +
   17.43 +gboolean mmyth_schedulerui_save (MMythSchedulerUI *scheduler_ui);
   17.44 +
   17.45 +void mmyth_schedulerui_cb_schedule_button (GtkButton * button, gpointer user_data);
   17.46 +
   17.47 +
   17.48 +#endif /*MMYTH_SCHEDULERECORDING_H_*/
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/maemo-ui/src/mmyth_tvplayer.c	Thu Sep 28 16:02:14 2006 +0100
    18.3 @@ -0,0 +1,684 @@
    18.4 +/**
    18.5 + * GMyth Library
    18.6 + *
    18.7 + * @file gmyth/mmyth_tvplayer.c
    18.8 + * 
    18.9 + * @brief <p> This component provides playback of the remote A/V using
   18.10 + * GStreamer.
   18.11 + * 
   18.12 + * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
   18.13 + * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
   18.14 + *
   18.15 + *//*
   18.16 + * 
   18.17 + * This program is free software; you can redistribute it and/or modify
   18.18 + * it under the terms of the GNU Lesser General Public License as published by
   18.19 + * the Free Software Foundation; either version 2 of the License, or
   18.20 + * (at your option) any later version.
   18.21 + *
   18.22 + * This program is distributed in the hope that it will be useful,
   18.23 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   18.24 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   18.25 + * GNU General Public License for more details.
   18.26 + *
   18.27 + * You should have received a copy of the GNU Lesser General Public License
   18.28 + * along with this program; if not, write to the Free Software
   18.29 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   18.30 + */
   18.31 +
   18.32 +#include "mmyth_tvplayer.h"
   18.33 + 
   18.34 +#include <gdk/gdkx.h>
   18.35 +
   18.36 +#include "gmyth_context.h"
   18.37 +#include "gmyth_remote_util.h"
   18.38 +
   18.39 +typedef struct _GstPlayerWindowStateChange
   18.40 +{
   18.41 +    GstElement *play;
   18.42 +    GstState old_state, new_state;
   18.43 +    MMythTVPlayer *tvplayer;
   18.44 +} GstPlayerWindowStateChange;
   18.45 +
   18.46 +typedef struct _GstPlayerWindowTagFound
   18.47 +{
   18.48 +    GstElement *play;
   18.49 +    GstTagList *taglist;
   18.50 +    MMythTVPlayer *tvplayer;
   18.51 +} GstPlayerWindowTagFound;
   18.52 +
   18.53 +/*
   18.54 +static gboolean idle_state (gpointer data);
   18.55 +*/
   18.56 +static gboolean bus_call (GstBus * bus, GstMessage * msg, gpointer data);
   18.57 +
   18.58 +static void mmyth_tvplayer_class_init          (MMythTVPlayerClass *klass);
   18.59 +static void mmyth_tvplayer_init                (MMythTVPlayer *object);
   18.60 +
   18.61 +static void mmyth_tvplayer_dispose  (GObject *object);
   18.62 +static void mmyth_tvplayer_finalize (GObject *object);
   18.63 +
   18.64 +G_DEFINE_TYPE(MMythTVPlayer, mmyth_tvplayer, G_TYPE_OBJECT)
   18.65 +
   18.66 +static gboolean mmyth_tvplayer_create_pipeline (MMythTVPlayer* tvplayer);
   18.67 +static void     new_pad_cb (GstElement *element, 
   18.68 +                            GstPad *pad, gpointer data);
   18.69 +
   18.70 +static gboolean expose_cb (GtkWidget * widget, 
   18.71 +                           GdkEventExpose * event, 
   18.72 +                           gpointer user_data);
   18.73 +
   18.74 +static void
   18.75 +mmyth_tvplayer_class_init (MMythTVPlayerClass *klass)
   18.76 +{
   18.77 +	GObjectClass *gobject_class;
   18.78 +
   18.79 +    gobject_class = (GObjectClass *) klass;
   18.80 +	
   18.81 +    gobject_class->dispose  = mmyth_tvplayer_dispose;
   18.82 +    gobject_class->finalize = mmyth_tvplayer_finalize;	
   18.83 +}
   18.84 +
   18.85 +static void
   18.86 +new_pad_cb (GstElement *element, GstPad *pad, gpointer data)
   18.87 +{
   18.88 +	MMythTVPlayer *tvplayer = MMYTH_TVPLAYER (data);
   18.89 +	GstPadLinkReturn ret;
   18.90 +	char *s;
   18.91 +	
   18.92 +	s = gst_caps_to_string (pad->caps);
   18.93 +
   18.94 +	if ( s[0] == 'a') {
   18.95 +		ret = gst_pad_link (pad, gst_element_get_pad (tvplayer->audioqueue, "sink"));
   18.96 +	} else {
   18.97 +		ret = gst_pad_link (pad, gst_element_get_pad (tvplayer->videoqueue, "sink")); 
   18.98 +	}
   18.99 +	
  18.100 +	g_free(s);
  18.101 +}
  18.102 +
  18.103 +static gboolean
  18.104 +expose_cb (GtkWidget * widget, GdkEventExpose * event, gpointer user_data)
  18.105 +{
  18.106 +    MMythTVPlayer *tvplayer = MMYTH_TVPLAYER (user_data);
  18.107 +
  18.108 +	if (tvplayer && tvplayer->videow) {
  18.109 +	    gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (tvplayer->gst_videosink),
  18.110 +                                  GDK_WINDOW_XWINDOW (widget->window));
  18.111 +		return TRUE;
  18.112 +	}
  18.113 +	
  18.114 +	g_warning ("MMythTVPlayer expose called before setting video window\n");
  18.115 +	
  18.116 +    return FALSE;
  18.117 +}
  18.118 +
  18.119 +static void
  18.120 +mmyth_tvplayer_init (MMythTVPlayer *tvplayer)
  18.121 +{
  18.122 +    tvplayer->gst_pipeline = NULL;
  18.123 +    tvplayer->gst_source = NULL;
  18.124 +    tvplayer->gst_videodec = NULL;
  18.125 +    tvplayer->gst_videosink = NULL;
  18.126 +    tvplayer->videoqueue = NULL;
  18.127 +    tvplayer->audioqueue = NULL;
  18.128 +    
  18.129 +    /* GTKWidget for rendering the video */
  18.130 +    tvplayer->videow = NULL;
  18.131 +	tvplayer->expose_handler = 0;
  18.132 +	    
  18.133 +	tvplayer->backend_hostname = NULL;
  18.134 +	tvplayer->backend_port = 0;
  18.135 +	tvplayer->local_hostname = NULL;
  18.136 +
  18.137 +	tvplayer->remote_encoder = NULL;
  18.138 +	tvplayer->tvchain = NULL;
  18.139 +	tvplayer->proginfo = NULL;
  18.140 +}
  18.141 +
  18.142 +static void
  18.143 +mmyth_tvplayer_dispose (GObject *object)
  18.144 +{
  18.145 +
  18.146 +	G_OBJECT_CLASS (mmyth_tvplayer_parent_class)->dispose (object);
  18.147 +}
  18.148 +
  18.149 +static void
  18.150 +mmyth_tvplayer_finalize (GObject *object)
  18.151 +{
  18.152 +	g_signal_handlers_destroy (object);
  18.153 +
  18.154 +	MMythTVPlayer *tvplayer = MMYTH_TVPLAYER (object);
  18.155 +
  18.156 +	g_debug ("[%s] Finalizing tvplayer", __FUNCTION__);
  18.157 +	
  18.158 +	if (tvplayer->videow != NULL) {
  18.159 +		if (g_signal_handler_is_connected (tvplayer->videow, 
  18.160 +						tvplayer->expose_handler)) {
  18.161 +			g_signal_handler_disconnect (tvplayer->videow,
  18.162 +				tvplayer->expose_handler);
  18.163 +		}
  18.164 +		g_object_unref (tvplayer->videow);
  18.165 +	}
  18.166 +	
  18.167 +	if ( tvplayer->remote_encoder != NULL )
  18.168 +		g_object_unref (tvplayer->remote_encoder);
  18.169 +	if ( tvplayer->tvchain != NULL )
  18.170 +		g_object_unref (tvplayer->tvchain);
  18.171 +	if ( tvplayer->proginfo != NULL )
  18.172 +		g_object_unref (tvplayer->proginfo);	
  18.173 +
  18.174 +	// Release Gstreamer elements
  18.175 +	if ( tvplayer->gst_pipeline != NULL )
  18.176 +		g_object_unref (tvplayer->gst_pipeline);	
  18.177 +	if ( tvplayer->gst_source != NULL )
  18.178 +		g_object_unref (tvplayer->gst_source);	
  18.179 +	if ( tvplayer->gst_videodec != NULL )
  18.180 +		g_object_unref (tvplayer->gst_videodec);	
  18.181 +	if ( tvplayer->gst_videosink != NULL )
  18.182 +		g_object_unref (tvplayer->gst_videosink);	
  18.183 +	if ( tvplayer->videoqueue != NULL )
  18.184 +		g_object_unref (tvplayer->videoqueue);	
  18.185 +	if ( tvplayer->audioqueue != NULL )
  18.186 +		g_object_unref (tvplayer->audioqueue);	
  18.187 +
  18.188 +	G_OBJECT_CLASS (mmyth_tvplayer_parent_class)->finalize (object);
  18.189 +}
  18.190 +
  18.191 +/** Creates a new instance of MMythTVPlayer. 
  18.192 + * 
  18.193 + * @return a new instance of MMythTVPlayer.
  18.194 + */
  18.195 +MMythTVPlayer *
  18.196 +mmyth_tvplayer_new ()
  18.197 +{
  18.198 +    MMythTVPlayer *tvplayer = 
  18.199 +        MMYTH_TVPLAYER (g_object_new(MMYTH_TVPLAYER_TYPE, NULL));
  18.200 +    
  18.201 +    return tvplayer;
  18.202 +}
  18.203 +
  18.204 +/** Initializes the tv player.
  18.205 + *
  18.206 + * @param tvplayer the object instance.
  18.207 + * @return gboolean TRUE if the pipeline was created 
  18.208 + * successfully, FALSE otherwise.
  18.209 + */
  18.210 +gboolean
  18.211 +mmyth_tvplayer_initialize (MMythTVPlayer *tvplayer)
  18.212 +{
  18.213 +	
  18.214 +    if (!mmyth_tvplayer_create_pipeline (tvplayer)) {
  18.215 +    	g_warning ("[%s] Error while creating pipeline. TV Player not initialized", __FUNCTION__);
  18.216 +		return FALSE;
  18.217 +	} else {
  18.218 +		g_debug ("[%s] GStreamer pipeline created", __FUNCTION__);	
  18.219 +    }
  18.220 +
  18.221 +	return TRUE;
  18.222 +}
  18.223 +
  18.224 +/** Creates the GStreamer pipeline used by the player.
  18.225 + *
  18.226 + * @param tvplayer the object instance.
  18.227 + * @return gboolean TRUE if the pipeline was created 
  18.228 + * successfully, FALSE otherwise.
  18.229 + */
  18.230 +static gboolean
  18.231 +mmyth_tvplayer_create_pipeline (MMythTVPlayer* tvplayer)
  18.232 +{
  18.233 +    GstElement *pipeline;
  18.234 +    GstElement *source, *parser;
  18.235 +    GstElement *videodec, *videosink;
  18.236 +#ifndef MAEMO_PLATFORM    
  18.237 +    GstElement *audiodec, *audioconv;
  18.238 +#endif
  18.239 +    GstElement *audiosink;
  18.240 +    GstElement *videoqueue, *audioqueue;
  18.241 +
  18.242 +    g_debug ("MMythTVPlayer: Setting the Gstreamer pipeline\n");
  18.243 +	
  18.244 +    pipeline = gst_pipeline_new ("video-player");
  18.245 +    source = gst_element_factory_make ("mythtvsrc", "myth-source");
  18.246 +    parser = gst_element_factory_make ("ffdemux_nuv", "nuv-demux");
  18.247 +
  18.248 +    /* Gstreamer Video elements */
  18.249 +    videoqueue = gst_element_factory_make ("queue", "video-queue");
  18.250 +    videodec = gst_element_factory_make ("ffdec_mpeg4", "video-decoder");
  18.251 +#ifdef MAEMO_PLATFORM
  18.252 +    videosink = gst_element_factory_make ("sdlvideosink", "image-output");
  18.253 +#else
  18.254 +    videosink = gst_element_factory_make ("xvimagesink", "image-output");
  18.255 +#endif
  18.256 +    
  18.257 +    /* Gstreamer Audio elements */
  18.258 +    audioqueue = gst_element_factory_make ("queue", "audio-queue");    
  18.259 +#ifdef MAEMO_PLATFORM    
  18.260 +    audiosink = gst_element_factory_make ("dspmp3sink", "audio-output");
  18.261 +#else    
  18.262 +    audiodec = gst_element_factory_make ("ffdec_mp3", "audio-decoder");
  18.263 +    audioconv = gst_element_factory_make ("audioconvert", "audio-converter");
  18.264 +    audiosink = gst_element_factory_make ("alsasink", "audio-output");
  18.265 +#endif    
  18.266 +    
  18.267 +    if (!(pipeline && source && parser && videodec && videosink) ||
  18.268 +    	!(videoqueue && audioqueue && audiosink)) {
  18.269 +        /* FIXME: hanlde the error correctly */
  18.270 +        /* video_alignment is not being created (below) 
  18.271 +           and is causing problems to the ui */
  18.272 +
  18.273 +	    tvplayer->gst_pipeline = NULL;
  18.274 +	    tvplayer->gst_videodec = NULL;
  18.275 +	    tvplayer->gst_videosink = NULL;
  18.276 +           
  18.277 +        g_warning ("GstElement creation error!\n");
  18.278 +        return FALSE;
  18.279 +    }
  18.280 +
  18.281 +#ifndef MAEMO_PLATFORM    
  18.282 +    if (!(audiodec && audioconv)) {
  18.283 +        g_warning ("GstElement for audio stream creation error!");
  18.284 +        return FALSE;
  18.285 +    }
  18.286 +#endif    
  18.287 +    
  18.288 +    
  18.289 +    tvplayer->gst_pipeline = pipeline;
  18.290 +    tvplayer->gst_source = source;
  18.291 +    tvplayer->gst_videodec = videodec;
  18.292 +    tvplayer->gst_videosink = videosink;
  18.293 +    g_object_ref (tvplayer->gst_pipeline);
  18.294 +    g_object_ref (tvplayer->gst_source);
  18.295 +    g_object_ref (tvplayer->gst_videodec);
  18.296 +    g_object_ref (tvplayer->gst_videosink);
  18.297 +
  18.298 +    tvplayer->videoqueue = videoqueue;
  18.299 +    tvplayer->audioqueue = audioqueue;
  18.300 +    g_object_ref (tvplayer->videoqueue);
  18.301 +    g_object_ref (tvplayer->audioqueue);
  18.302 +   	
  18.303 +    g_object_set (G_OBJECT (videosink), "sync", TRUE, NULL);
  18.304 +    g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL);
  18.305 +
  18.306 +    gst_bus_add_watch (gst_pipeline_get_bus (GST_PIPELINE (tvplayer->gst_pipeline)),
  18.307 +                       bus_call, tvplayer);
  18.308 +
  18.309 +    gst_bin_add_many (GST_BIN (pipeline), source, parser, videoqueue,
  18.310 +    			videodec, videosink, audioqueue, audiodec, audioconv, audiosink, NULL);
  18.311 +
  18.312 +    {
  18.313 +//        GstCaps *rtpcaps = gst_caps_new_simple ("application/x-rtp", NULL);
  18.314 +//        gst_element_link_filtered(source, parser, rtpcaps);
  18.315 +    }
  18.316 +    
  18.317 +    gst_element_link (source, parser);
  18.318 +    gst_element_link_many (videoqueue, videodec, videosink, NULL);
  18.319 +    gst_element_link_many (audioqueue, audiodec, audioconv, audiosink, NULL);
  18.320 +    
  18.321 +    g_signal_connect (parser, "pad-added", G_CALLBACK (new_pad_cb), tvplayer);
  18.322 +    
  18.323 +    return TRUE;
  18.324 +}
  18.325 +
  18.326 +/** Configures the backend and the tv player 
  18.327 + * for playing the recorded content A/V.
  18.328 + *
  18.329 + * FIXME: Change filename to program info or other structure about the recorded
  18.330 + *
  18.331 + * @param tvplayer the object instance.
  18.332 + * @param filename the file uri of the recorded content to be played.
  18.333 + * @return TRUE if successfull, FALSE if any error happens.
  18.334 + */
  18.335 +gboolean
  18.336 +mmyth_tvplayer_record_setup (MMythTVPlayer *tvplayer, gchar *filename)
  18.337 +{
  18.338 +	GMythSettings *msettings = gmyth_context_get_settings();
  18.339 +	
  18.340 +	// FIXME: we should receive the uri instead of filename
  18.341 +	GString *hostname = gmyth_settings_get_backend_hostname (msettings);
  18.342 +	int port = gmyth_settings_get_backend_port(msettings);
  18.343 +	
  18.344 +	GString *fullpath = g_string_new ("myth://");
  18.345 +	g_string_append_printf (fullpath, "%s:%d/%s", hostname->str, port, filename);
  18.346 +	
  18.347 +	tvplayer->is_livetv = FALSE;
  18.348 +
  18.349 +	g_debug ("[%s] Setting record uri to gstreamer pipeline to %s", __FUNCTION__, fullpath->str);
  18.350 +		
  18.351 +    g_object_set (G_OBJECT (tvplayer->gst_source), "location",
  18.352 +          fullpath->str, NULL);
  18.353 +          
  18.354 +    return TRUE;
  18.355 +}
  18.356 +
  18.357 +/** Configures the backend and the tv player 
  18.358 + * for playing the live tv.
  18.359 + *
  18.360 + * @param tvplayer the object instance.
  18.361 + * @return TRUE if successfull, FALSE if any error happens.
  18.362 + */
  18.363 +gboolean
  18.364 +mmyth_tvplayer_livetv_setup (MMythTVPlayer *tvplayer)
  18.365 +{
  18.366 +	GMythSettings *msettings = gmyth_context_get_settings ();
  18.367 +	gboolean res = TRUE;
  18.368 +
  18.369 +	res = gmyth_context_check_connection();
  18.370 +	if (!res) {
  18.371 +		g_warning ("[%s] LiveTV can not connect to backend", __FUNCTION__);	
  18.372 +		res = FALSE;
  18.373 +		goto error;
  18.374 +	}
  18.375 +
  18.376 +	tvplayer->backend_hostname = gmyth_settings_get_backend_hostname(msettings);
  18.377 +	tvplayer->backend_port = gmyth_settings_get_backend_port (msettings);
  18.378 +
  18.379 +	tvplayer->local_hostname  = g_string_new("");    
  18.380 +	gmyth_context_get_local_hostname (tvplayer->local_hostname);
  18.381 +
  18.382 +	if ( tvplayer->local_hostname == NULL ) {
  18.383 +		res = FALSE;
  18.384 +		goto error;
  18.385 +	}
  18.386 +
  18.387 +	// Gets the remote encoder num
  18.388 +	tvplayer->remote_encoder = remote_request_next_free_recorder (-1);
  18.389 +
  18.390 +	if ( tvplayer->remote_encoder == NULL ) {
  18.391 +		g_warning ("[%s] None remote encoder available", __FUNCTION__);
  18.392 +		res = FALSE;
  18.393 +		goto error;
  18.394 +	}
  18.395 +
  18.396 +	// Creates livetv chain handler
  18.397 +	tvplayer->tvchain = GMYTH_TVCHAIN ( g_object_new(GMYTH_TVCHAIN_TYPE, NULL) );
  18.398 +	gmyth_tvchain_initialize ( tvplayer->tvchain, tvplayer->local_hostname );
  18.399 +
  18.400 +	if ( tvplayer->tvchain == NULL || tvplayer->tvchain->tvchain_id == NULL ) {
  18.401 +		res = FALSE;
  18.402 +		goto error;
  18.403 +	}
  18.404 +
  18.405 +	// Init remote encoder. Opens its control socket.
  18.406 +	res = gmyth_remote_encoder_setup(tvplayer->remote_encoder);
  18.407 +	if ( !res ) {
  18.408 +		g_warning ("[%s] Fail while setting remote encoder\n", __FUNCTION__);
  18.409 +		res = FALSE;
  18.410 +		goto error;
  18.411 +	}
  18.412 +	// Spawn live tv. Uses the socket to send mythprotocol data to start livetv in the backend (remotelly)
  18.413 +	res = gmyth_remote_encoder_spawntv ( tvplayer->remote_encoder,
  18.414 +			gmyth_tvchain_get_id(tvplayer->tvchain) );
  18.415 +	if (!res) {
  18.416 +		g_warning ("[%s] Fail while spawn tv\n", __FUNCTION__);
  18.417 +		res = FALSE;
  18.418 +		goto error;
  18.419 +	}
  18.420 +
  18.421 +	// Reload all TV chain from Mysql database.
  18.422 +	gmyth_tvchain_reload_all (tvplayer->tvchain);
  18.423 +
  18.424 +	if ( tvplayer->tvchain == NULL ) {
  18.425 +		res = FALSE;
  18.426 +		goto error;
  18.427 +	}
  18.428 +
  18.429 +	// Get program info from database using chanid and starttime
  18.430 +	tvplayer->proginfo = gmyth_tvchain_get_program_at (tvplayer->tvchain, -1);
  18.431 +	if ( tvplayer->proginfo == NULL ) {
  18.432 +		g_warning ("[%s] LiveTV not successfully started.\n", __FUNCTION__ );
  18.433 +		res = FALSE;
  18.434 +		goto error;
  18.435 +	} else {
  18.436 +		g_debug ("[%s] MythLiveTV: All requests to backend to start TV were OK.\n", __FUNCTION__ );
  18.437 +	}
  18.438 +
  18.439 +	return res;
  18.440 +
  18.441 +error:
  18.442 +	if ( tvplayer->backend_hostname != NULL ) {
  18.443 +		g_string_free( tvplayer->backend_hostname, TRUE );
  18.444 +		res = FALSE;
  18.445 +	}
  18.446 +
  18.447 +	if ( tvplayer->local_hostname != NULL ) {
  18.448 +		g_string_free( tvplayer->local_hostname, TRUE );
  18.449 +		res = FALSE;
  18.450 +	}
  18.451 +
  18.452 +	if ( tvplayer->remote_encoder != NULL ) {
  18.453 +		g_object_unref (tvplayer->remote_encoder);
  18.454 +		tvplayer->remote_encoder = NULL;
  18.455 +	}
  18.456 +
  18.457 +	if ( tvplayer->tvchain != NULL ) {
  18.458 +		g_object_unref (tvplayer->tvchain);
  18.459 +		tvplayer->tvchain = NULL;
  18.460 +	}
  18.461 +
  18.462 +	if ( tvplayer->proginfo != NULL ) {
  18.463 +		g_object_unref (tvplayer->proginfo);
  18.464 +		tvplayer->proginfo = NULL;
  18.465 +	}
  18.466 +
  18.467 +	return res;
  18.468 +
  18.469 +}
  18.470 +
  18.471 +/** Sets the GTK video widget for the tv player. 
  18.472 + *
  18.473 + * @param tvplayer the object instance.
  18.474 + * @param videow the GTK video window.
  18.475 + * @return TRUE if successfull, FALSE if any error happens.
  18.476 + */
  18.477 +gboolean
  18.478 +mmyth_tvplayer_set_widget (MMythTVPlayer *tvplayer, GtkWidget *videow)
  18.479 +{
  18.480 +	tvplayer->videow = videow;
  18.481 +	g_object_ref (videow);
  18.482 +	
  18.483 +	g_debug ("[%s] Setting widget for tv player render", __FUNCTION__);
  18.484 +	
  18.485 +    tvplayer->expose_handler = g_signal_connect (tvplayer->videow, "expose-event", 
  18.486 +                                                 G_CALLBACK (expose_cb), tvplayer);
  18.487 +
  18.488 +    //g_signal_connect(miptv_ui->videow, "size_request", G_CALLBACK(cb_preferred_video_size), miptv_ui);
  18.489 +
  18.490 +    return TRUE;
  18.491 +}
  18.492 +
  18.493 +static gboolean
  18.494 +bus_call (GstBus * bus, GstMessage * msg, gpointer data)
  18.495 +{
  18.496 +    //MMythTVPlayer *tvplayer = MMYTH_TVPLAYER ( data );
  18.497 +    //GMainLoop *loop = tvplayer->loop;
  18.498 +
  18.499 +    switch (GST_MESSAGE_TYPE (msg)) {
  18.500 +        case GST_MESSAGE_EOS:
  18.501 +			printf ("End of stream\n");
  18.502 +            //g_idle_add ((GSourceFunc) idle_eos, data);
  18.503 +            gst_element_set_state ( GST_ELEMENT (GST_MESSAGE_SRC (msg)), GST_STATE_NULL );
  18.504 +	    gst_element_set_locked_state ( GST_ELEMENT (GST_MESSAGE_SRC (msg)), FALSE );
  18.505 +            break;
  18.506 +        case GST_MESSAGE_ERROR:
  18.507 +        {
  18.508 +                gchar *debug;
  18.509 +                GError *err;
  18.510 +
  18.511 +                gst_message_parse_error (msg, &err, &debug);
  18.512 +                g_free (debug);
  18.513 +
  18.514 +                printf ("Error: %s\n", err->message);
  18.515 +                g_error_free (err);
  18.516 +
  18.517 +                //g_main_loop_quit (loop);
  18.518 +        }
  18.519 +            break;
  18.520 +        default:
  18.521 +            printf (gst_message_type_get_name (GST_MESSAGE_TYPE (msg)));
  18.522 +            printf ("\n");
  18.523 +            break;
  18.524 +    }
  18.525 +
  18.526 +    return TRUE;
  18.527 +}
  18.528 +
  18.529 +
  18.530 +#if 0
  18.531 +static gboolean
  18.532 +idle_state (gpointer data)
  18.533 +{
  18.534 +    GstPlayerWindowStateChange *st = data;
  18.535 +
  18.536 +    if (st->old_state == GST_STATE_PLAYING) {
  18.537 +        if (st->miptv_ui->idle_id != 0) {
  18.538 +            g_source_remove (st->miptv_ui->idle_id);
  18.539 +            st->miptv_ui->idle_id = 0;
  18.540 +        }
  18.541 +    }
  18.542 +    else if (st->new_state == GST_STATE_PLAYING) {
  18.543 +        if (st->miptv_ui->idle_id != 0)
  18.544 +            g_source_remove (st->miptv_ui->idle_id);
  18.545 +
  18.546 +        st->miptv_ui->idle_id = g_idle_add (cb_iterate, st->miptv_ui);
  18.547 +    }
  18.548 +
  18.549 +    /* new movie loaded? */
  18.550 +    if (st->old_state == GST_STATE_READY && st->new_state > GST_STATE_READY) {
  18.551 +
  18.552 +        /* gboolean have_video = FALSE; */
  18.553 +
  18.554 +        gtk_widget_show (st->miptv_ui->videow);
  18.555 +
  18.556 +        gtk_window_resize (GTK_WINDOW (st->miptv_ui->main_window), 1, 1);
  18.557 +
  18.558 +    }
  18.559 +
  18.560 +    /* discarded movie? */
  18.561 +    if (st->old_state > GST_STATE_READY && st->new_state == GST_STATE_READY) {
  18.562 +
  18.563 +        if (st->miptv_ui->tagcache) {
  18.564 +            gst_tag_list_free (st->miptv_ui->tagcache);
  18.565 +            st->miptv_ui->tagcache = NULL;
  18.566 +        }
  18.567 +    }
  18.568 +
  18.569 +    gst_object_unref (GST_OBJECT (st->play));
  18.570 +    //g_object_unref (G_OBJECT (st->win));
  18.571 +    g_free (st);
  18.572 +
  18.573 +    /* once */
  18.574 +    return FALSE;
  18.575 +}
  18.576 +
  18.577 +#endif
  18.578 +
  18.579 +/** Stops playing the current A/V.
  18.580 + *
  18.581 + * FIXME: How to proceed differently between livetv 
  18.582 + * and recorded content?
  18.583 + *
  18.584 + * @param tvplayer the object instance.
  18.585 + * @return void 
  18.586 + */
  18.587 +void
  18.588 +mmyth_tvplayer_stop_playing (MMythTVPlayer *tvplayer) 
  18.589 +{
  18.590 +    g_debug ("[%s] Setting gstreamer pipeline state to NULL", __FUNCTION__);
  18.591 +
  18.592 +    gst_element_set_state (tvplayer->gst_pipeline, GST_STATE_NULL);
  18.593 +    
  18.594 +    if (tvplayer->is_livetv) {
  18.595 +	    if (!gmyth_remote_encoder_stop_livetv (tvplayer->remote_encoder)) {
  18.596 +	    	g_warning ("[%s] Error while stoping remote encoder", __FUNCTION__);	
  18.597 +	    }
  18.598 +    }
  18.599 +}
  18.600 +
  18.601 +/** Queries if the tvplayer is active playing A/V content.
  18.602 + *
  18.603 + * @param tvplayer the object instance.
  18.604 + * @return TRUE if the tvplayer is active, FALSE otherwise.
  18.605 + */
  18.606 +gboolean
  18.607 +mmyth_tvplayer_is_playing (MMythTVPlayer *tvplayer)
  18.608 +{
  18.609 +	return (GST_STATE (tvplayer->gst_pipeline) == GST_STATE_PLAYING);
  18.610 +}
  18.611 +
  18.612 +/** Static function that sets the tvplayer state to PLAYING.
  18.613 + *
  18.614 + * @param tvplayer the object instance.
  18.615 + * @return TRUE if the tvplayer is active, FALSE otherwise.
  18.616 + */
  18.617 +static gboolean
  18.618 +idle_play (gpointer data)
  18.619 +{
  18.620 +    MMythTVPlayer *tvplayer = MMYTH_TVPLAYER (data);
  18.621 +
  18.622 +	g_debug ("MMythTVPlayer: Setting pipeline state to PLAYING\n");
  18.623 +
  18.624 +    gst_element_set_state (tvplayer->gst_pipeline, GST_STATE_PLAYING);
  18.625 +
  18.626 +    return FALSE;
  18.627 +}
  18.628 +
  18.629 +/** Start playing A/V with the tvplayer attributes.
  18.630 + *
  18.631 + * @param tvplayer the object instance.
  18.632 + */
  18.633 +void
  18.634 +mmyth_tvplayer_start_playing (MMythTVPlayer *tvplayer)
  18.635 +{
  18.636 +
  18.637 +	// FIXME: Move this to livetv_setup??
  18.638 +	if (tvplayer->is_livetv) {
  18.639 +
  18.640 +	#if 0
  18.641 +		if (!tvplayer || !(tvplayer->proginfo) || !(tvplayer->local_hostname)
  18.642 +				|| !(tvplayer->gst_source)) {
  18.643 +			g_warning ("GMythtvPlayer not ready to start playing\n");		
  18.644 +		}
  18.645 +
  18.646 +		if (!(tvplayer->proginfo->pathname)) {
  18.647 +			g_warning ("[%s] Playback url is null, could not play the myth content", __FUNCTION__);
  18.648 +			return;
  18.649 +		}
  18.650 +
  18.651 +		g_debug ("MMythTVPlayer: Start playing %s", tvplayer->proginfo->pathname->str);
  18.652 +#endif
  18.653 +		g_object_set (G_OBJECT (tvplayer->gst_source), "mythtv-live",
  18.654 +				TRUE, NULL);
  18.655 +#if 0
  18.656 +		if ( tvplayer->tvchain != NULL ) {
  18.657 +			GString *str_chainid = gmyth_tvchain_get_id(tvplayer->tvchain);
  18.658 +			g_print( "[%s]\tCHAIN ID: %s\n", __FUNCTION__, str_chainid->str );
  18.659 +
  18.660 +			g_object_set (G_OBJECT (tvplayer->gst_source), "mythtv-live-chainid", 
  18.661 +					g_strdup( str_chainid->str ), NULL);      
  18.662 +			if ( str_chainid!=NULL)
  18.663 +				g_string_free( str_chainid, FALSE );
  18.664 +		}
  18.665 +
  18.666 +		if ( tvplayer->remote_encoder != NULL )	
  18.667 +			g_object_set (G_OBJECT (tvplayer->gst_source), "mythtv-live-id",
  18.668 +					tvplayer->remote_encoder->recorder_num, NULL );
  18.669 +		g_debug ("[%s] Setting location to %s", __FUNCTION__, 
  18.670 +				tvplayer->proginfo->pathname->str);
  18.671 +
  18.672 +		/* Sets the gstreamer properties acording to the service access address */
  18.673 +		g_object_set (G_OBJECT (tvplayer->gst_source), "location",
  18.674 +				tvplayer->proginfo->pathname->str, NULL);              
  18.675 +#endif
  18.676 +	}
  18.677 +
  18.678 +	g_object_set (G_OBJECT (tvplayer->gst_source), "mythtv-version",
  18.679 +              MYTHTV_VERSION_DEFAULT, NULL);
  18.680 +
  18.681 +    g_object_set (G_OBJECT (tvplayer->gst_source), "mythtv-debug",
  18.682 +              TRUE, NULL);
  18.683 +
  18.684 +    g_idle_add (idle_play, tvplayer);
  18.685 +
  18.686 +}
  18.687 +
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/maemo-ui/src/mmyth_tvplayer.h	Thu Sep 28 16:02:14 2006 +0100
    19.3 @@ -0,0 +1,112 @@
    19.4 +/**
    19.5 + * GMyth Library
    19.6 + *
    19.7 + * @file gmyth/mmyth_tvplayer.h
    19.8 + * 
    19.9 + * @brief <p> This component provides playback of the remote A/V using
   19.10 + * GStreamer.
   19.11 + * 
   19.12 + * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
   19.13 + * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
   19.14 + *
   19.15 + *//*
   19.16 + * 
   19.17 + * This program is free software; you can redistribute it and/or modify
   19.18 + * it under the terms of the GNU Lesser General Public License as published by
   19.19 + * the Free Software Foundation; either version 2 of the License, or
   19.20 + * (at your option) any later version.
   19.21 + *
   19.22 + * This program is distributed in the hope that it will be useful,
   19.23 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   19.24 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   19.25 + * GNU General Public License for more details.
   19.26 + *
   19.27 + * You should have received a copy of the GNU Lesser General Public License
   19.28 + * along with this program; if not, write to the Free Software
   19.29 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   19.30 + */
   19.31 +
   19.32 +#ifndef MMYTH_TVPLAYER_H_
   19.33 +#define MMYTH_TVPLAYER_H_
   19.34 +
   19.35 +#include <glib-object.h>
   19.36 +#include <gtk/gtk.h>
   19.37 +
   19.38 +/* GStreamer includes */
   19.39 +#include <gst/gst.h>
   19.40 +#include <gst/interfaces/xoverlay.h>
   19.41 +
   19.42 +#include "gmyth_remote_encoder.h"
   19.43 +#include "gmyth_tvchain.h"
   19.44 +#include "gmyth_common.h"
   19.45 +
   19.46 +G_BEGIN_DECLS
   19.47 +
   19.48 +#define MMYTH_TVPLAYER_TYPE               (mmyth_tvplayer_get_type ())
   19.49 +#define MMYTH_TVPLAYER(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), MMYTH_TVPLAYER_TYPE, MMythTVPlayer))
   19.50 +#define MMYTH_TVPLAYER_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), MMYTH_TVPLAYER_TYPE, MMythTVPlayerClass))
   19.51 +#define IS_MMYTH_TVPLAYER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), MMYTH_TVPLAYER_TYPE))
   19.52 +#define IS_MMYTH_TVPLAYER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), MMYTH_TVPLAYER_TYPE))
   19.53 +#define MMYTH_TVPLAYER_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), MMYTH_TVPLAYER_TYPE, MMythTVPlayerClass))
   19.54 +
   19.55 +
   19.56 +typedef struct _MMythTVPlayer         MMythTVPlayer;
   19.57 +typedef struct _MMythTVPlayerClass    MMythTVPlayerClass;
   19.58 +
   19.59 +struct _MMythTVPlayerClass
   19.60 +{
   19.61 +    GObjectClass parent_class;
   19.62 +
   19.63 +      /* callbacks */
   19.64 +      /*  no one for now */
   19.65 +};
   19.66 +
   19.67 +struct _MMythTVPlayer
   19.68 +{
   19.69 +    GObject parent;
   19.70 +    
   19.71 +    GstElement *gst_pipeline;
   19.72 +    GstElement *gst_source;
   19.73 +    GstElement *gst_videodec;
   19.74 +    GstElement *gst_videosink;
   19.75 +    GstElement *videoqueue;
   19.76 +    GstElement *audioqueue;
   19.77 +    
   19.78 +    gulong expose_handler;
   19.79 +//    GMainLoop *loop;
   19.80 +    
   19.81 +    GtkWidget *videow;
   19.82 +
   19.83 +	/* Backend connection related variables */
   19.84 +	GString *backend_hostname;
   19.85 +	gint backend_port;
   19.86 +	GString *local_hostname;
   19.87 +
   19.88 +	GMythRemoteEncoder *remote_encoder;
   19.89 +	GMythTVChain *tvchain;
   19.90 +	GMythProgramInfo *proginfo;
   19.91 +	
   19.92 +	gboolean is_livetv;
   19.93 +};
   19.94 +
   19.95 +
   19.96 +GType          mmyth_tvplayer_get_type (void);
   19.97 +
   19.98 +MMythTVPlayer* mmyth_tvplayer_new ();
   19.99 +gboolean       mmyth_tvplayer_initialize (MMythTVPlayer *tvplayer);
  19.100 +
  19.101 +void           mmyth_tvplayer_start_playing   (MMythTVPlayer *tvplayer);
  19.102 +void           mmyth_tvplayer_stop_playing    (MMythTVPlayer *tvplayer);
  19.103 +
  19.104 +gboolean       mmyth_tvplayer_set_widget   (MMythTVPlayer *tvplayer, 
  19.105 +                                            GtkWidget *videow);
  19.106 +
  19.107 +gboolean       mmyth_tvplayer_is_playing   (MMythTVPlayer *tvplayer);
  19.108 +
  19.109 +gboolean       mmyth_tvplayer_record_setup (MMythTVPlayer *tvplayer, 
  19.110 +                                            gchar *filename);
  19.111 +gboolean       mmyth_tvplayer_livetv_setup (MMythTVPlayer *tvplayer);
  19.112 +
  19.113 +G_END_DECLS
  19.114 +
  19.115 +#endif /*MMYTH_TVPLAYER_H_*/
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/maemo-ui/src/mmyth_ui.c	Thu Sep 28 16:02:14 2006 +0100
    20.3 @@ -0,0 +1,814 @@
    20.4 +
    20.5 +#include <glib-object.h>
    20.6 +#include <sys/types.h>
    20.7 +#include <sys/stat.h>
    20.8 +#include <unistd.h>
    20.9 +#include <string.h>
   20.10 +#include <stdio.h>
   20.11 +#include <gtk/gtk.h>
   20.12 +#include <gdk/gdkx.h>
   20.13 +#include <gst/interfaces/xoverlay.h>
   20.14 +#include <assert.h>
   20.15 +
   20.16 +#include "mmyth_ui.h"
   20.17 +#include "mmyth_uicommon.h"
   20.18 +#include "mmyth_schedulerui.h"
   20.19 +#include "mmyth_recordui.h"
   20.20 +#include "mmyth_uisettings.h"
   20.21 +#include "mmyth_epg_grid_view.h"
   20.22 +#include "mmyth_tvplayer.h"
   20.23 +
   20.24 +/* GMyth library includes */
   20.25 +#include "gmyth_context.h"
   20.26 +
   20.27 +#ifndef MAEMO_PLATFORM
   20.28 +static gint button_press_handler (GtkWidget *widget, GdkEvent *event);
   20.29 +#endif
   20.30 +
   20.31 +static MMythUiCommon *create_main_view (MMythUi * mmyth_ui);
   20.32 +static MMythUiCommon *create_video_view (MMythUi * mmyth_ui);
   20.33 +static MMythUiCommon *create_epg_grid_view (MMythUi * mmyth_ui);
   20.34 +static MMythUiCommon *create_record_view (MMythUi * mmyth_ui);
   20.35 +static MMythUiCommon *create_schedule_view (MMythUi * mmyth_ui);
   20.36 +
   20.37 +static void cb_video_close_button (GtkButton * button, gpointer user_data);
   20.38 +static void cb_record_button (GtkButton * button, gpointer user_data);
   20.39 +static void cb_menu_item_settings (GtkMenuItem *menuitem, gpointer user_data);
   20.40 +
   20.41 +/* main box from button box separator*/
   20.42 +static GtkWidget *main_vseparator = NULL;
   20.43 +
   20.44 +GdkPixbuf *icon_sports, *icon_news, 
   20.45 +          *icon_movies, *icon_shows, *icon_default;
   20.46 +
   20.47 +#ifndef MAEMO_PLATFORM
   20.48 +/* FIXME: */
   20.49 +static MMythUi *popup_mmyth_ui;
   20.50 +#endif
   20.51 +
   20.52 +MMythUi *
   20.53 +mmyth_ui_initialize (
   20.54 +#ifdef MAEMO_PLATFORM
   20.55 +	HildonProgram *program,
   20.56 +#endif
   20.57 +	GtkWidget * main_window)
   20.58 +{
   20.59 +    MMythUi *mmyth_ui;
   20.60 +
   20.61 +    mmyth_ui = g_new0 (MMythUi, 1);
   20.62 +
   20.63 +    mmyth_ui->main_window = main_window;    
   20.64 +    mmyth_ui->videow = NULL;
   20.65 +    mmyth_ui->mmyth_recordui = NULL;
   20.66 +    mmyth_ui->mmyth_schedulerui = NULL;
   20.67 +	
   20.68 +    /* Horizontal box that divides the view into control and video area */
   20.69 +    mmyth_ui->main_hbox = gtk_hbox_new (FALSE, 0);
   20.70 +    gtk_widget_show (mmyth_ui->main_hbox);
   20.71 +    g_object_ref (mmyth_ui->main_hbox);
   20.72 +
   20.73 +    main_bg_color.red   = 65000;
   20.74 +    main_bg_color.green = 65000;
   20.75 +    main_bg_color.blue  = 65000;
   20.76 +    
   20.77 +    
   20.78 +#ifndef MAEMO_PLATFORM
   20.79 +    /* Popup menu */
   20.80 +    popup_mmyth_ui = mmyth_ui;
   20.81 +    g_signal_connect (G_OBJECT (mmyth_ui->main_hbox), "event",
   20.82 +                      G_CALLBACK (button_press_handler),
   20.83 +                      G_OBJECT (mmyth_ui->main_hbox));    
   20.84 +
   20.85 +#else // #ifdef MAEMO
   20.86 +
   20.87 +    mmyth_ui->main_menu = GTK_MENU(gtk_menu_new());
   20.88 +    hildon_program_set_common_menu(program, mmyth_ui->main_menu);
   20.89 +
   20.90 +    mmyth_ui->menu_setup = gtk_menu_item_new_with_label("Setup");
   20.91 +    gtk_widget_set_size_request (GTK_WIDGET (mmyth_ui->menu_setup), 150, 40);
   20.92 +    gtk_menu_append(mmyth_ui->main_menu, mmyth_ui->menu_setup);
   20.93 +
   20.94 +    g_signal_connect(G_OBJECT(mmyth_ui->menu_setup), "activate", G_CALLBACK(cb_menu_item_settings), mmyth_ui);
   20.95 +
   20.96 +    gtk_widget_show_all (GTK_WIDGET (mmyth_ui->main_menu));
   20.97 +#endif
   20.98 +    
   20.99 +    // Main widget is mmyth_ui->main_hbox
  20.100 +    mmyth_ui->main_uicommon       = create_main_view (mmyth_ui);
  20.101 +
  20.102 +    gtk_container_add (GTK_CONTAINER (mmyth_ui->main_window),
  20.103 +                       mmyth_ui->main_hbox);
  20.104 +
  20.105 +    mmyth_ui_set_widget (mmyth_ui, mmyth_ui->main_uicommon);
  20.106 +
  20.107 +    return mmyth_ui;
  20.108 +}
  20.109 +
  20.110 +void
  20.111 +mmyth_ui_finalize (MMythUi * mmyth_ui)
  20.112 +{
  20.113 +    if (mmyth_ui != NULL) {
  20.114 +    	if (mmyth_ui->main_uicommon)
  20.115 +	    	mmyth_uicommon_free (mmyth_ui->main_uicommon);
  20.116 +    	if (mmyth_ui->video_uicommon)
  20.117 +		    mmyth_uicommon_free (mmyth_ui->video_uicommon);
  20.118 +		if (mmyth_ui->epg_grid_uicommon)
  20.119 +		    mmyth_uicommon_free (mmyth_ui->epg_grid_uicommon);
  20.120 +		if (mmyth_ui->record_uicommon)
  20.121 +		    mmyth_uicommon_free (mmyth_ui->record_uicommon);	    
  20.122 +		if (mmyth_ui->schedule_uicommon)
  20.123 +		    mmyth_uicommon_free (mmyth_ui->schedule_uicommon);
  20.124 +
  20.125 +	    g_free (mmyth_ui);
  20.126 +    }
  20.127 +}
  20.128 +
  20.129 +void
  20.130 +mmyth_ui_set_widget (MMythUi * mmyth_ui, MMythUiCommon * new_uicommon)
  20.131 +{
  20.132 +	if (new_uicommon == NULL) {
  20.133 +		g_warning ("MMythUI setting a NULL UI_Common as current display\n");
  20.134 +		return;
  20.135 +	}
  20.136 +		
  20.137 +    if (mmyth_ui->current_uicommon) {
  20.138 +        if (mmyth_ui->current_uicommon == mmyth_ui->video_uicommon) {
  20.139 +            gtk_widget_hide (mmyth_ui->current_uicommon->main_widget);
  20.140 +            gtk_widget_hide (mmyth_ui->videow);
  20.141 +        }
  20.142 +        else {
  20.143 +            gtk_container_remove (GTK_CONTAINER (mmyth_ui->main_hbox),
  20.144 +                                  mmyth_ui->current_uicommon->main_widget);
  20.145 +        }
  20.146 +
  20.147 +        gtk_container_remove (GTK_CONTAINER (mmyth_ui->main_hbox),
  20.148 +                              mmyth_ui->current_uicommon->event_box);
  20.149 +        gtk_container_remove (GTK_CONTAINER (mmyth_ui->main_hbox),
  20.150 +                              main_vseparator);        
  20.151 +
  20.152 +    }
  20.153 +
  20.154 +    if (new_uicommon->main_widget == mmyth_ui->video_alignment) {
  20.155 +        //gst_player_video_show (GST_PLAYER_VIDEO(mmyth_ui->videow));
  20.156 +        gtk_widget_show (mmyth_ui->video_alignment);
  20.157 +        gtk_widget_show (mmyth_ui->videow);
  20.158 +    }
  20.159 +    else {
  20.160 +        /* FIXME: Fst call is NULL when mmyth_player_init fails */
  20.161 +        if(mmyth_ui->video_alignment != NULL)
  20.162 +            gtk_widget_hide (mmyth_ui->video_alignment);
  20.163 +        /* FIXME: Fst call is NULL when mmyth_player_init fails */
  20.164 +        if(mmyth_ui->videow != NULL)
  20.165 +            gtk_widget_hide (mmyth_ui->videow);
  20.166 +
  20.167 +        gtk_box_pack_start (GTK_BOX (mmyth_ui->main_hbox),
  20.168 +                            new_uicommon->main_widget, TRUE, TRUE, 0);
  20.169 +    }
  20.170 +
  20.171 +    if(main_vseparator == NULL) {
  20.172 +        /* FIXME: should free this variable*/
  20.173 +        main_vseparator = gtk_vseparator_new();
  20.174 +        g_object_ref (main_vseparator);                   
  20.175 +    }  
  20.176 +    gtk_box_pack_start (GTK_BOX (mmyth_ui->main_hbox),
  20.177 +                        main_vseparator, FALSE, FALSE, 0);    
  20.178 +    gtk_widget_show (main_vseparator);
  20.179 +
  20.180 +    gtk_box_pack_end (GTK_BOX (mmyth_ui->main_hbox), new_uicommon->event_box, FALSE,
  20.181 +                      FALSE, 0);         
  20.182 +
  20.183 +    mmyth_ui->current_uicommon = new_uicommon;
  20.184 +
  20.185 +}
  20.186 +
  20.187 +/* The close callback is the same for all windows*/
  20.188 +static void
  20.189 +cb_not_impl_button (GtkButton * button, gpointer user_data)
  20.190 +{
  20.191 +    MMythUi *mmyth_ui = (MMythUi *) user_data;
  20.192 +
  20.193 +    GtkWidget *msg_dialog = gtk_message_dialog_new (
  20.194 +                                           GTK_WINDOW(mmyth_ui->main_window),
  20.195 +                                           GTK_DIALOG_MODAL |
  20.196 +                                           GTK_DIALOG_DESTROY_WITH_PARENT,
  20.197 +                                           GTK_MESSAGE_INFO,
  20.198 +                                           GTK_BUTTONS_OK,
  20.199 +                                           "Feature not implemented");
  20.200 +    gtk_widget_set_size_request (msg_dialog, 350, 120);
  20.201 +
  20.202 +    gtk_dialog_run (GTK_DIALOG (msg_dialog));
  20.203 +
  20.204 +    gtk_widget_destroy(GTK_WIDGET(msg_dialog)); 
  20.205 +}
  20.206 +
  20.207 +/******************************************************************************
  20.208 + *                        POPUP MENU WIDGET METHODS                           *
  20.209 + *****************************************************************************/
  20.210 +
  20.211 +static void 
  20.212 +cb_menu_item_settings (GtkMenuItem *menuitem,
  20.213 +                            gpointer user_data)
  20.214 +{
  20.215 +    
  20.216 +    MMythUi *mmyth_ui = (MMythUi*) user_data;
  20.217 +   
  20.218 +    if (mmyth_uisettings_run (GTK_WINDOW (mmyth_ui->main_window))) {
  20.219 +    	// If user changes the settings, we restart the context
  20.220 +    	g_debug ("[%s] Restarting mmyth_context to new settings", __FUNCTION__);
  20.221 +    	gmyth_context_initialize();
  20.222 +    }
  20.223 +}
  20.224 +
  20.225 +#ifndef MAEMO_PLATFORM
  20.226 +
  20.227 +static void 
  20.228 +detacher (GtkWidget *attach_widget,GtkMenu *menu) 
  20.229 +{
  20.230 +	
  20.231 +}
  20.232 +
  20.233 +static void
  20.234 +do_popup_menu (GtkWidget *my_widget, GdkEventButton *event)
  20.235 +{
  20.236 +    GtkWidget *popup;
  20.237 +
  20.238 +  int button, event_time;
  20.239 +
  20.240 +  GtkWidget *item_general;
  20.241 +  GtkWidget *image;
  20.242 +
  20.243 +  popup = gtk_menu_new ();
  20.244 +
  20.245 +  item_general = gtk_image_menu_item_new_with_mnemonic ("Setup");
  20.246 +  gtk_widget_show (item_general);
  20.247 +  gtk_container_add (GTK_CONTAINER (popup), item_general);
  20.248 +
  20.249 +  image = gtk_image_new_from_stock ("gtk-edit", GTK_ICON_SIZE_MENU);
  20.250 +  gtk_widget_show (image);
  20.251 +  gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item_general), image);
  20.252 +
  20.253 +  g_signal_connect (G_OBJECT(item_general), "activate", G_CALLBACK (cb_menu_item_settings), popup_mmyth_ui);
  20.254 +
  20.255 +    if (event) {
  20.256 +      button = event->button;
  20.257 +      event_time = event->time;
  20.258 +    } else {
  20.259 +      button = 0;
  20.260 +      event_time = gtk_get_current_event_time ();
  20.261 +    }
  20.262 +    
  20.263 +    gtk_menu_attach_to_widget (GTK_MENU (popup), my_widget, detacher);
  20.264 +    gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL, 
  20.265 +                  button, event_time);
  20.266 +    gtk_widget_show_all(popup);
  20.267 +}
  20.268 +
  20.269 +/* Respond to a button-press by posting a menu passed in as widget.
  20.270 + *
  20.271 + * Note that the "widget" argument is the menu being posted, NOT
  20.272 + * the button that was pressed.
  20.273 + */
  20.274 +static gint 
  20.275 +button_press_handler (GtkWidget *widget, GdkEvent *event)
  20.276 +{
  20.277 +
  20.278 +    if (event->type == GDK_BUTTON_PRESS) {
  20.279 +      GdkEventButton *bevent = (GdkEventButton *) event; 
  20.280 +          /* Ignore double-clicks and triple-clicks */
  20.281 +      if (bevent->button == 3)
  20.282 +        {
  20.283 +          do_popup_menu (widget, bevent);
  20.284 +          return TRUE;
  20.285 +        }
  20.286 +    }
  20.287 +
  20.288 +    /* Tell calling code that we have not handled this event; pass it on. */
  20.289 +    return FALSE;
  20.290 +}
  20.291 +#endif
  20.292 +
  20.293 +/******************************************************************************
  20.294 + *                          MAIN APP VIEW METHODS                             *
  20.295 + *****************************************************************************/
  20.296 +
  20.297 +static void
  20.298 +cb_close_button (GtkButton * button, gpointer user_data)
  20.299 +{
  20.300 +    MMythUi *mmyth_ui = (MMythUi *) user_data;
  20.301 +
  20.302 +    mmyth_ui_set_widget (mmyth_ui, mmyth_ui->main_uicommon);
  20.303 +}
  20.304 +
  20.305 +static void
  20.306 +cb_watch_tv_button (GtkButton * button, gpointer user_data)
  20.307 +{
  20.308 +    MMythUi *mmyth_ui = (MMythUi *) user_data;
  20.309 +	gboolean res = FALSE;
  20.310 +	
  20.311 +	if (!(mmyth_ui->video_uicommon))
  20.312 +		mmyth_ui->video_uicommon = create_video_view (mmyth_ui);
  20.313 +	
  20.314 +	// Creates the tv player that will retrieve the mythtv content, decode and show it
  20.315 +	mmyth_ui->tvplayer = mmyth_tvplayer_new ();
  20.316 +	/* choose here if this is a LiveTV session */
  20.317 +	mmyth_ui->tvplayer->is_livetv = TRUE;
  20.318 +
  20.319 +	res = mmyth_tvplayer_initialize (mmyth_ui->tvplayer);
  20.320 +
  20.321 +	if (!res) {
  20.322 +		g_warning ("[%s] Could not initialize tvplayer", __FUNCTION__);
  20.323 +
  20.324 +		g_object_unref (mmyth_ui->tvplayer);
  20.325 +		mmyth_ui->tvplayer = NULL;
  20.326 +
  20.327 +		GtkWidget *dialog = gtk_message_dialog_new (
  20.328 +				GTK_WINDOW(mmyth_ui->main_window),
  20.329 +				GTK_DIALOG_DESTROY_WITH_PARENT,
  20.330 +                GTK_MESSAGE_ERROR,
  20.331 +                GTK_BUTTONS_CLOSE,
  20.332 +			 	"MMyth found errors while starting TV Player, please check "
  20.333 +			 	"the GStreamer installation");
  20.334 +
  20.335 +		gtk_dialog_run (GTK_DIALOG (dialog));
  20.336 +		gtk_widget_destroy (dialog);
  20.337 +		
  20.338 +		return;
  20.339 +	}
  20.340 +	//res = mmyth_tvplayer_livetv_setup (mmyth_ui->tvplayer);
  20.341 +	//
  20.342 +	if (mmyth_ui && mmyth_ui->tvplayer && res) {
  20.343 +		mmyth_tvplayer_set_widget (mmyth_ui->tvplayer, mmyth_ui->videow);
  20.344 +		mmyth_tvplayer_start_playing (mmyth_ui->tvplayer);
  20.345 +	} else {
  20.346 +		// TODO: Show Alert with error description!
  20.347 +		g_warning ("[%s] MMythUI can't initialize tv_player", __FUNCTION__);
  20.348 +		g_object_unref (mmyth_ui->tvplayer);
  20.349 +		mmyth_ui->tvplayer = NULL;
  20.350 +		// FIXME: Show the exact error that happened
  20.351 +		GtkWidget *dialog = gtk_message_dialog_new (
  20.352 +				GTK_WINDOW(mmyth_ui->main_window),
  20.353 +				GTK_DIALOG_DESTROY_WITH_PARENT,
  20.354 +                GTK_MESSAGE_ERROR,
  20.355 +                GTK_BUTTONS_CLOSE,
  20.356 +                "Error while starting TV Player, please check if the backend"
  20.357 +                " is running properly and a tv card is available!");
  20.358 +		gtk_dialog_run (GTK_DIALOG (dialog));
  20.359 +		gtk_widget_destroy (dialog);		
  20.360 +		return;
  20.361 +	}
  20.362 +	mmyth_ui_set_widget (mmyth_ui, mmyth_ui->video_uicommon);
  20.363 +	
  20.364 +}
  20.365 +
  20.366 +static void 
  20.367 +cb_epg_button (GtkButton * button, gpointer user_data)
  20.368 +{
  20.369 +    MMythUi *mmyth_ui = (MMythUi *) user_data;
  20.370 +    
  20.371 +    if (!(mmyth_ui->epg_grid_uicommon))
  20.372 +    	mmyth_ui->epg_grid_uicommon = create_epg_grid_view(mmyth_ui);
  20.373 +    	
  20.374 +    mmyth_ui_set_widget (mmyth_ui, mmyth_ui->epg_grid_uicommon);
  20.375 +}
  20.376 +
  20.377 +static MMythUiCommon *
  20.378 +create_main_view (MMythUi * mmyth_ui)
  20.379 +{
  20.380 +    MMythUiCommon *ui_common;
  20.381 +    GtkWidget *main_widget;
  20.382 +    GtkWidget *image;
  20.383 +
  20.384 +	g_debug ("Creating Main UI Common");
  20.385 +	
  20.386 +    // FIXME: file path
  20.387 +#ifdef MMYTH_DEV
  20.388 +    image = gtk_image_new_from_file ("../pixmaps/mmyth_logo.png");
  20.389 +#else
  20.390 +    image = gtk_image_new_from_file ( PIX_DIR "mmyth_logo.png");
  20.391 +#endif
  20.392 +    
  20.393 +    main_widget = gtk_event_box_new();
  20.394 +    
  20.395 +    gtk_container_add (GTK_CONTAINER (main_widget),
  20.396 +                       image);
  20.397 +
  20.398 +
  20.399 +    gtk_widget_show_all (main_widget);
  20.400 +    g_object_ref (main_widget);
  20.401 +
  20.402 +    ui_common = mmyth_uicommon_new (main_widget,
  20.403 +                                    "Watch TV", "EPG", "Recording");
  20.404 +
  20.405 +    /* Button signals */
  20.406 +    // FIXME
  20.407 +    g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
  20.408 +                      G_CALLBACK (cb_watch_tv_button), mmyth_ui);
  20.409 +    g_signal_connect (G_OBJECT (ui_common->button2), "clicked",
  20.410 +                      G_CALLBACK (cb_epg_button), mmyth_ui);
  20.411 +    g_signal_connect (G_OBJECT (ui_common->button3), "clicked",
  20.412 +                      G_CALLBACK (cb_record_button), mmyth_ui);
  20.413 +
  20.414 +    return ui_common;
  20.415 +
  20.416 +}
  20.417 +
  20.418 +/******************************************************************************
  20.419 + *                         epg GRID VIEW METHODS                              *
  20.420 + *****************************************************************************/
  20.421 +
  20.422 +static MMythUiCommon *
  20.423 +create_epg_grid_view (MMythUi * mmyth_ui)
  20.424 +{
  20.425 +    MMythUiCommon *ui_common;        
  20.426 +
  20.427 +	g_debug ("Creating EPG Grid UI Common");
  20.428 +	
  20.429 +    GtkWidget *epg_grid_view = GTK_WIDGET (epg_grid_view_new (mmyth_ui));
  20.430 +    
  20.431 +    ui_common = mmyth_uicommon_new (epg_grid_view,
  20.432 +                                    "Play", "Record",
  20.433 +                                    "Close");    
  20.434 +    
  20.435 +    /* Button signals */
  20.436 +    g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
  20.437 +                      G_CALLBACK (cb_not_impl_button), mmyth_ui);
  20.438 +    g_signal_connect (G_OBJECT (ui_common->button2), "clicked",
  20.439 +                      G_CALLBACK (cb_record_button), mmyth_ui);
  20.440 +    g_signal_connect (G_OBJECT (ui_common->button3), "clicked",
  20.441 +                      G_CALLBACK (cb_close_button), mmyth_ui);
  20.442 +    
  20.443 +    return ui_common;
  20.444 +}
  20.445 +/******************************************************************************
  20.446 + *                         SCHEDULE VIEW METHODS                                *
  20.447 + ******************************************************************************/
  20.448 +
  20.449 +static void
  20.450 +cb_save_new_schedule (GtkButton *button, gpointer user_data)
  20.451 +{
  20.452 +    MMythUi *mmyth_ui = (MMythUi *) user_data;
  20.453 +
  20.454 +	if (!(mmyth_ui->schedule_uicommon))
  20.455 +		mmyth_ui->schedule_uicommon = create_schedule_view(mmyth_ui);
  20.456 +		
  20.457 +    mmyth_schedulerui_save (mmyth_ui->mmyth_schedulerui);
  20.458 +    
  20.459 +    mmyth_recordui_reload_schedule (mmyth_ui->mmyth_recordui);
  20.460 +    
  20.461 +    mmyth_ui_set_widget (mmyth_ui, mmyth_ui->record_uicommon);
  20.462 +    
  20.463 +}
  20.464 +
  20.465 +static void
  20.466 +cb_edit_scheduled (GtkTreeView * tree_view, GtkTreePath *path, 
  20.467 +		           GtkTreeViewColumn *column, gpointer user_data)
  20.468 +{
  20.469 +    MMythUi *mmyth_ui = (MMythUi *) user_data;
  20.470 +    GtkTreeSelection *selection;
  20.471 +	GtkTreeModel *list_store;
  20.472 +	GtkTreeIter iter;
  20.473 +	int index;
  20.474 +    //gint new_row = 0, record_id = 0;
  20.475 +	ScheduleInfo *schedule_info;
  20.476 +	GList *schedule_list;
  20.477 +	//GtkTreeIter iter;
  20.478 +	gint res;
  20.479 +
  20.480 +	//gtk_tree_store_clear(recordui->sch_tree_store);	
  20.481 +
  20.482 +	res = gmyth_scheduler_get_schedule_list(mmyth_ui->mmyth_recordui->scheduler, &(schedule_list));
  20.483 +	if (res < 0) {
  20.484 +		g_warning ("[%s] Retrieved NULL list of scheduled data from database", __FUNCTION__);
  20.485 +		//return FALSE;
  20.486 +	}
  20.487 +	printf("\nX %d", res); fflush(stdout);
  20.488 +    
  20.489 +   	selection = 
  20.490 +        gtk_tree_view_get_selection(GTK_TREE_VIEW(mmyth_ui->mmyth_recordui->sch_treeview));
  20.491 +    
  20.492 +    gtk_tree_selection_get_selected(selection, &list_store, &iter);
  20.493 +	gtk_tree_model_get(list_store, &iter, 4, &index, -1);
  20.494 +    
  20.495 +    mmyth_ui_set_widget (mmyth_ui, mmyth_ui->schedule_uicommon);
  20.496 +    
  20.497 +	if (!(mmyth_ui->schedule_uicommon))
  20.498 +		mmyth_ui->schedule_uicommon = create_schedule_view(mmyth_ui);
  20.499 +		
  20.500 +	schedule_list = g_list_nth(schedule_list, atoi(gtk_tree_path_to_string(path)));
  20.501 +	schedule_info = (ScheduleInfo*) schedule_list->data;
  20.502 +
  20.503 +    printf("\nstarttime: %ld", schedule_info->start_time); fflush(stdout);		
  20.504 +}
  20.505 +
  20.506 +static MMythUiCommon *
  20.507 +create_schedule_view (MMythUi * mmyth_ui)
  20.508 +{
  20.509 +    MMythUiCommon *ui_common;        
  20.510 +    GtkWidget *schedule_widget;
  20.511 +    
  20.512 +    g_debug ("Creating Schedule UI Common");
  20.513 +
  20.514 +	mmyth_ui->mmyth_schedulerui = mmyth_schedulerui_new ();
  20.515 +	if (mmyth_ui->mmyth_schedulerui == NULL) {
  20.516 +		g_warning ("[%s] Error while creating scheduler ui", __FUNCTION__);
  20.517 +		return NULL;
  20.518 +	}
  20.519 +	
  20.520 +	schedule_widget = mmyth_ui->mmyth_schedulerui->main_widget;
  20.521 +
  20.522 +    gtk_widget_show_all (schedule_widget);
  20.523 +    g_object_ref (schedule_widget);
  20.524 +    
  20.525 +    ui_common = mmyth_uicommon_new (schedule_widget,
  20.526 +                                    "Save", "Clear",
  20.527 +                                    "Cancel");    
  20.528 +
  20.529 +    /* Button signals */
  20.530 +    g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
  20.531 +                      G_CALLBACK (cb_save_new_schedule), mmyth_ui);
  20.532 +    g_signal_connect (G_OBJECT (ui_common->button2), "clicked",
  20.533 +                      G_CALLBACK (cb_not_impl_button), mmyth_ui);
  20.534 +    g_signal_connect (G_OBJECT (ui_common->button3), "clicked",
  20.535 +                      G_CALLBACK (cb_record_button), mmyth_ui);
  20.536 +    
  20.537 +    return ui_common;
  20.538 +}
  20.539 +/******************************************************************************
  20.540 + *                         RECORD VIEW METHODS                                *
  20.541 + ******************************************************************************/
  20.542 +static void
  20.543 +cb_record_button (GtkButton * button, gpointer user_data)
  20.544 +{
  20.545 +    MMythUi *mmyth_ui = (MMythUi *) user_data;
  20.546 +
  20.547 +	if (!(mmyth_ui->record_uicommon)) {
  20.548 +		mmyth_ui->record_uicommon = create_record_view (mmyth_ui);
  20.549 +		mmyth_ui->schedule_uicommon = create_schedule_view (mmyth_ui);
  20.550 +	}
  20.551 +	
  20.552 +	mmyth_recordui_reload_all (mmyth_ui->mmyth_recordui);
  20.553 +	
  20.554 +    mmyth_ui_set_widget (mmyth_ui, mmyth_ui->record_uicommon);
  20.555 +
  20.556 +} 
  20.557 +
  20.558 +static void
  20.559 +cb_record_close_button (GtkButton * button, gpointer user_data)
  20.560 +{
  20.561 +    MMythUi *mmyth_ui = (MMythUi *) user_data;
  20.562 +
  20.563 +	mmyth_ui_set_widget(mmyth_ui, mmyth_ui->main_uicommon);
  20.564 +
  20.565 +	mmyth_recordui_free(mmyth_ui->mmyth_recordui);
  20.566 +	
  20.567 +	if (mmyth_ui->record_uicommon) {
  20.568 +		gtk_widget_destroy (mmyth_ui->record_uicommon->main_widget);
  20.569 +		mmyth_uicommon_free(mmyth_ui->record_uicommon);
  20.570 +		mmyth_ui->record_uicommon = NULL;
  20.571 +	}
  20.572 +
  20.573 +	if (mmyth_ui->schedule_uicommon) {
  20.574 +	//	mmyth_uicommon_free(mmyth_ui->schedule_uicommon);
  20.575 +	}	
  20.576 +} 
  20.577 +
  20.578 +
  20.579 +
  20.580 +
  20.581 +static void
  20.582 +play_selected_recorded (gpointer user_data)
  20.583 +{
  20.584 +    MMythUi *mmyth_ui = (MMythUi *) user_data;
  20.585 +    gboolean res = FALSE;
  20.586 +
  20.587 +    gchar *path = mmyth_recordui_get_selected_recorded (mmyth_ui->mmyth_recordui);
  20.588 +    
  20.589 +    if (path == NULL) {
  20.590 +    	// This should never happens. Play button is just activated when
  20.591 +    	// a recording is selected.
  20.592 +    	g_warning ("[%s] Play button pressed while none recorded is selected", __FUNCTION__);
  20.593 +    	return;
  20.594 +    }
  20.595 +
  20.596 +	if (!(mmyth_ui->video_uicommon))
  20.597 +		mmyth_ui->video_uicommon = create_video_view (mmyth_ui);
  20.598 +	
  20.599 +	// Creates the tv player that will retrieve the mythtv content, decode and show it
  20.600 +	mmyth_ui->tvplayer = mmyth_tvplayer_new ();
  20.601 +	g_debug ("[%s] New TV Player created: %d\n", __FUNCTION__, (int) (mmyth_ui->tvplayer));
  20.602 +	res = mmyth_tvplayer_initialize (mmyth_ui->tvplayer);
  20.603 +	if (!res) {
  20.604 +		g_warning ("[%s] Could not initialize tvplayer", __FUNCTION__);
  20.605 +
  20.606 +		g_object_unref (mmyth_ui->tvplayer);
  20.607 +		mmyth_ui->tvplayer = NULL;
  20.608 +
  20.609 +		GtkWidget *dialog = gtk_message_dialog_new (
  20.610 +				GTK_WINDOW(mmyth_ui->main_window),
  20.611 +				GTK_DIALOG_DESTROY_WITH_PARENT,
  20.612 +                GTK_MESSAGE_ERROR,
  20.613 +                GTK_BUTTONS_CLOSE,
  20.614 +			 	"MMyth found errors while starting TV Player, please check "
  20.615 +			 	"the GStreamer installation");
  20.616 +
  20.617 +		gtk_dialog_run (GTK_DIALOG (dialog));
  20.618 +		gtk_widget_destroy (dialog);
  20.619 +		
  20.620 +		return;
  20.621 +	}		
  20.622 +
  20.623 +	res = mmyth_tvplayer_record_setup (mmyth_ui->tvplayer, path);
  20.624 +	
  20.625 +	if (mmyth_ui && mmyth_ui->tvplayer && res) {
  20.626 +		mmyth_tvplayer_set_widget (mmyth_ui->tvplayer, mmyth_ui->videow);
  20.627 +		mmyth_tvplayer_start_playing (mmyth_ui->tvplayer);
  20.628 +	} else {
  20.629 +		// TODO: Show Alert with error description!
  20.630 +		g_warning ("[%s] MMythUI can't initialize tv_player", __FUNCTION__);
  20.631 +		g_object_unref (mmyth_ui->tvplayer);
  20.632 +		mmyth_ui->tvplayer = NULL;
  20.633 +		// FIXME: Show the exact error that happened
  20.634 +		GtkWidget *dialog = gtk_message_dialog_new (
  20.635 +				GTK_WINDOW(mmyth_ui->main_window),
  20.636 +				GTK_DIALOG_DESTROY_WITH_PARENT,
  20.637 +                GTK_MESSAGE_ERROR,
  20.638 +                GTK_BUTTONS_CLOSE,
  20.639 +                "Error while starting TV Player, please check if the backend"
  20.640 +                " is running properly and a tv card is available!");
  20.641 +		gtk_dialog_run (GTK_DIALOG (dialog));
  20.642 +		gtk_widget_destroy (dialog);		
  20.643 +		return;
  20.644 +	}
  20.645 +	
  20.646 +	mmyth_ui_set_widget (mmyth_ui, mmyth_ui->video_uicommon);    
  20.647 +}
  20.648 +
  20.649 +static void
  20.650 +cb_play_clicked_recorded (GtkTreeView * tree_view, GtkTreePath *path, 
  20.651 +		GtkTreeViewColumn *column, gpointer user_data)
  20.652 +{
  20.653 +	play_selected_recorded (user_data);
  20.654 +}
  20.655 +
  20.656 +static void
  20.657 +cb_play_selected (GtkButton * button, gpointer user_data)
  20.658 +{
  20.659 +	play_selected_recorded (user_data);
  20.660 +}
  20.661 +
  20.662 +static void
  20.663 +cb_schedule_button (GtkButton * button, gpointer user_data)
  20.664 +{
  20.665 +    MMythUi *mmyth_ui = (MMythUi *) user_data;
  20.666 +
  20.667 +    mmyth_ui_set_widget (mmyth_ui, mmyth_ui->schedule_uicommon);
  20.668 +}
  20.669 +
  20.670 +void
  20.671 +cb_switch_page (GtkNotebook *notebook, GtkNotebookPage *page,
  20.672 +		guint page_num, gpointer user_data)
  20.673 +{
  20.674 +    MMythUi *mmyth_ui = (MMythUi *) user_data;
  20.675 +    MMythUiCommon *ui_common; 
  20.676 +    
  20.677 +	assert (mmyth_ui);
  20.678 +	assert (mmyth_ui->record_uicommon);
  20.679 +	
  20.680 +    ui_common = mmyth_ui->record_uicommon;
  20.681 +    
  20.682 +    if (page_num == 0) { // Switched to Schedule list
  20.683 +    	gtk_button_set_label (GTK_BUTTON (ui_common->button1), "New");
  20.684 +		g_signal_handlers_disconnect_by_func (
  20.685 +			G_OBJECT (ui_common->button1), G_CALLBACK (cb_play_selected), mmyth_ui);
  20.686 +	    g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
  20.687 +            G_CALLBACK (cb_schedule_button), mmyth_ui);
  20.688 +    } else if (page_num == 1) {
  20.689 +    	gtk_button_set_label (GTK_BUTTON (ui_common->button1), "Play");
  20.690 +		g_signal_handlers_disconnect_by_func (
  20.691 +			G_OBJECT (ui_common->button1), G_CALLBACK (cb_schedule_button), mmyth_ui);
  20.692 +	    g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
  20.693 +            G_CALLBACK (cb_play_selected), mmyth_ui);
  20.694 +    }
  20.695 +}
  20.696 +                                            
  20.697 +                                            
  20.698 +static MMythUiCommon *
  20.699 +create_record_view (MMythUi * mmyth_ui)
  20.700 +{
  20.701 +    MMythUiCommon *ui_common;        
  20.702 +    
  20.703 +   	g_debug ("Creating Record UI Common");
  20.704 +   	
  20.705 +	mmyth_ui->mmyth_recordui = mmyth_recordui_new ();
  20.706 +
  20.707 +	// FIXME: Change MMythRecordUI to a GtkWidget child and avoid this call!
  20.708 +    gtk_widget_show_all (mmyth_ui->mmyth_recordui->scrolled_window);
  20.709 +    
  20.710 +    ui_common = mmyth_uicommon_new (mmyth_ui->mmyth_recordui->scrolled_window, "New", "Delete", "<<Back");    
  20.711 +    g_object_ref (mmyth_ui->mmyth_recordui->scrolled_window);
  20.712 +        
  20.713 +    /* Button signals */
  20.714 +    g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
  20.715 +                      G_CALLBACK (cb_schedule_button), mmyth_ui);
  20.716 +    g_signal_connect (G_OBJECT (ui_common->button2), "clicked",
  20.717 +                      G_CALLBACK (mmyth_recordui_delete_selected), mmyth_ui->mmyth_recordui);
  20.718 +    g_signal_connect (G_OBJECT (ui_common->button3), "clicked",
  20.719 +                      G_CALLBACK (cb_record_close_button), mmyth_ui);
  20.720 +    g_signal_connect (G_OBJECT (mmyth_ui->mmyth_recordui->notebook),
  20.721 +		      "switch-page", G_CALLBACK (cb_switch_page), mmyth_ui);
  20.722 +    g_signal_connect (G_OBJECT (mmyth_ui->mmyth_recordui->rec_treeview),
  20.723 +		      "row-activated", G_CALLBACK (cb_play_clicked_recorded), mmyth_ui);
  20.724 +    g_signal_connect (G_OBJECT (mmyth_ui->mmyth_recordui->sch_treeview),
  20.725 +		      "row-activated", G_CALLBACK (cb_edit_scheduled), mmyth_ui);
  20.726 +    return ui_common;
  20.727 +}
  20.728 +
  20.729 +
  20.730 +/******************************************************************************
  20.731 + *                         GST VIDEO WIDGET METHODS                           *
  20.732 + *****************************************************************************/
  20.733 +
  20.734 +static void
  20.735 +cb_video_close_button (GtkButton * button, gpointer user_data)
  20.736 +{
  20.737 +    MMythUi *mmyth_ui = (MMythUi *) user_data;
  20.738 +	
  20.739 +	g_debug ("MMythUI video close button pressed");
  20.740 +	
  20.741 +	if (mmyth_ui && mmyth_ui->tvplayer) {
  20.742 +	    mmyth_tvplayer_stop_playing (mmyth_ui->tvplayer);
  20.743 +
  20.744 +		g_object_unref (mmyth_ui->tvplayer);
  20.745 +		mmyth_ui->tvplayer = NULL;	    
  20.746 +	} else {
  20.747 +		g_warning ("cb_video_close_button called with NULL pointer\n");
  20.748 +	}
  20.749 +	
  20.750 +    mmyth_ui_set_widget (mmyth_ui, mmyth_ui->main_uicommon);
  20.751 +}
  20.752 +
  20.753 +
  20.754 +static MMythUiCommon *
  20.755 +create_video_view (MMythUi * mmyth_ui)
  20.756 +{
  20.757 +
  20.758 +    MMythUiCommon *ui_common;
  20.759 +
  20.760 +	g_debug ("Creating Video UI Common");
  20.761 +	
  20.762 +	/* Creates widget to be user by MMythTVPlayer to draw the video */
  20.763 +    mmyth_ui->videow = gtk_drawing_area_new ();
  20.764 +    // FIXME: Get the widget size from settings
  20.765 +    gtk_widget_set_size_request (mmyth_ui->videow, 300, 240);
  20.766 +
  20.767 +    //mmiptv_ui->logo = gdk_pixbuf_new_from_file ("logo.png", NULL);
  20.768 +
  20.769 +	// Creates an alignment to place the video widget inside
  20.770 +    mmyth_ui->video_alignment = gtk_alignment_new (0.5, 0.5, 1, 1);
  20.771 +    gtk_widget_hide (mmyth_ui->video_alignment);
  20.772 +
  20.773 +    gtk_container_add (GTK_CONTAINER (mmyth_ui->video_alignment),
  20.774 +                       mmyth_ui->videow);
  20.775 +
  20.776 +    /* Add the gst video widget to hbox. It should never be removed. */    
  20.777 +    /* FIXME: mmyth_ui->video_alignment == NULL when mmyth_player_init fails */
  20.778 +    if((mmyth_ui->main_hbox != NULL) && (mmyth_ui->video_alignment != NULL)) {
  20.779 +        gtk_box_pack_start (GTK_BOX (mmyth_ui->main_hbox),
  20.780 +                            mmyth_ui->video_alignment, TRUE, TRUE, 0);    
  20.781 +	} else {
  20.782 +		g_warning ("[%s] Error while adding video_alignment to main widget", __FUNCTION__);	
  20.783 +    }
  20.784 +
  20.785 +    g_object_ref (mmyth_ui->videow);
  20.786 +    g_object_ref (mmyth_ui->video_alignment);
  20.787 +
  20.788 +    ui_common = mmyth_uicommon_new (mmyth_ui->video_alignment,
  20.789 +                                    "  Full\nScreen", "Other\nServices",
  20.790 +                                    "Close");
  20.791 +                                    
  20.792 +    
  20.793 +    g_signal_connect (G_OBJECT (ui_common->button1), "clicked",
  20.794 +                      G_CALLBACK (cb_not_impl_button), mmyth_ui);
  20.795 +    g_signal_connect (G_OBJECT (ui_common->button2), "clicked",
  20.796 +                      G_CALLBACK (cb_not_impl_button), mmyth_ui);    
  20.797 +    g_signal_connect (G_OBJECT (ui_common->button3), "clicked",
  20.798 +                      G_CALLBACK (cb_video_close_button), mmyth_ui);
  20.799 +
  20.800 +	if (ui_common)
  20.801 +		g_debug ("Video UI_Common sucessfull created");
  20.802 +		
  20.803 +    return ui_common;
  20.804 +}
  20.805 +
  20.806 +
  20.807 +
  20.808 +GtkWidget*
  20.809 +mmyth_ui_get_video_widget (MMythUi *mmyth_ui) {
  20.810 +	
  20.811 +	if (mmyth_ui && mmyth_ui->videow) {
  20.812 +	
  20.813 +		return mmyth_ui->videow;
  20.814 +	}
  20.815 +	
  20.816 +	return NULL;	
  20.817 +}
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/maemo-ui/src/mmyth_ui.h	Thu Sep 28 16:02:14 2006 +0100
    21.3 @@ -0,0 +1,73 @@
    21.4 +#ifndef MMYTH_UI_H_
    21.5 +#define MMYTH_UI_H_
    21.6 +
    21.7 +#include <gtk/gtk.h>
    21.8 +#include <gst/gst.h>
    21.9 +
   21.10 +#include "config.h"
   21.11 +
   21.12 +#ifdef MAEMO_PLATFORM
   21.13 +#include "hildon-widgets/hildon-program.h"
   21.14 +#include "hildon-widgets/hildon-window.h"
   21.15 +#endif
   21.16 +
   21.17 +#include "mmyth_uicommon.h"
   21.18 +#include "mmyth_recordui.h"
   21.19 +#include "mmyth_schedulerui.h"
   21.20 +#include "mmyth_tvplayer.h"
   21.21 +
   21.22 +typedef struct _MMythUi
   21.23 +{
   21.24 +
   21.25 +    /* The main application window */
   21.26 +    GtkWidget *main_window;
   21.27 +    MMythUiCommon *current_uicommon;
   21.28 +
   21.29 +    /* Main widget components */
   21.30 +    GtkWidget *main_hbox;
   21.31 +    GtkWidget *video_alignment;
   21.32 +    GdkPixbuf *logo;
   21.33 +
   21.34 +    /* Main widgets grouping */
   21.35 +    MMythUiCommon *main_uicommon;
   21.36 +    MMythUiCommon *video_uicommon;
   21.37 +    MMythUiCommon *epg_grid_uicommon;
   21.38 +    MMythUiCommon *record_uicommon;
   21.39 +    MMythUiCommon *schedule_uicommon;
   21.40 +    
   21.41 +    GtkWidget *videow;
   21.42 +    int idle_id;
   21.43 +    //GstTagList *tagcache;
   21.44 +    
   21.45 +    MMythRecordUI *mmyth_recordui;
   21.46 +    MMythSchedulerUI *mmyth_schedulerui;
   21.47 +
   21.48 +#ifdef MAEMO_PLATFORM
   21.49 +    HildonProgram *program;
   21.50 +    GtkMenu *main_menu;
   21.51 +    GtkWidget *menu_setup;
   21.52 +#endif
   21.53 +
   21.54 +    MMythTVPlayer *tvplayer;
   21.55 +    
   21.56 +} MMythUi;
   21.57 +
   21.58 +GdkPixbuf *icon_sports, *icon_news, *icon_movies, *icon_shows;
   21.59 +GdkColor main_bg_color;
   21.60 +
   21.61 +void mmyth_set_main_widget (MMythUi * mmyth_ui, MMythUiCommon * new_ui);
   21.62 +//void mmyth_play_selected(GtkButton * button, gpointer user_data);
   21.63 +
   21.64 +#ifdef MAEMO_PLATFORM
   21.65 +MMythUi *mmyth_ui_initialize (HildonProgram *program, GtkWidget * main_window);
   21.66 +#else
   21.67 +MMythUi *mmyth_ui_initialize (GtkWidget * main_window);
   21.68 +#endif
   21.69 +
   21.70 +void mmyth_ui_finalize (MMythUi * mmyth_ui);
   21.71 +
   21.72 +void mmyth_ui_set_widget (MMythUi * mmyth_ui, MMythUiCommon * new_uicommon);
   21.73 +
   21.74 +GtkWidget* mmyth_ui_get_video_widget (MMythUi *mmyth_ui);
   21.75 +
   21.76 +#endif /* MMYTH_UI_H_ */
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/maemo-ui/src/mmyth_uicommon.c	Thu Sep 28 16:02:14 2006 +0100
    22.3 @@ -0,0 +1,134 @@
    22.4 +
    22.5 +#include <gtk/gtk.h>
    22.6 +#include <glib.h>
    22.7 +#include <glib/gprintf.h>
    22.8 +
    22.9 +#include "mmyth_uicommon.h"
   22.10 +#include "mmyth_ui.h"
   22.11 +
   22.12 +static void
   22.13 +refresh_time_on_screen (GtkWidget *label)
   22.14 +{
   22.15 +	time_t real_time;
   22.16 +  	struct tm sched_time;
   22.17 +	GString *time_showed;
   22.18 +
   22.19 +	time_showed = g_string_new("");
   22.20 +	time(&real_time);
   22.21 +
   22.22 +    if (localtime_r((time_t *)&real_time, &sched_time) == NULL) {
   22.23 +        g_error ("localtime_r error in mmyth_epg_grid_view!\n");
   22.24 +        return NULL;
   22.25 +    }
   22.26 +
   22.27 +	g_string_printf(time_showed, "%d:%02d:%02d", 
   22.28 +		sched_time.tm_hour, 
   22.29 +		sched_time.tm_min, 
   22.30 +		sched_time.tm_sec);
   22.31 +
   22.32 +	gtk_label_set_text (GTK_LABEL(label), time_showed->str);
   22.33 +}
   22.34 +
   22.35 +MMythUiCommon *
   22.36 +mmyth_uicommon_new (GtkWidget * main_widget, const gchar * label1,
   22.37 +                    const gchar * label2, const gchar * label3)
   22.38 +{
   22.39 +
   22.40 +    MMythUiCommon *ui_common = g_new0 (MMythUiCommon, 1); 
   22.41 +    
   22.42 +    if (!main_widget) {
   22.43 +    	g_warning ("MMythUICommon created with a NULL main widget\n");
   22.44 +    }
   22.45 +    
   22.46 +    ui_common->main_widget = main_widget;
   22.47 +
   22.48 +    ui_common->event_box = gtk_event_box_new();
   22.49 +    
   22.50 +    /* Vertical box that divides the control area into two (buttons + clock) */
   22.51 +    ui_common->vbox = gtk_vbox_new (FALSE, 0);  /* spacing */
   22.52 +    gtk_container_set_border_width(GTK_CONTAINER (ui_common->vbox), 4);
   22.53 +    
   22.54 +    gtk_container_add (GTK_CONTAINER (ui_common->event_box),
   22.55 +                       ui_common->vbox);
   22.56 +    gtk_widget_modify_bg(ui_common->event_box, GTK_STATE_NORMAL, &main_bg_color);  
   22.57 +    
   22.58 +    /* Vertical box that divides the control area into four */
   22.59 +    ui_common->button_vbox = gtk_vbox_new (TRUE, 0);    /* spacing */
   22.60 +
   22.61 +    gtk_container_set_border_width (GTK_CONTAINER (ui_common->button_vbox), 0);
   22.62 +
   22.63 +    /* The button 1 */
   22.64 +    ui_common->button1 = gtk_button_new_with_label (label1);
   22.65 +    gtk_widget_modify_bg(ui_common->button1, GTK_STATE_NORMAL, &main_bg_color);  
   22.66 +    gtk_widget_set_size_request (ui_common->button1, BUTTON_WIDTH,
   22.67 +                                 BUTTON_HEIGHT);
   22.68 +
   22.69 +    /* The button 2 */
   22.70 +    ui_common->button2 = gtk_button_new_with_label (label2);
   22.71 +    gtk_widget_modify_bg(ui_common->button2, GTK_STATE_NORMAL, &main_bg_color);  
   22.72 +    gtk_widget_set_size_request (ui_common->button2, BUTTON_WIDTH,
   22.73 +                                 BUTTON_HEIGHT);
   22.74 +
   22.75 +    /* The button 3 */
   22.76 +    ui_common->button3 = gtk_button_new_with_label (label3);
   22.77 +    gtk_widget_modify_bg(ui_common->button3, GTK_STATE_NORMAL, &main_bg_color);  
   22.78 +    gtk_widget_set_size_request (ui_common->button3, BUTTON_WIDTH,
   22.79 +                                 BUTTON_HEIGHT);
   22.80 +
   22.81 +    /* The clock label */
   22.82 +    ui_common->label = gtk_label_new ("Starting...");
   22.83 +    gtk_widget_show (ui_common->label);
   22.84 +    ui_common->source_id = g_timeout_add(500, (GSourceFunc) refresh_time_on_screen, ui_common->label);
   22.85 +
   22.86 +    /* Packing components */
   22.87 +    gtk_box_pack_start (GTK_BOX (ui_common->vbox),
   22.88 +                        ui_common->button_vbox, TRUE, TRUE, 0);
   22.89 +
   22.90 +    gtk_box_pack_start (GTK_BOX (ui_common->vbox),
   22.91 +                        ui_common->label, FALSE, FALSE, 0);
   22.92 +
   22.93 +    gtk_box_pack_start (GTK_BOX (ui_common->button_vbox),
   22.94 +                        ui_common->button1, FALSE, FALSE, 0);
   22.95 +
   22.96 +    gtk_box_pack_start (GTK_BOX (ui_common->button_vbox),
   22.97 +                        ui_common->button2, FALSE, FALSE, 0);
   22.98 +
   22.99 +    gtk_box_pack_start (GTK_BOX (ui_common->button_vbox),
  22.100 +                        ui_common->button3, FALSE, FALSE, 0);
  22.101 +
  22.102 +    gtk_widget_show_all (ui_common->event_box);
  22.103 +
  22.104 +    /* FIXME: mmyth_ui->video_alignment == NULL when mmyth_player_init fails */
  22.105 +    if(ui_common->main_widget != NULL)
  22.106 +        g_object_ref (ui_common->main_widget);
  22.107 +        
  22.108 +    g_object_ref (ui_common->vbox);
  22.109 +    g_object_ref (ui_common->button_vbox);
  22.110 +    g_object_ref (ui_common->label);
  22.111 +    g_object_ref (ui_common->button1);
  22.112 +    g_object_ref (ui_common->button2);
  22.113 +    g_object_ref (ui_common->button3);
  22.114 +    g_object_ref (ui_common->event_box);
  22.115 +    return ui_common;
  22.116 +}
  22.117 +
  22.118 +void
  22.119 +mmyth_uicommon_free (MMythUiCommon *ui_common)
  22.120 +{
  22.121 +	g_debug ("[%s] Clean uicommon used memory", __FUNCTION__);
  22.122 +
  22.123 +    g_source_remove (ui_common->source_id);
  22.124 +    	
  22.125 +    g_object_unref (ui_common->main_widget);
  22.126 +    g_object_unref (ui_common->vbox);
  22.127 +    g_object_unref (ui_common->button_vbox);
  22.128 +    g_object_unref (ui_common->label);
  22.129 +    g_object_unref (ui_common->button1);
  22.130 +    g_object_unref (ui_common->button2);
  22.131 +    g_object_unref (ui_common->button3);
  22.132 +    g_object_unref (ui_common->event_box);    
  22.133 +    
  22.134 +    g_free (ui_common);
  22.135 +}
  22.136 +
  22.137 +
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/maemo-ui/src/mmyth_uicommon.h	Thu Sep 28 16:02:14 2006 +0100
    23.3 @@ -0,0 +1,51 @@
    23.4 +#ifndef MMYTH_UICOMMON_H_
    23.5 +#define MMYTH_UICOMMON_H_
    23.6 +
    23.7 +#include "config.h"
    23.8 +
    23.9 +#include <gtk/gtk.h>
   23.10 +#include <glib.h>
   23.11 +
   23.12 +#ifndef MAEMO_PLATFORM
   23.13 +#define BUTTON_HEIGHT        50
   23.14 +#define BUTTON_WIDTH        100
   23.15 +#else
   23.16 +#define BUTTON_HEIGHT       80
   23.17 +#define BUTTON_WIDTH        150
   23.18 +#endif
   23.19 +
   23.20 +#define MAIN_WINDOW_WIDTH	550
   23.21 +#define MAIN_WINDOW_HEIGHT	250
   23.22 +
   23.23 +#define CHANNELS_DIALOG_WIDTH	300
   23.24 +#define CHANNELS_DIALOG_HEIGHT	200
   23.25 +
   23.26 +#define SETTINGS_DIALOG_WIDTH	300
   23.27 +#define SETTINGS_DIALOG_HEIGHT	120
   23.28 +
   23.29 +extern GdkColor main_bg_color;
   23.30 +
   23.31 +typedef struct _MMythUiCommon
   23.32 +{
   23.33 +    GtkWidget *main_widget;
   23.34 +
   23.35 +    /* event box to set the background color*/
   23.36 +    GtkWidget *event_box;
   23.37 +    
   23.38 +    GtkWidget *vbox;
   23.39 +    GtkWidget *button_vbox;
   23.40 +    GtkWidget *label;
   23.41 +
   23.42 +    GtkWidget *button1;
   23.43 +    GtkWidget *button2;
   23.44 +    GtkWidget *button3;
   23.45 +    
   23.46 +    gint source_id;
   23.47 +} MMythUiCommon;
   23.48 +
   23.49 +MMythUiCommon *mmyth_uicommon_new (GtkWidget * main_widget,
   23.50 +                                   const gchar * label1, const gchar * label2,
   23.51 +                                   const gchar * label3);
   23.52 +void mmyth_uicommon_free (MMythUiCommon *ui_common);
   23.53 +
   23.54 +#endif /* MMYTH_UICOMMON_H_ */
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/maemo-ui/src/mmyth_uisettings.c	Thu Sep 28 16:02:14 2006 +0100
    24.3 @@ -0,0 +1,169 @@
    24.4 +#include<gtk/gtk.h>
    24.5 +#include<glib.h>
    24.6 +#include <sys/types.h>
    24.7 +#include <sys/stat.h>
    24.8 +#include <unistd.h>
    24.9 +#include <string.h>
   24.10 +#include <stdio.h>
   24.11 +#include <stdlib.h>
   24.12 +
   24.13 +#include "mmyth_uisettings.h"
   24.14 +
   24.15 +#include "gmyth_context.h"
   24.16 +
   24.17 +static GtkWidget *settings_dialog;
   24.18 +static GtkWidget *entry_hostname;
   24.19 +static GtkWidget *entry_dbname;
   24.20 +static GtkWidget *entry_username;
   24.21 +static GtkWidget *entry_passwd;
   24.22 +static GtkWidget *entry_port;
   24.23 +
   24.24 +static void settings_dialog_update_data (void);
   24.25 +static GtkWidget* add_entry_to_table (GtkWidget *table, GString *init_str,
   24.26 +	guint pos_left, guint pos_right, guint pos_top, guint pos_bottom);
   24.27 +static GtkWidget* add_label_to_table (GtkWidget *table, const gchar *str, 
   24.28 +	guint pos_left, guint pos_right,  guint pos_top, guint pos_bottom);
   24.29 +	
   24.30 +	
   24.31 +gboolean
   24.32 +mmyth_uisettings_run (GtkWindow *main_window)
   24.33 +{
   24.34 +
   24.35 +	GtkWidget *settings_table;
   24.36 +	GtkWidget *label_hostname, *label_dbname;
   24.37 +	GtkWidget *label_username, *label_passwd, *label_port;
   24.38 +
   24.39 +	GMythSettings *msettings = gmyth_context_get_settings();
   24.40 +	
   24.41 +	settings_dialog = gtk_dialog_new_with_buttons ("Settings",
   24.42 +                                         main_window,
   24.43 +                                         GTK_DIALOG_DESTROY_WITH_PARENT,
   24.44 +                                         GTK_STOCK_OK,
   24.45 +                                         GTK_RESPONSE_ACCEPT,
   24.46 +                                         GTK_STOCK_CANCEL,
   24.47 +                                         GTK_RESPONSE_REJECT,
   24.48 +                                         NULL);
   24.49 +                                         
   24.50 +  gtk_widget_set_size_request (settings_dialog, 400, 244);
   24.51 +
   24.52 +/*  scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
   24.53 +  gtk_widget_show (scrolledwindow1);
   24.54 +  gtk_container_add (GTK_CONTAINER (window1), scrolledwindow1);
   24.55 +  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER);
   24.56 +
   24.57 +  viewport1 = gtk_viewport_new (NULL, NULL);
   24.58 +  gtk_widget_show (viewport1);
   24.59 +  gtk_container_add (GTK_CONTAINER (scrolledwindow1), viewport1);
   24.60 +  gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport1), GTK_SHADOW_NONE);
   24.61 +*/
   24.62 +
   24.63 +	// Creates the table and attach it to the settings dialog
   24.64 +	settings_table = gtk_table_new (5, 2, FALSE);
   24.65 +	gtk_widget_show (settings_table);
   24.66 +	gtk_box_pack_start (GTK_BOX (GTK_DIALOG(settings_dialog)->vbox), settings_table, FALSE, TRUE, 0);
   24.67 +	gtk_container_set_border_width (GTK_CONTAINER (settings_table), 3);
   24.68 +	gtk_table_set_row_spacings (GTK_TABLE (settings_table), 5);
   24.69 +	gtk_table_set_col_spacings (GTK_TABLE (settings_table), 10);
   24.70 +
   24.71 +	label_hostname = add_label_to_table (settings_table, "Host Name:", 0, 1, 0, 1);
   24.72 +	label_dbname   = add_label_to_table (settings_table, "Database Name:", 0, 1, 1, 2);
   24.73 +	label_username = add_label_to_table (settings_table, "Username:", 0, 1, 2, 3);
   24.74 +	label_passwd = add_label_to_table (settings_table, "Password:", 0, 1, 3, 4);
   24.75 +	label_port = add_label_to_table (settings_table, "Server port:", 0, 1, 4, 5);
   24.76 +	
   24.77 +	entry_hostname = add_entry_to_table (settings_table,
   24.78 +		gmyth_settings_get_backend_hostname (msettings),
   24.79 +		1, 2, 0, 1);
   24.80 +	entry_dbname = add_entry_to_table (settings_table,
   24.81 +		gmyth_settings_get_dbname (msettings),
   24.82 +		1, 2, 1, 2 );
   24.83 +	entry_username = add_entry_to_table (settings_table,
   24.84 +		gmyth_settings_get_username (msettings),
   24.85 +		1, 2, 2, 3 );
   24.86 +	entry_passwd = add_entry_to_table (settings_table,
   24.87 +		gmyth_settings_get_password (msettings),
   24.88 +		1, 2, 3, 4 );
   24.89 +		
   24.90 +	GString *str_port = g_string_new ("");
   24.91 +	g_string_printf (str_port, "%d", 
   24.92 +		gmyth_settings_get_backend_port (msettings));
   24.93 +	entry_port = add_entry_to_table (settings_table, str_port,
   24.94 +		1, 2, 4, 5 );
   24.95 +	g_string_free (str_port, TRUE);
   24.96 +		
   24.97 +	if (gtk_dialog_run (GTK_DIALOG (settings_dialog)) == GTK_RESPONSE_ACCEPT) {
   24.98 +		settings_dialog_update_data ();
   24.99 +		gtk_widget_destroy (settings_dialog);
  24.100 +		return TRUE;
  24.101 +	}
  24.102 +	
  24.103 +	gtk_widget_destroy (settings_dialog);
  24.104 +	
  24.105 +	return FALSE;
  24.106 +	
  24.107 +}
  24.108 +
  24.109 +static GtkWidget*
  24.110 +add_label_to_table (GtkWidget *table, const gchar *str, guint pos_left, guint pos_right, 
  24.111 +		guint pos_top, guint pos_bottom )
  24.112 +{
  24.113 +	GtkWidget *tmp_label = gtk_label_new (str);
  24.114 +	
  24.115 +	gtk_widget_show (tmp_label);
  24.116 +	gtk_table_attach (GTK_TABLE (table), tmp_label, 
  24.117 +					pos_left, pos_right, pos_top, pos_bottom,
  24.118 +                    (GtkAttachOptions) (GTK_FILL),
  24.119 +                    (GtkAttachOptions) (0), 0, 0);
  24.120 +	gtk_misc_set_alignment (GTK_MISC (tmp_label), 0, 0.5);
  24.121 +	
  24.122 +	return tmp_label;
  24.123 +}
  24.124 +
  24.125 +static GtkWidget*
  24.126 +add_entry_to_table (GtkWidget *table, GString *init_str, guint pos_left, guint pos_right,
  24.127 +		guint pos_top, guint pos_bottom)
  24.128 +{
  24.129 +	GtkWidget *tmp_entry = gtk_entry_new ();
  24.130 +	gtk_widget_show (tmp_entry);
  24.131 +	gtk_table_attach (GTK_TABLE (table), tmp_entry, 
  24.132 +					pos_left, pos_right, pos_top, pos_bottom,
  24.133 +                    (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
  24.134 +                    (GtkAttachOptions) (0), 0, 0);
  24.135 +    if (init_str)
  24.136 +		gtk_entry_set_text (GTK_ENTRY (tmp_entry), (init_str->str));
  24.137 +		
  24.138 +	//gtk_entry_set_invisible_char (GTK_ENTRY (entry_port), 9679);
  24.139 +	
  24.140 +	return tmp_entry;
  24.141 +}
  24.142 +
  24.143 +static void
  24.144 +settings_dialog_update_data (void) 
  24.145 +{
  24.146 +	GString *tmp_entry_text;
  24.147 +	GMythSettings *msettings = gmyth_context_get_settings();
  24.148 +	
  24.149 +	if (!msettings) {
  24.150 +		g_warning ("[%s] Could not get GMythSettings instance from context\n", __FUNCTION__);
  24.151 +		return;
  24.152 +	}
  24.153 +		
  24.154 +	tmp_entry_text = g_string_new("");
  24.155 +	g_string_printf(tmp_entry_text, "%s", gtk_entry_get_text( GTK_ENTRY(entry_hostname)));
  24.156 +	gmyth_settings_set_backend_hostname(msettings, tmp_entry_text);
  24.157 +	
  24.158 +	g_string_printf(tmp_entry_text, "%s", gtk_entry_get_text( GTK_ENTRY(entry_dbname)));
  24.159 +	gmyth_settings_set_dbname(msettings, tmp_entry_text);
  24.160 +	
  24.161 +	g_string_printf(tmp_entry_text, "%s", gtk_entry_get_text( GTK_ENTRY(entry_username)));
  24.162 +	gmyth_settings_set_username(msettings, tmp_entry_text);
  24.163 +	
  24.164 +	g_string_printf(tmp_entry_text, "%s", gtk_entry_get_text( GTK_ENTRY(entry_passwd)));
  24.165 +	gmyth_settings_set_password(msettings, tmp_entry_text);	
  24.166 +	
  24.167 +	g_string_printf(tmp_entry_text, "%s", gtk_entry_get_text( GTK_ENTRY(entry_port)));
  24.168 +	gmyth_settings_set_backend_port(msettings, atoi(tmp_entry_text->str));
  24.169 +	
  24.170 +	gmyth_settings_save (msettings);
  24.171 +	
  24.172 +}
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/maemo-ui/src/mmyth_uisettings.h	Thu Sep 28 16:02:14 2006 +0100
    25.3 @@ -0,0 +1,6 @@
    25.4 +#ifndef MMYTH_SETTINGS_H_
    25.5 +#define MMYTH_SETTINGS_H_
    25.6 +
    25.7 +gboolean mmyth_uisettings_run (GtkWindow *main_window);
    25.8 +
    25.9 +#endif /*MMYTH_SETTINGS_H_*/
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/maemo-ui/src/mmyth_videoplayer.c	Thu Sep 28 16:02:14 2006 +0100
    26.3 @@ -0,0 +1,369 @@
    26.4 +
    26.5 +#include <gst/gst.h>
    26.6 +#include <gtk/gtk.h>
    26.7 +#include <gdk/gdkx.h>
    26.8 +#include <gst/interfaces/xoverlay.h>
    26.9 +#include <unistd.h>
   26.10 +
   26.11 +#include "mmyth_ui.h"
   26.12 +#include "mmyth_videoplayer.h"
   26.13 +#include "mmyth_sdpreader.h"
   26.14 +
   26.15 +#include "esg_database.h"
   26.16 +
   26.17 +#include "ipd_demux.h"
   26.18 +#include "ipd_network.h"
   26.19 +
   26.20 +#ifdef INDT_IP_DECAPSULATOR
   26.21 +#include <sys/types.h>
   26.22 +#include <signal.h>
   26.23 +#endif
   26.24 +
   26.25 +/* Global flag/semaphore to control IP decapsulator threads */
   26.26 +gboolean state_keep_running = 0;
   26.27 +
   26.28 +
   26.29 +typedef struct _GstPlayerWindowStateChange
   26.30 +{
   26.31 +    GstElement *play;
   26.32 +    GstState old_state, new_state;
   26.33 +    MMythUi *mmyth_ui;
   26.34 +} GstPlayerWindowStateChange;
   26.35 +
   26.36 +typedef struct _GstPlayerWindowTagFound
   26.37 +{
   26.38 +    GstElement *play;
   26.39 +    GstTagList *taglist;
   26.40 +    MMythUi *mmyth_ui;
   26.41 +} GstPlayerWindowTagFound;
   26.42 +
   26.43 +
   26.44 +GstElement *gst_pipeline, *gst_decoder, *gst_videosink;
   26.45 +
   26.46 +static gboolean idle_state (gpointer data);
   26.47 +
   26.48 +static gboolean
   26.49 +bus_call (GstBus * bus, GstMessage * msg, gpointer data)
   26.50 +{
   26.51 +    MMythUi *mmyth_ui = (MMythUi *) data;
   26.52 +    GMainLoop *loop = mmyth_ui->loop;
   26.53 +
   26.54 +    switch (GST_MESSAGE_TYPE (msg)) {
   26.55 +        case GST_MESSAGE_EOS:
   26.56 +
   26.57 +            if (mmyth_ui->idle_id != 0) {
   26.58 +                g_source_remove (mmyth_ui->idle_id);
   26.59 +                mmyth_ui->idle_id = 0;
   26.60 +            }
   26.61 +
   26.62 +            //g_idle_add ((GSourceFunc) idle_eos, data);
   26.63 +            gst_element_set_state (GST_ELEMENT (GST_MESSAGE_SRC (msg)),
   26.64 +                                   GST_STATE_READY);
   26.65 +            break;
   26.66 +        case GST_MESSAGE_ERROR:{
   26.67 +                gchar *debug;
   26.68 +                GError *err;
   26.69 +
   26.70 +                gst_message_parse_error (msg, &err, &debug);
   26.71 +                g_free (debug);
   26.72 +
   26.73 +                printf ("Error: %s\n", err->message);
   26.74 +                g_error_free (err);
   26.75 +
   26.76 +                g_main_loop_quit (loop);
   26.77 +            }
   26.78 +            break;
   26.79 +        case GST_MESSAGE_STATE_CHANGED:{
   26.80 +                GstState oldstate;
   26.81 +                GstState newstate;
   26.82 +                GstState pending;
   26.83 +                GstPlayerWindowStateChange *st =
   26.84 +                    g_new (GstPlayerWindowStateChange, 1);
   26.85 +
   26.86 +                gst_message_parse_state_changed (msg,
   26.87 +                                                 &oldstate,
   26.88 +                                                 &newstate, &pending);
   26.89 +
   26.90 +                st->play = mmyth_ui->play;
   26.91 +                gst_object_ref (GST_OBJECT (mmyth_ui->play));
   26.92 +                st->old_state = oldstate;
   26.93 +                st->new_state = newstate;
   26.94 +
   26.95 +                st->mmyth_ui = mmyth_ui;
   26.96 +
   26.97 +                /* State debug messages */
   26.98 +                printf ("oldstate = %s, newstate = %s, pendingstate = %s\n",
   26.99 +                        gst_element_state_get_name (oldstate),
  26.100 +                        gst_element_state_get_name (newstate),
  26.101 +                        gst_element_state_get_name (pending));
  26.102 +
  26.103 +                g_idle_add ((GSourceFunc) idle_state, st);
  26.104 +
  26.105 +            }
  26.106 +            break;
  26.107 +        default:
  26.108 +            printf (gst_message_type_get_name (GST_MESSAGE_TYPE (msg)));
  26.109 +            printf ("\n");
  26.110 +            break;
  26.111 +    }
  26.112 +
  26.113 +    return TRUE;
  26.114 +}
  26.115 +
  26.116 +
  26.117 +static gboolean
  26.118 +cb_iterate (gpointer data)
  26.119 +{
  26.120 +    MMythUi *mmyth_ui = (MMythUi *) data;
  26.121 +    //gboolean res;
  26.122 +
  26.123 +    g_main_loop_run (mmyth_ui->loop);
  26.124 +/*
  26.125 +	if (!GST_FLAG_IS_SET (mmyth_ui->play, GST_BIN_SELF_SCHEDULABLE)) {
  26.126 +    	res = gst_bin_iterate (GST_BIN (mmyth_ui->play));
  26.127 +	} else {
  26.128 +    	g_usleep (100);
  26.129 +		res = (gst_element_get_state (mmyth_ui->play) == GST_STATE_PLAYING);
  26.130 +	}
  26.131 +
  26.132 +	if (!res)
  26.133 +    	mmyth_ui->idle_id = 0;
  26.134 +    	
  26.135 +    return res;
  26.136 +*/
  26.137 +    return FALSE;
  26.138 +
  26.139 +}
  26.140 +
  26.141 +static gboolean
  26.142 +idle_state (gpointer data)
  26.143 +{
  26.144 +    GstPlayerWindowStateChange *st = data;
  26.145 +
  26.146 +    if (st->old_state == GST_STATE_PLAYING) {
  26.147 +        if (st->mmyth_ui->idle_id != 0) {
  26.148 +            g_source_remove (st->mmyth_ui->idle_id);
  26.149 +            st->mmyth_ui->idle_id = 0;
  26.150 +        }
  26.151 +    }
  26.152 +    else if (st->new_state == GST_STATE_PLAYING) {
  26.153 +        if (st->mmyth_ui->idle_id != 0)
  26.154 +            g_source_remove (st->mmyth_ui->idle_id);
  26.155 +
  26.156 +        st->mmyth_ui->idle_id = g_idle_add (cb_iterate, st->mmyth_ui);
  26.157 +    }
  26.158 +
  26.159 +    /* new movie loaded? */
  26.160 +    if (st->old_state == GST_STATE_READY && st->new_state > GST_STATE_READY) {
  26.161 +
  26.162 +        /* gboolean have_video = FALSE; */
  26.163 +
  26.164 +        gtk_widget_show (st->mmyth_ui->videow);
  26.165 +
  26.166 +        gtk_window_resize (GTK_WINDOW (st->mmyth_ui->main_window), 1, 1);
  26.167 +
  26.168 +    }
  26.169 +
  26.170 +    /* discarded movie? */
  26.171 +    if (st->old_state > GST_STATE_READY && st->new_state == GST_STATE_READY) {
  26.172 +
  26.173 +        if (st->mmyth_ui->tagcache) {
  26.174 +            gst_tag_list_free (st->mmyth_ui->tagcache);
  26.175 +            st->mmyth_ui->tagcache = NULL;
  26.176 +        }
  26.177 +    }
  26.178 +
  26.179 +    gst_object_unref (GST_OBJECT (st->play));
  26.180 +    //g_object_unref (G_OBJECT (st->win));
  26.181 +    g_free (st);
  26.182 +
  26.183 +    /* once */
  26.184 +    return FALSE;
  26.185 +}
  26.186 +
  26.187 +
  26.188 +
  26.189 +static gboolean
  26.190 +expose (GtkWidget * widget, GdkEventExpose * event, gpointer user_data)
  26.191 +{
  26.192 +    MMythUi *mmyth_ui = (MMythUi *) user_data;
  26.193 +
  26.194 +    gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (mmyth_ui->videosink),
  26.195 +                                  GDK_WINDOW_XWINDOW (mmyth_ui->videow->
  26.196 +                                                      window));
  26.197 +    return TRUE;
  26.198 +}
  26.199 +
  26.200 +
  26.201 +void
  26.202 +mmyth_player_init (MMythUi * mmyth_ui)
  26.203 +{
  26.204 +    GstElement *play;
  26.205 +    GstElement *source, *parser, *decoder, *videosink;
  26.206 +
  26.207 +    play = gst_pipeline_new ("video-player");
  26.208 +    source = gst_element_factory_make ("udpsrc", "file-source");
  26.209 +    parser = gst_element_factory_make ("rtph263pdepay", "rtp-demux");
  26.210 +    decoder = gst_element_factory_make ("ffdec_h263", "mpeg-decoder");
  26.211 +    videosink = gst_element_factory_make ("xvimagesink", "image-output");
  26.212 +    gst_pipeline = play;
  26.213 +    gst_decoder = decoder;
  26.214 +    gst_videosink = videosink;
  26.215 +
  26.216 +    if (!(gst_pipeline && source && parser && decoder && videosink)) {
  26.217 +        /* FIXME: hanlde the error correctly */
  26.218 +        /* video_alignment is not being created (below) 
  26.219 +           and is causing problems to the ui */
  26.220 +        g_print ("GstElement creation error!\n");
  26.221 +        return;
  26.222 +    }
  26.223 +
  26.224 +    g_object_set (G_OBJECT (videosink), "sync", FALSE, NULL);
  26.225 +
  26.226 +    gst_bus_add_watch (gst_pipeline_get_bus (GST_PIPELINE (gst_pipeline)),
  26.227 +                       bus_call, mmyth_ui);
  26.228 +
  26.229 +    gst_bin_add_many (GST_BIN (gst_pipeline), source, parser, decoder,
  26.230 +                      videosink, NULL);
  26.231 +
  26.232 +    {
  26.233 +        GstCaps *rtpcaps = gst_caps_new_simple ("application/x-rtp", NULL);
  26.234 +        gst_element_link_filtered(source, parser, rtpcaps);
  26.235 +    }
  26.236 +    
  26.237 +    gst_element_link_many (/*source,*/ parser, decoder, videosink, NULL);
  26.238 +
  26.239 +    /* actual window */
  26.240 +    mmyth_ui->play = play;
  26.241 +    mmyth_ui->videosink = videosink;
  26.242 +    mmyth_ui->udpsource = source;
  26.243 +
  26.244 +    g_object_ref (mmyth_ui->play);
  26.245 +    g_object_ref (mmyth_ui->videosink);
  26.246 +
  26.247 +    /* video widget */
  26.248 +    //mmyth_ui->videow = gst_player_video_new (videosink, play);
  26.249 +    mmyth_ui->videow = gtk_drawing_area_new ();
  26.250 +    gtk_widget_set_size_request (mmyth_ui->videow, 300, 240);
  26.251 +
  26.252 +    mmyth_ui->logo = gdk_pixbuf_new_from_file ("logo.png", NULL);
  26.253 +
  26.254 +
  26.255 +    mmyth_ui->video_alignment = gtk_alignment_new (0.5, 0.5, 0, 0);
  26.256 +    gtk_widget_hide (mmyth_ui->video_alignment);
  26.257 +
  26.258 +    gtk_container_add (GTK_CONTAINER (mmyth_ui->video_alignment),
  26.259 +                       mmyth_ui->videow);
  26.260 +
  26.261 +    g_signal_connect (mmyth_ui->videow, "expose-event", G_CALLBACK (expose),
  26.262 +                      mmyth_ui);
  26.263 +    //g_signal_connect(mmyth_ui->videow, "size_request", G_CALLBACK(cb_preferred_video_size), mmyth_ui);
  26.264 +
  26.265 +
  26.266 +    g_object_ref (mmyth_ui->videow);
  26.267 +    g_object_ref (mmyth_ui->video_alignment);
  26.268 +
  26.269 +    //gnome_app_set_contents (app, videow);
  26.270 +    //gtk_widget_show (mmyth_ui->videow);
  26.271 +
  26.272 +//fail:
  26.273 +//  gst_object_unref (GST_OBJECT (play));
  26.274 +//  return NULL;  
  26.275 +
  26.276 +}
  26.277 +
  26.278 +void
  26.279 +mmyth_player_stop (MMythUi * mmyth_ui)
  26.280 +{
  26.281 +    gst_element_set_state (mmyth_ui->play, GST_STATE_NULL);
  26.282 +
  26.283 +    if(mmyth_ui->videow != NULL)
  26.284 +        gtk_widget_hide (mmyth_ui->videow);
  26.285 +
  26.286 +    /* Disable IP Decapsulator playing threads */
  26.287 +    state_keep_running = FALSE;	
  26.288 +
  26.289 +}
  26.290 +
  26.291 +static gboolean
  26.292 +idle_play (gpointer data)
  26.293 +{
  26.294 +    MMythUi *mmyth_ui = (MMythUi *) data;
  26.295 +
  26.296 +    sleep (2);
  26.297 +
  26.298 +    gst_element_set_state (mmyth_ui->play, GST_STATE_PLAYING);
  26.299 +
  26.300 +    return FALSE;
  26.301 +}
  26.302 +
  26.303 +
  26.304 +/* Run IP decapsulator play function in a new thread. The thread is finished setting the
  26.305 + * semaphore "state_keep_running" to FALSE*/
  26.306 +gpointer
  26.307 +run_ipd(gpointer data)
  26.308 +{
  26.309 +    GString *ip_addr = (GString*) data;
  26.310 +
  26.311 +	state_keep_running = TRUE;
  26.312 +
  26.313 +	printf("Inside thread\n");
  26.314 +
  26.315 +	ipd_mpe_play_section (ip_addr->str, &state_keep_running);
  26.316 +
  26.317 +	return 0;
  26.318 +}
  26.319 +
  26.320 +void
  26.321 +mmyth_play_channel (MMythUi * mmyth_ui, gint service_number)
  26.322 +{
  26.323 +	ESGDatabase *esg_db;
  26.324 +    DVBHService *service;
  26.325 +	SDPData sdp_data;
  26.326 +	GString *service_ip_addr;
  26.327 +	
  26.328 +	/* First verifies if there is a tuned network */
  26.329 +	if ( !ipd_network_is_tuned() ) {
  26.330 +		/* FIXME: show alert and handle this error */
  26.331 +        g_warning ("Play not possible, network not tuned");
  26.332 +		return;
  26.333 +	}
  26.334 +
  26.335 +    esg_db = esg_database_get_instance();
  26.336 +    /* Gets the service structure */
  26.337 +    service = (DVBHService *) esg_database_get_service_from_number
  26.338 +                                 (esg_db, service_number);
  26.339 +
  26.340 +	/* Verifies if sdp fragment exists to this service */
  26.341 +	if ( service->sdp_file == NULL ) {
  26.342 +		/* FIXME: Implement error handling */
  26.343 +        g_warning ("SDP fragment not available to access service");
  26.344 +		return;
  26.345 +    }
  26.346 +	
  26.347 +	/* Parses the sdp to get ipv6 address and port */
  26.348 +	mmyth_sdp_parse_file (service->sdp_file->str, &sdp_data);
  26.349 +
  26.350 +    /* Sets the gstreamer properties acording to the service access address */
  26.351 +	/* FIXME: Develop sdp_bin in gstreamer to give sdp file as pipeline config */
  26.352 +    g_object_set (G_OBJECT (mmyth_ui->udpsource), "multicast_group",
  26.353 +                  sdp_data.ip_addr->str, NULL);
  26.354 +    g_object_set (G_OBJECT (mmyth_ui->udpsource), "port", sdp_data.video_port, NULL);
  26.355 +
  26.356 +    /* Shows the video widget on screen */
  26.357 +    mmyth_ui_set_widget (mmyth_ui, mmyth_ui->video_uicommon);
  26.358 +
  26.359 +    gtk_widget_show (mmyth_ui->videow);
  26.360 +    gtk_widget_queue_draw (mmyth_ui->videow);
  26.361 +
  26.362 +#ifdef INDT_IP_DECAPSULATOR
  26.363 +    /* Will be dealocated in run_ipd */	
  26.364 +	service_ip_addr = g_string_new (sdp_data.ip_addr->str);
  26.365 +	
  26.366 +	/* Requests the IP decapsulator to play the channel stream*/
  26.367 +	g_thread_create (run_ipd, (gpointer) service_ip_addr, FALSE, NULL);
  26.368 +#endif
  26.369 +		
  26.370 +    //gst_element_set_state (mmyth_ui->play, GST_STATE_PLAYING);
  26.371 +    g_idle_add (idle_play, mmyth_ui);
  26.372 +}
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/maemo-ui/src/mmyth_videoplayer.h	Thu Sep 28 16:02:14 2006 +0100
    27.3 @@ -0,0 +1,12 @@
    27.4 +#ifndef MMYTH_VIDEOPLAYER_H_
    27.5 +#define MMYTH_VIDEOPLAYER_H_
    27.6 +
    27.7 +#include "mmyth_ui.h"
    27.8 +
    27.9 +void mmyth_player_init (MMythUi * mmyth_ui);
   27.10 +void mmyth_player_stop (MMythUi * mmyth_ui);
   27.11 +
   27.12 +void mmyth_play_channel (MMythUi * mmyth_ui, gint service_id);
   27.13 +
   27.14 +
   27.15 +#endif /* MMYTH_VIDEOPLAYER_H_ */
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/maemo-ui/src/svn-commit.tmp	Thu Sep 28 16:02:14 2006 +0100
    28.3 @@ -0,0 +1,10 @@
    28.4 +
    28.5 +--This line, and those below, will be ignored--
    28.6 +
    28.7 +A    .
    28.8 +M    mmyth_ui.h
    28.9 +A    mmyth_main.c
   28.10 +A    mmyth_tvplayer.c
   28.11 +M    Makefile.am
   28.12 +A    mmyth_tvplayer.h
   28.13 +M    mmyth_ui.c