Logo Search packages:      
Sourcecode: pulseaudio version File versions

pa_glib_mainloop* pa_glib_mainloop_new ( GMainContext *  c  ) 

Create a new GLIB main loop object for the specified GLIB main loop context. Takes an argument c for the GMainContext to use. If c is NULL the default context is used.

Definition at line 614 of file glib-mainloop.c.

                                                        {
    pa_glib_mainloop *g;

    static GSourceFuncs source_funcs = {
        prepare_func,
        check_func,
        dispatch_func,
        NULL,
        NULL,
        NULL
    };

    g = (pa_glib_mainloop*) g_source_new(&source_funcs, sizeof(pa_glib_mainloop));
    g_main_context_ref(g->context = c ? c : g_main_context_default());

    g->api = vtable;
    g->api.userdata = g;

    PA_LLIST_HEAD_INIT(pa_io_event, g->io_events);
    PA_LLIST_HEAD_INIT(pa_time_event, g->time_events);
    PA_LLIST_HEAD_INIT(pa_defer_event, g->defer_events);

    g->n_enabled_defer_events = g->n_enabled_time_events = 0;
    g->io_events_please_scan = g->time_events_please_scan = g->defer_events_please_scan = 0;

    g->cached_next_time_event = NULL;

    g_source_attach(&g->source, g->context);
    g_source_set_can_recurse(&g->source, FALSE);

    return g;
}


Generated by  Doxygen 1.6.0   Back to index