Commit 936a9f4d authored by Julian Bouzas's avatar Julian Bouzas
Browse files

core: add wp_core_idle_add API

parent 59ab08ff
......@@ -440,6 +440,19 @@ wp_core_get_context (WpCore * self)
return self->context;
}
GSource *
wp_core_idle_add (WpCore * self, GSourceFunc function, gpointer data)
{
GSource *source = NULL;
g_return_val_if_fail (WP_IS_CORE (self), NULL);
source = g_idle_source_new ();
g_source_set_callback (source, function, data, NULL);
g_source_attach (source, self->context);
return source;
}
struct pw_core *
wp_core_get_pw_core (WpCore * self)
{
......@@ -468,9 +481,7 @@ wp_core_connect (WpCore *self)
g_return_val_if_fail (WP_IS_CORE (self), FALSE);
source = g_idle_source_new ();
g_source_set_callback (source, (GSourceFunc) connect_in_idle, self, NULL);
g_source_attach (source, self->context);
source = wp_core_idle_add (self, (GSourceFunc) connect_in_idle, self);
return TRUE;
}
......
......@@ -40,6 +40,7 @@ G_DECLARE_FINAL_TYPE (WpCore, wp_core, WP, CORE, GObject)
WpCore * wp_core_new (GMainContext *context, WpProperties * properties);
GMainContext * wp_core_get_context (WpCore * self);
GSource * wp_core_idle_add (WpCore * self, GSourceFunc function, gpointer data);
struct pw_core * wp_core_get_pw_core (WpCore * self);
struct pw_remote * wp_core_get_pw_remote (WpCore * self);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment