Path: blob/master/thirdparty/linuxbsd_headers/pulse/operation.h
9905 views
#ifndef foooperationhfoo1#define foooperationhfoo23/***4This file is part of PulseAudio.56Copyright 2004-2006 Lennart Poettering78PulseAudio is free software; you can redistribute it and/or modify9it under the terms of the GNU Lesser General Public License as published10by the Free Software Foundation; either version 2.1 of the License,11or (at your option) any later version.1213PulseAudio is distributed in the hope that it will be useful, but14WITHOUT ANY WARRANTY; without even the implied warranty of15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU16General Public License for more details.1718You should have received a copy of the GNU Lesser General Public License19along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.20***/2122#include <pulse/cdecl.h>23#include <pulse/def.h>24#include <pulse/version.h>2526/** \file27* Asynchronous operations */2829PA_C_DECL_BEGIN3031/** An asynchronous operation object */32typedef struct pa_operation pa_operation;3334/** A callback for operation state changes */35typedef void (*pa_operation_notify_cb_t) (pa_operation *o, void *userdata);3637/** Increase the reference count by one */38pa_operation *pa_operation_ref(pa_operation *o);3940/** Decrease the reference count by one */41void pa_operation_unref(pa_operation *o);4243/** Cancel the operation. Beware! This will not necessarily cancel the44* execution of the operation on the server side. However it will make45* sure that the callback associated with this operation will not be46* called anymore, effectively disabling the operation from the client47* side's view. */48void pa_operation_cancel(pa_operation *o);4950/** Return the current status of the operation */51pa_operation_state_t pa_operation_get_state(pa_operation *o);5253/** Set the callback function that is called when the operation state54* changes. Usually this is not necessary, since the functions that55* create pa_operation objects already take a callback that is called56* when the operation finishes. Registering a state change callback is57* mainly useful, if you want to get called back also if the operation58* gets cancelled. \since 4.0 */59void pa_operation_set_state_callback(pa_operation *o, pa_operation_notify_cb_t cb, void *userdata);6061PA_C_DECL_END6263#endif646566