mainloop-api.h File Reference

Main loop abstraction layer. More...

Go to the source code of this file.

Data Structures

struct  pa_mainloop_api
 An abstract mainloop API vtable. More...

Typedefs

typedef struct pa_mainloop_api pa_mainloop_api
 An abstract mainloop API vtable.
typedef enum pa_io_event_flags pa_io_event_flags_t
 A bitmask for IO events.
typedef struct pa_io_event pa_io_event
 An opaque IO event source object.
typedef void(* pa_io_event_cb_t )(pa_mainloop_api *ea, pa_io_event *e, int fd, pa_io_event_flags_t events, void *userdata)
 An IO event callback protoype.
typedef void(* pa_io_event_destroy_cb_t )(pa_mainloop_api *a, pa_io_event *e, void *userdata)
 A IO event destroy callback prototype \ since 0.9.3.
typedef struct pa_time_event pa_time_event
 An opaque timer event source object.
typedef void(* pa_time_event_cb_t )(pa_mainloop_api *a, pa_time_event *e, const struct timeval *tv, void *userdata)
 A time event callback prototype.
typedef void(* pa_rtclock_event_cb_t )(pa_mainloop_api *a, pa_time_event *e, pa_usec_t time, void *userdata)
 A rtclock time event callback prototype.
typedef void(* pa_time_event_destroy_cb_t )(pa_mainloop_api *a, pa_time_event *e, void *userdata)
 A time event destroy callback prototype \ since 0.9.3.
typedef struct pa_defer_event pa_defer_event
 An opaque deferred event source object.
typedef void(* pa_defer_event_cb_t )(pa_mainloop_api *a, pa_defer_event *e, void *userdata)
 A defer event callback protoype.
typedef void(* pa_defer_event_destroy_cb_t )(pa_mainloop_api *a, pa_defer_event *e, void *userdata)
 A defer event destroy callback prototype \ since 0.9.3.

Enumerations

enum  pa_io_event_flags {
  PA_IO_EVENT_NULL = 0,
  PA_IO_EVENT_INPUT = 1,
  PA_IO_EVENT_OUTPUT = 2,
  PA_IO_EVENT_HANGUP = 4,
  PA_IO_EVENT_ERROR = 8
}
 A bitmask for IO events. More...

Functions

void pa_mainloop_api_once (pa_mainloop_api *m, void(*callback)(pa_mainloop_api *m, void *userdata), void *userdata)
 Run the specified callback function once from the main loop using an anonymous defer event.


Detailed Description

Main loop abstraction layer.

Both the PulseAudio core and the PulseAudio client library use a main loop abstraction layer. Due to this it is possible to embed PulseAudio into other applications easily. Two main loop implemenations are currently available:

The structure pa_mainloop_api is used as vtable for the main loop abstraction.

This mainloop abstraction layer has no direct support for UNIX signals. Generic, mainloop implementation agnostic support is available throught mainloop-signal.h.


Typedef Documentation

An opaque deferred event source object.

Events of this type are triggered once in every main loop iteration

typedef void(* pa_defer_event_cb_t)(pa_mainloop_api *a, pa_defer_event *e, void *userdata)

A defer event callback protoype.

Since:
0.9.3

typedef void(* pa_defer_event_destroy_cb_t)(pa_mainloop_api *a, pa_defer_event *e, void *userdata)

A defer event destroy callback prototype \ since 0.9.3.

typedef struct pa_io_event pa_io_event

An opaque IO event source object.

Examples:
pacat.c.

typedef void(* pa_io_event_cb_t)(pa_mainloop_api *ea, pa_io_event *e, int fd, pa_io_event_flags_t events, void *userdata)

An IO event callback protoype.

Since:
0.9.3

typedef void(* pa_io_event_destroy_cb_t)(pa_mainloop_api *a, pa_io_event *e, void *userdata)

A IO event destroy callback prototype \ since 0.9.3.

A bitmask for IO events.

Examples:
pacat.c.

An abstract mainloop API vtable.

typedef void(* pa_rtclock_event_cb_t)(pa_mainloop_api *a, pa_time_event *e, pa_usec_t time, void *userdata)

A rtclock time event callback prototype.

Since:
0.9.16

typedef struct pa_time_event pa_time_event

An opaque timer event source object.

Examples:
pacat.c.

typedef void(* pa_time_event_cb_t)(pa_mainloop_api *a, pa_time_event *e, const struct timeval *tv, void *userdata)

A time event callback prototype.

Since:
0.9.3

typedef void(* pa_time_event_destroy_cb_t)(pa_mainloop_api *a, pa_time_event *e, void *userdata)

A time event destroy callback prototype \ since 0.9.3.


Enumeration Type Documentation

A bitmask for IO events.

Enumerator:
PA_IO_EVENT_NULL  No event.
PA_IO_EVENT_INPUT  Input event.
PA_IO_EVENT_OUTPUT  Output event.
PA_IO_EVENT_HANGUP  Hangup event.
PA_IO_EVENT_ERROR  Error event.


Function Documentation

void pa_mainloop_api_once ( pa_mainloop_api m,
void(*)(pa_mainloop_api *m, void *userdata)  callback,
void *  userdata 
)

Run the specified callback function once from the main loop using an anonymous defer event.


Generated on Mon Jun 14 16:31:37 2010 for PulseAudio by  doxygen 1.5.6