refactor: extract project related functions to project.c
This commit is contained in:
+37
-3
@@ -29,6 +29,8 @@ typedef struct StringArray {
|
||||
unsigned int length;
|
||||
} StringArray;
|
||||
|
||||
// args.c
|
||||
|
||||
typedef struct Parameters {
|
||||
char project_path[STR_LEN];
|
||||
char config_file[STR_LEN];
|
||||
@@ -51,9 +53,7 @@ typedef struct Parameters {
|
||||
bool trace_fps;
|
||||
} Parameters;
|
||||
|
||||
typedef struct Vertex {
|
||||
vec2 pos;
|
||||
} Vertex;
|
||||
// file.c
|
||||
|
||||
typedef struct File {
|
||||
char path[STR_LEN];
|
||||
@@ -65,6 +65,12 @@ typedef struct File {
|
||||
|
||||
typedef ARRAY(FileArray, File);
|
||||
|
||||
// shaders.c
|
||||
|
||||
typedef struct Vertex {
|
||||
vec2 pos;
|
||||
} Vertex;
|
||||
|
||||
typedef struct ShaderProgram {
|
||||
bool error;
|
||||
|
||||
@@ -121,6 +127,8 @@ typedef struct ShaderProgram {
|
||||
EGLDisplay egl_display;
|
||||
} ShaderProgram;
|
||||
|
||||
// video.c
|
||||
|
||||
typedef struct VideoCapture {
|
||||
char name[STR_LEN];
|
||||
bool error;
|
||||
@@ -137,8 +145,12 @@ typedef struct VideoCapture {
|
||||
|
||||
typedef ARRAY(VideoCaptureArray, VideoCapture);
|
||||
|
||||
// window.c
|
||||
|
||||
typedef GLFWwindow Window;
|
||||
|
||||
// tempo.c
|
||||
|
||||
typedef struct Tempo {
|
||||
long last_reset;
|
||||
long last_tap;
|
||||
@@ -150,6 +162,8 @@ typedef struct Tempo {
|
||||
float tempo;
|
||||
} Tempo;
|
||||
|
||||
// context.c
|
||||
|
||||
typedef struct SharedContext {
|
||||
int fd;
|
||||
|
||||
@@ -176,6 +190,8 @@ typedef struct SharedContext {
|
||||
bool stop;
|
||||
} SharedContext;
|
||||
|
||||
// state.c
|
||||
|
||||
typedef struct StateConfig {
|
||||
unsigned int state_max;
|
||||
|
||||
@@ -194,12 +210,16 @@ typedef struct StateConfig {
|
||||
unsigned int tap_tempo_code;
|
||||
} StateConfig;
|
||||
|
||||
// timer.c
|
||||
|
||||
typedef struct Timer {
|
||||
struct timeval start;
|
||||
unsigned int counter;
|
||||
unsigned int target;
|
||||
} Timer;
|
||||
|
||||
// config.c
|
||||
|
||||
typedef struct ConfigFile {
|
||||
struct hashmap *map;
|
||||
} ConfigFile;
|
||||
@@ -209,6 +229,8 @@ typedef struct ConfigFileItem {
|
||||
char value[STR_LEN];
|
||||
} ConfigFileItem;
|
||||
|
||||
// midi.c
|
||||
|
||||
typedef struct MidiDevice {
|
||||
bool error;
|
||||
char name[STR_LEN];
|
||||
@@ -216,4 +238,16 @@ typedef struct MidiDevice {
|
||||
snd_rawmidi_t *output;
|
||||
} MidiDevice;
|
||||
|
||||
// project.c
|
||||
|
||||
typedef struct Project {
|
||||
bool error;
|
||||
ConfigFile config;
|
||||
StateConfig state_config;
|
||||
FileArray fragment_shaders;
|
||||
File common_shader_code; // TODO change
|
||||
unsigned int frag_count;
|
||||
unsigned int in_count;
|
||||
} Project;
|
||||
|
||||
#endif /* TYPES_H */
|
||||
Reference in New Issue
Block a user