gmyth-upnp/src/gmyth_upnp.c
branchtrunk
changeset 715 e01c60057f07
parent 704 5b6a77d85cf7
child 754 cb885ee44618
     1.1 --- a/gmyth-upnp/src/gmyth_upnp.c	Wed May 23 21:49:19 2007 +0100
     1.2 +++ b/gmyth-upnp/src/gmyth_upnp.c	Fri May 25 18:25:50 2007 +0100
     1.3 @@ -8,8 +8,6 @@
     1.4   *
     1.5   * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
     1.6   * @author Rosfran Lins Borges <rosfran.borges@indt.org.br>
     1.7 - *
     1.8 - *//*
     1.9   * 
    1.10   * This program is free software; you can redistribute it and/or modify
    1.11   * it under the terms of the GNU Lesser General Public License as published by
    1.12 @@ -178,13 +176,29 @@
    1.13  	G_OBJECT_CLASS (gmyth_upnp_parent_class)->finalize (object);
    1.14  }
    1.15  
    1.16 +gchar *
    1.17 +gmyth_upnp_device_status_to_string( GMythUPnPDeviceStatus status )
    1.18 +{
    1.19 +	if ( status == CgUpnpDeviceStatusAdded )
    1.20 +		return "Added";
    1.21 +	else if ( status == CgUpnpDeviceStatusUpdated )
    1.22 +		return "Updated";
    1.23 +	else if ( status == CgUpnpDeviceStatusInvalid )
    1.24 +		return "Invalid";
    1.25 +	else if ( status == CgUpnpDeviceStatusRemoved )
    1.26 +		return "Removed";
    1.27 +	
    1.28 +	return "";
    1.29 +}
    1.30 +
    1.31  /**
    1.32   * GObject's signal handler
    1.33   */ 
    1.34  static void
    1.35  _mythtv_device_found( GMythUPnP *gmyth_upnp, GMythUPnPDeviceStatus status, gchar* udn )
    1.36  {
    1.37 -	g_debug( "status = %d, UDN = %s\n", status, udn );
    1.38 +	g_debug( "Device: [status = %s, UDN = %s]\n", 
    1.39 +		gmyth_upnp_device_status_to_string( status ), udn );
    1.40  }
    1.41  
    1.42  /**
    1.43 @@ -250,6 +264,8 @@
    1.44  	gmyth_upnp->port = gmyth_uri_get_port( uri );
    1.45  	gmyth_upnp->protocol = gmyth_uri_get_protocol( uri );
    1.46  
    1.47 +	gmyth_debug("MythTV UPnP service [ %s, %d ].", gmyth_upnp->host, gmyth_upnp->port);
    1.48 +
    1.49  	upnp_servers_list = g_list_append( upnp_servers_list, gmyth_upnp );
    1.50  
    1.51  	if ( uri != NULL )