/* rygel-tracker-metadata-values.c generated by valac 0.15.2.4-51044, the Vala compiler
 * generated from rygel-tracker-metadata-values.vala, do not modify */

/*
 * Copyright (C) 2008 Zeeshan Ali <zeenix@gmail.com>.
 * Copyright (C) 2008 Nokia Corporation.
 *
 * Author: Zeeshan Ali <zeenix@gmail.com>
 *
 * This file is part of Rygel.
 *
 * Rygel is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Rygel is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#include <glib.h>
#include <glib-object.h>
#include <rygel.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <gee.h>


#define RYGEL_TRACKER_TYPE_METADATA_VALUES (rygel_tracker_metadata_values_get_type ())
#define RYGEL_TRACKER_METADATA_VALUES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TRACKER_TYPE_METADATA_VALUES, RygelTrackerMetadataValues))
#define RYGEL_TRACKER_METADATA_VALUES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TRACKER_TYPE_METADATA_VALUES, RygelTrackerMetadataValuesClass))
#define RYGEL_TRACKER_IS_METADATA_VALUES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TRACKER_TYPE_METADATA_VALUES))
#define RYGEL_TRACKER_IS_METADATA_VALUES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TRACKER_TYPE_METADATA_VALUES))
#define RYGEL_TRACKER_METADATA_VALUES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TRACKER_TYPE_METADATA_VALUES, RygelTrackerMetadataValuesClass))

typedef struct _RygelTrackerMetadataValues RygelTrackerMetadataValues;
typedef struct _RygelTrackerMetadataValuesClass RygelTrackerMetadataValuesClass;
typedef struct _RygelTrackerMetadataValuesPrivate RygelTrackerMetadataValuesPrivate;

#define RYGEL_TRACKER_TYPE_ITEM_FACTORY (rygel_tracker_item_factory_get_type ())
#define RYGEL_TRACKER_ITEM_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TRACKER_TYPE_ITEM_FACTORY, RygelTrackerItemFactory))
#define RYGEL_TRACKER_ITEM_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TRACKER_TYPE_ITEM_FACTORY, RygelTrackerItemFactoryClass))
#define RYGEL_TRACKER_IS_ITEM_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TRACKER_TYPE_ITEM_FACTORY))
#define RYGEL_TRACKER_IS_ITEM_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TRACKER_TYPE_ITEM_FACTORY))
#define RYGEL_TRACKER_ITEM_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TRACKER_TYPE_ITEM_FACTORY, RygelTrackerItemFactoryClass))

typedef struct _RygelTrackerItemFactory RygelTrackerItemFactory;
typedef struct _RygelTrackerItemFactoryClass RygelTrackerItemFactoryClass;

#define RYGEL_TRACKER_TYPE_RESOURCES_IFACE (rygel_tracker_resources_iface_get_type ())
#define RYGEL_TRACKER_RESOURCES_IFACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TRACKER_TYPE_RESOURCES_IFACE, RygelTrackerResourcesIface))
#define RYGEL_TRACKER_IS_RESOURCES_IFACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TRACKER_TYPE_RESOURCES_IFACE))
#define RYGEL_TRACKER_RESOURCES_IFACE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), RYGEL_TRACKER_TYPE_RESOURCES_IFACE, RygelTrackerResourcesIfaceIface))

typedef struct _RygelTrackerResourcesIface RygelTrackerResourcesIface;
typedef struct _RygelTrackerResourcesIfaceIface RygelTrackerResourcesIfaceIface;

#define RYGEL_TRACKER_TYPE_RESOURCES_IFACE_PROXY (rygel_tracker_resources_iface_proxy_get_type ())
#define _rygel_tracker_item_factory_unref0(var) ((var == NULL) ? NULL : (var = (rygel_tracker_item_factory_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define RYGEL_TRACKER_TYPE_QUERY_TRIPLETS (rygel_tracker_query_triplets_get_type ())
#define RYGEL_TRACKER_QUERY_TRIPLETS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TRACKER_TYPE_QUERY_TRIPLETS, RygelTrackerQueryTriplets))
#define RYGEL_TRACKER_QUERY_TRIPLETS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TRACKER_TYPE_QUERY_TRIPLETS, RygelTrackerQueryTripletsClass))
#define RYGEL_TRACKER_IS_QUERY_TRIPLETS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TRACKER_TYPE_QUERY_TRIPLETS))
#define RYGEL_TRACKER_IS_QUERY_TRIPLETS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TRACKER_TYPE_QUERY_TRIPLETS))
#define RYGEL_TRACKER_QUERY_TRIPLETS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TRACKER_TYPE_QUERY_TRIPLETS, RygelTrackerQueryTripletsClass))

typedef struct _RygelTrackerQueryTriplets RygelTrackerQueryTriplets;
typedef struct _RygelTrackerQueryTripletsClass RygelTrackerQueryTripletsClass;
typedef struct _RygelTrackerItemFactoryPrivate RygelTrackerItemFactoryPrivate;

#define RYGEL_TRACKER_TYPE_SEARCH_CONTAINER (rygel_tracker_search_container_get_type ())
#define RYGEL_TRACKER_SEARCH_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TRACKER_TYPE_SEARCH_CONTAINER, RygelTrackerSearchContainer))
#define RYGEL_TRACKER_SEARCH_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TRACKER_TYPE_SEARCH_CONTAINER, RygelTrackerSearchContainerClass))
#define RYGEL_TRACKER_IS_SEARCH_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TRACKER_TYPE_SEARCH_CONTAINER))
#define RYGEL_TRACKER_IS_SEARCH_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TRACKER_TYPE_SEARCH_CONTAINER))
#define RYGEL_TRACKER_SEARCH_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TRACKER_TYPE_SEARCH_CONTAINER, RygelTrackerSearchContainerClass))

typedef struct _RygelTrackerSearchContainer RygelTrackerSearchContainer;
typedef struct _RygelTrackerSearchContainerClass RygelTrackerSearchContainerClass;

#define RYGEL_TRACKER_TYPE_QUERY_TRIPLET (rygel_tracker_query_triplet_get_type ())
#define RYGEL_TRACKER_QUERY_TRIPLET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TRACKER_TYPE_QUERY_TRIPLET, RygelTrackerQueryTriplet))
#define RYGEL_TRACKER_QUERY_TRIPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TRACKER_TYPE_QUERY_TRIPLET, RygelTrackerQueryTripletClass))
#define RYGEL_TRACKER_IS_QUERY_TRIPLET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TRACKER_TYPE_QUERY_TRIPLET))
#define RYGEL_TRACKER_IS_QUERY_TRIPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TRACKER_TYPE_QUERY_TRIPLET))
#define RYGEL_TRACKER_QUERY_TRIPLET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TRACKER_TYPE_QUERY_TRIPLET, RygelTrackerQueryTripletClass))

typedef struct _RygelTrackerQueryTriplet RygelTrackerQueryTriplet;
typedef struct _RygelTrackerQueryTripletClass RygelTrackerQueryTripletClass;
#define _rygel_tracker_query_triplet_unref0(var) ((var == NULL) ? NULL : (var = (rygel_tracker_query_triplet_unref (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))

#define RYGEL_TRACKER_TYPE_QUERY (rygel_tracker_query_get_type ())
#define RYGEL_TRACKER_QUERY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TRACKER_TYPE_QUERY, RygelTrackerQuery))
#define RYGEL_TRACKER_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TRACKER_TYPE_QUERY, RygelTrackerQueryClass))
#define RYGEL_TRACKER_IS_QUERY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TRACKER_TYPE_QUERY))
#define RYGEL_TRACKER_IS_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TRACKER_TYPE_QUERY))
#define RYGEL_TRACKER_QUERY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TRACKER_TYPE_QUERY, RygelTrackerQueryClass))

typedef struct _RygelTrackerQuery RygelTrackerQuery;
typedef struct _RygelTrackerQueryClass RygelTrackerQueryClass;

#define RYGEL_TRACKER_TYPE_SELECTION_QUERY (rygel_tracker_selection_query_get_type ())
#define RYGEL_TRACKER_SELECTION_QUERY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TRACKER_TYPE_SELECTION_QUERY, RygelTrackerSelectionQuery))
#define RYGEL_TRACKER_SELECTION_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TRACKER_TYPE_SELECTION_QUERY, RygelTrackerSelectionQueryClass))
#define RYGEL_TRACKER_IS_SELECTION_QUERY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TRACKER_TYPE_SELECTION_QUERY))
#define RYGEL_TRACKER_IS_SELECTION_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TRACKER_TYPE_SELECTION_QUERY))
#define RYGEL_TRACKER_SELECTION_QUERY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TRACKER_TYPE_SELECTION_QUERY, RygelTrackerSelectionQueryClass))

typedef struct _RygelTrackerSelectionQuery RygelTrackerSelectionQuery;
typedef struct _RygelTrackerSelectionQueryClass RygelTrackerSelectionQueryClass;
#define _rygel_tracker_query_unref0(var) ((var == NULL) ? NULL : (var = (rygel_tracker_query_unref (var), NULL)))
typedef struct _RygelTrackerQueryPrivate RygelTrackerQueryPrivate;
typedef struct _RygelTrackerSelectionQueryPrivate RygelTrackerSelectionQueryPrivate;
typedef struct _RygelTrackerQueryTripletPrivate RygelTrackerQueryTripletPrivate;
typedef struct _RygelTrackerMetadataValuesFetchMetadataValuesData RygelTrackerMetadataValuesFetchMetadataValuesData;
typedef struct _RygelTrackerMetadataValuesFindObjectData RygelTrackerMetadataValuesFindObjectData;

struct _RygelTrackerMetadataValues {
	RygelSimpleContainer parent_instance;
	RygelTrackerMetadataValuesPrivate * priv;
	gchar** key_chain;
	gint key_chain_length1;
};

struct _RygelTrackerMetadataValuesClass {
	RygelSimpleContainerClass parent_class;
	gchar* (*create_id_for_title) (RygelTrackerMetadataValues* self, const gchar* title);
	gchar* (*create_title_for_value) (RygelTrackerMetadataValues* self, const gchar* value);
	gchar* (*create_filter) (RygelTrackerMetadataValues* self, const gchar* variable, const gchar* value);
};

struct _RygelTrackerResourcesIfaceIface {
	GTypeInterface parent_iface;
	void (*sparql_query) (RygelTrackerResourcesIface* self, const gchar* query, GAsyncReadyCallback _callback_, gpointer _user_data_);
	gchar** (*sparql_query_finish) (RygelTrackerResourcesIface* self, GAsyncResult* _res_, int* result_length1, int* result_length2, GError** error);
	void (*sparql_update) (RygelTrackerResourcesIface* self, const gchar* query, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*sparql_update_finish) (RygelTrackerResourcesIface* self, GAsyncResult* _res_, GError** error);
	void (*sparql_update_blank) (RygelTrackerResourcesIface* self, const gchar* query, GAsyncReadyCallback _callback_, gpointer _user_data_);
	GHashTable** (*sparql_update_blank_finish) (RygelTrackerResourcesIface* self, GAsyncResult* _res_, int* result_length1, int* result_length2, GError** error);
};

struct _RygelTrackerMetadataValuesPrivate {
	RygelTrackerItemFactory* item_factory;
	gboolean update_in_progress;
	gchar* child_class;
	RygelTrackerResourcesIface* resources;
};

struct _RygelTrackerItemFactory {
	GTypeInstance parent_instance;
	volatile int ref_count;
	RygelTrackerItemFactoryPrivate * priv;
	gchar* category;
	gchar* category_iri;
	gchar* upnp_class;
	gchar* upload_dir;
	GeeArrayList* properties;
};

struct _RygelTrackerItemFactoryClass {
	GTypeClass parent_class;
	void (*finalize) (RygelTrackerItemFactory *self);
	RygelMediaItem* (*create) (RygelTrackerItemFactory* self, const gchar* id, const gchar* uri, RygelTrackerSearchContainer* parent, gchar** metadata, int metadata_length1, GError** error);
	void (*set_metadata) (RygelTrackerItemFactory* self, RygelMediaItem* item, const gchar* uri, gchar** metadata, int metadata_length1, GError** error);
};

struct _RygelTrackerQuery {
	GTypeInstance parent_instance;
	volatile int ref_count;
	RygelTrackerQueryPrivate * priv;
	RygelTrackerQueryTriplets* triplets;
};

struct _RygelTrackerQueryClass {
	GTypeClass parent_class;
	void (*finalize) (RygelTrackerQuery *self);
	void (*execute) (RygelTrackerQuery* self, RygelTrackerResourcesIface* resources, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*execute_finish) (RygelTrackerQuery* self, GAsyncResult* _res_, GError** error);
	gchar* (*to_string) (RygelTrackerQuery* self);
};

struct _RygelTrackerSelectionQuery {
	RygelTrackerQuery parent_instance;
	RygelTrackerSelectionQueryPrivate * priv;
	GeeArrayList* variables;
	GeeArrayList* filters;
	gchar* order_by;
	gint offset;
	gint max_count;
	gchar** result;
	gint result_length1;
	gint result_length2;
};

struct _RygelTrackerSelectionQueryClass {
	RygelTrackerQueryClass parent_class;
};

struct _RygelTrackerQueryTriplet {
	GTypeInstance parent_instance;
	volatile int ref_count;
	RygelTrackerQueryTripletPrivate * priv;
	gchar* graph;
	gchar* subject;
	gchar* predicate;
	gchar* obj;
	RygelTrackerQueryTriplet* next;
};

struct _RygelTrackerQueryTripletClass {
	GTypeClass parent_class;
	void (*finalize) (RygelTrackerQueryTriplet *self);
};

struct _RygelTrackerMetadataValuesFetchMetadataValuesData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	RygelTrackerMetadataValues* self;
	gboolean _tmp0_;
	gint i;
	RygelTrackerQueryTriplets* _tmp1_;
	RygelTrackerQueryTriplets* triplets;
	RygelTrackerQueryTriplets* _tmp2_;
	RygelTrackerItemFactory* _tmp3_;
	const gchar* _tmp4_;
	RygelTrackerQueryTriplet* _tmp5_;
	RygelTrackerQueryTriplet* _tmp6_;
	gchar** _tmp7_;
	gint _tmp7__length1;
	gint num_keys;
	gint _tmp8_;
	gchar** _tmp9_;
	gchar** variables;
	gint variables_length1;
	gint _variables_size_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	gint _tmp12_;
	gint _tmp13_;
	gint _tmp14_;
	gchar** _tmp15_;
	gint _tmp15__length1;
	gint _tmp16_;
	gchar** _tmp17_;
	gint _tmp17__length1;
	gint _tmp18_;
	const gchar* _tmp19_;
	gchar* _tmp20_;
	gchar* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* subject;
	gint _tmp24_;
	gchar* _tmp25_;
	gchar** _tmp26_;
	gint _tmp26__length1;
	gint _tmp27_;
	const gchar* _tmp28_;
	gchar* _tmp29_;
	RygelTrackerQueryTriplets* _tmp30_;
	const gchar* _tmp31_;
	gchar** _tmp32_;
	gint _tmp32__length1;
	gint _tmp33_;
	const gchar* _tmp34_;
	gchar** _tmp35_;
	gint _tmp35__length1;
	gint _tmp36_;
	const gchar* _tmp37_;
	RygelTrackerQueryTriplet* _tmp38_;
	RygelTrackerQueryTriplet* _tmp39_;
	GeeArrayList* _tmp40_;
	GeeArrayList* selected;
	gchar** _tmp41_;
	gint _tmp41__length1;
	gint _tmp42_;
	const gchar* _tmp43_;
	gchar* _tmp44_;
	gchar* last_variable;
	GeeArrayList* _tmp45_;
	const gchar* _tmp46_;
	gchar* _tmp47_;
	gchar* _tmp48_;
	GeeArrayList* _tmp49_;
	RygelTrackerQueryTriplets* _tmp50_;
	const gchar* _tmp51_;
	RygelTrackerSelectionQuery* _tmp52_;
	RygelTrackerSelectionQuery* query;
	RygelTrackerSelectionQuery* _tmp53_;
	RygelTrackerResourcesIface* _tmp54_;
	GError* _error_;
	const gchar* _tmp55_;
	gchar** _tmp56_;
	gint _tmp56__length1;
	gchar* _tmp57_;
	gchar* _tmp58_;
	GError* _tmp59_;
	const gchar* _tmp60_;
	gboolean _tmp61_;
	gboolean _tmp62_;
	gint _tmp63_;
	gint _tmp64_;
	RygelTrackerSelectionQuery* _tmp65_;
	gchar** _tmp66_;
	gint _tmp66__length1;
	gint _tmp66__length2;
	gint _tmp67_;
	RygelTrackerSelectionQuery* _tmp68_;
	gchar** _tmp69_;
	gint _tmp69__length1;
	gint _tmp69__length2;
	gint _tmp70_;
	const gchar* _tmp71_;
	gchar* _tmp72_;
	gchar* value;
	const gchar* _tmp73_;
	const gchar* _tmp74_;
	gchar* _tmp75_;
	gchar* title;
	const gchar* _tmp76_;
	const gchar* _tmp77_;
	gchar* _tmp78_;
	gchar* id;
	gboolean _tmp79_;
	const gchar* _tmp80_;
	const gchar* _tmp81_;
	gboolean _tmp82_;
	gboolean _tmp83_;
	RygelTrackerQueryTriplets* _tmp84_;
	RygelTrackerQueryTriplets* _tmp85_;
	RygelTrackerQueryTriplets* child_triplets;
	GeeArrayList* _tmp86_;
	GeeArrayList* filters;
	RygelTrackerQueryTriplets* _tmp87_;
	gpointer _tmp88_;
	RygelTrackerQueryTriplet* _tmp89_;
	const gchar* _tmp90_;
	const gchar* _tmp91_;
	gchar* _tmp92_;
	gchar* _tmp93_;
	gchar* filter;
	GeeArrayList* _tmp94_;
	const gchar* _tmp95_;
	const gchar* _tmp96_;
	const gchar* _tmp97_;
	RygelTrackerItemFactory* _tmp98_;
	RygelTrackerQueryTriplets* _tmp99_;
	GeeArrayList* _tmp100_;
	RygelTrackerSearchContainer* _tmp101_;
	RygelTrackerSearchContainer* container;
	const gchar* _tmp102_;
	RygelTrackerSearchContainer* _tmp103_;
	const gchar* _tmp104_;
	gchar* _tmp105_;
	RygelTrackerSearchContainer* _tmp106_;
	GError * _inner_error_;
};

struct _RygelTrackerMetadataValuesFindObjectData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GSimpleAsyncResult* _async_result;
	RygelTrackerMetadataValues* self;
	gchar* id;
	GCancellable* cancellable;
	RygelMediaObject* result;
	const gchar* _tmp0_;
	gboolean _tmp1_;
	const gchar* _tmp2_;
	GCancellable* _tmp3_;
	RygelMediaObject* _tmp4_;
	RygelMediaObject* _tmp5_;
	GError * _inner_error_;
};


static gpointer rygel_tracker_metadata_values_parent_class = NULL;

GType rygel_tracker_metadata_values_get_type (void) G_GNUC_CONST;
gpointer rygel_tracker_item_factory_ref (gpointer instance);
void rygel_tracker_item_factory_unref (gpointer instance);
GParamSpec* rygel_tracker_param_spec_item_factory (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void rygel_tracker_value_set_item_factory (GValue* value, gpointer v_object);
void rygel_tracker_value_take_item_factory (GValue* value, gpointer v_object);
gpointer rygel_tracker_value_get_item_factory (const GValue* value);
GType rygel_tracker_item_factory_get_type (void) G_GNUC_CONST;
GType rygel_tracker_resources_iface_proxy_get_type (void) G_GNUC_CONST;
guint rygel_tracker_resources_iface_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
GType rygel_tracker_resources_iface_get_type (void) G_GNUC_CONST;
#define RYGEL_TRACKER_METADATA_VALUES_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), RYGEL_TRACKER_TYPE_METADATA_VALUES, RygelTrackerMetadataValuesPrivate))
enum  {
	RYGEL_TRACKER_METADATA_VALUES_DUMMY_PROPERTY
};
#define RYGEL_TRACKER_METADATA_VALUES_TRACKER_SERVICE "org.freedesktop.Tracker1"
#define RYGEL_TRACKER_METADATA_VALUES_RESOURCES_PATH "/org/freedesktop/Tracker1/Resources"
RygelTrackerMetadataValues* rygel_tracker_metadata_values_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelTrackerItemFactory* item_factory, gchar** key_chain, int key_chain_length1, const gchar* child_class);
static gchar** _vala_array_dup1 (gchar** self, int length);
static void rygel_tracker_metadata_values_create_proxies (RygelTrackerMetadataValues* self, GError** error);
void rygel_tracker_metadata_values_fetch_metadata_values (RygelTrackerMetadataValues* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
void rygel_tracker_metadata_values_fetch_metadata_values_finish (RygelTrackerMetadataValues* self, GAsyncResult* _res_);
static void rygel_tracker_metadata_values_fetch_metadata_values_data_free (gpointer _data);
static gboolean rygel_tracker_metadata_values_fetch_metadata_values_co (RygelTrackerMetadataValuesFetchMetadataValuesData* _data_);
RygelTrackerQueryTriplets* rygel_tracker_query_triplets_new (void);
RygelTrackerQueryTriplets* rygel_tracker_query_triplets_construct (GType object_type);
GType rygel_tracker_query_triplets_get_type (void) G_GNUC_CONST;
#define RYGEL_TRACKER_SELECTION_QUERY_ITEM_VARIABLE "?item"
GType rygel_tracker_search_container_get_type (void) G_GNUC_CONST;
RygelTrackerQueryTriplet* rygel_tracker_query_triplet_new (const gchar* subject, const gchar* predicate, const gchar* obj);
RygelTrackerQueryTriplet* rygel_tracker_query_triplet_construct (GType object_type, const gchar* subject, const gchar* predicate, const gchar* obj);
gpointer rygel_tracker_query_triplet_ref (gpointer instance);
void rygel_tracker_query_triplet_unref (gpointer instance);
GParamSpec* rygel_tracker_param_spec_query_triplet (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void rygel_tracker_value_set_query_triplet (GValue* value, gpointer v_object);
void rygel_tracker_value_take_query_triplet (GValue* value, gpointer v_object);
gpointer rygel_tracker_value_get_query_triplet (const GValue* value);
GType rygel_tracker_query_triplet_get_type (void) G_GNUC_CONST;
RygelTrackerSelectionQuery* rygel_tracker_selection_query_new (GeeArrayList* variables, RygelTrackerQueryTriplets* triplets, GeeArrayList* filters, const gchar* order_by, gint offset, gint max_count);
RygelTrackerSelectionQuery* rygel_tracker_selection_query_construct (GType object_type, GeeArrayList* variables, RygelTrackerQueryTriplets* triplets, GeeArrayList* filters, const gchar* order_by, gint offset, gint max_count);
gpointer rygel_tracker_query_ref (gpointer instance);
void rygel_tracker_query_unref (gpointer instance);
GParamSpec* rygel_tracker_param_spec_query (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void rygel_tracker_value_set_query (GValue* value, gpointer v_object);
void rygel_tracker_value_take_query (GValue* value, gpointer v_object);
gpointer rygel_tracker_value_get_query (const GValue* value);
GType rygel_tracker_query_get_type (void) G_GNUC_CONST;
GType rygel_tracker_selection_query_get_type (void) G_GNUC_CONST;
void rygel_tracker_query_execute (RygelTrackerQuery* self, RygelTrackerResourcesIface* resources, GAsyncReadyCallback _callback_, gpointer _user_data_);
void rygel_tracker_query_execute_finish (RygelTrackerQuery* self, GAsyncResult* _res_, GError** error);
static void rygel_tracker_metadata_values_fetch_metadata_values_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
gchar* rygel_tracker_metadata_values_create_title_for_value (RygelTrackerMetadataValues* self, const gchar* value);
gchar* rygel_tracker_metadata_values_create_id_for_title (RygelTrackerMetadataValues* self, const gchar* title);
RygelTrackerQueryTriplets* rygel_tracker_query_triplets_new_clone (RygelTrackerQueryTriplets* triplets);
RygelTrackerQueryTriplets* rygel_tracker_query_triplets_construct_clone (GType object_type, RygelTrackerQueryTriplets* triplets);
gchar* rygel_tracker_metadata_values_create_filter (RygelTrackerMetadataValues* self, const gchar* variable, const gchar* value);
RygelTrackerSearchContainer* rygel_tracker_search_container_new (const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelTrackerItemFactory* item_factory, RygelTrackerQueryTriplets* triplets, GeeArrayList* filters);
RygelTrackerSearchContainer* rygel_tracker_search_container_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelTrackerItemFactory* item_factory, RygelTrackerQueryTriplets* triplets, GeeArrayList* filters);
static void rygel_tracker_metadata_values_real_find_object_data_free (gpointer _data);
static void rygel_tracker_metadata_values_real_find_object (RygelMediaContainer* base, const gchar* id, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
static gboolean rygel_tracker_metadata_values_real_find_object_co (RygelTrackerMetadataValuesFindObjectData* _data_);
static gboolean rygel_tracker_metadata_values_is_our_child (RygelTrackerMetadataValues* self, const gchar* id);
static void rygel_tracker_metadata_values_find_object_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
static gchar* rygel_tracker_metadata_values_real_create_id_for_title (RygelTrackerMetadataValues* self, const gchar* title);
static gchar* rygel_tracker_metadata_values_real_create_title_for_value (RygelTrackerMetadataValues* self, const gchar* value);
static gchar* rygel_tracker_metadata_values_real_create_filter (RygelTrackerMetadataValues* self, const gchar* variable, const gchar* value);
gchar* rygel_tracker_query_escape_string (const gchar* literal);
static void rygel_tracker_metadata_values_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


static gpointer _rygel_tracker_item_factory_ref0 (gpointer self) {
	return self ? rygel_tracker_item_factory_ref (self) : NULL;
}


static gchar** _vala_array_dup1 (gchar** self, int length) {
	gchar** result;
	int i;
	result = g_new0 (gchar*, length + 1);
	for (i = 0; i < length; i++) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (self[i]);
		result[i] = _tmp0_;
	}
	return result;
}


RygelTrackerMetadataValues* rygel_tracker_metadata_values_construct (GType object_type, const gchar* id, RygelMediaContainer* parent, const gchar* title, RygelTrackerItemFactory* item_factory, gchar** key_chain, int key_chain_length1, const gchar* child_class) {
	RygelTrackerMetadataValues * self = NULL;
	const gchar* _tmp0_;
	RygelMediaContainer* _tmp1_;
	const gchar* _tmp2_;
	RygelTrackerItemFactory* _tmp3_;
	RygelTrackerItemFactory* _tmp4_;
	gchar** _tmp5_;
	gint _tmp5__length1;
	gchar** _tmp6_;
	gint _tmp6__length1;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (id != NULL, NULL);
	g_return_val_if_fail (parent != NULL, NULL);
	g_return_val_if_fail (title != NULL, NULL);
	g_return_val_if_fail (item_factory != NULL, NULL);
	_tmp0_ = id;
	_tmp1_ = parent;
	_tmp2_ = title;
	self = (RygelTrackerMetadataValues*) rygel_simple_container_construct (object_type, _tmp0_, _tmp1_, _tmp2_);
	_tmp3_ = item_factory;
	_tmp4_ = _rygel_tracker_item_factory_ref0 (_tmp3_);
	_rygel_tracker_item_factory_unref0 (self->priv->item_factory);
	self->priv->item_factory = _tmp4_;
	_tmp5_ = key_chain;
	_tmp5__length1 = key_chain_length1;
	_tmp6_ = (_tmp5_ != NULL) ? _vala_array_dup1 (_tmp5_, _tmp5__length1) : ((gpointer) _tmp5_);
	_tmp6__length1 = _tmp5__length1;
	self->key_chain = (_vala_array_free (self->key_chain, self->key_chain_length1, (GDestroyNotify) g_free), NULL);
	self->key_chain = _tmp6_;
	self->key_chain_length1 = _tmp6__length1;
	_tmp7_ = child_class;
	_tmp8_ = g_strdup (_tmp7_);
	_g_free0 (self->priv->child_class);
	self->priv->child_class = _tmp8_;
	{
		rygel_tracker_metadata_values_create_proxies (self, &_inner_error_);
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_IO_ERROR) {
				goto __catch1_g_io_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
	}
	goto __finally1;
	__catch1_g_io_error:
	{
		GError* _error_ = NULL;
		const gchar* _tmp9_ = NULL;
		GError* _tmp10_;
		const gchar* _tmp11_;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		_tmp9_ = _ ("Failed to connect to session bus: %s");
		_tmp10_ = _error_;
		_tmp11_ = _tmp10_->message;
		g_critical (_tmp9_, _tmp11_);
		_g_error_free0 (_error_);
		return self;
	}
	__finally1:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
	rygel_tracker_metadata_values_fetch_metadata_values (self, NULL, NULL);
	return self;
}


static void rygel_tracker_metadata_values_fetch_metadata_values_data_free (gpointer _data) {
	RygelTrackerMetadataValuesFetchMetadataValuesData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (RygelTrackerMetadataValuesFetchMetadataValuesData, _data_);
}


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


void rygel_tracker_metadata_values_fetch_metadata_values (RygelTrackerMetadataValues* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	RygelTrackerMetadataValuesFetchMetadataValuesData* _data_;
	RygelTrackerMetadataValues* _tmp0_;
	_data_ = g_slice_new0 (RygelTrackerMetadataValuesFetchMetadataValuesData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, rygel_tracker_metadata_values_fetch_metadata_values);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_tracker_metadata_values_fetch_metadata_values_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	rygel_tracker_metadata_values_fetch_metadata_values_co (_data_);
}


void rygel_tracker_metadata_values_fetch_metadata_values_finish (RygelTrackerMetadataValues* self, GAsyncResult* _res_) {
	RygelTrackerMetadataValuesFetchMetadataValuesData* _data_;
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
}


static gchar* string_replace (const gchar* self, const gchar* old, const gchar* replacement) {
	gchar* result = NULL;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	{
		const gchar* _tmp0_;
		gchar* _tmp1_ = NULL;
		gchar* _tmp2_;
		GRegex* _tmp3_;
		GRegex* _tmp4_;
		GRegex* regex;
		GRegex* _tmp5_;
		const gchar* _tmp6_;
		gchar* _tmp7_ = NULL;
		gchar* _tmp8_;
		_tmp0_ = old;
		_tmp1_ = g_regex_escape_string (_tmp0_, -1);
		_tmp2_ = _tmp1_;
		_tmp3_ = g_regex_new (_tmp2_, 0, 0, &_inner_error_);
		_tmp4_ = _tmp3_;
		_g_free0 (_tmp2_);
		regex = _tmp4_;
		if (_inner_error_ != NULL) {
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch2_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		_tmp5_ = regex;
		_tmp6_ = replacement;
		_tmp7_ = g_regex_replace_literal (_tmp5_, self, (gssize) (-1), 0, _tmp6_, 0, &_inner_error_);
		_tmp8_ = _tmp7_;
		if (_inner_error_ != NULL) {
			_g_regex_unref0 (regex);
			if (_inner_error_->domain == G_REGEX_ERROR) {
				goto __catch2_g_regex_error;
			}
			_g_regex_unref0 (regex);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return NULL;
		}
		result = _tmp8_;
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally2;
	__catch2_g_regex_error:
	{
		GError* e = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		g_assert_not_reached ();
		_g_error_free0 (e);
	}
	__finally2:
	if (_inner_error_ != NULL) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return NULL;
	}
}


static void rygel_tracker_metadata_values_fetch_metadata_values_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	RygelTrackerMetadataValuesFetchMetadataValuesData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	rygel_tracker_metadata_values_fetch_metadata_values_co (_data_);
}


static gboolean rygel_tracker_metadata_values_fetch_metadata_values_co (RygelTrackerMetadataValuesFetchMetadataValuesData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->update_in_progress;
	if (_data_->_tmp0_) {
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	_data_->self->priv->update_in_progress = TRUE;
	rygel_simple_container_clear ((RygelSimpleContainer*) _data_->self);
	_data_->_tmp1_ = rygel_tracker_query_triplets_new ();
	_data_->triplets = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->triplets;
	_data_->_tmp3_ = _data_->self->priv->item_factory;
	_data_->_tmp4_ = _data_->_tmp3_->category;
	_data_->_tmp5_ = rygel_tracker_query_triplet_new (RYGEL_TRACKER_SELECTION_QUERY_ITEM_VARIABLE, "a", _data_->_tmp4_);
	_data_->_tmp6_ = _data_->_tmp5_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp2_, _data_->_tmp6_);
	_rygel_tracker_query_triplet_unref0 (_data_->_tmp6_);
	_data_->_tmp7_ = _data_->self->key_chain;
	_data_->_tmp7__length1 = _data_->self->key_chain_length1;
	_data_->num_keys = _data_->_tmp7__length1 - 1;
	_data_->_tmp8_ = _data_->num_keys;
	_data_->_tmp9_ = NULL;
	_data_->_tmp9_ = g_new0 (gchar*, _data_->_tmp8_ + 1);
	_data_->variables = _data_->_tmp9_;
	_data_->variables_length1 = _data_->_tmp8_;
	_data_->_variables_size_ = _data_->variables_length1;
	{
		_data_->i = 0;
		_data_->_tmp10_ = TRUE;
		while (TRUE) {
			_data_->_tmp11_ = _data_->_tmp10_;
			if (!_data_->_tmp11_) {
				_data_->_tmp12_ = _data_->i;
				_data_->i = _data_->_tmp12_ + 1;
			}
			_data_->_tmp10_ = FALSE;
			_data_->_tmp13_ = _data_->i;
			_data_->_tmp14_ = _data_->num_keys;
			if (!(_data_->_tmp13_ < _data_->_tmp14_)) {
				break;
			}
			_data_->_tmp15_ = _data_->variables;
			_data_->_tmp15__length1 = _data_->variables_length1;
			_data_->_tmp16_ = _data_->i;
			_data_->_tmp17_ = _data_->self->key_chain;
			_data_->_tmp17__length1 = _data_->self->key_chain_length1;
			_data_->_tmp18_ = _data_->i;
			_data_->_tmp19_ = _data_->_tmp17_[_data_->_tmp18_];
			_data_->_tmp20_ = NULL;
			_data_->_tmp20_ = string_replace (_data_->_tmp19_, ":", "_");
			_data_->_tmp21_ = _data_->_tmp20_;
			_data_->_tmp22_ = g_strconcat ("?", _data_->_tmp21_, NULL);
			_g_free0 (_data_->_tmp15_[_data_->_tmp16_]);
			_data_->_tmp15_[_data_->_tmp16_] = _data_->_tmp22_;
			_data_->_tmp23_ = _data_->_tmp15_[_data_->_tmp16_];
			_g_free0 (_data_->_tmp21_);
			_data_->_tmp24_ = _data_->i;
			if (_data_->_tmp24_ == 0) {
				_data_->_tmp25_ = g_strdup (RYGEL_TRACKER_SELECTION_QUERY_ITEM_VARIABLE);
				_g_free0 (_data_->subject);
				_data_->subject = _data_->_tmp25_;
			} else {
				_data_->_tmp26_ = _data_->variables;
				_data_->_tmp26__length1 = _data_->variables_length1;
				_data_->_tmp27_ = _data_->i;
				_data_->_tmp28_ = _data_->_tmp26_[_data_->_tmp27_ - 1];
				_data_->_tmp29_ = g_strdup (_data_->_tmp28_);
				_g_free0 (_data_->subject);
				_data_->subject = _data_->_tmp29_;
			}
			_data_->_tmp30_ = _data_->triplets;
			_data_->_tmp31_ = _data_->subject;
			_data_->_tmp32_ = _data_->self->key_chain;
			_data_->_tmp32__length1 = _data_->self->key_chain_length1;
			_data_->_tmp33_ = _data_->i;
			_data_->_tmp34_ = _data_->_tmp32_[_data_->_tmp33_];
			_data_->_tmp35_ = _data_->variables;
			_data_->_tmp35__length1 = _data_->variables_length1;
			_data_->_tmp36_ = _data_->i;
			_data_->_tmp37_ = _data_->_tmp35_[_data_->_tmp36_];
			_data_->_tmp38_ = rygel_tracker_query_triplet_new (_data_->_tmp31_, _data_->_tmp34_, _data_->_tmp37_);
			_data_->_tmp39_ = _data_->_tmp38_;
			gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp30_, _data_->_tmp39_);
			_rygel_tracker_query_triplet_unref0 (_data_->_tmp39_);
			_g_free0 (_data_->subject);
		}
	}
	_data_->_tmp40_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL);
	_data_->selected = _data_->_tmp40_;
	_data_->_tmp41_ = _data_->variables;
	_data_->_tmp41__length1 = _data_->variables_length1;
	_data_->_tmp42_ = _data_->num_keys;
	_data_->_tmp43_ = _data_->_tmp41_[_data_->_tmp42_ - 1];
	_data_->_tmp44_ = g_strdup (_data_->_tmp43_);
	_data_->last_variable = _data_->_tmp44_;
	_data_->_tmp45_ = _data_->selected;
	_data_->_tmp46_ = _data_->last_variable;
	_data_->_tmp47_ = g_strconcat ("DISTINCT ", _data_->_tmp46_, NULL);
	_data_->_tmp48_ = _data_->_tmp47_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp45_, _data_->_tmp48_);
	_g_free0 (_data_->_tmp48_);
	_data_->_tmp49_ = _data_->selected;
	_data_->_tmp50_ = _data_->triplets;
	_data_->_tmp51_ = _data_->last_variable;
	_data_->_tmp52_ = rygel_tracker_selection_query_new (_data_->_tmp49_, _data_->_tmp50_, NULL, _data_->_tmp51_, 0, -1);
	_data_->query = _data_->_tmp52_;
	{
		_data_->_tmp53_ = _data_->query;
		_data_->_tmp54_ = _data_->self->priv->resources;
		_data_->_state_ = 1;
		rygel_tracker_query_execute ((RygelTrackerQuery*) _data_->_tmp53_, _data_->_tmp54_, rygel_tracker_metadata_values_fetch_metadata_values_ready, _data_);
		return FALSE;
		_state_1:
		rygel_tracker_query_execute_finish ((RygelTrackerQuery*) _data_->_tmp53_, _data_->_res_, &_data_->_inner_error_);
		if (_data_->_inner_error_ != NULL) {
			goto __catch3_g_error;
		}
	}
	goto __finally3;
	__catch3_g_error:
	{
		_data_->_error_ = _data_->_inner_error_;
		_data_->_inner_error_ = NULL;
		_data_->_tmp55_ = NULL;
		_data_->_tmp55_ = _ ("Error getting all values for '%s': %s");
		_data_->_tmp56_ = _data_->self->key_chain;
		_data_->_tmp56__length1 = _data_->self->key_chain_length1;
		_data_->_tmp57_ = NULL;
		_data_->_tmp57_ = g_strjoinv (" -> ", _data_->_tmp56_);
		_data_->_tmp58_ = _data_->_tmp57_;
		_data_->_tmp59_ = _data_->_error_;
		_data_->_tmp60_ = _data_->_tmp59_->message;
		g_critical (_data_->_tmp55_, _data_->_tmp58_, _data_->_tmp60_);
		_g_free0 (_data_->_tmp58_);
		_data_->self->priv->update_in_progress = FALSE;
		_g_error_free0 (_data_->_error_);
		_rygel_tracker_query_unref0 (_data_->query);
		_g_free0 (_data_->last_variable);
		_g_object_unref0 (_data_->selected);
		_data_->variables = (_vala_array_free (_data_->variables, _data_->variables_length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (_data_->triplets);
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	__finally3:
	if (_data_->_inner_error_ != NULL) {
		_rygel_tracker_query_unref0 (_data_->query);
		_g_free0 (_data_->last_variable);
		_g_object_unref0 (_data_->selected);
		_data_->variables = (_vala_array_free (_data_->variables, _data_->variables_length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (_data_->triplets);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
		g_clear_error (&_data_->_inner_error_);
		return FALSE;
	}
	{
		_data_->i = 0;
		_data_->_tmp61_ = TRUE;
		while (TRUE) {
			_data_->_tmp62_ = _data_->_tmp61_;
			if (!_data_->_tmp62_) {
				_data_->_tmp63_ = _data_->i;
				_data_->i = _data_->_tmp63_ + 1;
			}
			_data_->_tmp61_ = FALSE;
			_data_->_tmp64_ = _data_->i;
			_data_->_tmp65_ = _data_->query;
			_data_->_tmp66_ = _data_->_tmp65_->result;
			_data_->_tmp66__length1 = _data_->_tmp65_->result_length1;
			_data_->_tmp66__length2 = _data_->_tmp65_->result_length2;
			_data_->_tmp67_ = _data_->_tmp66__length1;
			if (!(_data_->_tmp64_ < _data_->_tmp67_)) {
				break;
			}
			_data_->_tmp68_ = _data_->query;
			_data_->_tmp69_ = _data_->_tmp68_->result;
			_data_->_tmp69__length1 = _data_->_tmp68_->result_length1;
			_data_->_tmp69__length2 = _data_->_tmp68_->result_length2;
			_data_->_tmp70_ = _data_->i;
			_data_->_tmp71_ = _data_->_tmp69_[(_data_->_tmp70_ * _data_->_tmp69__length2) + 0];
			_data_->_tmp72_ = g_strdup (_data_->_tmp71_);
			_data_->value = _data_->_tmp72_;
			_data_->_tmp73_ = _data_->value;
			if (g_strcmp0 (_data_->_tmp73_, "") == 0) {
				_g_free0 (_data_->value);
				continue;
			}
			_data_->_tmp74_ = _data_->value;
			_data_->_tmp75_ = NULL;
			_data_->_tmp75_ = rygel_tracker_metadata_values_create_title_for_value (_data_->self, _data_->_tmp74_);
			_data_->title = _data_->_tmp75_;
			_data_->_tmp76_ = _data_->title;
			if (_data_->_tmp76_ == NULL) {
				_g_free0 (_data_->title);
				_g_free0 (_data_->value);
				continue;
			}
			_data_->_tmp77_ = _data_->title;
			_data_->_tmp78_ = NULL;
			_data_->_tmp78_ = rygel_tracker_metadata_values_create_id_for_title (_data_->self, _data_->_tmp77_);
			_data_->id = _data_->_tmp78_;
			_data_->_tmp80_ = _data_->id;
			if (_data_->_tmp80_ == NULL) {
				_data_->_tmp79_ = TRUE;
			} else {
				_data_->_tmp81_ = _data_->id;
				_data_->_tmp82_ = FALSE;
				_data_->_tmp82_ = rygel_simple_container_is_child_id_unique ((RygelSimpleContainer*) _data_->self, _data_->_tmp81_);
				_data_->_tmp79_ = !_data_->_tmp82_;
			}
			_data_->_tmp83_ = _data_->_tmp79_;
			if (_data_->_tmp83_) {
				_g_free0 (_data_->id);
				_g_free0 (_data_->title);
				_g_free0 (_data_->value);
				continue;
			}
			_data_->_tmp84_ = _data_->triplets;
			_data_->_tmp85_ = rygel_tracker_query_triplets_new_clone (_data_->_tmp84_);
			_data_->child_triplets = _data_->_tmp85_;
			_data_->_tmp86_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL);
			_data_->filters = _data_->_tmp86_;
			_data_->_tmp87_ = _data_->child_triplets;
			_data_->_tmp88_ = NULL;
			_data_->_tmp88_ = gee_abstract_list_last ((GeeAbstractList*) _data_->_tmp87_);
			_data_->_tmp89_ = (RygelTrackerQueryTriplet*) _data_->_tmp88_;
			_data_->_tmp90_ = _data_->_tmp89_->obj;
			_data_->_tmp91_ = _data_->value;
			_data_->_tmp92_ = NULL;
			_data_->_tmp92_ = rygel_tracker_metadata_values_create_filter (_data_->self, _data_->_tmp90_, _data_->_tmp91_);
			_data_->_tmp93_ = _data_->_tmp92_;
			_rygel_tracker_query_triplet_unref0 (_data_->_tmp89_);
			_data_->filter = _data_->_tmp93_;
			_data_->_tmp94_ = _data_->filters;
			_data_->_tmp95_ = _data_->filter;
			gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp94_, _data_->_tmp95_);
			_data_->_tmp96_ = _data_->id;
			_data_->_tmp97_ = _data_->title;
			_data_->_tmp98_ = _data_->self->priv->item_factory;
			_data_->_tmp99_ = _data_->child_triplets;
			_data_->_tmp100_ = _data_->filters;
			_data_->_tmp101_ = rygel_tracker_search_container_new (_data_->_tmp96_, (RygelMediaContainer*) _data_->self, _data_->_tmp97_, _data_->_tmp98_, _data_->_tmp99_, _data_->_tmp100_);
			_data_->container = _data_->_tmp101_;
			_data_->_tmp102_ = _data_->self->priv->child_class;
			if (_data_->_tmp102_ != NULL) {
				_data_->_tmp103_ = _data_->container;
				_data_->_tmp104_ = _data_->self->priv->child_class;
				_data_->_tmp105_ = g_strdup (_data_->_tmp104_);
				_g_free0 (((RygelMediaObject*) _data_->_tmp103_)->upnp_class);
				((RygelMediaObject*) _data_->_tmp103_)->upnp_class = _data_->_tmp105_;
			}
			_data_->_tmp106_ = _data_->container;
			rygel_simple_container_add_child_container ((RygelSimpleContainer*) _data_->self, (RygelMediaContainer*) _data_->_tmp106_);
			_g_object_unref0 (_data_->container);
			_g_free0 (_data_->filter);
			_g_object_unref0 (_data_->filters);
			_g_object_unref0 (_data_->child_triplets);
			_g_free0 (_data_->id);
			_g_free0 (_data_->title);
			_g_free0 (_data_->value);
		}
	}
	rygel_media_container_updated ((RygelMediaContainer*) _data_->self);
	_data_->self->priv->update_in_progress = FALSE;
	_rygel_tracker_query_unref0 (_data_->query);
	_g_free0 (_data_->last_variable);
	_g_object_unref0 (_data_->selected);
	_data_->variables = (_vala_array_free (_data_->variables, _data_->variables_length1, (GDestroyNotify) g_free), NULL);
	_g_object_unref0 (_data_->triplets);
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static void rygel_tracker_metadata_values_real_find_object_data_free (gpointer _data) {
	RygelTrackerMetadataValuesFindObjectData* _data_;
	_data_ = _data;
	_g_free0 (_data_->id);
	_g_object_unref0 (_data_->cancellable);
	_g_object_unref0 (_data_->result);
	_g_object_unref0 (_data_->self);
	g_slice_free (RygelTrackerMetadataValuesFindObjectData, _data_);
}


static void rygel_tracker_metadata_values_real_find_object (RygelMediaContainer* base, const gchar* id, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_) {
	RygelTrackerMetadataValues * self;
	RygelTrackerMetadataValuesFindObjectData* _data_;
	RygelTrackerMetadataValues* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	GCancellable* _tmp3_;
	GCancellable* _tmp4_;
	self = (RygelTrackerMetadataValues*) base;
	_data_ = g_slice_new0 (RygelTrackerMetadataValuesFindObjectData);
	_data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, rygel_tracker_metadata_values_real_find_object);
	g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, rygel_tracker_metadata_values_real_find_object_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = id;
	_tmp2_ = g_strdup (_tmp1_);
	_data_->id = _tmp2_;
	_tmp3_ = cancellable;
	_tmp4_ = _g_object_ref0 (_tmp3_);
	_data_->cancellable = _tmp4_;
	rygel_tracker_metadata_values_real_find_object_co (_data_);
}


static RygelMediaObject* rygel_tracker_metadata_values_real_find_object_finish (RygelMediaContainer* base, GAsyncResult* _res_, GError** error) {
	RygelMediaObject* result;
	RygelTrackerMetadataValuesFindObjectData* _data_;
	if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
		return NULL;
	}
	_data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
	result = _data_->result;
	_data_->result = NULL;
	return result;
}


static void rygel_tracker_metadata_values_find_object_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
	RygelTrackerMetadataValuesFindObjectData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	rygel_tracker_metadata_values_real_find_object_co (_data_);
}


static gboolean rygel_tracker_metadata_values_real_find_object_co (RygelTrackerMetadataValuesFindObjectData* _data_) {
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->id;
	_data_->_tmp1_ = FALSE;
	_data_->_tmp1_ = rygel_tracker_metadata_values_is_our_child (_data_->self, _data_->_tmp0_);
	if (_data_->_tmp1_) {
		_data_->_tmp2_ = _data_->id;
		_data_->_tmp3_ = _data_->cancellable;
		_data_->_state_ = 1;
		RYGEL_MEDIA_CONTAINER_CLASS (rygel_tracker_metadata_values_parent_class)->find_object ((RygelMediaContainer*) RYGEL_SIMPLE_CONTAINER (_data_->self), _data_->_tmp2_, _data_->_tmp3_, rygel_tracker_metadata_values_find_object_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp4_ = NULL;
		_data_->_tmp4_ = RYGEL_MEDIA_CONTAINER_CLASS (rygel_tracker_metadata_values_parent_class)->find_object_finish ((RygelMediaContainer*) RYGEL_SIMPLE_CONTAINER (_data_->self), _data_->_res_, &_data_->_inner_error_);
		_data_->_tmp5_ = _data_->_tmp4_;
		if (_data_->_inner_error_ != NULL) {
			g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
			g_error_free (_data_->_inner_error_);
			if (_data_->_state_ == 0) {
				g_simple_async_result_complete_in_idle (_data_->_async_result);
			} else {
				g_simple_async_result_complete (_data_->_async_result);
			}
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->result = _data_->_tmp5_;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	} else {
		_data_->result = NULL;
		if (_data_->_state_ == 0) {
			g_simple_async_result_complete_in_idle (_data_->_async_result);
		} else {
			g_simple_async_result_complete (_data_->_async_result);
		}
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	if (_data_->_state_ == 0) {
		g_simple_async_result_complete_in_idle (_data_->_async_result);
	} else {
		g_simple_async_result_complete (_data_->_async_result);
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}


static gchar* rygel_tracker_metadata_values_real_create_id_for_title (RygelTrackerMetadataValues* self, const gchar* title) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	g_return_val_if_fail (title != NULL, NULL);
	_tmp0_ = ((RygelMediaObject*) self)->id;
	_tmp1_ = g_strconcat (_tmp0_, ":", NULL);
	_tmp2_ = _tmp1_;
	_tmp3_ = title;
	_tmp4_ = g_uri_escape_string (_tmp3_, "", TRUE);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strconcat (_tmp2_, _tmp5_, NULL);
	_tmp7_ = _tmp6_;
	_g_free0 (_tmp5_);
	_g_free0 (_tmp2_);
	result = _tmp7_;
	return result;
}


gchar* rygel_tracker_metadata_values_create_id_for_title (RygelTrackerMetadataValues* self, const gchar* title) {
	g_return_val_if_fail (self != NULL, NULL);
	return RYGEL_TRACKER_METADATA_VALUES_GET_CLASS (self)->create_id_for_title (self, title);
}


static gchar* rygel_tracker_metadata_values_real_create_title_for_value (RygelTrackerMetadataValues* self, const gchar* value) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (value != NULL, NULL);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	result = _tmp1_;
	return result;
}


gchar* rygel_tracker_metadata_values_create_title_for_value (RygelTrackerMetadataValues* self, const gchar* value) {
	g_return_val_if_fail (self != NULL, NULL);
	return RYGEL_TRACKER_METADATA_VALUES_GET_CLASS (self)->create_title_for_value (self, value);
}


static gchar* rygel_tracker_metadata_values_real_create_filter (RygelTrackerMetadataValues* self, const gchar* variable, const gchar* value) {
	gchar* result = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	const gchar* _tmp3_;
	gchar* _tmp4_ = NULL;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	g_return_val_if_fail (variable != NULL, NULL);
	g_return_val_if_fail (value != NULL, NULL);
	_tmp0_ = variable;
	_tmp1_ = g_strconcat (_tmp0_, " = \"", NULL);
	_tmp2_ = _tmp1_;
	_tmp3_ = value;
	_tmp4_ = rygel_tracker_query_escape_string (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = g_strconcat (_tmp2_, _tmp5_, NULL);
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strconcat (_tmp7_, "\"", NULL);
	_tmp9_ = _tmp8_;
	_g_free0 (_tmp7_);
	_g_free0 (_tmp5_);
	_g_free0 (_tmp2_);
	result = _tmp9_;
	return result;
}


gchar* rygel_tracker_metadata_values_create_filter (RygelTrackerMetadataValues* self, const gchar* variable, const gchar* value) {
	g_return_val_if_fail (self != NULL, NULL);
	return RYGEL_TRACKER_METADATA_VALUES_GET_CLASS (self)->create_filter (self, variable, value);
}


static gboolean rygel_tracker_metadata_values_is_our_child (RygelTrackerMetadataValues* self, const gchar* id) {
	gboolean result = FALSE;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (id != NULL, FALSE);
	_tmp0_ = id;
	_tmp1_ = ((RygelMediaObject*) self)->id;
	_tmp2_ = g_strconcat (_tmp1_, ":", NULL);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_str_has_prefix (_tmp0_, _tmp3_);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp3_);
	result = _tmp5_;
	return result;
}


static void rygel_tracker_metadata_values_create_proxies (RygelTrackerMetadataValues* self, GError** error) {
	RygelTrackerResourcesIface* _tmp0_ = NULL;
	RygelTrackerResourcesIface* _tmp1_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_initable_new (RYGEL_TRACKER_TYPE_RESOURCES_IFACE_PROXY, NULL, &_inner_error_, "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, "g-name", RYGEL_TRACKER_METADATA_VALUES_TRACKER_SERVICE, "g-bus-type", G_BUS_TYPE_SESSION, "g-object-path", RYGEL_TRACKER_METADATA_VALUES_RESOURCES_PATH, "g-interface-name", "org.freedesktop.Tracker1.Resources", NULL);
	_tmp1_ = (RygelTrackerResourcesIface*) _tmp0_;
	if (_inner_error_ != NULL) {
		if (_inner_error_->domain == G_IO_ERROR) {
			g_propagate_error (error, _inner_error_);
			return;
		} else {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return;
		}
	}
	_g_object_unref0 (self->priv->resources);
	self->priv->resources = _tmp1_;
}


static void rygel_tracker_metadata_values_class_init (RygelTrackerMetadataValuesClass * klass) {
	rygel_tracker_metadata_values_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (RygelTrackerMetadataValuesPrivate));
	RYGEL_MEDIA_CONTAINER_CLASS (klass)->find_object = rygel_tracker_metadata_values_real_find_object;
	RYGEL_MEDIA_CONTAINER_CLASS (klass)->find_object_finish = rygel_tracker_metadata_values_real_find_object_finish;
	RYGEL_TRACKER_METADATA_VALUES_CLASS (klass)->create_id_for_title = rygel_tracker_metadata_values_real_create_id_for_title;
	RYGEL_TRACKER_METADATA_VALUES_CLASS (klass)->create_title_for_value = rygel_tracker_metadata_values_real_create_title_for_value;
	RYGEL_TRACKER_METADATA_VALUES_CLASS (klass)->create_filter = rygel_tracker_metadata_values_real_create_filter;
	G_OBJECT_CLASS (klass)->finalize = rygel_tracker_metadata_values_finalize;
}


static void rygel_tracker_metadata_values_instance_init (RygelTrackerMetadataValues * self) {
	self->priv = RYGEL_TRACKER_METADATA_VALUES_GET_PRIVATE (self);
	self->priv->update_in_progress = FALSE;
}


static void rygel_tracker_metadata_values_finalize (GObject* obj) {
	RygelTrackerMetadataValues * self;
	self = RYGEL_TRACKER_METADATA_VALUES (obj);
	_rygel_tracker_item_factory_unref0 (self->priv->item_factory);
	self->key_chain = (_vala_array_free (self->key_chain, self->key_chain_length1, (GDestroyNotify) g_free), NULL);
	_g_free0 (self->priv->child_class);
	_g_object_unref0 (self->priv->resources);
	G_OBJECT_CLASS (rygel_tracker_metadata_values_parent_class)->finalize (obj);
}


/**
 * Container listing possible values of a particuler Tracker metadata key.
 */
GType rygel_tracker_metadata_values_get_type (void) {
	static volatile gsize rygel_tracker_metadata_values_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_tracker_metadata_values_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelTrackerMetadataValuesClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_tracker_metadata_values_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelTrackerMetadataValues), 0, (GInstanceInitFunc) rygel_tracker_metadata_values_instance_init, NULL };
		GType rygel_tracker_metadata_values_type_id;
		rygel_tracker_metadata_values_type_id = g_type_register_static (RYGEL_TYPE_SIMPLE_CONTAINER, "RygelTrackerMetadataValues", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
		g_once_init_leave (&rygel_tracker_metadata_values_type_id__volatile, rygel_tracker_metadata_values_type_id);
	}
	return rygel_tracker_metadata_values_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



