leaf-global.h
1 /*
2  ==============================================================================
3 
4  leaf-global.h
5  Created: 24 Oct 2019 2:24:38pm
6  Author: Matthew Wang
7 
8  ==============================================================================
9  */
10 
11 #ifndef LEAF_GLOBAL_H_INCLUDED
12 #define LEAF_GLOBAL_H_INCLUDED
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 #include "leaf-mempool.h"
19 
20 #if _WIN32 || _WIN64
21 #include "..\leaf-config.h"
22 #else
23 #include "../leaf-config.h"
24 #endif
25 
31  struct LEAF
32  {
34  float sampleRate;
35  float invSampleRate;
36  int blockSize;
38  float (*random)(void);
40  tMempool mempool;
41  _tMempool _internal_mempool;
42  size_t header_size;
43  void (*errorCallback)(LEAF* const, LEAFErrorType);
44  int errorState[LEAFErrorNil];
45 
47  };
48 
49  //==============================================================================
50 
51 #ifdef __cplusplus
52 }
53 #endif
54 
55 #endif // LEAF_GLOBAL_H_INCLUDED
56 
57 //==============================================================================
58 
59 
LEAF::blockSize
int blockSize
The audio block size.
Definition: leaf-global.h:36
LEAF::errorState
int errorState[LEAFErrorNil]
An array of flags that indicate which errors have occurred.
Definition: leaf-global.h:44
LEAF::random
float(* random)(void)
A pointer to the random() function provided on initialization.
Definition: leaf-global.h:38
LEAF::clearOnAllocation
int clearOnAllocation
A flag that determines whether memory allocated from the LEAF memory pool will be cleared.
Definition: leaf-global.h:39
LEAF::twoPiTimesInvSampleRate
float twoPiTimesInvSampleRate
Two-pi times the inverse of the current sample rate.
Definition: leaf-global.h:37
LEAF::errorCallback
void(* errorCallback)(LEAF *const, LEAFErrorType)
A pointer to the callback function for LEAF errors. Can be set by the user.
Definition: leaf-global.h:43
LEAF::mempool
tMempool mempool
The default LEAF mempool object.
Definition: leaf-global.h:40
LEAF::sampleRate
float sampleRate
The current audio sample rate. Set with LEAF_setSampleRate().
Definition: leaf-global.h:34
LEAF::header_size
size_t header_size
The size in bytes of memory region headers within mempools.
Definition: leaf-global.h:42
LEAF::invSampleRate
float invSampleRate
The inverse of the current sample rate.
Definition: leaf-global.h:35
LEAF
Struct for an instance of LEAF.
Definition: leaf-global.h:31