|
JackUtils 0.5
Provides simplified Jack API for clients :)
|
This module allows you to wrap your variable in code to allow it's easy rendering, saving and loading from/to file. More...
Data Structures | |
| struct | ju_varclass |
| class of variable. More... | |
| struct | ju_var_s |
| Variable shared structure. More... | |
Typedefs | |
| typedef struct ju_var_s | ju_var_t |
| simple wraper... | |
Functions | |
| JU_API ju_var_t | ju_var_nil () |
| Creates ZERO variable to show end of variables array. More... | |
| JU_API ju_var_t | ju_var_float_rw (ju_cstr_t name, float *val, float min, float max) |
| Creates modifyable float variable :) More... | |
| JU_API ju_var_t | ju_var_float_ro (ju_cstr_t name, float *val) |
| Creates readonly float variable :) It will not be saved/parsed and changed anyhow! More... | |
| JU_API void | ju_vars_lock () |
| A common way to protect your variables in multithread world :) ONLY in space between calling ju_vars_lock() and ju_vars_unlock() you may read and modify your variables. More... | |
| JU_API void | ju_vars_unlock () |
| See ju_vars_lock()! It is important! | |
| JU_API int | ju_vars_save (ju_cstr_t filename, ju_var_t *vararr) |
| Saves your variables into the file. More... | |
| JU_API int | ju_vars_load (ju_cstr_t filename, ju_var_t *vararr) |
| Loads your variables from the file. More... | |
| JU_API int | ju_vars_draw (jg_ctx_t *u, ju_var_t *vararr, int eh) |
| Renders (and probably processes) your variables. More... | |
This module allows you to wrap your variable in code to allow it's easy rendering, saving and loading from/to file.
Creates readonly float variable :) It will not be saved/parsed and changed anyhow!
| name | name of the variable |
| val | POINTER on value of variable! |
Creates modifyable float variable :)
| name | name of the variable |
| val | POINTER on value of variable! |
| min | minimal float value |
| max | maximal float value |
| JU_API ju_var_t ju_var_nil | ( | ) |
Creates ZERO variable to show end of variables array.
| JU_API int ju_vars_draw | ( | jg_ctx_t * | u, |
| ju_var_t * | vararr, | ||
| int | eh | ||
| ) |
Renders (and probably processes) your variables.
| u | JackGUI context |
| vararr | array of variables. MUST termitates with ju_var_nil()! |
| eh | height oh each element! |
References ju_var_s::_vp, ju_var_s::name, ju_varclass::render, and ju_varclass::widthratio.
Loads your variables from the file.
| filename | self-describing |
| vararr | array of variables. MUST termitates with ju_var_nil()! |
References ju_var_s::_vp, ju_var_s::name, and ju_varclass::parse.
| JU_API void ju_vars_lock | ( | ) |
A common way to protect your variables in multithread world :) ONLY in space between calling ju_vars_lock() and ju_vars_unlock() you may read and modify your variables.
Direct acess in one thread without locking, but locking in other, or direct acess everywhere is UNDEFINED BEHAVIOUR.
A cost of lock is much smaller than cost of hours of debugging :) believe me.
Saves your variables into the file.
| filename | self-describing |
| vararr | array of variables. MUST termitates with ju_var_nil()! |
References ju_var_s::_vp, ju_var_s::name, and ju_varclass::write.