aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/alsa/alsa-transaction.h
blob: 7726458c6970c17f327b75e48ac94a4eb0857c0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef __INC_ALSA_TRANSACTION_H
#define __INC_ALSA_TRANSACTION_H

#include <urcu/list.h>
#include <stdbool.h>

#include <afb/afb-binding.h>

struct SoftMixerT_;

typedef void (*AlsaTransactionDestructor) (struct SoftMixerT_ *, void*);

typedef struct {
	const char * uid;
	struct SoftMixerT_*  mixer;
	struct cds_list_head item_list; // list of items
	struct cds_list_head transaction_node; // node in a list of transactions
} AlsaMixerTransaction;

typedef struct {
	struct cds_list_head list_entry;
	void * object;
	AlsaTransactionDestructor destructor;
} AlsaMixerTransactionDataItem;

extern AlsaMixerTransaction * AlsaMixerTransactionNew(struct SoftMixerT_ * api, const char*);

extern void AlsaMixerTransactionDelete(AlsaMixerTransaction * transaction);

extern void AlsaMixerTransactionDataListDestroy(AlsaMixerTransaction*);

extern bool AlsaMixerTransactionObjectAdd(AlsaMixerTransaction*, void * object, AlsaTransactionDestructor destructor);

extern void AlsaMixerTransactionObjectForget(AlsaMixerTransaction* list, void * object);

extern void AlsaMixerTransactionDoCleanup(AlsaMixerTransaction*);

extern bool AlsaMixerTransactionVerbCreate(AlsaMixerTransaction*);

extern void AlsaMixerTransactionVerbCB(afb_req_t request);

#endif /* __INC_ALSA_TRANSACTION_H */