1 module pulse.operation;
2 
3 version(linux):
4 
5 import pulse.def;
6 
7 extern (C):
8 
9 /***
10   This file is part of PulseAudio.
11 
12   Copyright 2004-2006 Lennart Poettering
13 
14   PulseAudio is free software; you can redistribute it and/or modify
15   it under the terms of the GNU Lesser General Public License as published
16   by the Free Software Foundation; either version 2.1 of the License,
17   or (at your option) any later version.
18 
19   PulseAudio is distributed in the hope that it will be useful, but
20   WITHOUT ANY WARRANTY; without even the implied warranty of
21   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22   General Public License for more details.
23 
24   You should have received a copy of the GNU Lesser General Public License
25   along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
26 ***/
27 
28 /** \file
29  * Asynchronous operations */
30 
31 /** An asynchronous operation object */
32 struct pa_operation;
33 
34 /** A callback for operation state changes */
35 alias pa_operation_notify_cb_t = void function (pa_operation* o, void* userdata);
36 
37 /** Increase the reference count by one */
38 pa_operation* pa_operation_ref (pa_operation* o);
39 
40 /** Decrease the reference count by one */
41 void pa_operation_unref (pa_operation* o);
42 
43 /** Cancel the operation. Beware! This will not necessarily cancel the
44  * execution of the operation on the server side. However it will make
45  * sure that the callback associated with this operation will not be
46  * called anymore, effectively disabling the operation from the client
47  * side's view. */
48 void pa_operation_cancel (pa_operation* o);
49 
50 /** Return the current status of the operation */
51 pa_operation_state_t pa_operation_get_state (const(pa_operation)* o);
52 
53 /** Set the callback function that is called when the operation state
54  * changes. Usually this is not necessary, since the functions that
55  * create pa_operation objects already take a callback that is called
56  * when the operation finishes. Registering a state change callback is
57  * mainly useful, if you want to get called back also if the operation
58  * gets cancelled. \since 4.0 */
59 void pa_operation_set_state_callback (pa_operation* o, pa_operation_notify_cb_t cb, void* userdata);
60