Skip to content

Commit

Permalink
update to 1.5.2.5/10.2 chugin.h
Browse files Browse the repository at this point in the history
  • Loading branch information
gewang committed Jul 23, 2024
1 parent 7d9d24b commit 7b9027f
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions chuck/include/chugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
// 1.5.0.0 (ge) | moved to chuck.h for at-a-glance visibility
// 1.5.2.0 (ge) | moved to chuck_def.h for chugins headers streamlining
//-----------------------------------------------------------------------------
#define CHUCK_VERSION_STRING "1.5.2.4 (chai)"
#define CHUCK_VERSION_STRING "1.5.2.5 (chai)"
//-----------------------------------------------------------------------------


Expand Down Expand Up @@ -1158,7 +1158,7 @@ struct a_Program_ { a_Section section; a_Program next; uint32_t line; uint32_t w
#define CK_DLL_VERSION_MAJOR (10)
// minor API version: revisions
// minor API version of chuck must >= API version of chugin
#define CK_DLL_VERSION_MINOR (1)
#define CK_DLL_VERSION_MINOR (2)
#define CK_DLL_VERSION_MAKE(maj,min) ((t_CKUINT)(((maj) << 16) | (min)))
#define CK_DLL_VERSION_GETMAJOR(v) (((v) >> 16) & 0xFFFF)
#define CK_DLL_VERSION_GETMINOR(v) ((v) & 0xFFFF)
Expand Down Expand Up @@ -1435,6 +1435,8 @@ typedef t_CKBOOL (CK_DLL_CALL * f_tock)( Chuck_Object * SELF, Chuck_UAna * UANA,
typedef t_CKBOOL (CK_DLL_CALL * f_mainthreadhook)( void * bindle );
// "main thread" quit (stop running hook)
typedef t_CKBOOL (CK_DLL_CALL * f_mainthreadquit)( void * bindle );
// callback function, called on host shutdown
typedef void (CK_DLL_CALL * f_callback_on_shutdown)( void * bindle );
// shreds watcher callback
typedef void (CK_DLL_CALL * f_shreds_watcher)( Chuck_VM_Shred * SHRED, t_CKINT CODE, t_CKINT PARAM, Chuck_VM * VM, void * BINDLE );
// type instantiation callback
Expand Down Expand Up @@ -1509,6 +1511,8 @@ typedef void (CK_DLL_CALL * f_add_ugen_funcf_auto_num_channels)( Chuck_DL_Query
typedef t_CKBOOL (CK_DLL_CALL * f_end_class)( Chuck_DL_Query * query );
// create main thread hook- used for executing a "hook" function in the main thread of a primary chuck instance
typedef Chuck_DL_MainThreadHook * (CK_DLL_CALL * f_create_main_thread_hook)( Chuck_DL_Query * query, f_mainthreadhook hook, f_mainthreadquit quit, void * bindle );
// register a callback to be called on host shutdown, e.g., for chugin cleanup
typedef void (CK_DLL_CALL * f_register_callback_on_shutdown)( Chuck_DL_Query * query, f_callback_on_shutdown cb, void * bindle );
// register a callback function to receive notification from the VM about shreds (add, remove, etc.)
typedef void (CK_DLL_CALL * f_register_shreds_watcher)( Chuck_DL_Query * query, f_shreds_watcher cb, t_CKUINT options, void * bindle );
// unregister a shreds notification callback
Expand Down Expand Up @@ -1684,6 +1688,14 @@ struct Chuck_DL_Query
// -------------
f_create_main_thread_hook create_main_thread_hook;

public:
// -------------
// register a function to be run on host shutdown; this can be used
// for chugin cleanup when the host (chuck, miniAudicle, etc.) exits
// including on SIGINT (ctrl-c termination) | added 1.5.2.5 (ge)
// -------------
f_register_callback_on_shutdown register_callback_on_shutdown;

public:
// -------------
// register callback to be invoked by chuck host at various
Expand Down Expand Up @@ -2107,31 +2119,41 @@ struct Chuck_DL_Api
// array_int operations
t_CKINT (CK_DLL_CALL * const array_int_size)( ArrayInt array );
t_CKINT (CK_DLL_CALL * const array_int_get_idx)( ArrayInt array, t_CKINT idx );
void (CK_DLL_CALL *const array_int_set_idx)( ArrayInt array, t_CKINT idx, t_CKINT value );
t_CKBOOL (CK_DLL_CALL * const array_int_get_key)( ArrayInt array, const char * key, t_CKINT & value );
void (CK_DLL_CALL *const array_int_set_key)( ArrayInt array, const char *key, t_CKINT value );
t_CKBOOL (CK_DLL_CALL * const array_int_push_back)( ArrayInt array, t_CKINT value );
void (CK_DLL_CALL * const array_int_clear)( ArrayInt array );
// array_float operations
t_CKINT (CK_DLL_CALL * const array_float_size)( ArrayFloat array );
t_CKFLOAT (CK_DLL_CALL * const array_float_get_idx)( ArrayFloat array, t_CKINT idx );
void (CK_DLL_CALL *const array_float_set_idx)( ArrayFloat array, t_CKINT idx, t_CKFLOAT value );
t_CKBOOL (CK_DLL_CALL * const array_float_get_key)( ArrayFloat array, const char * key, t_CKFLOAT & value );
void (CK_DLL_CALL *const array_float_set_key)( ArrayFloat array, const char *key, t_CKFLOAT value );
t_CKBOOL (CK_DLL_CALL * const array_float_push_back)( ArrayFloat array, t_CKFLOAT value );
void (CK_DLL_CALL * const array_float_clear)(ArrayFloat array);
// array_vec2/complex/polar/16 operations | 1.5.2.0 (ge) added
t_CKINT (CK_DLL_CALL * const array_vec2_size)( ArrayVec2 array );
t_CKVEC2 (CK_DLL_CALL * const array_vec2_get_idx)( ArrayVec2 array, t_CKINT idx );
void (CK_DLL_CALL *const array_vec2_set_idx)( ArrayVec2 array, t_CKINT idx, t_CKVEC2 value );
t_CKBOOL (CK_DLL_CALL * const array_vec2_get_key)( ArrayVec2 array, const char * key, t_CKVEC2 & value );
void (CK_DLL_CALL *const array_vec2_set_key)( ArrayVec2 array, const char *key, t_CKVEC2 value );
t_CKBOOL (CK_DLL_CALL * const array_vec2_push_back)( ArrayVec2 array, const t_CKVEC2 & value );
void (CK_DLL_CALL * const array_vec2_clear)(ArrayVec2 array);
// array_vec3/24 operations | 1.5.2.0 (ge) added
t_CKINT (CK_DLL_CALL * const array_vec3_size)( ArrayVec3 array );
t_CKVEC3 (CK_DLL_CALL * const array_vec3_get_idx)( ArrayVec3 array, t_CKINT idx );
void (CK_DLL_CALL *const array_vec3_set_idx)( ArrayVec3 array, t_CKINT idx, t_CKVEC3 value );
t_CKBOOL (CK_DLL_CALL * const array_vec3_get_key)( ArrayVec3 array, const char * key, t_CKVEC3 & value );
void (CK_DLL_CALL *const array_vec3_set_key)( ArrayVec3 array, const char *key, t_CKVEC3 value );
t_CKBOOL (CK_DLL_CALL * const array_vec3_push_back)( ArrayVec3 array, const t_CKVEC3 & value );
void (CK_DLL_CALL * const array_vec3_clear)(ArrayVec3 array);
// array_vec4/32 operations | 1.5.2.0 (ge) added
t_CKINT (CK_DLL_CALL * const array_vec4_size)( ArrayVec4 array );
t_CKVEC4 (CK_DLL_CALL * const array_vec4_get_idx)( ArrayVec4 array, t_CKINT idx );
void (CK_DLL_CALL *const array_vec4_set_idx)( ArrayVec4 array, t_CKINT idx, t_CKVEC4 value );
t_CKBOOL (CK_DLL_CALL * const array_vec4_get_key)( ArrayVec4 array, const char * key, t_CKVEC4 & value );
void (CK_DLL_CALL *const array_vec4_set_key)( ArrayVec4 array, const char *key, t_CKVEC4 value );
t_CKBOOL (CK_DLL_CALL * const array_vec4_push_back)( ArrayVec4 array, const t_CKVEC4 & value );
void (CK_DLL_CALL * const array_vec4_clear)(ArrayVec4 array);
// (UNSAFE) get c++ vector pointers from chuck arrays | 1.5.2.0
Expand Down

0 comments on commit 7b9027f

Please sign in to comment.