summaryrefslogtreecommitdiffstats
path: root/plugins/alsa/alsa-transaction.h
blob: ba45ae711c2886591424d77dfd4437a5792b6dbd (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
43
#ifndef __INC_ALSA_TRANSACTION_H
#define __INC_ALSA_TRANSACTION_H

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

#include "afb-definitions.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 bool AlsaMixerTransactionObjectAddTail(AlsaMixerTransaction* list, void* object, AlsaTransactionDestructor destructor);

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

extern void AlsaMixerTransactionDoCleanup(AlsaMixerTransaction*);

extern bool AlsaMixerTransactionVerbCreate(AlsaMixerTransaction*);

extern void AlsaMixerTransactionVerbCB(AFB_ReqT request);

#endif /* __INC_ALSA_TRANSACTION_H */