Max 5 API Reference
![]() |
Functions | |
float | swapf32 (float f) |
Byte swaps 32 bit floating point number. | |
double | swapf64 (double f) |
Byte swaps 64 bit floating point number. | |
void | jit_global_critical_enter (void) |
Enters the global Jitter critical region. | |
void | jit_global_critical_exit (void) |
Exits the global Jitter critical region. | |
void | jit_error_sym (void *x, t_symbol *s) |
Sends symbol based error message to Max console (safe from all threads). | |
void | jit_error_code (void *x, t_jit_err v) |
Sends error code based error message to Max console (safe from all threads). | |
void | jit_post_sym (void *x, t_symbol *s) |
Sends symbol based message to Max console (safe from all threads). | |
t_jit_err | jit_err_from_max_err (t_max_err err) |
Converts Max style error codes to Jitter style error codes. | |
void | jit_rand_setseed (long n) |
Sets global random number generator seed. | |
long | jit_rand (void) |
Generates a random value as a signed long integer. |
t_jit_err jit_err_from_max_err | ( | t_max_err | err | ) |
Converts Max style error codes to Jitter style error codes.
err | Max error code |
Definition at line 2251 of file jit.foundation.c.
References MAX_ERR_DUPLICATE, MAX_ERR_GENERIC, MAX_ERR_INVALID_PTR, MAX_ERR_NONE, and MAX_ERR_OUT_OF_MEM.
Referenced by jit_attr_setchar_array(), jit_attr_setdouble_array(), jit_attr_setfloat(), jit_attr_setfloat_array(), jit_attr_setlong(), jit_attr_setlong_array(), jit_attr_setsym(), jit_attr_setsym_array(), jit_class_addadornment(), jit_class_addattr(), jit_class_addmethod(), jit_class_addtypedwrapper(), jit_class_free(), jit_class_method_addargsafe(), jit_class_register(), jit_object_detach(), jit_object_free(), and jit_object_unregister().
void jit_error_code | ( | void * | x, | |
t_jit_err | v | |||
) |
Sends error code based error message to Max console (safe from all threads).
x | object pointer | |
v | error code |
Definition at line 2216 of file jit.foundation.c.
References defer().
Referenced by max_jit_attr_getdump(), and max_jit_mop_jit_matrix().
void jit_error_sym | ( | void * | x, | |
t_symbol * | s | |||
) |
Sends symbol based error message to Max console (safe from all threads).
x | object pointer | |
s | error message symbol |
Definition at line 2145 of file jit.foundation.c.
References defer().
void jit_global_critical_enter | ( | void | ) |
Enters the global Jitter critical region.
This function is useful for simple protection of thread sensitive operations. However, it may be too broad a lock, as it prevents any other operations that use the global critical region from working. For more localized control, I would suggest using either MaxMSP's systhread API or the platform specific locking mechanisms however, be sensitive to the possibility deadlock when locking code which calls code which may require the locking off unknown resources.
Definition at line 25 of file jit.critical.c.
References critical_enter().
Referenced by jit_linklist_append(), jit_linklist_chuck(), jit_linklist_chuckindex(), jit_linklist_clear(), jit_linklist_deleteindex(), jit_linklist_findall(), jit_linklist_findcount(), jit_linklist_findfirst(), jit_linklist_getindex(), jit_linklist_insertindex(), jit_linklist_makearray(), jit_linklist_methodall(), jit_linklist_objptr2index(), jit_linklist_reverse(), jit_linklist_rotate(), jit_linklist_shuffle(), jit_linklist_sort(), and jit_linklist_swap().
void jit_global_critical_exit | ( | void | ) |
Exits the global Jitter critical region.
This function is useful for simple protection of thread sensitive operations. However, it may be too broad a lock, as it prevents any other operations that use the global critical region from working. For more localized control, I would suggest using either MaxMSP's systhread API or the platform specific locking mechanisms however, be sensitive to the possibility deadlock when locking code which calls code which may require the locking off unknown resources.
Definition at line 44 of file jit.critical.c.
References critical_exit().
Referenced by jit_linklist_append(), jit_linklist_chuck(), jit_linklist_chuckindex(), jit_linklist_clear(), jit_linklist_deleteindex(), jit_linklist_findall(), jit_linklist_findcount(), jit_linklist_findfirst(), jit_linklist_getindex(), jit_linklist_insertindex(), jit_linklist_makearray(), jit_linklist_methodall(), jit_linklist_objptr2index(), jit_linklist_reverse(), jit_linklist_rotate(), jit_linklist_shuffle(), jit_linklist_sort(), and jit_linklist_swap().
void jit_post_sym | ( | void * | x, | |
t_symbol * | s | |||
) |
Sends symbol based message to Max console (safe from all threads).
x | object pointer | |
s | message symbol |
Definition at line 2236 of file jit.foundation.c.
References defer().
long jit_rand | ( | void | ) |
Generates a random value as a signed long integer.
Definition at line 48 of file jit.rand.c.
Referenced by jit_linklist_shuffle().
void jit_rand_setseed | ( | long | n | ) |
Sets global random number generator seed.
n | seed |
Definition at line 32 of file jit.rand.c.
References systime_ticks().
float swapf32 | ( | float | f | ) |
Byte swaps 32 bit floating point number.
f | input float |
Definition at line 21 of file jit.byteorder.c.
double swapf64 | ( | double | f | ) |
Byte swaps 64 bit floating point number.
f | input double |
Definition at line 42 of file jit.byteorder.c.