-
Notifications
You must be signed in to change notification settings - Fork 16
/
CNFA_null.c
46 lines (37 loc) · 1.03 KB
/
CNFA_null.c
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
44
45
//Copyright 2015-2020 <>< Charles Lohr under the ColorChord License.
#include "CNFA.h"
#include "os_generic.h"
#include <stdlib.h>
struct CNFADriverNull
{
void (*CloseFn)( void * object );
int (*StateFn)( void * object );
CNFACBType callback;
short channelsPlay;
short channelsRec;
int spsPlay;
int spsRec;
void * opaque;
};
void CloseCNFANull( void * object )
{
free( object );
}
int CNFAStateNull( void * object )
{
return 0;
}
void * InitCNFANull( CNFACBType cb, const char * your_name, int reqSPSPlay, int reqSPSRec, int reqChannelsPlay, int reqChannelsRec, int sugBufferSize, const char * outputSelect, const char * inputSelect, void * opaque )
{
struct CNFADriverNull * r = (struct CNFADriverNull *)malloc( sizeof( struct CNFADriverNull ) );
r->CloseFn = CloseCNFANull;
r->StateFn = CNFAStateNull;
r->callback = cb;
r->spsPlay = reqSPSPlay;
r->spsRec = reqSPSRec;
r->opaque = opaque;
r->channelsPlay = reqChannelsPlay;
r->channelsRec = reqChannelsRec;
return r;
}
REGISTER_CNFA( NullCNFA, 1, "NULL", InitCNFANull );