SG Com
SG.h
Go to the documentation of this file.
1#ifndef SG_H
2#define SG_H
3
4#include <stdint.h>
5
8#ifdef BUILDING_DLL
10#if defined(_WIN32) | defined(__ORBIS__) | defined(__PROSPERO__)
11#define SG_DYN __declspec(dllexport)
12#else
14#define SG_DYN __attribute__ ((visibility ("default")))
15#endif
16#else
17#define SG_DYN
18#endif
19
20typedef unsigned long int sg_uniqueid;
21typedef unsigned int sg_size;
22typedef unsigned char sg_byte;
23typedef unsigned int sg_bool;
24
25#define SG_ARRAY_COUNT(arr) (sizeof(arr) / sizeof(arr[0]))
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
34 typedef enum {
39
43 typedef enum {
52
56 typedef enum {
61
65 typedef enum {
70
74 typedef struct SG_AnimationNode {
75 const char *name;
76 const char *node_namespace;
79 const char **channel_names;
82
87 typedef void(*SG_LoggingCallback) (const char *message);
88
94 static inline unsigned int get_audio_sample_rate( SG_AudioSampleRate audio_sample_rate ) {
95 switch ( audio_sample_rate ) {
96 case SG_AUDIO_8_KHZ:
97 return 8000;
98 case SG_AUDIO_12_KHZ:
99 return 12000;
100 case SG_AUDIO_16_KHZ:
101 return 16000;
102 case SG_AUDIO_24_KHZ:
103 return 24000;
104 case SG_AUDIO_32_KHZ:
105 return 32000;
107 return 44100;
108 case SG_AUDIO_48_KHZ:
109 return 48000;
110 default:
111 return 16000;
112 }
113 }
114
115#ifdef __cplusplus
116}
117#endif
118
119#endif // SG_H
unsigned int sg_size
Definition: SG.h:21
void(* SG_LoggingCallback)(const char *message)
Callback that will be called by an Engine to output log messages.
Definition: SG.h:87
unsigned char sg_byte
Definition: SG.h:22
SG_AudioSampleType
Enum of audio sample types.
Definition: SG.h:34
@ SG_AUDIO_INT_32
32 bit integer
Definition: SG.h:36
@ SG_AUDIO_FLOAT_32
32 bit float (IEEE 745 single precision binary32)
Definition: SG.h:37
@ SG_AUDIO_INT_16
16 bit integer
Definition: SG.h:35
unsigned long int sg_uniqueid
Definition: SG.h:20
SG_AnimationNodeType
Enum of animation node types.
Definition: SG.h:65
@ SG_CONTROL
Definition: SG.h:68
@ SG_JOINT
Definition: SG.h:66
@ SG_BLENDSHAPE
Definition: SG.h:67
unsigned int sg_bool
Definition: SG.h:23
struct SG_AnimationNode SG_AnimationNode
Structure containing an animation node.
SG_AudioSampleRate
Enum of audio sample rates.
Definition: SG.h:43
@ SG_AUDIO_12_KHZ
12 kHz
Definition: SG.h:45
@ SG_AUDIO_48_KHZ
48 kHz
Definition: SG.h:50
@ SG_AUDIO_8_KHZ
8 kHz
Definition: SG.h:44
@ SG_AUDIO_16_KHZ
16 kHz
Definition: SG.h:46
@ SG_AUDIO_24_KHZ
24 kHz
Definition: SG.h:47
@ SG_AUDIO_32_KHZ
32 kHz
Definition: SG.h:48
@ SG_AUDIO_44_1_KHZ
44.1 kHz
Definition: SG.h:49
static unsigned int get_audio_sample_rate(SG_AudioSampleRate audio_sample_rate)
Function to convert SG_AudioSampleRate into an integer.
Definition: SG.h:94
SG_LoggingLevel
Enum for logging level.
Definition: SG.h:56
@ SG_LOGLEVEL_NONE
No logging enabled, default.
Definition: SG.h:57
@ SG_LOGLEVEL_DEBUG
All information will be logged.
Definition: SG.h:59
@ SG_LOGLEVEL_ERROR
Only errors will be logged.
Definition: SG.h:58
Structure containing an animation node.
Definition: SG.h:74
SG_AnimationNodeType type
Type of the node.
Definition: SG.h:77
float * channel_values
Current values of the animation channels.
Definition: SG.h:80
const char ** channel_names
Names of the animation channels.
Definition: SG.h:79
sg_size num_channels
Number of animation channels.
Definition: SG.h:78
const char * node_namespace
Namespace of the node.
Definition: SG.h:76
const char * name
Unique name of the node.
Definition: SG.h:75