mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
pulse: Add pa_operation_set_state_callback() API
[The original commit message didn't have any explanation why this change is made, so I'll add that information here myself. --Tanu Kaskinen] This change is from the developers of a Haskell binding[1]. According to them, this change isn't strictly necessary, but their code gets significantly cleaner if they can register an operation callback that is called when the operation is cancelled due to the context getting disconnected. [1] https://github.com/favonia/pulse
This commit is contained in:
parent
b1e47df72c
commit
a255c29344
4 changed files with 30 additions and 0 deletions
|
|
@ -34,6 +34,9 @@ PA_C_DECL_BEGIN
|
|||
/** An asynchronous operation object */
|
||||
typedef struct pa_operation pa_operation;
|
||||
|
||||
/** A callback for operation state changes */
|
||||
typedef void (*pa_operation_notify_cb_t) (pa_operation *o, void *userdata);
|
||||
|
||||
/** Increase the reference count by one */
|
||||
pa_operation *pa_operation_ref(pa_operation *o);
|
||||
|
||||
|
|
@ -50,6 +53,10 @@ void pa_operation_cancel(pa_operation *o);
|
|||
/** Return the current status of the operation */
|
||||
pa_operation_state_t pa_operation_get_state(pa_operation *o);
|
||||
|
||||
/** Set the callback function that is called when the operation
|
||||
* is canceled due to disconnection. \since 4.0 */
|
||||
void pa_operation_set_state_callback(pa_operation *o, pa_operation_notify_cb_t cb, void *userdata);
|
||||
|
||||
PA_C_DECL_END
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue