[libdmapsharing] Work on authentication



commit 73f5f530001853440d444a1c4058304cd7265cf1
Author: W. Michael Petullo <mike flyn org>
Date:   Mon May 9 20:14:00 2011 -0500

    Work on authentication
    
    See also https://bugzilla.gnome.org/show_bug.cgi?id=501389.
    Signed-off-by: W. Michael Petullo <mike flyn org>

 libdmapsharing/daap-connection.c         |    2 -
 libdmapsharing/daap-connection.h         |    1 -
 libdmapsharing/dacp-connection.c         |    2 -
 libdmapsharing/dacp-connection.h         |    1 -
 libdmapsharing/dacp-share.c              |    1 -
 libdmapsharing/dmap-connection.c         |  149 ++++++++++++------------------
 libdmapsharing/dmap-connection.h         |    1 -
 libdmapsharing/dmap-marshal.list         |    1 +
 libdmapsharing/dmap-mdns-browser-avahi.c |    1 -
 libdmapsharing/dmap-mdns-browser-dnssd.c |    1 -
 libdmapsharing/dmap-mdns-browser-howl.c  |    1 -
 libdmapsharing/dmap-mdns-browser.h       |    4 +-
 libdmapsharing/dpap-connection.c         |    2 -
 libdmapsharing/dpap-connection.h         |    1 -
 tests/dacplisten.c                       |   30 ++----
 tests/dmapcopy.c                         |   28 ++----
 tests/dmapcopy.vala                      |    2 +-
 tests/dmapserve.c                        |   30 ++----
 tests/dpapview.c                         |   64 ++++++--------
 tests/dpapview.vala                      |    2 +-
 tests/test-dmap-client.c                 |   27 +++++-
 tests/vala-dmap-container-db.c           |   12 ++-
 tests/vala-dmap-container-db.vala        |    4 +
 tests/vala-dmap-db.c                     |    2 +-
 tests/vala-dpap-record.c                 |   90 +++++++-----------
 vala/libdmapsharing-3.0.vapi             |  139 +++++++++++++++++++---------
 26 files changed, 289 insertions(+), 309 deletions(-)
---
diff --git a/libdmapsharing/daap-connection.c b/libdmapsharing/daap-connection.c
index 28b88b7..cfe3bdf 100644
--- a/libdmapsharing/daap-connection.c
+++ b/libdmapsharing/daap-connection.c
@@ -174,14 +174,12 @@ DAAPConnection *
 daap_connection_new (const char *name,
 		     const char *host,
 		     guint port,
-		     gboolean password_protected,
 		     DMAPDb * db, DMAPRecordFactory * factory)
 {
 	DAAPConnection *connection;
 
 	connection = g_object_new (DAAP_TYPE_CONNECTION,
 				   "name", name,
-				   "password-protected", password_protected,
 				   "db", db,
 				   "host", host,
 				   "port", port, "factory", factory, NULL);
diff --git a/libdmapsharing/daap-connection.h b/libdmapsharing/daap-connection.h
index fdaf7dd..a1e8ee8 100644
--- a/libdmapsharing/daap-connection.h
+++ b/libdmapsharing/daap-connection.h
@@ -88,7 +88,6 @@ GType daap_connection_get_type (void);
 DAAPConnection *daap_connection_new (const char *name,
 				     const char *host,
 				     guint port,
-				     gboolean password_protected,
 				     DMAPDb * db,
 				     DMAPRecordFactory * factory);
 G_END_DECLS
diff --git a/libdmapsharing/dacp-connection.c b/libdmapsharing/dacp-connection.c
index 6ffdc3a..fe7cf8c 100644
--- a/libdmapsharing/dacp-connection.c
+++ b/libdmapsharing/dacp-connection.c
@@ -75,14 +75,12 @@ DACPConnection *
 dacp_connection_new (const char *name,
 		     const char *host,
 		     guint port,
-		     gboolean password_protected,
 		     DMAPDb * db, DMAPRecordFactory * factory)
 {
 	DACPConnection *connection;
 
 	connection = g_object_new (DACP_TYPE_CONNECTION,
 				   "name", name,
-				   "password-protected", password_protected,
 				   "db", db,
 				   "host", host,
 				   "port", port, "factory", factory, NULL);
diff --git a/libdmapsharing/dacp-connection.h b/libdmapsharing/dacp-connection.h
index 59691a1..54c898f 100644
--- a/libdmapsharing/dacp-connection.h
+++ b/libdmapsharing/dacp-connection.h
@@ -88,7 +88,6 @@ GType dacp_connection_get_type (void);
 DACPConnection *dacp_connection_new (const char *name,
 				     const char *host,
 				     guint port,
-				     gboolean password_protected,
 				     DMAPDb * db,
 				     DMAPRecordFactory * factory);
 G_END_DECLS
diff --git a/libdmapsharing/dacp-share.c b/libdmapsharing/dacp-share.c
index 8be3f7d..8e72f57 100644
--- a/libdmapsharing/dacp-share.c
+++ b/libdmapsharing/dacp-share.c
@@ -1092,7 +1092,6 @@ dacp_share_pair (DACPShare * share, gchar * service_name, gchar passcode[4])
 
 	remote_info->connection = DMAP_CONNECTION (dacp_connection_new (name,
 						                        remote_info->host, remote_info->port,
-									FALSE,
 									NULL,
 									NULL));
 	/* This is required since we don't call DMAPConnection default handler */
diff --git a/libdmapsharing/dmap-connection.c b/libdmapsharing/dmap-connection.c
index c68ead3..c0a6a3b 100644
--- a/libdmapsharing/dmap-connection.c
+++ b/libdmapsharing/dmap-connection.c
@@ -60,7 +60,6 @@ G_DEFINE_TYPE (DMAPConnection, dmap_connection, G_TYPE_OBJECT);
 struct DMAPConnectionPrivate
 {
 	char *name;
-	gboolean password_protected;
 	char *username;
 	char *password;
 	char *host;
@@ -105,7 +104,6 @@ enum
 	PROP_FACTORY,
 	PROP_NAME,
 	PROP_ENTRY_TYPE,
-	PROP_PASSWORD_PROTECTED,
 	PROP_HOST,
 	PROP_PORT,
 	PROP_BASE_URI,
@@ -113,6 +111,8 @@ enum
 	PROP_SESSION_ID,
 	PROP_DMAP_VERSION,
 	PROP_REVISION_NUMBER,
+	PROP_USERNAME,
+	PROP_PASSWORD,
 };
 
 enum
@@ -178,15 +178,6 @@ dmap_connection_class_init (DMAPConnectionClass * klass)
 							       |
 							       G_PARAM_CONSTRUCT_ONLY));
 
-	g_object_class_install_property (object_class,
-					 PROP_PASSWORD_PROTECTED,
-					 g_param_spec_boolean
-					 ("password-protected",
-					  "password protected",
-					  "connection is password protected",
-					  FALSE,
-					  G_PARAM_READWRITE |
-					  G_PARAM_CONSTRUCT_ONLY));
 	g_object_class_install_property (object_class, PROP_NAME,
 					 g_param_spec_string ("name",
 							      "connection name",
@@ -249,6 +240,21 @@ dmap_connection_class_init (DMAPConnectionClass * klass)
 							   0, G_MAXINT, 0,
 							   G_PARAM_READWRITE));
 
+	g_object_class_install_property (object_class, PROP_USERNAME,
+					 g_param_spec_string ("username",
+							      "connection username",
+							      "connection username",
+							      "libdmapsharing",
+							      G_PARAM_READWRITE |
+							      G_PARAM_CONSTRUCT_ONLY));
+
+	g_object_class_install_property (object_class, PROP_PASSWORD,
+					 g_param_spec_string ("password",
+							      "connection password",
+							      "connection password",
+							      NULL,
+							      G_PARAM_WRITABLE));
+
 	signals[AUTHENTICATE] = g_signal_new ("authenticate",
 					      G_TYPE_FROM_CLASS
 					      (object_class),
@@ -256,9 +262,13 @@ dmap_connection_class_init (DMAPConnectionClass * klass)
 					      G_STRUCT_OFFSET
 					      (DMAPConnectionClass,
 					       authenticate), NULL, NULL,
-					      dmap_marshal_STRING__STRING,
-					      G_TYPE_STRING, 1,
-					      G_TYPE_STRING);
+					      dmap_marshal_VOID__STRING_POINTER_POINTER_POINTER_BOOLEAN,
+					      G_TYPE_NONE, 5,
+					      G_TYPE_STRING,
+					      SOUP_TYPE_SESSION,
+					      SOUP_TYPE_MESSAGE,
+					      SOUP_TYPE_AUTH,
+					      G_TYPE_BOOLEAN);
 	signals[CONNECTING] =
 		g_signal_new ("connecting", G_TYPE_FROM_CLASS (object_class),
 			      G_SIGNAL_RUN_LAST,
@@ -292,23 +302,6 @@ static void
 dmap_connection_init (DMAPConnection * connection)
 {
 	connection->priv = DMAP_CONNECTION_GET_PRIVATE (connection);
-
-	connection->priv->username =
-		g_strdup_printf ("libdmapsharing_%s", VERSION);
-}
-
-static char *
-connection_get_password (DMAPConnection * connection)
-{
-	char *password = NULL;;
-
-	// FIXME: GDK_THREADS_ENTER ();
-	g_signal_emit (connection,
-		       signals[AUTHENTICATE],
-		       0, connection->priv->name, &password);
-	// FIXME: GDK_THREADS_LEAVE ();
-
-	return password;
 }
 
 static void
@@ -759,7 +752,7 @@ handle_login (DMAPConnection * connection,
 	if (status == SOUP_STATUS_UNAUTHORIZED
 	    || status == SOUP_STATUS_FORBIDDEN) {
 		g_debug ("Incorrect password");
-		priv->state = DMAP_GET_PASSWORD;
+		// Maintain present state; libsoup will signal for password.
 		if (priv->do_something_id != 0) {
 			g_source_remove (priv->do_something_id);
 		}
@@ -1190,11 +1183,34 @@ connected_cb (DMAPConnection * connection, ConnectionResponseData * rdata)
 	}
 }
 
+static void
+authenticate_cb (SoupSession *session, SoupMessage *msg, SoupAuth *auth, gboolean retrying, DMAPConnection *connection)
+{
+	if (retrying || ! connection->priv->password) {
+		g_debug ("Requesting password from application");
+		soup_session_pause_message (session, msg);
+		// FIXME: GDK_THREADS_ENTER ();
+		g_signal_emit (connection,
+			       signals[AUTHENTICATE],
+			       0,
+			       connection->priv->name,
+			       session,
+			       msg,
+			       auth,
+			       retrying);
+		// FIXME: GDK_THREADS_LEAVE ();
+	} else {
+		soup_auth_authenticate (auth, connection->priv->username, connection->priv->password);
+	}
+}
+
 void
 dmap_connection_setup (DMAPConnection * connection)
 {
 	connection->priv->session = soup_session_async_new ();
 
+	g_signal_connect (connection->priv->session, "authenticate", authenticate_cb, connection);
+
 	connection->priv->base_uri = soup_uri_new (NULL);
 	soup_uri_set_scheme (connection->priv->base_uri,
 			     SOUP_URI_SCHEME_HTTP);
@@ -1417,40 +1433,13 @@ dmap_connection_do_something (DMAPConnection * connection)
 		}
 		break;
 
-	case DMAP_GET_PASSWORD:
-		if (priv->password_protected) {
-			/* FIXME this bit is still synchronous */
-			g_debug ("Need a password for %s", priv->name);
-			g_free (priv->password);
-			priv->password = connection_get_password (connection);
-
-			if (priv->password == NULL
-			    || priv->password[0] == '\0') {
-				g_debug ("Password entry cancelled");
-				priv->result = FALSE;
-				priv->state = DMAP_DONE;
-				dmap_connection_do_something (connection);
-				return FALSE;
-			}
-
-			/* If the share went away while we were asking for the password,
-			 * don't bother trying to log in.
-			 */
-			if (priv->state != DMAP_GET_PASSWORD) {
-				return FALSE;
-			}
-		}
-
-		/* otherwise, fall through */
-		priv->state = DMAP_LOGIN;
-
 	case DMAP_LOGIN:
+		// NOTE: libsoup will signal if password required and not present.
 		g_debug ("Logging into DAAP server");
 		if (!http_get (connection, "/login", FALSE, 0.0, 0, FALSE,
 			       (DMAPResponseHandler) handle_login, NULL,
 			       FALSE)) {
 			g_debug ("Could not login to DAAP server");
-			/* FIXME: set state back to GET_PASSWORD to try again */
 			dmap_connection_state_done (connection, FALSE);
 		}
 
@@ -1605,31 +1594,6 @@ dmap_connection_get_headers (DMAPConnection * connection, const gchar * uri)
 				     request_id);
 	g_free (request_id);
 
-	if (priv->password_protected) {
-		char *h;
-		char *user_pass;
-		char *token;
-
-		if (priv->username == NULL || priv->password == NULL) {
-			g_debug ("No username or no password provided");
-		} else {
-
-			user_pass =
-				g_strdup_printf ("%s:%s", priv->username,
-						 priv->password);
-			token = g_base64_encode ((guchar *) user_pass,
-						 strlen (user_pass));
-			h = g_strdup_printf ("Basic %s", token);
-
-			g_free (token);
-			g_free (user_pass);
-
-			soup_message_headers_append (headers,
-						     "Authentication", h);
-			g_free (h);
-		}
-	}
-
 	return headers;
 }
 
@@ -1751,9 +1715,6 @@ dmap_connection_set_property (GObject * object,
 		priv->record_factory =
 			DMAP_RECORD_FACTORY (g_value_get_pointer (value));
 		break;
-	case PROP_PASSWORD_PROTECTED:
-		priv->password_protected = g_value_get_boolean (value);
-		break;
 	case PROP_HOST:
 		g_free (priv->host);
 		priv->host = g_value_dup_string (value);
@@ -1776,6 +1737,12 @@ dmap_connection_set_property (GObject * object,
 	case PROP_REVISION_NUMBER:
 		priv->revision_number = g_value_get_int (value);
 		break;
+	case PROP_USERNAME:
+		priv->username = g_value_dup_string (value);
+		break;
+	case PROP_PASSWORD:
+		priv->password = g_value_dup_string (value);
+		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 		break;
@@ -1799,9 +1766,6 @@ dmap_connection_get_property (GObject * object,
 	case PROP_NAME:
 		g_value_set_string (value, priv->name);
 		break;
-	case PROP_PASSWORD_PROTECTED:
-		g_value_set_boolean (value, priv->password_protected);
-		break;
 	case PROP_HOST:
 		g_value_set_string (value, priv->host);
 		break;
@@ -1823,6 +1787,9 @@ dmap_connection_get_property (GObject * object,
 	case PROP_REVISION_NUMBER:
 		g_value_set_int (value, priv->revision_number);
 		break;
+	case PROP_USERNAME:
+		g_value_set_string (value, priv->username);
+		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 		break;
diff --git a/libdmapsharing/dmap-connection.h b/libdmapsharing/dmap-connection.h
index 22b8fed..cf2362e 100644
--- a/libdmapsharing/dmap-connection.h
+++ b/libdmapsharing/dmap-connection.h
@@ -89,7 +89,6 @@ typedef struct DMAPConnectionPrivate DMAPConnectionPrivate;
 typedef enum
 {
 	DMAP_GET_INFO = 0,
-	DMAP_GET_PASSWORD,
 	DMAP_LOGIN,
 	DMAP_GET_REVISION_NUMBER,
 	DMAP_GET_DB_INFO,
diff --git a/libdmapsharing/dmap-marshal.list b/libdmapsharing/dmap-marshal.list
index a25b0e7..00795af 100644
--- a/libdmapsharing/dmap-marshal.list
+++ b/libdmapsharing/dmap-marshal.list
@@ -5,3 +5,4 @@ ULONG:VOID
 VOID:STRING,STRING
 VOID:STRING,BOOLEAN
 BOOLEAN:STRING
+VOID:STRING,POINTER,POINTER,POINTER,BOOLEAN
diff --git a/libdmapsharing/dmap-mdns-browser-avahi.c b/libdmapsharing/dmap-mdns-browser-avahi.c
index 12890fc..a66d08c 100644
--- a/libdmapsharing/dmap-mdns-browser-avahi.c
+++ b/libdmapsharing/dmap-mdns-browser-avahi.c
@@ -431,7 +431,6 @@ resolve_cb (AvahiServiceResolver * service_resolver,
 		service->host = g_strdup (host);
 		service->port = port;
 		service->pair = pair;
-		service->password_protected = pp;
 		browser->priv->services =
 			g_slist_append (browser->priv->services, service);
 		g_signal_emit (browser,
diff --git a/libdmapsharing/dmap-mdns-browser-dnssd.c b/libdmapsharing/dmap-mdns-browser-dnssd.c
index 935052a..e8da05b 100644
--- a/libdmapsharing/dmap-mdns-browser-dnssd.c
+++ b/libdmapsharing/dmap-mdns-browser-dnssd.c
@@ -368,7 +368,6 @@ dmap_mdns_browser_resolve (DMAPMdnsBrowser * browser,
 	service->host = g_strdup (browser->priv->host_target);
 	service->port = browser->priv->port;
 	service->pair = NULL;
-	service->password_protected = FALSE;
 
 	// add to the services list
 	browser->priv->services =
diff --git a/libdmapsharing/dmap-mdns-browser-howl.c b/libdmapsharing/dmap-mdns-browser-howl.c
index d4cd03d..6482e37 100644
--- a/libdmapsharing/dmap-mdns-browser-howl.c
+++ b/libdmapsharing/dmap-mdns-browser-howl.c
@@ -272,7 +272,6 @@ resolve_cb (sw_discovery discovery,
 	service->name = name;
 	service->host = g_strdup (host);
 	service->port = port;
-	service->password_protected = pp;
 	service->pair = pair;
 	browser->priv->services =
 		g_slist_append (browser->priv->services, service);
diff --git a/libdmapsharing/dmap-mdns-browser.h b/libdmapsharing/dmap-mdns-browser.h
index 721e9e1..f3dbf27 100644
--- a/libdmapsharing/dmap-mdns-browser.h
+++ b/libdmapsharing/dmap-mdns-browser.h
@@ -83,8 +83,7 @@ typedef enum
 	DMAP_MDNS_BROWSER_SERVICE_TYPE_DAAP,
 	DMAP_MDNS_BROWSER_SERVICE_TYPE_DPAP,
 	DMAP_MDNS_BROWSER_SERVICE_TYPE_DACP,
-	DMAP_MDNS_BROWSER_SERVICE_TYPE_LAST =
-		DMAP_MDNS_BROWSER_SERVICE_TYPE_DACP
+	DMAP_MDNS_BROWSER_SERVICE_TYPE_LAST = DMAP_MDNS_BROWSER_SERVICE_TYPE_DACP
 } DMAPMdnsBrowserServiceType;
 
 static const char * const service_type_name[] = {
@@ -107,7 +106,6 @@ struct _DMAPMdnsBrowserService
 	gchar *name;
 	gchar *host;
 	guint port;
-	gboolean password_protected;
 	gchar *pair;
 };
 
diff --git a/libdmapsharing/dpap-connection.c b/libdmapsharing/dpap-connection.c
index 9b356e0..8382fea 100644
--- a/libdmapsharing/dpap-connection.c
+++ b/libdmapsharing/dpap-connection.c
@@ -163,14 +163,12 @@ DPAPConnection *
 dpap_connection_new (const char *name,
 		     const char *host,
 		     guint port,
-		     gboolean password_protected,
 		     DMAPDb * db, DMAPRecordFactory * factory)
 {
 	DPAPConnection *connection;
 
 	connection = g_object_new (DPAP_TYPE_CONNECTION,
 				   "name", name,
-				   "password-protected", password_protected,
 				   "db", db,
 				   "host", host,
 				   "port", port, "factory", factory, NULL);
diff --git a/libdmapsharing/dpap-connection.h b/libdmapsharing/dpap-connection.h
index 915b1e9..13616dc 100644
--- a/libdmapsharing/dpap-connection.h
+++ b/libdmapsharing/dpap-connection.h
@@ -88,7 +88,6 @@ GType dpap_connection_get_type (void);
 DPAPConnection *dpap_connection_new (const char *name,
 				     const char *host,
 				     guint port,
-				     gboolean password_protected,
 				     DMAPDb * db,
 				     DMAPRecordFactory * factory);
 G_END_DECLS
diff --git a/tests/dacplisten.c b/tests/dacplisten.c
index c1b285b..e4901d1 100644
--- a/tests/dacplisten.c
+++ b/tests/dacplisten.c
@@ -1,4 +1,4 @@
-/* dacplisten.c generated by valac 0.11.4, the Vala compiler
+/* dacplisten.c generated by valac 0.12.0, the Vala compiler
  * generated from dacplisten.vala, do not modify */
 
 /*   FILE: dacplisten.vala -- Listen to DACP remotes
@@ -279,30 +279,22 @@ static void __lambda1__dacp_share_add_guid (DACPShare* _sender, const gchar* gui
 DACPListener* dacp_listener_construct (GType object_type) {
 	DACPListener * self = NULL;
 	ValaDMAPDb* _tmp0_ = NULL;
-	DMAPDb* _tmp1_;
-	ValaDMAPContainerDb* _tmp2_ = NULL;
-	DMAPContainerDb* _tmp3_;
-	ValaDACPPlayer* _tmp4_ = NULL;
-	DACPPlayer* _tmp5_;
-	DACPShare* _tmp6_ = NULL;
-	DACPShare* _tmp7_;
+	ValaDMAPContainerDb* _tmp1_ = NULL;
+	ValaDACPPlayer* _tmp2_ = NULL;
+	DACPShare* _tmp3_ = NULL;
 	self = (DACPListener*) g_object_new (object_type, NULL);
 	_tmp0_ = vala_dmap_db_new ();
-	_tmp1_ = (DMAPDb*) _tmp0_;
 	_g_object_unref0 (self->priv->db);
-	self->priv->db = _tmp1_;
-	_tmp2_ = vala_dmap_container_db_new ();
-	_tmp3_ = (DMAPContainerDb*) _tmp2_;
+	self->priv->db = (DMAPDb*) _tmp0_;
+	_tmp1_ = vala_dmap_container_db_new ();
 	_g_object_unref0 (self->priv->container_db);
-	self->priv->container_db = _tmp3_;
-	_tmp4_ = vala_dacp_player_new ();
-	_tmp5_ = (DACPPlayer*) _tmp4_;
+	self->priv->container_db = (DMAPContainerDb*) _tmp1_;
+	_tmp2_ = vala_dacp_player_new ();
 	_g_object_unref0 (self->priv->player);
-	self->priv->player = _tmp5_;
-	_tmp6_ = dacp_share_new ("dacplisten", self->priv->player, self->priv->db, self->priv->container_db);
-	_tmp7_ = _tmp6_;
+	self->priv->player = (DACPPlayer*) _tmp2_;
+	_tmp3_ = dacp_share_new ("dacplisten", self->priv->player, self->priv->db, self->priv->container_db);
 	_g_object_unref0 (self->priv->share);
-	self->priv->share = _tmp7_;
+	self->priv->share = _tmp3_;
 	g_signal_connect_object (self->priv->share, "remote-found", (GCallback) __lambda0__dacp_share_remote_found, self, 0);
 	g_signal_connect_object (self->priv->share, "add-guid", (GCallback) __lambda1__dacp_share_add_guid, self, 0);
 	dacp_share_start_lookup (self->priv->share);
diff --git a/tests/dmapcopy.c b/tests/dmapcopy.c
index b78be9b..2e96a4a 100644
--- a/tests/dmapcopy.c
+++ b/tests/dmapcopy.c
@@ -1,4 +1,4 @@
-/* dmapcopy.c generated by valac 0.11.4, the Vala compiler
+/* dmapcopy.c generated by valac 0.12.0, the Vala compiler
  * generated from dmapcopy.vala, do not modify */
 
 /*   FILE: dmapcopy.vala -- Copy files from a DMAP server
@@ -170,12 +170,10 @@ static gboolean _dpap_copy_connected_cb_dmap_connection_callback (DMAPConnection
 
 static void dpap_copy_service_added_cb (DPAPCopy* self, DMAPMdnsBrowserService* service) {
 	DPAPConnection* _tmp0_ = NULL;
-	DMAPConnection* _tmp1_;
 	g_return_if_fail (self != NULL);
-	_tmp0_ = dpap_connection_new (service->service_name, service->host, service->port, FALSE, (DMAPDb*) self->priv->db, (DMAPRecordFactory*) self->priv->factory);
-	_tmp1_ = DMAP_CONNECTION (_tmp0_);
+	_tmp0_ = dpap_connection_new (service->service_name, service->host, service->port, (DMAPDb*) self->priv->db, (DMAPRecordFactory*) self->priv->factory);
 	_g_object_unref0 (self->priv->connection);
-	self->priv->connection = _tmp1_;
+	self->priv->connection = DMAP_CONNECTION (_tmp0_);
 	dmap_connection_connect (self->priv->connection, _dpap_copy_connected_cb_dmap_connection_callback, self);
 }
 
@@ -188,25 +186,19 @@ static void _dpap_copy_service_added_cb_dmap_mdns_browser_service_added (DMAPMdn
 DPAPCopy* dpap_copy_construct (GType object_type, GError** error) {
 	DPAPCopy* self = NULL;
 	ValaDMAPDb* _tmp0_ = NULL;
-	ValaDMAPDb* _tmp1_;
-	ValaDPAPRecordFactory* _tmp2_ = NULL;
-	ValaDPAPRecordFactory* _tmp3_;
-	DMAPMdnsBrowser* _tmp4_ = NULL;
-	DMAPMdnsBrowser* _tmp5_;
+	ValaDPAPRecordFactory* _tmp1_ = NULL;
+	DMAPMdnsBrowser* _tmp2_ = NULL;
 	GError * _inner_error_ = NULL;
 	self = (DPAPCopy*) g_type_create_instance (object_type);
 	_tmp0_ = vala_dmap_db_new ();
-	_tmp1_ = _tmp0_;
 	_g_object_unref0 (self->priv->db);
-	self->priv->db = _tmp1_;
-	_tmp2_ = vala_dpap_record_factory_new ();
-	_tmp3_ = _tmp2_;
+	self->priv->db = _tmp0_;
+	_tmp1_ = vala_dpap_record_factory_new ();
 	_g_object_unref0 (self->priv->factory);
-	self->priv->factory = _tmp3_;
-	_tmp4_ = dmap_mdns_browser_new (DMAP_MDNS_BROWSER_SERVICE_TYPE_DPAP);
-	_tmp5_ = _tmp4_;
+	self->priv->factory = _tmp1_;
+	_tmp2_ = dmap_mdns_browser_new (DMAP_MDNS_BROWSER_SERVICE_TYPE_DPAP);
 	_g_object_unref0 (self->priv->browser);
-	self->priv->browser = _tmp5_;
+	self->priv->browser = _tmp2_;
 	g_signal_connect (self->priv->browser, "service-added", (GCallback) _dpap_copy_service_added_cb_dmap_mdns_browser_service_added, self);
 	dmap_mdns_browser_start (self->priv->browser, &_inner_error_);
 	if (_inner_error_ != NULL) {
diff --git a/tests/dmapcopy.vala b/tests/dmapcopy.vala
index db1249a..190ac39 100644
--- a/tests/dmapcopy.vala
+++ b/tests/dmapcopy.vala
@@ -59,7 +59,7 @@ private class DPAPCopy {
 	}
 
 	private void service_added_cb (DMAP.MdnsBrowserService *service) {
-		connection = (DMAP.Connection) new DPAP.Connection (service->service_name, service->host, service->port, false, db, factory);
+		connection = (DMAP.Connection) new DPAP.Connection (service->service_name, service->host, service->port, db, factory);
 		connection.connect (connected_cb);
 	}
 
diff --git a/tests/dmapserve.c b/tests/dmapserve.c
index 052f030..558f580 100644
--- a/tests/dmapserve.c
+++ b/tests/dmapserve.c
@@ -1,4 +1,4 @@
-/* dmapserve.c generated by valac 0.11.4, the Vala compiler
+/* dmapserve.c generated by valac 0.12.0, the Vala compiler
  * generated from dmapserve.vala, do not modify */
 
 /*   FILE: dmapserve.vala -- Serve media using DMAP
@@ -134,31 +134,23 @@ static void _debug_printf_glog_func (const gchar* log_domain, GLogLevelFlags log
 DPAPServe* dpap_serve_construct (GType object_type, GError** error) {
 	DPAPServe* self = NULL;
 	ValaDPAPRecord* _tmp0_ = NULL;
-	ValaDPAPRecord* _tmp1_;
-	ValaDMAPDb* _tmp2_ = NULL;
-	ValaDMAPDb* _tmp3_;
-	ValaDMAPContainerDb* _tmp4_ = NULL;
-	ValaDMAPContainerDb* _tmp5_;
-	DPAPShare* _tmp6_ = NULL;
-	DPAPShare* _tmp7_;
+	ValaDMAPDb* _tmp1_ = NULL;
+	ValaDMAPContainerDb* _tmp2_ = NULL;
+	DPAPShare* _tmp3_ = NULL;
 	self = (DPAPServe*) g_type_create_instance (object_type);
 	_tmp0_ = vala_dpap_record_new ();
-	_tmp1_ = _tmp0_;
 	_g_object_unref0 (self->priv->record);
-	self->priv->record = _tmp1_;
-	_tmp2_ = vala_dmap_db_new ();
-	_tmp3_ = _tmp2_;
+	self->priv->record = _tmp0_;
+	_tmp1_ = vala_dmap_db_new ();
 	_g_object_unref0 (self->priv->db);
-	self->priv->db = _tmp3_;
+	self->priv->db = _tmp1_;
 	dmap_db_add ((DMAPDb*) self->priv->db, (DMAPRecord*) self->priv->record);
-	_tmp4_ = vala_dmap_container_db_new ();
-	_tmp5_ = _tmp4_;
+	_tmp2_ = vala_dmap_container_db_new ();
 	_g_object_unref0 (self->priv->container_db);
-	self->priv->container_db = _tmp5_;
-	_tmp6_ = dpap_share_new ("dmapserve", NULL, self->priv->db, self->priv->container_db, NULL);
-	_tmp7_ = _tmp6_;
+	self->priv->container_db = _tmp2_;
+	_tmp3_ = dpap_share_new ("dmapserve", NULL, self->priv->db, self->priv->container_db, NULL);
 	_g_object_unref0 (self->priv->share);
-	self->priv->share = _tmp7_;
+	self->priv->share = _tmp3_;
 	return self;
 }
 
diff --git a/tests/dpapview.c b/tests/dpapview.c
index 6f19dd7..0ac39be 100644
--- a/tests/dpapview.c
+++ b/tests/dpapview.c
@@ -1,4 +1,4 @@
-/* dpapview.c generated by valac 0.11.4, the Vala compiler
+/* dpapview.c generated by valac 0.12.0, the Vala compiler
  * generated from dpapview.vala, do not modify */
 
 /*   FILE: dpapviewer.vala -- View DPAP data
@@ -144,21 +144,19 @@ static void _lambda0_ (gconstpointer k, gconstpointer v, DPAPViewer* self) {
 	GdkPixbuf* pixbuf;
 	GByteArray* _tmp0_ = NULL;
 	GtkTreeIter iter = {0};
-	GtkTreeIter _tmp7_ = {0};
-	const gchar* _tmp8_ = NULL;
+	GtkTreeIter _tmp6_ = {0};
+	const gchar* _tmp7_ = NULL;
 	GError * _inner_error_ = NULL;
 	pixbuf = NULL;
 	_tmp0_ = vala_dpap_record_get_thumbnail (VALA_DPAP_RECORD (v));
 	if (_tmp0_ != NULL) {
-		gchar* path;
+		gchar* path = NULL;
 		gchar* _tmp1_ = NULL;
 		gint _tmp2_;
 		gint fd;
 		GByteArray* _tmp3_ = NULL;
 		GdkPixbuf* _tmp4_ = NULL;
 		GdkPixbuf* _tmp5_;
-		GdkPixbuf* _tmp6_;
-		path = NULL;
 		_tmp2_ = g_file_open_tmp ("dpapview.XXXXXX", &_tmp1_, &_inner_error_);
 		_g_free0 (path);
 		path = _tmp1_;
@@ -189,16 +187,15 @@ static void _lambda0_ (gconstpointer k, gconstpointer v, DPAPViewer* self) {
 			g_clear_error (&_inner_error_);
 			return;
 		}
-		_tmp6_ = _tmp5_;
 		_g_object_unref0 (pixbuf);
-		pixbuf = _tmp6_;
+		pixbuf = _tmp5_;
 		g_unlink (path);
 		_g_free0 (path);
 	}
-	gtk_list_store_append (self->priv->liststore, &_tmp7_);
-	iter = _tmp7_;
-	_tmp8_ = vala_dpap_record_get_filename (VALA_DPAP_RECORD (v));
-	gtk_list_store_set (self->priv->liststore, &iter, 0, pixbuf, 1, _tmp8_, -1);
+	gtk_list_store_append (self->priv->liststore, &_tmp6_);
+	iter = _tmp6_;
+	_tmp7_ = vala_dpap_record_get_filename (VALA_DPAP_RECORD (v));
+	gtk_list_store_set (self->priv->liststore, &iter, 0, pixbuf, 1, _tmp7_, -1);
 	_g_object_unref0 (pixbuf);
 }
 
@@ -230,12 +227,10 @@ static gboolean _dpap_viewer_connected_cb_dmap_connection_callback (DMAPConnecti
 
 static void dpap_viewer_service_added_cb (DPAPViewer* self, DMAPMdnsBrowserService* service) {
 	DPAPConnection* _tmp0_ = NULL;
-	DMAPConnection* _tmp1_;
 	g_return_if_fail (self != NULL);
-	_tmp0_ = dpap_connection_new (service->service_name, service->host, service->port, FALSE, (DMAPDb*) self->priv->db, (DMAPRecordFactory*) self->priv->factory);
-	_tmp1_ = DMAP_CONNECTION (_tmp0_);
+	_tmp0_ = dpap_connection_new (service->service_name, service->host, service->port, (DMAPDb*) self->priv->db, (DMAPRecordFactory*) self->priv->factory);
 	_g_object_unref0 (self->priv->connection);
-	self->priv->connection = _tmp1_;
+	self->priv->connection = DMAP_CONNECTION (_tmp0_);
 	dmap_connection_connect (self->priv->connection, _dpap_viewer_connected_cb_dmap_connection_callback, self);
 }
 
@@ -263,43 +258,38 @@ DPAPViewer* dpap_viewer_construct (GType object_type, GtkBuilder* builder, GErro
 	GObject* _tmp6_ = NULL;
 	GObject* _tmp7_;
 	GtkListStore* _tmp8_;
-	GtkListStore* _tmp9_;
-	ValaDMAPDb* _tmp10_ = NULL;
-	ValaDMAPDb* _tmp11_;
-	ValaDPAPRecordFactory* _tmp12_ = NULL;
-	ValaDPAPRecordFactory* _tmp13_;
-	DMAPMdnsBrowser* _tmp14_ = NULL;
-	DMAPMdnsBrowser* _tmp15_;
+	ValaDMAPDb* _tmp9_ = NULL;
+	ValaDPAPRecordFactory* _tmp10_ = NULL;
+	DMAPMdnsBrowser* _tmp11_ = NULL;
 	GError * _inner_error_ = NULL;
 	g_return_val_if_fail (builder != NULL, NULL);
 	self = (DPAPViewer*) g_type_create_instance (object_type);
 	gtk_builder_connect_signals (builder, self);
 	_tmp0_ = gtk_builder_get_object (builder, "window");
-	_tmp2_ = _g_object_ref0 ((_tmp1_ = _tmp0_, GTK_IS_WIDGET (_tmp1_) ? ((GtkWidget*) _tmp1_) : NULL));
+	_tmp1_ = _tmp0_;
+	_tmp2_ = _g_object_ref0 (GTK_IS_WIDGET (_tmp1_) ? ((GtkWidget*) _tmp1_) : NULL);
 	widget = _tmp2_;
 	_tmp3_ = gtk_builder_get_object (builder, "iconview");
-	_tmp5_ = _g_object_ref0 ((_tmp4_ = _tmp3_, GTK_IS_ICON_VIEW (_tmp4_) ? ((GtkIconView*) _tmp4_) : NULL));
+	_tmp4_ = _tmp3_;
+	_tmp5_ = _g_object_ref0 (GTK_IS_ICON_VIEW (_tmp4_) ? ((GtkIconView*) _tmp4_) : NULL);
 	iconview = _tmp5_;
 	_tmp6_ = gtk_builder_get_object (builder, "liststore");
-	_tmp8_ = _g_object_ref0 ((_tmp7_ = _tmp6_, GTK_IS_LIST_STORE (_tmp7_) ? ((GtkListStore*) _tmp7_) : NULL));
-	_tmp9_ = _tmp8_;
+	_tmp7_ = _tmp6_;
+	_tmp8_ = _g_object_ref0 (GTK_IS_LIST_STORE (_tmp7_) ? ((GtkListStore*) _tmp7_) : NULL);
 	_g_object_unref0 (self->priv->liststore);
-	self->priv->liststore = _tmp9_;
-	_tmp10_ = vala_dmap_db_new ();
-	_tmp11_ = _tmp10_;
+	self->priv->liststore = _tmp8_;
+	_tmp9_ = vala_dmap_db_new ();
 	_g_object_unref0 (self->priv->db);
-	self->priv->db = _tmp11_;
-	_tmp12_ = vala_dpap_record_factory_new ();
-	_tmp13_ = _tmp12_;
+	self->priv->db = _tmp9_;
+	_tmp10_ = vala_dpap_record_factory_new ();
 	_g_object_unref0 (self->priv->factory);
-	self->priv->factory = _tmp13_;
+	self->priv->factory = _tmp10_;
 	gtk_icon_view_set_pixbuf_column (iconview, 0);
 	gtk_icon_view_set_text_column (iconview, 1);
 	gtk_widget_show_all (widget);
-	_tmp14_ = dmap_mdns_browser_new (DMAP_MDNS_BROWSER_SERVICE_TYPE_DPAP);
-	_tmp15_ = _tmp14_;
+	_tmp11_ = dmap_mdns_browser_new (DMAP_MDNS_BROWSER_SERVICE_TYPE_DPAP);
 	_g_object_unref0 (self->priv->browser);
-	self->priv->browser = _tmp15_;
+	self->priv->browser = _tmp11_;
 	g_signal_connect (self->priv->browser, "service-added", (GCallback) _dpap_viewer_service_added_cb_dmap_mdns_browser_service_added, self);
 	dmap_mdns_browser_start (self->priv->browser, &_inner_error_);
 	if (_inner_error_ != NULL) {
diff --git a/tests/dpapview.vala b/tests/dpapview.vala
index 388d676..b7bdad0 100644
--- a/tests/dpapview.vala
+++ b/tests/dpapview.vala
@@ -50,7 +50,7 @@ private class DPAPViewer {
 	}
 
 	private void service_added_cb (DMAP.MdnsBrowserService *service) {
-		connection = (DMAP.Connection) new DPAP.Connection (service->service_name, service->host, service->port, false, db, factory);
+		connection = (DMAP.Connection) new DPAP.Connection (service->service_name, service->host, service->port, db, factory);
 		connection.connect (connected_cb);
 	}
 
diff --git a/tests/test-dmap-client.c b/tests/test-dmap-client.c
index aa07e8f..38c3057 100644
--- a/tests/test-dmap-client.c
+++ b/tests/test-dmap-client.c
@@ -62,6 +62,25 @@ connected_cb (DMAPConnection *connection,
 }
 
 static void
+authenticate_cb (DMAPConnection *connection,
+		 const char *name,
+		 SoupSession *session,
+		 SoupMessage *msg,
+		 SoupAuth *auth,
+		 gboolean retrying,
+		 gpointer user_data)
+{
+	char *username, password[BUFSIZ + 1];
+	g_object_get (connection, "username", &username, NULL);
+	g_print ("Password required (username is %s): ", username);
+	fgets (password, BUFSIZ, stdin);
+	password[strlen(password) - 1] = 0x00; // Remove newline.
+	g_object_set (connection, "password", password, NULL);
+	soup_auth_authenticate (auth, username, password);
+	soup_session_unpause_message (session, msg);
+}
+
+static void
 service_added_cb (DMAPMdnsBrowser *browser,
                   DMAPMdnsBrowserService *service,
                   gpointer user_data)
@@ -74,8 +93,7 @@ service_added_cb (DMAPMdnsBrowser *browser,
              service->service_name,
              service->name,
              service->host,
-             service->port,
-             service->password_protected ? "protected" : "not protected");
+             service->port);
 
     db = DMAP_DB (test_dmap_db_new ());
     if (db == NULL) {
@@ -87,14 +105,15 @@ service_added_cb (DMAPMdnsBrowser *browser,
         if (factory == NULL) {
    	    g_error ("Error creating record factory");
         }
-        conn = DMAP_CONNECTION (daap_connection_new (service->name, service->host, service->port, FALSE, db, factory));
+        conn = DMAP_CONNECTION (daap_connection_new (service->name, service->host, service->port, db, factory));
     } else {
         factory = DMAP_RECORD_FACTORY (test_dpap_record_factory_new ());
         if (factory == NULL) {
    	    g_error ("Error creating record factory");
         }
-        conn = DMAP_CONNECTION (dpap_connection_new (service->name, service->host, service->port, FALSE, db, factory));
+        conn = DMAP_CONNECTION (dpap_connection_new (service->name, service->host, service->port, db, factory));
     }
+    g_signal_connect (DMAP_CONNECTION (conn), "authenticate", (DMAPConnectionCallback) authenticate_cb, NULL);
     dmap_connection_connect (DMAP_CONNECTION (conn), (DMAPConnectionCallback) connected_cb, db);
 }
 
diff --git a/tests/vala-dmap-container-db.c b/tests/vala-dmap-container-db.c
index 36fbc70..0167a40 100644
--- a/tests/vala-dmap-container-db.c
+++ b/tests/vala-dmap-container-db.c
@@ -1,4 +1,4 @@
-/* vala-dmap-container-db.c generated by valac 0.11.4, the Vala compiler
+/* vala-dmap-container-db.c generated by valac 0.12.0, the Vala compiler
  * generated from vala-dmap-container-db.vala, do not modify */
 
 /*   FILE: vala-dmap-db.vala -- A DMAPContainerDb implementation in Vala
@@ -66,6 +66,7 @@ enum  {
 static gint64 vala_dmap_container_db_real_count (DMAPContainerDb* base);
 static void vala_dmap_container_db_real_foreach (DMAPContainerDb* base, GHFunc func, void* func_target);
 static DMAPContainerRecord* vala_dmap_container_db_real_lookup_by_id (DMAPContainerDb* base, guint id);
+static void vala_dmap_container_db_real_add (DMAPContainerDb* base, DMAPContainerRecord* record);
 ValaDMAPContainerDb* vala_dmap_container_db_new (void);
 ValaDMAPContainerDb* vala_dmap_container_db_construct (GType object_type);
 static void vala_dmap_container_db_finalize (GObject* obj);
@@ -119,6 +120,14 @@ static DMAPContainerRecord* vala_dmap_container_db_real_lookup_by_id (DMAPContai
 }
 
 
+static void vala_dmap_container_db_real_add (DMAPContainerDb* base, DMAPContainerRecord* record) {
+	ValaDMAPContainerDb * self;
+	self = (ValaDMAPContainerDb*) base;
+	g_return_if_fail (record != NULL);
+	g_error ("vala-dmap-container-db.vala:45: add not implemented");
+}
+
+
 ValaDMAPContainerDb* vala_dmap_container_db_construct (GType object_type) {
 	ValaDMAPContainerDb * self = NULL;
 	self = (ValaDMAPContainerDb*) g_object_new (object_type, NULL);
@@ -143,6 +152,7 @@ static void vala_dmap_container_db_dmap_container_db_interface_init (DMAPContain
 	iface->count = (gint64 (*)(DMAPContainerDb*)) vala_dmap_container_db_real_count;
 	iface->foreach = (void (*)(DMAPContainerDb* ,GHFunc ,void*)) vala_dmap_container_db_real_foreach;
 	iface->lookup_by_id = (DMAPContainerRecord* (*)(DMAPContainerDb* ,guint)) vala_dmap_container_db_real_lookup_by_id;
+	iface->add = (void (*)(DMAPContainerDb* ,DMAPContainerRecord*)) vala_dmap_container_db_real_add;
 }
 
 
diff --git a/tests/vala-dmap-container-db.vala b/tests/vala-dmap-container-db.vala
index 645eba0..7571e39 100644
--- a/tests/vala-dmap-container-db.vala
+++ b/tests/vala-dmap-container-db.vala
@@ -40,4 +40,8 @@ private class ValaDMAPContainerDb : GLib.Object, DMAP.ContainerDb {
 	public unowned DMAP.ContainerRecord lookup_by_id (uint id) {
 		GLib.error ("lookup_by_id not implemented");
 	}
+
+	public void add (DMAP.ContainerRecord record) {
+		GLib.error ("add not implemented");
+	}
 }
diff --git a/tests/vala-dmap-db.c b/tests/vala-dmap-db.c
index 1e49b8b..879e8eb 100644
--- a/tests/vala-dmap-db.c
+++ b/tests/vala-dmap-db.c
@@ -1,4 +1,4 @@
-/* vala-dmap-db.c generated by valac 0.11.4, the Vala compiler
+/* vala-dmap-db.c generated by valac 0.12.0, the Vala compiler
  * generated from vala-dmap-db.vala, do not modify */
 
 /*   FILE: vala-dmap-db.vala -- A DMAPDb implementation in Vala
diff --git a/tests/vala-dpap-record.c b/tests/vala-dpap-record.c
index 879ac3e..4b44a43 100644
--- a/tests/vala-dpap-record.c
+++ b/tests/vala-dpap-record.c
@@ -1,4 +1,4 @@
-/* vala-dpap-record.c generated by valac 0.11.4, the Vala compiler
+/* vala-dpap-record.c generated by valac 0.12.0, the Vala compiler
  * generated from vala-dpap-record.vala, do not modify */
 
 /*   FILE: vala-dpap-record.vala -- A DPAPRecord implementation in Vala
@@ -189,60 +189,55 @@ ValaDPAPRecord* vala_dpap_record_construct (GType object_type) {
 	gchar* _tmp6_ = NULL;
 	gchar* _tmp7_;
 	gchar* _tmp8_;
-	gchar* _tmp9_;
+	gchar* _tmp9_ = NULL;
 	gchar* _tmp10_;
 	gchar* _tmp11_;
-	gchar* _tmp12_ = NULL;
-	gchar* _tmp13_;
-	gchar* _tmp14_;
+	gchar* _tmp12_;
 	gchar* path;
-	gint data_length1;
-	gint _data_size_;
-	guint8* data;
-	guint8* _tmp15_ = NULL;
-	size_t _tmp16_;
-	GByteArray* _tmp17_ = NULL;
-	GByteArray* _tmp18_;
+	guint8* data = NULL;
+	gint data_length1 = 0;
+	gint _data_size_ = 0;
+	guint8* _tmp13_ = NULL;
+	size_t _tmp14_;
+	GByteArray* _tmp15_ = NULL;
 	GError * _inner_error_ = NULL;
 	self = (ValaDPAPRecord*) g_object_new (object_type, NULL);
 	_tmp0_ = g_get_current_dir ();
 	_tmp1_ = _tmp0_;
 	_tmp2_ = g_strconcat ("file://", _tmp1_, NULL);
-	_tmp3_ = g_strconcat (_tmp2_, "/media/test.jpeg", NULL);
+	_tmp3_ = _tmp2_;
+	_tmp4_ = g_strconcat (_tmp3_, "/media/test.jpeg", NULL);
 	_g_free0 (self->priv->_location);
-	self->priv->_location = _tmp3_;
-	_g_free0 (_tmp2_);
+	self->priv->_location = _tmp4_;
+	_g_free0 (_tmp3_);
 	_g_free0 (_tmp1_);
-	_tmp4_ = g_strdup ("1.333");
-	_tmp5_ = _tmp4_;
+	_tmp5_ = g_strdup ("1.333");
 	_g_free0 (self->priv->_aspect_ratio);
 	self->priv->_aspect_ratio = _tmp5_;
 	_tmp6_ = g_path_get_basename (self->priv->_location);
-	_tmp7_ = _tmp6_;
 	_g_free0 (self->priv->_filename);
-	self->priv->_filename = _tmp7_;
-	_tmp8_ = g_strdup ("JPEG");
-	_tmp9_ = _tmp8_;
+	self->priv->_filename = _tmp6_;
+	_tmp7_ = g_strdup ("JPEG");
 	_g_free0 (self->priv->_format);
-	self->priv->_format = _tmp9_;
-	_tmp10_ = g_strdup ("Comments");
-	_tmp11_ = _tmp10_;
+	self->priv->_format = _tmp7_;
+	_tmp8_ = g_strdup ("Comments");
 	_g_free0 (self->priv->_comments);
-	self->priv->_comments = _tmp11_;
+	self->priv->_comments = _tmp8_;
 	self->priv->_large_filesize = 13953;
 	self->priv->_pixel_height = 480;
 	self->priv->_pixel_width = 640;
 	self->priv->_rating = 5;
 	self->priv->_creation_date = 0;
-	_tmp12_ = g_get_current_dir ();
-	_tmp13_ = _tmp12_;
-	path = (_tmp14_ = g_strconcat (_tmp13_, "/media/test.jpeg", NULL), _g_free0 (_tmp13_), _tmp14_);
-	data_length1 = 0;
-	data = NULL;
-	g_file_get_contents (path, (gchar**) (&_tmp15_), &_tmp16_, &_inner_error_);
+	_tmp9_ = g_get_current_dir ();
+	_tmp10_ = _tmp9_;
+	_tmp11_ = g_strconcat (_tmp10_, "/media/test.jpeg", NULL);
+	_tmp12_ = _tmp11_;
+	_g_free0 (_tmp10_);
+	path = _tmp12_;
+	g_file_get_contents (path, (gchar**) (&_tmp13_), &_tmp14_, &_inner_error_);
 	data = (g_free (data), NULL);
-	data = _tmp15_;
-	data_length1 = _tmp16_;
+	data = _tmp13_;
+	data_length1 = _tmp14_;
 	if (_inner_error_ != NULL) {
 		data = (g_free (data), NULL);
 		_g_free0 (path);
@@ -250,10 +245,9 @@ ValaDPAPRecord* vala_dpap_record_construct (GType object_type) {
 		g_clear_error (&_inner_error_);
 		return NULL;
 	}
-	_tmp17_ = g_byte_array_new ();
-	_tmp18_ = _tmp17_;
+	_tmp15_ = g_byte_array_new ();
 	_g_byte_array_free0 (self->priv->_thumbnail);
-	self->priv->_thumbnail = _tmp18_;
+	self->priv->_thumbnail = _tmp15_;
 	g_byte_array_append (self->priv->_thumbnail, data, data_length1);
 	data = (g_free (data), NULL);
 	_g_free0 (path);
@@ -276,12 +270,10 @@ const gchar* vala_dpap_record_get_location (ValaDPAPRecord* self) {
 
 void vala_dpap_record_set_location (ValaDPAPRecord* self, const gchar* value) {
 	gchar* _tmp0_;
-	gchar* _tmp1_;
 	g_return_if_fail (self != NULL);
 	_tmp0_ = g_strdup (value);
-	_tmp1_ = _tmp0_;
 	_g_free0 (self->priv->_location);
-	self->priv->_location = _tmp1_;
+	self->priv->_location = _tmp0_;
 	g_object_notify ((GObject *) self, "location");
 }
 
@@ -296,12 +288,10 @@ const gchar* vala_dpap_record_get_filename (ValaDPAPRecord* self) {
 
 void vala_dpap_record_set_filename (ValaDPAPRecord* self, const gchar* value) {
 	gchar* _tmp0_;
-	gchar* _tmp1_;
 	g_return_if_fail (self != NULL);
 	_tmp0_ = g_strdup (value);
-	_tmp1_ = _tmp0_;
 	_g_free0 (self->priv->_filename);
-	self->priv->_filename = _tmp1_;
+	self->priv->_filename = _tmp0_;
 	g_object_notify ((GObject *) self, "filename");
 }
 
@@ -316,12 +306,10 @@ const gchar* vala_dpap_record_get_aspect_ratio (ValaDPAPRecord* self) {
 
 void vala_dpap_record_set_aspect_ratio (ValaDPAPRecord* self, const gchar* value) {
 	gchar* _tmp0_;
-	gchar* _tmp1_;
 	g_return_if_fail (self != NULL);
 	_tmp0_ = g_strdup (value);
-	_tmp1_ = _tmp0_;
 	_g_free0 (self->priv->_aspect_ratio);
-	self->priv->_aspect_ratio = _tmp1_;
+	self->priv->_aspect_ratio = _tmp0_;
 	g_object_notify ((GObject *) self, "aspect-ratio");
 }
 
@@ -336,12 +324,10 @@ const gchar* vala_dpap_record_get_format (ValaDPAPRecord* self) {
 
 void vala_dpap_record_set_format (ValaDPAPRecord* self, const gchar* value) {
 	gchar* _tmp0_;
-	gchar* _tmp1_;
 	g_return_if_fail (self != NULL);
 	_tmp0_ = g_strdup (value);
-	_tmp1_ = _tmp0_;
 	_g_free0 (self->priv->_format);
-	self->priv->_format = _tmp1_;
+	self->priv->_format = _tmp0_;
 	g_object_notify ((GObject *) self, "format");
 }
 
@@ -356,12 +342,10 @@ GByteArray* vala_dpap_record_get_thumbnail (ValaDPAPRecord* self) {
 
 void vala_dpap_record_set_thumbnail (ValaDPAPRecord* self, GByteArray* value) {
 	GByteArray* _tmp0_ = NULL;
-	GByteArray* _tmp1_;
 	g_return_if_fail (self != NULL);
 	_tmp0_ = g_byte_array_new ();
-	_tmp1_ = _tmp0_;
 	_g_byte_array_free0 (self->priv->_thumbnail);
-	self->priv->_thumbnail = _tmp1_;
+	self->priv->_thumbnail = _tmp0_;
 	g_byte_array_append (self->priv->_thumbnail, value->data, (gint) value->len);
 	g_object_notify ((GObject *) self, "thumbnail");
 }
@@ -377,12 +361,10 @@ const gchar* vala_dpap_record_get_comments (ValaDPAPRecord* self) {
 
 void vala_dpap_record_set_comments (ValaDPAPRecord* self, const gchar* value) {
 	gchar* _tmp0_;
-	gchar* _tmp1_;
 	g_return_if_fail (self != NULL);
 	_tmp0_ = g_strdup (value);
-	_tmp1_ = _tmp0_;
 	_g_free0 (self->priv->_comments);
-	self->priv->_comments = _tmp1_;
+	self->priv->_comments = _tmp0_;
 	g_object_notify ((GObject *) self, "comments");
 }
 
diff --git a/vala/libdmapsharing-3.0.vapi b/vala/libdmapsharing-3.0.vapi
index f27166e..f6847f1 100644
--- a/vala/libdmapsharing-3.0.vapi
+++ b/vala/libdmapsharing-3.0.vapi
@@ -5,7 +5,7 @@ namespace DAAP {
 	[CCode (cheader_filename = "libdmapsharing/dmap.h")]
 	public class Connection : DAAP.DMAPConnection {
 		[CCode (has_construct_function = false)]
-		public Connection (string name, string host, uint port, bool password_protected, DMAP.Db db, DMAP.RecordFactory factory);
+		public Connection (string name, string host, uint port, DMAP.Db db, DMAP.RecordFactory factory);
 	}
 	[CCode (cheader_filename = "libdmapsharing/dmap.h")]
 	public class DMAPConnection : GLib.Object {
@@ -48,6 +48,8 @@ namespace DAAP {
 		[NoAccessorMethod]
 		public string name { owned get; construct; }
 		[NoAccessorMethod]
+		public string password { set; }
+		[NoAccessorMethod]
 		public bool password_protected { get; construct; }
 		[NoAccessorMethod]
 		public uint port { get; construct; }
@@ -55,7 +57,9 @@ namespace DAAP {
 		public int revision_number { get; set; }
 		[NoAccessorMethod]
 		public int session_id { get; set; }
-		public virtual signal unowned string authenticate (string name);
+		[NoAccessorMethod]
+		public string username { owned get; construct; }
+		public virtual signal void authenticate (string name, Soup.Session p1, Soup.Message p2, Soup.Auth p3, bool p4);
 		public virtual signal void connected ();
 		public virtual signal void connecting (ulong state, float progress);
 		public virtual signal void disconnected ();
@@ -75,8 +79,6 @@ namespace DAAP {
 	public class DMAPGstInputStream : GLib.InputStream, GLib.Seekable {
 		[CCode (cname = "dmap_gst_input_stream_new", type = "GInputStream*", has_construct_function = false)]
 		public DMAPGstInputStream (string transcode_mimetype, GLib.InputStream src_stream);
-		[CCode (cname = "dmap_gst_input_stream_new_buffer_cb", type = "void", has_construct_function = false)]
-		public DMAPGstInputStream.buffer_cb (Gst.Element element, DAAP.DMAPGstInputStream stream);
 		[NoWrapper]
 		public virtual void kill_pipeline (DAAP.DMAPGstInputStream p1);
 	}
@@ -218,6 +220,8 @@ namespace DAAP {
 	}
 	[CCode (cheader_filename = "libdmapsharing/dmap.h")]
 	public interface DMAPContainerDb : GLib.Object {
+		[CCode (cname = "dmap_container_db_add")]
+		public abstract void add (DMAP.ContainerDb db, DAAP.DMAPContainerRecord record);
 		[CCode (cname = "dmap_container_db_count")]
 		public abstract int64 count (DMAP.ContainerDb db);
 		[CCode (cname = "dmap_container_db_foreach")]
@@ -273,10 +277,21 @@ namespace DAAP {
 		public abstract bool itunes_compat ();
 		public abstract unowned GLib.InputStream read () throws GLib.Error;
 	}
-	[CCode (cprefix = "DMAP_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "PLAY_", cheader_filename = "libdmapsharing/dmap.h")]
+	public enum DACPPlayState {
+		STOPPED,
+		PAUSED,
+		PLAYING
+	}
+	[CCode (cprefix = "REPEAT_", cheader_filename = "libdmapsharing/dmap.h")]
+	public enum DACPRepeatState {
+		NONE,
+		SINGLE,
+		ALL
+	}
+	[CCode (cprefix = "DMAP_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPConnectionState {
 		GET_INFO,
-		GET_PASSWORD,
 		LOGIN,
 		GET_REVISION_NUMBER,
 		GET_DB_INFO,
@@ -435,12 +450,12 @@ namespace DAAP {
 		CC_CMMK,
 		CC_CMVO
 	}
-	[CCode (cprefix = "DMAP_MDNS_BROWSER_ERROR_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_MDNS_BROWSER_ERROR_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPMdnsBrowserError {
 		NOT_RUNNING,
 		FAILED
 	}
-	[CCode (cprefix = "DMAP_MDNS_BROWSER_SERVICE_TYPE_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_MDNS_BROWSER_SERVICE_TYPE_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPMdnsBrowserServiceType {
 		INVALID,
 		DAAP,
@@ -448,17 +463,17 @@ namespace DAAP {
 		DACP,
 		LAST
 	}
-	[CCode (cprefix = "DMAP_MDNS_PUBLISHER_ERROR_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_MDNS_PUBLISHER_ERROR_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPMdnsPublisherError {
 		NOT_RUNNING,
 		FAILED
 	}
-	[CCode (cprefix = "DMAP_MEDIA_KIND_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_MEDIA_KIND_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPMediaKind {
 		MUSIC,
 		MOVIE
 	}
-	[CCode (cprefix = "DMAP_TYPE_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_TYPE_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPType {
 		BYTE,
 		SIGNED_INT,
@@ -521,12 +536,12 @@ namespace DACP {
 	[CCode (cheader_filename = "libdmapsharing/dmap.h")]
 	public class Connection : DACP.DMAPConnection {
 		[CCode (has_construct_function = false)]
-		public Connection (string name, string host, uint port, bool password_protected, DMAP.Db db, DACP.DMAPRecordFactory factory);
+		public Connection (string name, string host, uint port, DMAP.Db db, DACP.DMAPRecordFactory factory);
 	}
 	[CCode (cheader_filename = "libdmapsharing/dmap.h")]
 	public class DAAPConnection : DACP.DMAPConnection {
 		[CCode (cname = "daap_connection_new", type = "DAAPConnection*", has_construct_function = false)]
-		public DAAPConnection (string name, string host, uint port, bool password_protected, DMAP.Db db, DACP.DMAPRecordFactory factory);
+		public DAAPConnection (string name, string host, uint port, DMAP.Db db, DACP.DMAPRecordFactory factory);
 	}
 	[CCode (cheader_filename = "libdmapsharing/dmap.h")]
 	public class DAAPShare : DACP.DMAPShare {
@@ -574,6 +589,8 @@ namespace DACP {
 		[NoAccessorMethod]
 		public string name { owned get; construct; }
 		[NoAccessorMethod]
+		public string password { set; }
+		[NoAccessorMethod]
 		public bool password_protected { get; construct; }
 		[NoAccessorMethod]
 		public uint port { get; construct; }
@@ -581,7 +598,9 @@ namespace DACP {
 		public int revision_number { get; set; }
 		[NoAccessorMethod]
 		public int session_id { get; set; }
-		public virtual signal unowned string authenticate (string name);
+		[NoAccessorMethod]
+		public string username { owned get; construct; }
+		public virtual signal void authenticate (string name, Soup.Session p1, Soup.Message p2, Soup.Auth p3, bool p4);
 		public virtual signal void connected ();
 		public virtual signal void connecting (ulong state, float progress);
 		public virtual signal void disconnected ();
@@ -601,8 +620,6 @@ namespace DACP {
 	public class DMAPGstInputStream : GLib.InputStream, GLib.Seekable {
 		[CCode (cname = "dmap_gst_input_stream_new", type = "GInputStream*", has_construct_function = false)]
 		public DMAPGstInputStream (string transcode_mimetype, GLib.InputStream src_stream);
-		[CCode (cname = "dmap_gst_input_stream_new_buffer_cb", type = "void", has_construct_function = false)]
-		public DMAPGstInputStream.buffer_cb (Gst.Element element, DACP.DMAPGstInputStream stream);
 		[NoWrapper]
 		public virtual void kill_pipeline (DACP.DMAPGstInputStream p1);
 	}
@@ -766,6 +783,8 @@ namespace DACP {
 	}
 	[CCode (cheader_filename = "libdmapsharing/dmap.h")]
 	public interface DMAPContainerDb : GLib.Object {
+		[CCode (cname = "dmap_container_db_add")]
+		public abstract void add (DMAP.ContainerDb db, DACP.DMAPContainerRecord record);
 		[CCode (cname = "dmap_container_db_count")]
 		public abstract int64 count (DMAP.ContainerDb db);
 		[CCode (cname = "dmap_container_db_foreach")]
@@ -831,10 +850,9 @@ namespace DACP {
 		public bool shuffle_state { get; set; }
 		public ulong volume { get; set; }
 	}
-	[CCode (cprefix = "DMAP_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPConnectionState {
 		GET_INFO,
-		GET_PASSWORD,
 		LOGIN,
 		GET_REVISION_NUMBER,
 		GET_DB_INFO,
@@ -993,12 +1011,12 @@ namespace DACP {
 		CC_CMMK,
 		CC_CMVO
 	}
-	[CCode (cprefix = "DMAP_MDNS_BROWSER_ERROR_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_MDNS_BROWSER_ERROR_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPMdnsBrowserError {
 		NOT_RUNNING,
 		FAILED
 	}
-	[CCode (cprefix = "DMAP_MDNS_BROWSER_SERVICE_TYPE_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_MDNS_BROWSER_SERVICE_TYPE_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPMdnsBrowserServiceType {
 		INVALID,
 		DAAP,
@@ -1006,17 +1024,17 @@ namespace DACP {
 		DACP,
 		LAST
 	}
-	[CCode (cprefix = "DMAP_MDNS_PUBLISHER_ERROR_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_MDNS_PUBLISHER_ERROR_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPMdnsPublisherError {
 		NOT_RUNNING,
 		FAILED
 	}
-	[CCode (cprefix = "DMAP_MEDIA_KIND_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_MEDIA_KIND_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPMediaKind {
 		MUSIC,
 		MOVIE
 	}
-	[CCode (cprefix = "DMAP_TYPE_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_TYPE_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPType {
 		BYTE,
 		SIGNED_INT,
@@ -1029,13 +1047,13 @@ namespace DACP {
 		CONTAINER,
 		POINTER
 	}
-	[CCode (cprefix = "PLAY_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "PLAY_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum PlayState {
 		STOPPED,
 		PAUSED,
 		PLAYING
 	}
-	[CCode (cprefix = "REPEAT_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "REPEAT_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum RepeatState {
 		NONE,
 		SINGLE,
@@ -1121,6 +1139,8 @@ namespace DMAP {
 		[NoAccessorMethod]
 		public string name { owned get; construct; }
 		[NoAccessorMethod]
+		public string password { set; }
+		[NoAccessorMethod]
 		public bool password_protected { get; construct; }
 		[NoAccessorMethod]
 		public uint port { get; construct; }
@@ -1128,7 +1148,9 @@ namespace DMAP {
 		public int revision_number { get; set; }
 		[NoAccessorMethod]
 		public int session_id { get; set; }
-		public virtual signal unowned string authenticate (string name);
+		[NoAccessorMethod]
+		public string username { owned get; construct; }
+		public virtual signal void authenticate (string name, Soup.Session p1, Soup.Message p2, Soup.Auth p3, bool p4);
 		public virtual signal void connected ();
 		public virtual signal void connecting (ulong state, float progress);
 		public virtual signal void disconnected ();
@@ -1155,8 +1177,6 @@ namespace DMAP {
 	public class GstInputStream : GLib.InputStream, GLib.Seekable {
 		[CCode (type = "GInputStream*", has_construct_function = false)]
 		public GstInputStream (string transcode_mimetype, GLib.InputStream src_stream);
-		[CCode (type = "void", has_construct_function = false)]
-		public GstInputStream.buffer_cb (Gst.Element element, DMAP.GstInputStream stream);
 		[NoWrapper]
 		public virtual void kill_pipeline ();
 	}
@@ -1276,6 +1296,7 @@ namespace DMAP {
 	}
 	[CCode (cheader_filename = "libdmapsharing/dmap.h")]
 	public interface ContainerDb : GLib.Object {
+		public abstract void add (DMAP.ContainerRecord record);
 		public abstract int64 count ();
 		public abstract void @foreach (GLib.HFunc func);
 		public abstract unowned DMAP.ContainerRecord lookup_by_id (uint id);
@@ -1307,10 +1328,9 @@ namespace DMAP {
 	public interface RecordFactory {
 		public abstract DMAP.Record create (void* user_data);
 	}
-	[CCode (cprefix = "DMAP_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum ConnectionState {
 		GET_INFO,
-		GET_PASSWORD,
 		LOGIN,
 		GET_REVISION_NUMBER,
 		GET_DB_INFO,
@@ -1469,12 +1489,24 @@ namespace DMAP {
 		CC_CMMK,
 		CC_CMVO
 	}
-	[CCode (cprefix = "DMAP_MDNS_BROWSER_ERROR_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "PLAY_", cheader_filename = "libdmapsharing/dmap.h")]
+	public enum DACPPlayState {
+		STOPPED,
+		PAUSED,
+		PLAYING
+	}
+	[CCode (cprefix = "REPEAT_", cheader_filename = "libdmapsharing/dmap.h")]
+	public enum DACPRepeatState {
+		NONE,
+		SINGLE,
+		ALL
+	}
+	[CCode (cprefix = "DMAP_MDNS_BROWSER_ERROR_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum MdnsBrowserError {
 		NOT_RUNNING,
 		FAILED
 	}
-	[CCode (cprefix = "DMAP_MDNS_BROWSER_SERVICE_TYPE_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_MDNS_BROWSER_SERVICE_TYPE_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum MdnsBrowserServiceType {
 		INVALID,
 		DAAP,
@@ -1482,17 +1514,17 @@ namespace DMAP {
 		DACP,
 		LAST
 	}
-	[CCode (cprefix = "DMAP_MDNS_PUBLISHER_ERROR_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_MDNS_PUBLISHER_ERROR_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum MdnsPublisherError {
 		NOT_RUNNING,
 		FAILED
 	}
-	[CCode (cprefix = "DMAP_MEDIA_KIND_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_MEDIA_KIND_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum MediaKind {
 		MUSIC,
 		MOVIE
 	}
-	[CCode (cprefix = "DMAP_TYPE_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_TYPE_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum Type {
 		BYTE,
 		SIGNED_INT,
@@ -1555,7 +1587,7 @@ namespace DPAP {
 	[CCode (cheader_filename = "libdmapsharing/dmap.h")]
 	public class Connection : DPAP.DMAPConnection {
 		[CCode (has_construct_function = false)]
-		public Connection (string name, string host, uint port, bool password_protected, DMAP.Db db, DMAP.RecordFactory factory);
+		public Connection (string name, string host, uint port, DMAP.Db db, DMAP.RecordFactory factory);
 	}
 	[CCode (cheader_filename = "libdmapsharing/dmap.h")]
 	public class DMAPConnection : GLib.Object {
@@ -1598,6 +1630,8 @@ namespace DPAP {
 		[NoAccessorMethod]
 		public string name { owned get; construct; }
 		[NoAccessorMethod]
+		public string password { set; }
+		[NoAccessorMethod]
 		public bool password_protected { get; construct; }
 		[NoAccessorMethod]
 		public uint port { get; construct; }
@@ -1605,7 +1639,9 @@ namespace DPAP {
 		public int revision_number { get; set; }
 		[NoAccessorMethod]
 		public int session_id { get; set; }
-		public virtual signal unowned string authenticate (string name);
+		[NoAccessorMethod]
+		public string username { owned get; construct; }
+		public virtual signal void authenticate (string name, Soup.Session p1, Soup.Message p2, Soup.Auth p3, bool p4);
 		public virtual signal void connected ();
 		public virtual signal void connecting (ulong state, float progress);
 		public virtual signal void disconnected ();
@@ -1625,8 +1661,6 @@ namespace DPAP {
 	public class DMAPGstInputStream : GLib.InputStream, GLib.Seekable {
 		[CCode (cname = "dmap_gst_input_stream_new", type = "GInputStream*", has_construct_function = false)]
 		public DMAPGstInputStream (string transcode_mimetype, GLib.InputStream src_stream);
-		[CCode (cname = "dmap_gst_input_stream_new_buffer_cb", type = "void", has_construct_function = false)]
-		public DMAPGstInputStream.buffer_cb (Gst.Element element, DPAP.DMAPGstInputStream stream);
 		[NoWrapper]
 		public virtual void kill_pipeline (DPAP.DMAPGstInputStream p1);
 	}
@@ -1768,6 +1802,8 @@ namespace DPAP {
 	}
 	[CCode (cheader_filename = "libdmapsharing/dmap.h")]
 	public interface DMAPContainerDb : GLib.Object {
+		[CCode (cname = "dmap_container_db_add")]
+		public abstract void add (DMAP.ContainerDb db, DPAP.DMAPContainerRecord record);
 		[CCode (cname = "dmap_container_db_count")]
 		public abstract int64 count (DMAP.ContainerDb db);
 		[CCode (cname = "dmap_container_db_foreach")]
@@ -1821,10 +1857,21 @@ namespace DPAP {
 	public interface Record {
 		public abstract unowned GLib.InputStream read () throws GLib.Error;
 	}
-	[CCode (cprefix = "DMAP_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "PLAY_", cheader_filename = "libdmapsharing/dmap.h")]
+	public enum DACPPlayState {
+		STOPPED,
+		PAUSED,
+		PLAYING
+	}
+	[CCode (cprefix = "REPEAT_", cheader_filename = "libdmapsharing/dmap.h")]
+	public enum DACPRepeatState {
+		NONE,
+		SINGLE,
+		ALL
+	}
+	[CCode (cprefix = "DMAP_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPConnectionState {
 		GET_INFO,
-		GET_PASSWORD,
 		LOGIN,
 		GET_REVISION_NUMBER,
 		GET_DB_INFO,
@@ -1983,12 +2030,12 @@ namespace DPAP {
 		CC_CMMK,
 		CC_CMVO
 	}
-	[CCode (cprefix = "DMAP_MDNS_BROWSER_ERROR_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_MDNS_BROWSER_ERROR_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPMdnsBrowserError {
 		NOT_RUNNING,
 		FAILED
 	}
-	[CCode (cprefix = "DMAP_MDNS_BROWSER_SERVICE_TYPE_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_MDNS_BROWSER_SERVICE_TYPE_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPMdnsBrowserServiceType {
 		INVALID,
 		DAAP,
@@ -1996,17 +2043,17 @@ namespace DPAP {
 		DACP,
 		LAST
 	}
-	[CCode (cprefix = "DMAP_MDNS_PUBLISHER_ERROR_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_MDNS_PUBLISHER_ERROR_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPMdnsPublisherError {
 		NOT_RUNNING,
 		FAILED
 	}
-	[CCode (cprefix = "DMAP_MEDIA_KIND_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_MEDIA_KIND_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPMediaKind {
 		MUSIC,
 		MOVIE
 	}
-	[CCode (cprefix = "DMAP_TYPE_", has_type_id = false, cheader_filename = "libdmapsharing/dmap.h")]
+	[CCode (cprefix = "DMAP_TYPE_", cheader_filename = "libdmapsharing/dmap.h")]
 	public enum DMAPType {
 		BYTE,
 		SIGNED_INT,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]