├── .gitignore ├── LICENSE.md ├── README.md ├── c74support ├── c74_jitter.h ├── c74_max.h ├── c74_msp.h ├── c74_ui.h ├── c74_ui_graphics.h ├── jit-includes │ ├── JitterAPI.framework │ │ ├── JitterAPI │ │ ├── Resources │ │ └── Versions │ │ │ ├── A │ │ │ ├── JitterAPI │ │ │ └── Resources │ │ │ │ ├── Info.plist │ │ │ │ └── JitterAPI.rsrc │ │ │ └── Current │ ├── jit.bin.h │ ├── jit.byteorder.h │ ├── jit.common.h │ ├── jit.cpost.h │ ├── jit.critical.h │ ├── jit.cubicspline.h │ ├── jit.error.h │ ├── jit.file.h │ ├── jit.fixmath.h │ ├── jit.functor.h │ ├── jit.gl.cache.h │ ├── jit.gl.chunk.h │ ├── jit.gl.common.h │ ├── jit.gl.context.h │ ├── jit.gl.context.view.h │ ├── jit.gl.draw.h │ ├── jit.gl.drawinfo.h │ ├── jit.gl.h │ ├── jit.gl.ob3d.h │ ├── jit.gl.pixelformat.h │ ├── jit.gl.procs.h │ ├── jit.gl.support.h │ ├── jit.glext.h │ ├── jit.glext_nv.h │ ├── jit.gworld.h │ ├── jit.half.h │ ├── jit.linklist.h │ ├── jit.mac.h │ ├── jit.math.h │ ├── jit.matrix.util.h │ ├── jit.max.h │ ├── jit.namespace.h │ ├── jit.op.h │ ├── jit.parallel.utils.h │ ├── jit.platform.h │ ├── jit.symbols.h │ ├── jit.vecmath.h │ ├── jit.wglext.h │ ├── jit.window.h │ ├── max.jit.mop.h │ └── x64 │ │ └── jitlib.lib ├── max-includes │ ├── MaxAPI.framework │ │ ├── MaxAPI │ │ ├── Resources │ │ └── Versions │ │ │ ├── A │ │ │ ├── MaxAPI │ │ │ └── Resources │ │ │ │ ├── English.lproj │ │ │ │ └── InfoPlist.strings │ │ │ │ └── Info.plist │ │ │ └── Current │ ├── c74_linker_flags.txt │ ├── common │ │ ├── basic_c_strings.c │ │ ├── commonsyms.c │ │ ├── commonsyms_max4.c │ │ ├── commonsyms_max4.h │ │ ├── dllmain_win.c │ │ ├── dummy.cpp │ │ ├── ext_byteorder.c │ │ ├── jpatcher_syms.c │ │ └── verinfo_win.rc │ ├── commonsyms.h │ ├── ext.h │ ├── ext_anim.h │ ├── ext_assist.h │ ├── ext_atomarray.h │ ├── ext_atombuf.h │ ├── ext_atomic.h │ ├── ext_backgroundtask.h │ ├── ext_boxstyle.h │ ├── ext_byteorder.h │ ├── ext_charset.h │ ├── ext_colors.h │ ├── ext_common.h │ ├── ext_critical.h │ ├── ext_database.h │ ├── ext_default.h │ ├── ext_dictionary.h │ ├── ext_dictobj.h │ ├── ext_drag.h │ ├── ext_dynamiccolor.h │ ├── ext_event.h │ ├── ext_expr.h │ ├── ext_fun.h │ ├── ext_globalsymbol.h │ ├── ext_hashtab.h │ ├── ext_infer_system.h │ ├── ext_itm.h │ ├── ext_linklist.h │ ├── ext_maxtypes.h │ ├── ext_menu.h │ ├── ext_mess.h │ ├── ext_midi.h │ ├── ext_numc.h │ ├── ext_obex.h │ ├── ext_obex_util.h │ ├── ext_obstring.h │ ├── ext_oms.h │ ├── ext_packages.h │ ├── ext_parameter.h │ ├── ext_path.h │ ├── ext_post.h │ ├── ext_preferences.h │ ├── ext_prefix.h │ ├── ext_prefix_includes.h │ ├── ext_preprocessor.h │ ├── ext_proto.h │ ├── ext_proto_win.h │ ├── ext_quickmap.h │ ├── ext_sndfile.h │ ├── ext_strings.h │ ├── ext_support.h │ ├── ext_symobject.h │ ├── ext_sysfile.h │ ├── ext_sysmem.h │ ├── ext_sysmidi.h │ ├── ext_sysparallel.h │ ├── ext_sysprocess.h │ ├── ext_syssem.h │ ├── ext_sysshmem.h │ ├── ext_systhread.h │ ├── ext_systime.h │ ├── ext_time.h │ ├── ext_timeline.h │ ├── ext_track.h │ ├── ext_typelist.h │ ├── ext_user.h │ ├── ext_wind.h │ ├── ext_xmltree.h │ ├── indexmap.h │ ├── jdataview.h │ ├── jgraphics.h │ ├── jpatcher_api.h │ ├── jpatcher_syms.h │ ├── jpatcher_utils.h │ ├── macho-prefix.pch │ ├── max_keydefs.h │ ├── max_types.h │ └── x64 │ │ └── MaxAPI.lib └── msp-includes │ ├── MaxAudioAPI.framework │ ├── MaxAudioAPI │ ├── Resources │ └── Versions │ │ ├── A │ │ ├── MaxAudioAPI │ │ └── Resources │ │ │ └── Info.plist │ │ └── Current │ ├── MaxAudioAPI.h │ ├── buffer.h │ ├── ext_buffer.h │ ├── r_pfft.h │ ├── x64 │ └── MaxAudio.lib │ ├── z_altivec.h │ ├── z_dsp.h │ └── z_sampletype.h └── script ├── GetGitRevisionDescription.cmake ├── GetGitRevisionDescription.cmake.in ├── Info.plist.in ├── PkgInfo ├── excludefromcollectives.json ├── git-rev.cmake ├── max-linker-flags.txt ├── max-package.cmake ├── max-posttarget.cmake ├── max-pretarget.cmake └── verinfo.rc.in /.gitignore: -------------------------------------------------------------------------------- 1 | /script/verinfo.rc 2 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021, Cycling '74. 2 | All rights reserved. 3 | 4 | The software to which this license pertains is the Max SDK that consists of the C language header files and source code examples contained within this archive. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # max-sdk-base 2 | This folder contains the headers, libs, and script files you will need to compile an external object written in C or C++ used by the [Max Software Development Kit](https://github.com/Cycling74/max-sdk) and [Min-DevKit Package](https://github.com/Cycling74/min-devkit). Please refer to those repositories for additional documentation and best practices. 3 | 4 | ## Overview of Contents 5 | 6 | * `c74support` : header and lib files 7 | * `script` : resources to be included and used by CMake 8 | 9 | ## License 10 | 11 | See the accompanying `License.md` file. 12 | 13 | ## Support 14 | 15 | For support, please use the developer forums at: 16 | http://cycling74.com/forums/ -------------------------------------------------------------------------------- /c74support/c74_jitter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "c74_max.h" 4 | 5 | namespace c74 { 6 | namespace max { 7 | 8 | #ifdef C74_NO_SDK_BASE_SUBMODULE 9 | #include "jit.common.h" 10 | #include "max.jit.mop.h" 11 | #else 12 | #include "jit-includes/jit.common.h" 13 | #include "jit-includes/max.jit.mop.h" 14 | #endif 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /c74support/c74_max.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | // include this outside of the namespace, and 10 | // before any Max headers can include ext_prefix.h 11 | #include "ext_prefix_includes.h" 12 | 13 | namespace c74 { 14 | namespace max { 15 | 16 | #define calcoffset(x,y) ((c74::max::t_ptr_int)(&(((x *)0L)->y))) 17 | 18 | #ifdef C74_NO_SDK_BASE_SUBMODULE 19 | #include "ext.h" 20 | #include "ext_dictobj.h" 21 | #include "ext_time.h" 22 | #include "commonsyms.h" 23 | #include "jgraphics.h" 24 | #include "ext_parameter.h" 25 | #include "ext_boxstyle.h" 26 | #else 27 | #include "max-includes/ext.h" 28 | #include "max-includes/ext_dictobj.h" 29 | #include "max-includes/ext_time.h" 30 | #include "max-includes/commonsyms.h" 31 | #include "max-includes/jgraphics.h" 32 | #include "max-includes/ext_parameter.h" 33 | #include "max-includes/ext_boxstyle.h" 34 | #endif 35 | 36 | #undef min 37 | #undef max 38 | 39 | static const int ASSIST_STRING_MAXSIZE = 256; 40 | 41 | } 42 | } 43 | 44 | // necessary to redefine this outside of the namespace 45 | BEGIN_USING_C_LINKAGE 46 | /** ext_main() is the entry point for an extern to be loaded, which all externs must implement 47 | this shared/common prototype ensures that it will be exported correctly on all platforms. 48 | 49 | @ingroup class 50 | @param r Pointer to resources for the external, if applicable. 51 | @see @ref chapter_anatomy 52 | @version Introduced in Max 6.1.9 53 | */ 54 | void C74_EXPORT ext_main(void *r); 55 | END_USING_C_LINKAGE 56 | -------------------------------------------------------------------------------- /c74support/c74_msp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "c74_max.h" 4 | 5 | namespace c74 { 6 | namespace max { 7 | 8 | #ifdef C74_NO_SDK_BASE_SUBMODULE 9 | #include "MaxAudioAPI.h" 10 | #include "ext_buffer.h" 11 | #else 12 | #include "msp-includes/MaxAudioAPI.h" 13 | #include "msp-includes/ext_buffer.h" 14 | #endif 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /c74support/c74_ui.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace c74 { 5 | namespace max { 6 | 7 | 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /c74support/c74_ui_graphics.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace c74 { 5 | namespace max { 6 | 7 | 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /c74support/jit-includes/JitterAPI.framework/JitterAPI: -------------------------------------------------------------------------------- 1 | Versions/Current/JitterAPI -------------------------------------------------------------------------------- /c74support/jit-includes/JitterAPI.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /c74support/jit-includes/JitterAPI.framework/Versions/A/JitterAPI: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cycling74/max-sdk-base/a9321e86fdb08d03da9fe4053f3accec4a775b6b/c74support/jit-includes/JitterAPI.framework/Versions/A/JitterAPI -------------------------------------------------------------------------------- /c74support/jit-includes/JitterAPI.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | JitterAPI 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.cycling74.JitterAPI 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.7.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.7.0 23 | CSResourcesFileMapped 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /c74support/jit-includes/JitterAPI.framework/Versions/A/Resources/JitterAPI.rsrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cycling74/max-sdk-base/a9321e86fdb08d03da9fe4053f3accec4a775b6b/c74support/jit-includes/JitterAPI.framework/Versions/A/Resources/JitterAPI.rsrc -------------------------------------------------------------------------------- /c74support/jit-includes/JitterAPI.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /c74support/jit-includes/jit.bin.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 4 | jit.bin.h 5 | Copyright 2001-2005 - Cycling '74 6 | Joshua Kit Clayton jkc@cycling74.com 7 | 8 | jit binary file format(similar to AIFF/RIFF) 9 | 10 | All multibyte integers/floats are stored in BigEndian format. 11 | 12 | All chunks have: 13 | 14 | ckid - 4 byte char string 15 | cksize - 32 bit int chunk size 16 | 17 | */ 18 | 19 | #ifndef _JIT_BIN_H_ 20 | #define _JIT_BIN_H_ 21 | 22 | #include "ext_prefix.h" 23 | #include "ext_mess.h" 24 | #include "ext_sysfile.h" 25 | #include "max_types.h" 26 | #include "jit.error.h" 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | #if C74_PRAGMA_STRUCT_PACKPUSH 33 | #pragma pack(push, 2) 34 | #elif C74_PRAGMA_STRUCT_PACK 35 | #pragma pack(2) 36 | #endif 37 | 38 | // misc constants 39 | enum { 40 | JIT_BIN_MAC_TYPE = FOUR_CHAR('JiT!'), 41 | 42 | JIT_BIN_VERSION_1 = 0x3C93DC80, //2002/03/17 00:00:00 UTC 43 | 44 | JIT_BIN_CHUNK_CONTAINER = FOUR_CHAR('FORM'), 45 | JIT_BIN_CHUNK_FORMAT_VERSION = FOUR_CHAR('FVER'), 46 | JIT_BIN_CHUNK_MATRIX = FOUR_CHAR('MTRX'), 47 | 48 | JIT_BIN_FORMAT = FOUR_CHAR('JIT!'), 49 | 50 | JIT_BIN_FILESIZE_UNKNOWN = 0xFFFFFFFF, 51 | 52 | JIT_BIN_TYPE_CHAR = FOUR_CHAR('CHAR'), 53 | JIT_BIN_TYPE_LONG = FOUR_CHAR('LONG'), 54 | JIT_BIN_TYPE_FLOAT32 = FOUR_CHAR('FL32'), 55 | JIT_BIN_TYPE_FLOAT64 = FOUR_CHAR('FL64'), 56 | 57 | JIT_BIN_HEADER_SIZE = (6*SIZE_INT32), 58 | JIT_BIN_CKINFO_SIZE = (2*SIZE_INT32) 59 | }; 60 | 61 | typedef struct _jit_bin_chunk_container 62 | { 63 | t_uint32 ckid; //'FORM' 64 | t_int32 cksize; //filesize 65 | t_uint32 formtype; //'JIT!' 66 | } t_jit_bin_chunk_container; 67 | 68 | typedef struct _jit_bin_chunk_format_version 69 | { 70 | t_uint32 ckid; //'FVER' 71 | t_int32 cksize; //12 72 | t_uint32 vers; //timestamp 73 | } t_jit_bin_chunk_format_version; 74 | 75 | typedef struct _jit_bin_chunk_matrix 76 | { 77 | t_uint32 ckid; //'MTRX' 78 | t_int32 cksize; //varies(should be equal to 24+(4*dimcount)+(typesize*planecount*totalpoints)) 79 | t_int32 offset; //data offset(should be equal to 24+(4*dimcount)) 80 | t_uint32 type; //'CHAR','LONG','FL32','FL64' 81 | t_int32 planecount; 82 | t_int32 dimcount; 83 | t_int32 dim[1]; 84 | } t_jit_bin_chunk_matrix; 85 | 86 | 87 | //later we can add things like variable/value pairs, attributes, 88 | //time code, comments, metadata, atom lists, audio, etc. 89 | 90 | t_jit_err jit_bin_read_header(t_filehandle fh, t_uint32 *version, t_int32 *filesize); 91 | t_jit_err jit_bin_read_chunk_info(t_filehandle fh, t_uint32 *ckid, t_int32 *cksize); 92 | t_jit_err jit_bin_read_matrix(t_filehandle fh, void *matrix); 93 | 94 | t_jit_err jit_bin_write_header(t_filehandle fh, t_int32 filesize); 95 | t_jit_err jit_bin_write_matrix(t_filehandle fh, void *matrix); 96 | 97 | 98 | #if C74_PRAGMA_STRUCT_PACKPUSH 99 | #pragma pack(pop) 100 | #elif C74_PRAGMA_STRUCT_PACK 101 | #pragma pack() 102 | #endif 103 | 104 | #ifdef __cplusplus 105 | } 106 | #endif 107 | 108 | #endif //_JIT_BIN_H_ 109 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.byteorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | jit.byteorder.h 3 | 4 | Copyright 2001-2005 - Cycling '74 5 | Joshua Kit Clayton jkc@cycling74.com 6 | 7 | */ 8 | 9 | #ifndef __JIT_BYTEORDER_H__ 10 | #define __JIT_BYTEORDER_H__ 11 | 12 | #include "ext_byteorder.h" 13 | 14 | #if (defined(WIN32) || TARGET_RT_LITTLE_ENDIAN || C74_LITTLE_ENDIAN || __i386__) 15 | #define JIT_LITTLE_ENDIAN 16 | #else 17 | #define JIT_BIG_ENDIAN 18 | #endif 19 | 20 | #define SWAP16(x) ((t_int16)(((((t_uint16)(x))>>8)&0x00ff)+((((t_uint16)(x))<<8)&0xff00))) 21 | #define SWAP32(x) ((t_int32)(((((t_uint32)(x))>>24L)&0x000000ff)+((((t_uint32)(x))>>8L)&0x0000ff00)+ \ 22 | ((((t_uint32)(x))<<24L)&0xff000000)+((((t_uint32)(x))<<8L)&0x00ff0000))) 23 | #define SWAPF32 swapf32 24 | #define SWAPF64 swapf64 25 | #define SWAPF32_PTR swap_pointer_32 26 | #define SWAPF64_PTR swap_pointer_64 27 | #define SWAPF32_PTR_TO_PTR swap_pointer_32_copy 28 | #define SWAPF64_PTR_TO_PTR swap_pointer_64_copy 29 | #define SWAPF32_FROM_PTR swap_pointer_32_to_float32 30 | #define SWAPF64_FROM_PTR swap_pointer_64_to_float64 31 | 32 | #ifdef JIT_BIG_ENDIAN 33 | #define LE_I16(x) SWAP16(x) 34 | #define LE_I32(x) SWAP32(x) 35 | #define LE_F32(x) SWAPF32(x) 36 | #define LE_F64(x) SWAPF64(x) 37 | #define LE_F32_PTR(x) SWAPF32_PTR((unsigned char *)(x)) 38 | #define LE_F64_PTR(x) SWAPF64_PTR((unsigned char *)(x)) 39 | #define LE_F32_FROM_PTR(x) SWAPF32_FROM_PTR((unsigned char *)(x)) 40 | #define LE_F64_FROM_PTR(x) SWAPF64_FROM_PTR((unsigned char *)(x)) 41 | #define LE_F32_PTR_TO_PTR(x,y) SWAPF32_PTR_TO_PTR((unsigned char *)(x),(unsigned char *)(y)) 42 | #define LE_F64_PTR_TO_PTR(x,y) SWAPF64_PTR_TO_PTR((unsigned char *)(x),(unsigned char *)(y)) 43 | #define BE_I16(x) (x) 44 | #define BE_I32(x) (x) 45 | #define BE_F32_PTR(x) 46 | #define BE_F64_PTR(x) 47 | #define BE_F32_FROM_PTR(x) (*(float *)(x)) 48 | #define BE_F64_FROM_PTR(x) (*(double *)(x)) 49 | #define BE_F32_PTR_TO_PTR(x,y) ((*(float *)(y))=(*(float *)(x))) 50 | #define BE_F64_PTR_TO_PTR(x,y) ((*(double *)(y))=(*(double *)(x))) 51 | #define FOUR_CHAR(x) (x) 52 | #else 53 | #define LE_I16(x) (x) 54 | #define LE_I32(x) (x) 55 | #define LE_F32(x) (x) 56 | #define LE_F64(x) (x) 57 | #define LE_F32_PTR(x) 58 | #define LE_F64_PTR(x) 59 | #define LE_F32_FROM_PTR(x) (*(float *)(x)) 60 | #define LE_F64_FROM_PTR(x) (*(double *)(x)) 61 | #define LE_F32_PTR_TO_PTR(x,y) ((*(float *)(y))=(*(float *)(x))) 62 | #define LE_F64_PTR_TO_PTR(x,y) ((*(double *)(y))=(*(double *)(x))) 63 | #define BE_I16(x) SWAP16(x) 64 | #define BE_I32(x) SWAP32(x) 65 | #define BE_F32_PTR(x) SWAPF32_PTR((unsigned char *)(x)) 66 | #define BE_F64_PTR(x) SWAPF64_PTR((unsigned char *)(x)) 67 | #define BE_F32_FROM_PTR(x) SWAPF32_FROM_PTR((unsigned char *)(x)) 68 | #define BE_F64_FROM_PTR(x) SWAPF64_FROM_PTR((unsigned char *)(x)) 69 | #define BE_F32_PTR_TO_PTR(x,y) SWAPF32_PTR_TO_PTR((unsigned char *)(x),(unsigned char *)(y)) 70 | #define BE_F64_PTR_TO_PTR(x,y) SWAPF64_PTR_TO_PTR((unsigned char *)(x),(unsigned char *)(y)) 71 | 72 | #define FOUR_CHAR(x) (x) 73 | #endif 74 | 75 | 76 | #ifdef __cplusplus 77 | extern "C" { 78 | #endif 79 | 80 | // OBSOLETE. don't use. not safe to pass byteswapped floats in registers 81 | float swapf32(float f); 82 | double swapf64(double f); 83 | 84 | // these functions are inplace 85 | void swap_pointer_16(unsigned char *p); 86 | void swap_pointer_32(unsigned char *p); 87 | void swap_pointer_64(unsigned char *p); 88 | // these function copy from one pointer to another (src!=dst) 89 | void swap_pointer_16_copy(unsigned char *src, unsigned char *dst); 90 | void swap_pointer_32_copy(unsigned char *src, unsigned char *dst); 91 | void swap_pointer_64_copy(unsigned char *src, unsigned char *dst); 92 | // these functions return floating point values from a byteswapped pointer 93 | float swap_pointer_32_to_float32(unsigned char *p); 94 | double swap_pointer_64_to_float64(unsigned char *p); 95 | 96 | 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | 101 | #endif // __JIT_BYTEORDER_H__ 102 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.cpost.h: -------------------------------------------------------------------------------- 1 | /* 2 | jit.cpost.h 3 | 4 | Copyright 2003 - Cycling '74 5 | Jeremy Bernstein jeremy@bootsquad.com 6 | 7 | */ 8 | 9 | #ifndef __JIT_CPOST_H__ 10 | #define __JIT_CPOST_H__ 11 | 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | void jit_cpost(const char *format, ...); 18 | 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | 25 | #endif //__JIT_CPOST_H__ 26 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.critical.h: -------------------------------------------------------------------------------- 1 | /* 2 | jit.critical.h 3 | 4 | Copyright 2001-2003 - Cycling '74 5 | Joshua Kit Clayton jkc@cycling74.com 6 | 7 | */ 8 | 9 | #ifndef __JIT_CRITICAL_H__ 10 | #define __JIT_CRITICAL_H__ 11 | 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | void jit_global_critical_enter(void); 18 | void jit_global_critical_exit(void); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.cubicspline.h: -------------------------------------------------------------------------------- 1 | #ifndef _JIT_CUBICSPLINE_H_ 2 | #define _JIT_CUBICSPLINE_H_ 3 | 4 | /* 5 | * Copyright 2001-2005 - Cycling '74 6 | * Derek Gerstmann - derek@cycling74.com 7 | * 8 | * Cubic spline evaluation and utility methods 9 | * 10 | */ 11 | 12 | // -------------------------------------------------------------------------- 13 | 14 | #include "ext_prefix.h" 15 | #include "ext_mess.h" 16 | #include "jit.error.h" 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #if C74_PRAGMA_STRUCT_PACKPUSH 23 | #pragma pack(push, 2) 24 | #elif C74_PRAGMA_STRUCT_PACK 25 | #pragma pack(2) 26 | #endif 27 | 28 | typedef t_int32 t_jit_cubicspline_basismatrix_fixed[4][4]; 29 | typedef float t_jit_cubicspline_basismatrix_float32[4][4]; 30 | typedef double t_jit_cubicspline_basismatrix_float64[4][4]; 31 | 32 | // -------------------------------------------------------------------------- 33 | 34 | extern t_symbol *ps_jit_cubicspline_basisname_bezier; 35 | extern t_symbol *ps_jit_cubicspline_basisname_bspline; 36 | extern t_symbol *ps_jit_cubicspline_basisname_catmullrom; 37 | extern t_symbol *ps_jit_cubicspline_basisname_hermite; 38 | extern t_symbol *ps_jit_cubicspline_basisname_power; 39 | 40 | 41 | // -------------------------------------------------------------------------- 42 | 43 | t_jit_err jit_cubicspline_fillbasis_fixed( 44 | t_symbol *name, t_jit_cubicspline_basismatrix_fixed *matrix, 45 | t_int32 *stepcount); 46 | 47 | t_jit_err jit_cubicspline_fillbasis_float32( 48 | t_symbol *name, t_jit_cubicspline_basismatrix_float32 *matrix, 49 | t_int32 *stepcount); 50 | 51 | t_jit_err jit_cubicspline_fillbasis_float64( 52 | t_symbol *name, t_jit_cubicspline_basismatrix_float64 *matrix, 53 | t_int32 *stepcount); 54 | 55 | t_int32 jit_cubicspline_general_eval_fixed( 56 | t_int32 val, t_int32 stepcount, t_int32 knotcount, t_int32 *knots, 57 | t_jit_cubicspline_basismatrix_fixed matrix); 58 | 59 | float jit_cubicspline_general_eval_float32( 60 | float val, t_int32 stepcount, t_int32 knotcount, float *knots, 61 | t_jit_cubicspline_basismatrix_float32 matrix); 62 | 63 | double jit_cubicspline_general_eval_float64( 64 | double val, t_int32 stepcount, t_int32 knotcount, double *knots, 65 | t_jit_cubicspline_basismatrix_float64 matrix); 66 | 67 | // -------------------------------------------------------------------------- 68 | 69 | 70 | #if C74_PRAGMA_STRUCT_PACKPUSH 71 | #pragma pack(pop) 72 | #elif C74_PRAGMA_STRUCT_PACK 73 | #pragma pack() 74 | #endif 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.error.h: -------------------------------------------------------------------------------- 1 | /* 2 | jit.error.h 3 | 4 | Copyright 2001-2005 - Cycling '74 5 | Joshua Kit Clayton jkc@cycling74.com 6 | 7 | */ 8 | 9 | #ifndef __JIT_ERROR_H__ 10 | #define __JIT_ERROR_H__ 11 | 12 | #include "ext_prefix.h" 13 | #include "ext_mess.h" 14 | #include "jit.byteorder.h" 15 | 16 | typedef t_atom_long t_jit_err; 17 | 18 | //errors 19 | enum t_jit_error_code { 20 | JIT_ERR_NONE = 0, 21 | JIT_ERR_GENERIC = FOUR_CHAR('EROR'), 22 | JIT_ERR_INVALID_OBJECT = FOUR_CHAR('INOB'), 23 | JIT_ERR_OBJECT_BUSY = FOUR_CHAR('OBSY'), 24 | JIT_ERR_OUT_OF_MEM = FOUR_CHAR('OMEM'), 25 | JIT_ERR_INVALID_PTR = FOUR_CHAR('INVP'), 26 | JIT_ERR_DUPLICATE = FOUR_CHAR('DUPL'), 27 | JIT_ERR_OUT_OF_BOUNDS = FOUR_CHAR('OBND'), 28 | JIT_ERR_INVALID_INPUT = FOUR_CHAR('INVI'), 29 | JIT_ERR_INVALID_OUTPUT = FOUR_CHAR('INVO'), 30 | JIT_ERR_MISMATCH_TYPE = FOUR_CHAR('MSTP'), 31 | JIT_ERR_MISMATCH_PLANE = FOUR_CHAR('MSPL'), 32 | JIT_ERR_MISMATCH_DIM = FOUR_CHAR('MSDM'), 33 | JIT_ERR_MATRIX_UNKNOWN = FOUR_CHAR('MXUN'), 34 | JIT_ERR_SUPPRESS_OUTPUT = FOUR_CHAR('SPRS'), 35 | JIT_ERR_DATA_UNAVAILABLE = FOUR_CHAR('DUVL'), 36 | JIT_ERR_HW_UNAVAILABLE = FOUR_CHAR('HUVL') 37 | }; 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | #define jit_catch(x) {t_jit_err _jit_catch_err; if (_jit_catch_err=(x)) { return _jit_catch_err; }} 44 | 45 | void jit_object_post(t_object *x, char *s, ...); 46 | void jit_object_error(t_object *x, char *s, ...); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif //__JIT_ERROR_H__ 53 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.file.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | jit.file.h 4 | Copyright 2001-2005 - Cycling '74 5 | Joshua Kit Clayton jkc@cycling74.com 6 | 7 | - platform independent file calls 8 | */ 9 | 10 | #ifndef _JIT_FILE_H_ 11 | #define _JIT_FILE_H_ 12 | 13 | #include "jit.error.h" 14 | 15 | typedef long t_jit_fileref; 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | t_jit_err jit_file_fsclose(t_jit_fileref refnum); 22 | t_jit_err jit_file_fsread(t_jit_fileref refnum, long *count, void *bufptr); 23 | t_jit_err jit_file_fswrite(t_jit_fileref refnum, long *count, const void *bufptr); 24 | t_jit_err jit_file_seteof(t_jit_fileref refnum, long logeof); 25 | t_jit_err jit_file_geteof(t_jit_fileref refnum, long *logeof); 26 | t_jit_err jit_file_setfpos(t_jit_fileref refnum, long mode, long offset); 27 | t_jit_err jit_file_getfpos(t_jit_fileref refnum, long *filepos); 28 | 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif /* _JIT_FILE_H_ */ 35 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.fixmath.h: -------------------------------------------------------------------------------- 1 | /* 2 | jit.fixmath.h 3 | 4 | Copyright 2001-2005 - Cycling '74 5 | Joshua Kit Clayton jkc@cycling74.com 6 | 7 | */ 8 | 9 | #ifndef __JIT_FIXMATH_H__ 10 | #define __JIT_FIXMATH_H__ 11 | 12 | #include "jit.error.h" 13 | #include "max_types.h" 14 | 15 | #if MAC_VERSION 16 | #include // we redefine some CarbonCore/FixMath.h symbols, so include early to avoid clashes 17 | #endif 18 | 19 | /* the following is to account for duplicates in GXMath.h */ 20 | 21 | #ifdef fixed1 22 | #undef fixed1 23 | #endif 24 | #ifdef IntToFixed 25 | #undef IntToFixed 26 | #endif 27 | #ifdef FloatToFixed 28 | #undef FloatToFixed 29 | #endif 30 | #ifdef FixedToInt 31 | #undef FixedToInt 32 | #endif 33 | #ifdef FixedToFloat 34 | #undef FixedToFloat 35 | #endif 36 | 37 | #ifndef __MACTYPES__ 38 | typedef t_int32 Fixed; 39 | typedef Fixed * FixedPtr; 40 | typedef t_int32 Fract; 41 | typedef Fract * FractPtr; 42 | typedef t_uint32 UnsignedFixed; 43 | typedef UnsignedFixed * UnsignedFixedPtr; 44 | typedef short ShortFixed; 45 | typedef ShortFixed * ShortFixedPtr; 46 | #endif 47 | 48 | #define fixed1 (1<<16L) 49 | #define fixedhalf (1<<15L) 50 | #define IntToFixed(x) ((Fixed)((x)<<16L)) 51 | #define FloatToFixed(x) ((Fixed)((x) * (float)fixed1)) 52 | #define DoubleToFixed(x) ((Fixed)((x) * (double)fixed1)) 53 | #define FixedToInt(x) ((x)>>16L) 54 | #define FixedToFloat(x) ((float) (x) * 1./(float)fixed1) 55 | #define FixedToDouble(x) ((double)(x) * 1./(double)fixed1) 56 | #define FixMul(x,y) (((y)>>8L) * ((x)>>8L)) //both are large(>1) 57 | #define FixMul2(x,y) (((y) * ((x)>>8L))>>8L) //y is small 58 | #define FixMul3(x,y) ((((y)>>8L) * (x))>>8L) //x is small 59 | #define FixMul4(x,y) (((y) * (x))>>16L) //both are small 60 | 61 | #define FixDiv(x,y) ((((y)>>8L)!=0)?((((x)<<4L) / ((y)>>8L))<<4L):0) 62 | #define FixedFraction(x) ((x)&0xffffL) //unsigned fraction 63 | #define FixedFractionSigned(x) ((x)&0x8000ffffL) 64 | 65 | #define FixedEps ((long) 1) 66 | #define FixedOneMinusEps (fixed1 - FixedEps) 67 | #define FixedFrac(x) ((x) & FixedOneMinusEps) 68 | #define FixedFloor(x) ((x) & ~FixedOneMinusEps) 69 | #define FixedCeil(x) FixedFloor((x) + FixedOneMinusEps) 70 | #define FixedMod2(x) ((x) & (fixed1 | FixedOneMinusEps)) 71 | 72 | #ifdef FixedRound 73 | #undef FixedRound 74 | #endif 75 | #define FixedRound(x) ((FixedFrac(x) < fixedhalf) ? FixedFloor(x) : FixedCeil(x)) 76 | 77 | #endif //__JIT_FIXMATH_H__ 78 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.functor.h: -------------------------------------------------------------------------------- 1 | /* 2 | jit.functor.h 3 | 4 | Copyright 2001-2005 - Cycling '74 5 | Joshua Kit Clayton jkc@cycling74.com 6 | 7 | */ 8 | 9 | #ifndef _JIT_FUNCTOR_H_ 10 | #define _JIT_FUNCTOR_H_ 11 | 12 | #include "jit.fixmath.h" 13 | #include "jit.common.h" 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | #if C74_PRAGMA_STRUCT_PACKPUSH 20 | #pragma pack(push, 2) 21 | #elif C74_PRAGMA_STRUCT_PACK 22 | #pragma pack(2) 23 | #endif 24 | 25 | typedef t_int32(*(t_jit_functor_fixed_sig))(void *, t_int32, t_int32 *); 26 | typedef float(*(t_jit_functor_float32_sig))(void *, t_int32, float *); 27 | typedef double(*(t_jit_functor_float64_sig))(void *, t_int32, double *); 28 | 29 | typedef t_int32(*(t_jit_functor_fixed_scalar_sig))(void *, t_int32); 30 | typedef float(*(t_jit_functor_float32_scalar_sig))(void *, float); 31 | typedef double(*(t_jit_functor_float64_scalar_sig))(void *, double); 32 | 33 | typedef struct _jit_functor_interface 34 | { 35 | t_jit_functor_fixed_sig evalfixed; 36 | t_jit_functor_fixed_sig evalfixed_1d; 37 | t_jit_functor_fixed_sig evalfixed_2d; 38 | t_jit_functor_fixed_sig evalfixed_3d; 39 | 40 | t_jit_functor_float32_sig evalfloat32; 41 | t_jit_functor_float32_sig evalfloat32_1d; 42 | t_jit_functor_float32_sig evalfloat32_2d; 43 | t_jit_functor_float32_sig evalfloat32_3d; 44 | 45 | t_jit_functor_float64_sig evalfloat64; 46 | t_jit_functor_float64_sig evalfloat64_1d; 47 | t_jit_functor_float64_sig evalfloat64_2d; 48 | t_jit_functor_float64_sig evalfloat64_3d; 49 | 50 | } t_jit_functor_interface; 51 | 52 | typedef struct _jit_functor_wrapper 53 | { 54 | t_jit_object *ob; // functor object 55 | t_jit_functor_interface *fm; // functor methods 56 | 57 | } t_jit_functor_wrapper; 58 | 59 | // combined scalar value 60 | typedef struct _jit_functor_combined_value 61 | { 62 | t_int32 fixed; 63 | float float32; 64 | double float64; 65 | 66 | } t_jit_functor_combined_value; 67 | 68 | #define JIT_FUNCTOR_COMBINED_VALUE_SETALL(x,v) \ 69 | (x).float64 = (double)(v);\ 70 | (x).float32 = (float)(v);\ 71 | (x).fixed = DoubleToFixed((double)(v)) 72 | 73 | // combined dimensional value 74 | typedef struct _jit_functor_combined_dimvalue 75 | { 76 | t_int32 fixed[JIT_MATRIX_MAX_DIMCOUNT]; 77 | float float32[JIT_MATRIX_MAX_DIMCOUNT]; 78 | double float64[JIT_MATRIX_MAX_DIMCOUNT]; 79 | t_int32 dimcount; 80 | 81 | } t_jit_functor_combined_dimvalue; 82 | 83 | #define JIT_FUNCTOR_COMBINED_ARRAY_SETALL(i,x,v) \ 84 | (x).float64[i] = (double)(v);\ 85 | (x).float32[i] = (float)(v);\ 86 | (x).fixed[i] = DoubleToFixed((double)(v)) 87 | 88 | // combined dynamic array 89 | typedef struct _jit_functor_combined_dynarray 90 | { 91 | t_int32 *fixed; 92 | float *float32; 93 | double *float64; 94 | t_int32 count; 95 | 96 | } t_jit_functor_combined_dynarray; 97 | 98 | 99 | t_jit_err jit_functor_setup_class(t_class *c, char *categoryname, char *classname); 100 | t_jit_err jit_functor_addcategory(t_class *c, t_symbol *categoryname); 101 | t_jit_object *jit_functor_getcategorylist(t_class *c); 102 | t_jit_object *jit_functor_classlist_in_category(t_symbol *categoryname); 103 | t_class *jit_functor_lookup_relaxed(t_symbol *categoryname, t_symbol *classname); 104 | t_class *jit_functor_lookup(t_symbol *categoryname, t_symbol *classname); 105 | t_jit_err jit_functor_new_object_with_interface(t_jit_object **ob, t_jit_functor_interface **fi, t_symbol *category, t_symbol *name); 106 | t_jit_err jit_functor_wrapper_init(t_jit_functor_wrapper *e, t_symbol *category, t_symbol *name); 107 | t_jit_err jit_functor_setattr(t_jit_object *x, t_symbol *s, t_int32 ac, t_atom *av); 108 | 109 | // utility functions 110 | t_int32 jit_functor_eval_fixed_with_float32(t_jit_object *x, t_int32 dimcount, t_int32 *vals, t_jit_functor_float32_sig fp); 111 | t_int32 jit_functor_eval_fixed_with_float64(t_jit_object *x, t_int32 dimcount, t_int32 *vals, t_jit_functor_float64_sig fp); 112 | float jit_functor_eval_float32_with_fixed(t_jit_object *x, t_int32 dimcount, float *vals, t_jit_functor_fixed_sig fp); 113 | float jit_functor_eval_float32_with_float64(t_jit_object *x, t_int32 dimcount, float *vals, t_jit_functor_float64_sig fp); 114 | double jit_functor_eval_float64_with_fixed(t_jit_object *x, t_int32 dimcount, double *vals, t_jit_functor_fixed_sig fp); 115 | double jit_functor_eval_float64_with_float32(t_jit_object *x, t_int32 dimcount, double *vals, t_jit_functor_float32_sig fp); 116 | 117 | t_int32 jit_functor_eval_fixed_with_scalar_product(t_jit_object *x, t_int32 dimcount, t_int32 *vals, t_jit_functor_fixed_scalar_sig fp); 118 | float jit_functor_eval_float32_with_scalar_product(t_jit_object *x, t_int32 dimcount, float *vals, t_jit_functor_float32_scalar_sig fp); 119 | double jit_functor_eval_float64_with_scalar_product(t_jit_object *x, t_int32 dimcount, double *vals, t_jit_functor_float64_scalar_sig fp); 120 | t_int32 jit_functor_eval_fixed_with_scalar_sum(t_jit_object *x, t_int32 dimcount, t_int32 *vals, t_jit_functor_fixed_scalar_sig fp); 121 | float jit_functor_eval_float32_with_scalar_sum(t_jit_object *x, t_int32 dimcount, float *vals, t_jit_functor_float32_scalar_sig fp); 122 | double jit_functor_eval_float64_with_scalar_sum(t_jit_object *x, t_int32 dimcount, double *vals, t_jit_functor_float64_scalar_sig fp); 123 | 124 | t_int32 jit_functor_eval_fixed_with_lut_wrap_product(t_jit_object *x, t_int32 dimcount, t_int32 *vals, t_int32 *fixlut); 125 | t_int32 jit_functor_eval_fixed_with_lut_wrap_sum(t_jit_object *x, t_int32 dimcount, t_int32 *vals, t_int32 *fixlut); 126 | t_int32 jit_functor_eval_fixed_with_lut_clip_product(t_jit_object *x, t_int32 dimcount, t_int32 *vals, t_int32 *fixlut); 127 | t_int32 jit_functor_eval_fixed_with_lut_clip_sum(t_jit_object *x, t_int32 dimcount, t_int32 *vals, t_int32 *fixlut); 128 | 129 | // dynamic array utility functions 130 | t_jit_err jit_functor_combined_dynarray_init(t_jit_functor_combined_dynarray *x, t_int32 count); 131 | t_jit_err jit_functor_combined_dynarray_destroy(t_jit_functor_combined_dynarray *x); 132 | 133 | #if C74_PRAGMA_STRUCT_PACKPUSH 134 | #pragma pack(pop) 135 | #elif C74_PRAGMA_STRUCT_PACK 136 | #pragma pack() 137 | #endif 138 | 139 | #ifdef __cplusplus 140 | } 141 | #endif 142 | 143 | #endif //_JIT_FUNCTOR_H_ 144 | 145 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.gl.cache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jit.gl.cache.h 3 | * 4 | * Internal data structure for storing cached geometric data. 5 | * 6 | */ 7 | 8 | // -------------------------------------------------------------------------------- 9 | 10 | #ifndef JIT_GL_MESH_CACHE_H 11 | #define JIT_GL_MESH_CACHE_H 12 | 13 | #include "jit.gl.h" 14 | 15 | /*************************************************************************/ 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #if C74_PRAGMA_STRUCT_PACKPUSH 22 | #pragma pack(push, 2) 23 | #elif C74_PRAGMA_STRUCT_PACK 24 | #pragma pack(2) 25 | #endif 26 | 27 | /****************************************************************************/ 28 | 29 | enum t_jit_gl_mesh_cache_type { 30 | JIT_GL_MESH_CACHE_NONE = 0, 31 | JIT_GL_MESH_CACHE_AUTO = 1, 32 | JIT_GL_MESH_CACHE_DISPLAYLIST = 2, 33 | JIT_GL_MESH_CACHE_VERTEXARRAY = 3, 34 | JIT_GL_MESH_CACHE_VERTEXBUFFER = 4, 35 | JIT_GL_MESH_CACHE_DEFAULT_GROW = 64 36 | }; 37 | 38 | #define JIT_SYM_IF(x) ((x) && (x) != _jit_sym_nothing && (x)->s_name) 39 | #define JIT_SYM_SAFECSTR(x) ((JIT_SYM_IF(x)) ? (x)->s_name : "" ) 40 | 41 | // -------------------------------------------------------------------------------- 42 | 43 | typedef struct _jit_gl_cache { 44 | void *data; // raw data values 45 | long bytes; // number of allocated bytes 46 | long manage; // flag to manage data creation/deletion 47 | long type; // type of cached data (VERTEX/NORMAL/etc) 48 | long buffertype; // type of buffer (ARRAY/ELEMENT) 49 | long datatype; // enumerated datatype prim 50 | long datasize; // sizeof datatype 51 | long enumtype; // type of geometry (quad, triangles, line) 52 | long geomsize; // size of geometry primitive (4=quad, 3=triangle, 2=line) 53 | long elements; // total elements 54 | long drawcount; // number of draw submissions 55 | long drawsize; // size of draw submission 56 | long count; // number of coordinates 57 | long coords; // coordinate dimensions (1-4) 58 | long stride; // stride length between elements 59 | long start; // start index 60 | long end; // end index 61 | //long mode; // cache mode (STATIC/DYNAMIC) 62 | long used; // used flag 63 | long update; // update flag 64 | long capacity; // allocated element count 65 | long grow; // resize amount 66 | long id; // id for cached data 67 | 68 | } t_jit_gl_cache; 69 | 70 | // -------------------------------------------------------------------------------- 71 | 72 | extern t_symbol *ps_jit_gl_cache_none; 73 | extern t_symbol *ps_jit_gl_cache_auto; 74 | extern t_symbol *ps_jit_gl_cache_var; 75 | extern t_symbol *ps_jit_gl_cache_vbo; 76 | extern t_symbol *ps_jit_gl_cache_dl; 77 | extern t_symbol *ps_jit_gl_cache_vertexarray; 78 | extern t_symbol *ps_jit_gl_cache_vertexbuffer; 79 | extern t_symbol *ps_jit_gl_cache_displaylist; 80 | 81 | // -------------------------------------------------------------------------------- 82 | 83 | t_jit_err jit_gl_cache_init(void); 84 | t_jit_gl_cache * jit_gl_cache_new(long count, long coords, long datatype); 85 | void jit_gl_cache_free(t_jit_gl_cache *x); 86 | t_jit_err jit_gl_cache_clear(t_jit_gl_cache *x); 87 | t_jit_err jit_gl_cache_buffer_destroy(t_jit_gl_cache *x); 88 | t_jit_err jit_gl_cache_destroy(t_jit_gl_cache *x); 89 | t_jit_err jit_gl_cache_reset(t_jit_gl_cache *x); 90 | long jit_gl_cache_compare(t_jit_gl_cache *x, long a, long b, double epsilon); 91 | t_jit_err jit_gl_cache_weld(t_jit_gl_cache *x, double epsilon); 92 | t_jit_err jit_gl_cache_grow(t_jit_gl_cache *x, long bytes, long copy); 93 | t_jit_err jit_gl_cache_resize(t_jit_gl_cache *x, long elements, long coords, long datatype, long copy); 94 | t_jit_err jit_gl_cache_append(t_jit_gl_cache *x, char *data, long count, long coords, long datatype); 95 | t_jit_err jit_gl_cache_replace(t_jit_gl_cache *x, long index, char *data, long count, long coords, long datatype); 96 | GLenum jit_gl_cache_datatype_from_symbol(t_symbol *s); 97 | long jit_gl_cache_datasize_from_datatype(GLenum e); 98 | 99 | /****************************************************************************/ 100 | 101 | #if C74_PRAGMA_STRUCT_PACKPUSH 102 | #pragma pack(pop) 103 | #elif C74_PRAGMA_STRUCT_PACK 104 | #pragma pack() 105 | #endif 106 | 107 | #ifdef __cplusplus 108 | } 109 | #endif 110 | 111 | /****************************************************************************/ 112 | 113 | 114 | #endif // JIT_GL_MESH_CACHE_H 115 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.gl.chunk.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2005 - Cycling '74 3 | * Randall Jones - rej@2uptech.com 4 | * 5 | * OpenGL Chunk structure used to store one gl-command's-worth of data, 6 | * in a format which can be passed easily to glDrawRangeElements 7 | */ 8 | 9 | /****************************************************************************/ 10 | 11 | #ifndef JIT_GL_CHUNK_H 12 | #define JIT_GL_CHUNK_H 13 | 14 | /****************************************************************************/ 15 | 16 | #include "jit.gl.h" 17 | 18 | /*************************************************************************/ 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | #if C74_PRAGMA_STRUCT_PACKPUSH 25 | #pragma pack(push, 2) 26 | #elif C74_PRAGMA_STRUCT_PACK 27 | #pragma pack(2) 28 | #endif 29 | 30 | /****************************************************************************/ 31 | 32 | /** 33 | * t_jit_glchunk is a public structure to store one gl-command's-worth of data, 34 | * in a format which can be passed easily to glDrawRangeElements, and matrixoutput. 35 | * 36 | */ 37 | typedef struct _jit_glchunk { 38 | t_symbol * prim; ///< drawing primitive. "tri_strip", "tri", "quads", "quad_grid", etc. 39 | t_jit_object * m_vertex; ///< vertex matrix containing xyzst... data 40 | t_symbol * m_vertex_name; ///< vertex matrix name 41 | t_jit_object * m_index; ///< optional 1d matrix of vertex indices to use with drawing primitive 42 | t_symbol * m_index_name; ///< index matrix name 43 | unsigned long m_flags; ///< chunk flags to ignore texture, normal, color, or edge planes when drawing 44 | void * next_chunk; ///< pointer to next chunk for drawing a list of chunks together 45 | } 46 | t_jit_glchunk; 47 | 48 | /****************************************************************************/ 49 | 50 | t_jit_glchunk * jit_glchunk_new(t_symbol * prim, int planes, int vertices, int indices); 51 | t_jit_glchunk * jit_glchunk_grid_new(t_symbol * prim, int planes, int width, int height); 52 | void jit_glchunk_delete(t_jit_glchunk * x); 53 | t_jit_err jit_glchunk_copy(t_jit_glchunk ** newcopy, t_jit_glchunk * orig); 54 | 55 | t_jit_glchunk * jit_glchunk_new_frommatrix(t_symbol * prim, void *vm, void *im); 56 | 57 | /****************************************************************************/ 58 | 59 | // flags for chunk creation 60 | enum t_jit_gl_chunk_flags { 61 | JIT_GL_CHUNK_IGNORE_TEXTURES = 1 << 0, 62 | JIT_GL_CHUNK_IGNORE_NORMALS = 1 << 1, 63 | JIT_GL_CHUNK_IGNORE_COLORS = 1 << 2, 64 | JIT_GL_CHUNK_IGNORE_EDGES = 1 << 3 65 | }; 66 | 67 | /****************************************************************************/ 68 | 69 | #if C74_PRAGMA_STRUCT_PACKPUSH 70 | #pragma pack(pop) 71 | #elif C74_PRAGMA_STRUCT_PACK 72 | #pragma pack() 73 | #endif 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | /****************************************************************************/ 80 | 81 | #endif // JIT_GL_CHUNK_H 82 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.gl.context.h: -------------------------------------------------------------------------------- 1 | #ifndef JIT_GL_CONTEXT_H 2 | #define JIT_GL_CONTEXT_H 3 | 4 | /****************************************************************************/ 5 | 6 | #include "jit.gl.h" 7 | #if defined(WIN_VERSION) || !defined(GL3_VERSION) 8 | #define JIT_GL_USE_PROCS 1 9 | #endif 10 | #ifdef JIT_GL_USE_PROCS 11 | #include "jit.gl.procs.h" 12 | #endif 13 | #include "jit.gl.support.h" 14 | #include "jit.gl.pixelformat.h" 15 | 16 | /*************************************************************************/ 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #if C74_PRAGMA_STRUCT_PACKPUSH 23 | #pragma pack(push, 2) 24 | #elif C74_PRAGMA_STRUCT_PACK 25 | #pragma pack(2) 26 | #endif 27 | 28 | 29 | /****************************************************************************/ 30 | 31 | typedef struct _jit_gl_context_struct 32 | { 33 | t_jit_gl_native_context context; 34 | t_jit_gl_native_device device; 35 | t_jit_gl_native_pixelformat pixelformat; 36 | #ifdef JIT_GL_USE_PROCS 37 | t_jit_gl_extprocs *procs; // proc table for opengl extensions 38 | #endif 39 | t_jit_gl_support *support; // opengl feature support 40 | const char *extensions; // opengl extensions string 41 | void *target; 42 | long targettype; // window/pwindow/matrix/other 43 | long renderer_id; // mac only 44 | long flags; 45 | void *auxdata; 46 | void *offscreentex; 47 | void *offscreenfbo; 48 | #ifdef WIN_VERSION 49 | t_jit_gl_platform_data platform_data; 50 | #endif 51 | } t_jit_gl_context_struct, *t_jit_gl_context; 52 | 53 | typedef struct _jit_gl_context_info 54 | { 55 | long flags; 56 | long targettype; //window/pwindow/matrix/other 57 | long renderer_id; //mac only 58 | t_jit_gl_context share; 59 | t_jit_gl_pixelformat *pixelformat; 60 | void *nativewin; 61 | short samples; 62 | } t_jit_gl_context_info; 63 | 64 | 65 | /****************************************************************************/ 66 | 67 | t_jit_gl_context jit_gl_create_context(void *target, t_jit_gl_context_info *info); 68 | GLboolean jit_gl_destroy_context(t_jit_gl_context ctx); 69 | GLboolean jit_gl_destroy_native_context(t_jit_gl_native_context native); 70 | GLboolean jit_gl_update_context(t_jit_gl_context ctx); 71 | GLboolean jit_gl_set_context(t_jit_gl_context ctx); 72 | t_jit_gl_context jit_gl_get_context(void); 73 | t_jit_gl_support *jit_gl_get_support(void); 74 | GLboolean jit_gl_context_swap_buffers(t_jit_gl_context ctx); 75 | GLboolean jit_gl_configure(GLenum pname, GLuint param); 76 | long jit_gl_set_swap_interval(t_jit_gl_context ctx, long interval); 77 | char jit_gl_is_extension_supported(t_jit_gl_context ctx, const char* ext); 78 | 79 | /****************************************************************************/ 80 | 81 | // context flags 82 | enum t_jit_gl_context_flag { 83 | JIT_GL_CTX_DOUBLEBUF = 0x00000001, 84 | JIT_GL_CTX_DEPTHBUF = 0x00000002, 85 | JIT_GL_CTX_ACCELERATED = 0x00000004, 86 | JIT_GL_CTX_FSAA = 0x00000008, 87 | JIT_GL_CTX_HINT_QUALITY = 0x00000010, 88 | JIT_GL_CTX_STEREO = 0x00000020 89 | }; 90 | 91 | // target types 92 | enum t_jit_gl_target_type { 93 | JIT_GL_TARGET_WINDOW = 0x00000000, 94 | JIT_GL_TARGET_MATRIX = 0x00000001, 95 | JIT_GL_TARGET_PWINDOW = 0x00000002, 96 | JIT_GL_TARGET_TEXTURE = 0x00000003, 97 | JIT_GL_TARGET_ROOT_SHARED = 0x00000004 98 | }; 99 | 100 | /****************************************************************************/ 101 | 102 | #if C74_PRAGMA_STRUCT_PACKPUSH 103 | #pragma pack(pop) 104 | #elif C74_PRAGMA_STRUCT_PACK 105 | #pragma pack() 106 | #endif 107 | 108 | #ifdef __cplusplus 109 | } 110 | #endif 111 | 112 | /****************************************************************************/ 113 | 114 | #endif 115 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.gl.drawinfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2005 - Cycling '74 3 | * Joshua Kit Clayton - jkc@cycling74.com 4 | * 5 | * OpenGL drawinfo structure used to store texture binding info per draw call. 6 | */ 7 | 8 | /****************************************************************************/ 9 | 10 | #ifndef JIT_GL_DRAWINFO_H 11 | #define JIT_GL_DRAWINFO_H 12 | 13 | /****************************************************************************/ 14 | 15 | #include "jit.gl.context.h" 16 | 17 | /*************************************************************************/ 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | #if C74_PRAGMA_STRUCT_PACKPUSH 24 | #pragma pack(push, 2) 25 | #elif C74_PRAGMA_STRUCT_PACK 26 | #pragma pack(2) 27 | #endif 28 | 29 | /****************************************************************************/ 30 | 31 | /** 32 | * t_jit_gl_drawinfo struct used for tasks such as multi texture unit binding. 33 | * 34 | */ 35 | typedef struct _jit_gl_drawinfo 36 | { 37 | t_jit_gl_context ctx; ///< current t_jit_gl_context 38 | void *ob3d; ///< object's t_jit_ob3d pointer 39 | void *rfu[6]; ///< reserved for future use 40 | } t_jit_gl_drawinfo; 41 | 42 | t_jit_err jit_gl_drawinfo_setup(void *x, t_jit_gl_drawinfo *drawinfo); 43 | #ifndef GL3_VERSION 44 | long jit_gl_drawinfo_active_textures(t_jit_gl_drawinfo *drawinfo); 45 | void jit_gl_texcoord1f(t_jit_gl_drawinfo *drawinfo, double s); 46 | void jit_gl_texcoord2f(t_jit_gl_drawinfo *drawinfo, double s, double t); 47 | void jit_gl_texcoord3f(t_jit_gl_drawinfo *drawinfo, double s, double t, double r); 48 | void jit_gl_texcoord1fv(t_jit_gl_drawinfo *drawinfo, float *v); 49 | void jit_gl_texcoord2fv(t_jit_gl_drawinfo *drawinfo, float *v); 50 | void jit_gl_texcoord3fv(t_jit_gl_drawinfo *drawinfo, float *v); 51 | #endif 52 | void jit_gl_bindtexture(t_jit_gl_drawinfo *drawinfo, t_symbol *s, long i); 53 | void jit_gl_unbindtexture(t_jit_gl_drawinfo *drawinfo, t_symbol *s, long i); 54 | void jit_gl_begincapture(t_jit_gl_drawinfo *drawinfo, t_symbol *s, long i); 55 | void jit_gl_endcapture(t_jit_gl_drawinfo *drawinfo, t_symbol *s, long i); 56 | /****************************************************************************/ 57 | 58 | #if C74_PRAGMA_STRUCT_PACKPUSH 59 | #pragma pack(pop) 60 | #elif C74_PRAGMA_STRUCT_PACK 61 | #pragma pack() 62 | #endif 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | /****************************************************************************/ 69 | 70 | #endif // __JIT_GL_H__ 71 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.gl.ob3d.h: -------------------------------------------------------------------------------- 1 | #ifndef JIT_GL_OB3D_H 2 | #define JIT_GL_OB3D_H 3 | 4 | /****************************************************************************/ 5 | 6 | #include "jit.gl.h" 7 | 8 | /****************************************************************************/ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #if C74_PRAGMA_STRUCT_PACKPUSH 15 | #pragma pack(push, 2) 16 | #elif C74_PRAGMA_STRUCT_PACK 17 | #pragma pack(2) 18 | #endif 19 | 20 | /****************************************************************************/ 21 | 22 | 23 | typedef struct _jit_class3d 24 | { 25 | long oboffset; // instance byte offset to the ob3d struct. 26 | long flags; 27 | // extensible 28 | } t_jit_class3d; 29 | 30 | /****************************************************************************/ 31 | 32 | void *jit_ob3d_setup(void * jit_class, long oboffset, long ob3d_flags); 33 | t_jit_err jit_ob3d_set(void *x, void *p); 34 | void *jit_ob3d_get(void *x); 35 | void *jit_ob3d_new(void *x, t_symbol * dest_name); 36 | void jit_ob3d_free(void *x); 37 | t_jit_err jit_ob3d_set_context(void *x); 38 | t_jit_err jit_ob3d_draw_chunk(void *ob3d, t_jit_glchunk * chunk); 39 | void jit_ob3d_set_viewport(void *v, long x, long y, long width, long height); 40 | 41 | void * ob3d_maxob_get(void *v); 42 | void * ob3d_jitob_get(void *v); 43 | void * ob3d_patcher_get(void *v); 44 | long ob3d_auto_get(void *v); 45 | long ob3d_enable_get(void *v); 46 | long ob3d_ui_get(void *v); 47 | void * ob3d_outlet_get(void *v); 48 | long ob3d_dirty_get(void *v); 49 | void ob3d_dirty_set(void *v, long c); 50 | void ob3d_dest_dim_set(void *v, long width, long height); 51 | void ob3d_dest_dim_get(void *v, long *width, long *height); 52 | void ob3d_render_ptr_set(void *v, void *render_ptr); 53 | void * ob3d_render_ptr_get(void *v); 54 | 55 | void ob3d_set_color(void *v, float *color); 56 | void ob3d_get_color(void *v, float *color); 57 | long ob3d_texture_count(void *v); 58 | 59 | t_jit_err ob3d_draw_begin(void *ob3d, long setup); 60 | t_jit_err ob3d_draw_end(void *ob3d, long setup); 61 | t_jit_err ob3d_draw_preamble(void *ob3d); 62 | 63 | t_symbol * jit_ob3d_init_jpatcher_render(void *jitob); 64 | 65 | t_jit_err jit_ob3d_dest_name_set(t_jit_object *x, void *attr, long argc, t_atom *argv); 66 | t_jit_err jit_gl_vbo_create(void *x, GLenum target, GLenum usage); 67 | t_jit_err jit_gl_vbo_submit(void *x, long size, const void *data); 68 | 69 | /****************************************************************************/ 70 | 71 | #if C74_PRAGMA_STRUCT_PACKPUSH 72 | #pragma pack(pop) 73 | #elif C74_PRAGMA_STRUCT_PACK 74 | #pragma pack() 75 | #endif 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | /****************************************************************************/ 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.glext_nv.h: -------------------------------------------------------------------------------- 1 | #ifndef __glext_nv_h_ 2 | #define __glext_nv_h_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #ifndef GL_NV_half_float 9 | #define GL_NV_half_float 10 | #endif 11 | typedef unsigned short GLhalfNV; 12 | 13 | #define GL_PIXEL_PACK_BUFFER_EXT 0x88EB 14 | #define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC 15 | 16 | #define GL_VERTEX_PROGRAM_NV 0x8620 17 | #define GL_FRAGMENT_PROGRAM_NV 0x8870 18 | 19 | #define GL_PROGRAM_ERROR_POSITION_NV 0x864B 20 | 21 | #define GL_PROGRAM_ERROR_STRING_NV 0x8874 22 | 23 | #define GL_TEXTURE_RECTANGLE_NV 0x84F5 24 | 25 | #define GL_HALF_FLOAT_NV 0x140B 26 | 27 | #define GL_FLOAT_R_NV 0x8880 28 | #define GL_FLOAT_RG_NV 0x8881 29 | #define GL_FLOAT_RGB_NV 0x8882 30 | #define GL_FLOAT_RGBA_NV 0x8883 31 | #define GL_FLOAT_R16_NV 0x8884 32 | #define GL_FLOAT_R32_NV 0x8885 33 | #define GL_FLOAT_RG16_NV 0x8886 34 | #define GL_FLOAT_RG32_NV 0x8887 35 | #define GL_FLOAT_RGB16_NV 0x8888 36 | #define GL_FLOAT_RGB32_NV 0x8889 37 | #define GL_FLOAT_RGBA16_NV 0x888A 38 | #define GL_FLOAT_RGBA32_NV 0x888B 39 | #define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C 40 | #define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D 41 | #define GL_FLOAT_RGBA_MODE_NV 0x888E 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.gworld.h: -------------------------------------------------------------------------------- 1 | #ifndef __JIT_GWORLD_H__ 2 | #define __JIT_GWORLD_H__ 3 | 4 | // nothing to see here 5 | 6 | #endif //__JIT_GWORLD_H__ 7 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.half.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2001-2005 - Cycling '74 3 | * Derek Gerstmann - derek@cycling74.com 4 | * 5 | * Support for 16 bit floating point evaluation. 6 | * 7 | */ 8 | 9 | #ifndef JIT_HALF_H 10 | #define JIT_HALF_H 11 | 12 | // -------------------------------------------------------------------------- 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | // -------------------------------------------------------------------------- 19 | 20 | // 16 bit "half" floating point 21 | typedef unsigned short half; 22 | 23 | // init half datatype 24 | void jit_half_init(); 25 | 26 | // convert float-to-half 27 | half jit_float_to_half(float i); 28 | 29 | // convert half-to-float 30 | float jit_half_to_float(half y); 31 | 32 | // round to n-bits of precision 33 | half jit_half_round(half h, unsigned int n); 34 | 35 | // returns -h 36 | half jit_half_negate(half h); 37 | 38 | // returns h + a 39 | half jit_half_add(half h, half a); 40 | 41 | // returns h + a 42 | half jit_half_add_float(half h, float a); 43 | 44 | // returns h - a 45 | half jit_half_sub(half h, half a); 46 | 47 | // returns h - a 48 | half jit_half_sub_float(half h, float a); 49 | 50 | // returns h * a 51 | half jit_half_mul(half h, half a); 52 | 53 | // returns h * a 54 | half jit_half_mul_float(half h, float a); 55 | 56 | // returns h / a 57 | half jit_half_div(half h, half a); 58 | 59 | // returns h / a 60 | half jit_half_div_float(half h, float a); 61 | 62 | // returns 1 if h is a proper real 63 | long jit_half_is_finite(half h); 64 | 65 | // returns 1 if h is normalized 66 | long jit_half_is_normalized(half h); 67 | 68 | // returns 1 if h is denormalized 69 | long jit_half_is_denormalized(half h); 70 | 71 | // returns 1 if h == 0 72 | long jit_half_is_zero(half h); 73 | 74 | // returns 1 if h is < 0 75 | long jit_half_is_negative(half h); 76 | 77 | // returns 1 if h is a nan 78 | long jit_half_is_nan(half h); 79 | 80 | // returns 1 if h is an infinity 81 | long jit_half_is_inf(half h); 82 | 83 | // -------------------------------------------------------------------------- 84 | 85 | #ifdef WIN_VERSION 86 | 87 | #define JIT_HALF_MIN 5.96046448e-08f // smallest positive half 88 | #define JIT_HALF_NRM_MIN 6.10351562e-05f // smallest positive normalized half 89 | #define JIT_HALF_MAX 65504.0f // largest positive half 90 | #define JIT_HALF_EPSILON 0.00097656f // smallest positive e for which half (1.0 + e) != half (1.0) 91 | 92 | #else 93 | 94 | #define JIT_HALF_MIN 5.96046448e-08 // smallest positive half 95 | #define JIT_HALF_NRM_MIN 6.10351562e-05 // smallest positive normalized half 96 | #define JIT_HALF_MAX 65504.0 // largest positive half 97 | #define JIT_HALF_EPSILON 0.00097656 // smallest positive e for which half (1.0 + e) != half (1.0) 98 | 99 | #endif // WIN_VERSION 100 | 101 | #define JIT_HALF_MANT_DIG 11 // number of digits in mantissa (significand + hidden leading 1) 102 | #define JIT_HALF_DIG 2 // number of base 10 digits that can be represented without change 103 | #define JIT_HALF_RADIX 2 // base of the exponent 104 | #define JIT_HALF_MIN_EXP -13 // minimum negative exponent 105 | #define JIT_HALF_MAX_EXP 16 // maximum positive exponent 106 | #define JIT_HALF_MIN_10_EXP -4 // minimum positive 10^exponent 107 | #define JIT_HALF_MAX_10_EXP 4 // maximum positive 10^exponent 108 | #define JIT_HALF_POSINF (0x7c00) // positive infinity 109 | #define JIT_HALF_NEGINF (0xfc00) // negative infinity 110 | #define JIT_HALF_QNAN (0x7fff) // qnan 111 | #define JIT_HALF_SNAN (0x7dff) // signed nan 112 | 113 | // -------------------------------------------------------------------------- 114 | 115 | #ifdef __cplusplus 116 | } 117 | #endif 118 | 119 | // -------------------------------------------------------------------------- 120 | 121 | #endif // JIT_HALF_H 122 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.linklist.h: -------------------------------------------------------------------------------- 1 | /* 2 | jit.linklist.h 3 | 4 | Copyright 2001-2005 - Cycling '74 5 | Joshua Kit Clayton jkc@cycling74.com 6 | 7 | */ 8 | 9 | #ifndef _JIT_LINKLIST_H_ 10 | #define _JIT_LINKLIST_H_ 11 | 12 | #include "ext_linklist.h" 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #if C74_PRAGMA_STRUCT_PACKPUSH 19 | #pragma pack(push, 2) 20 | #elif C74_PRAGMA_STRUCT_PACK 21 | #pragma pack(2) 22 | #endif 23 | 24 | 25 | typedef t_llelem t_jit_llelem; 26 | typedef t_linklist t_jit_linklist; 27 | void jit_linklist_init(void); //manual class registration 28 | 29 | 30 | // as of Max 6.1, we use the Max linklist from ext_linklist.h for jit_linklist. 31 | // jit_linklist is aliased to the linklist class, and we leave the following exports 32 | // for compatibility purposes of older compiled externs. they simply call their 33 | // max linklist counterparts 34 | 35 | 36 | #ifdef JIT_LINKLIST_DECLARE_PROTOTYPES 37 | 38 | void *jit_linklist_new(void); 39 | void jit_linklist_free(t_jit_linklist *x); 40 | void jit_linklist_chuck(t_jit_linklist *x); //like free, but don't free the objects 41 | t_atom_long jit_linklist_getsize(t_jit_linklist *x); 42 | void *jit_linklist_getindex(t_jit_linklist *x, long index); 43 | t_jit_llelem *jit_linklist_index2ptr(t_jit_linklist *x, long index); 44 | long jit_linklist_ptr2index(t_jit_linklist *x, t_jit_llelem *p); 45 | t_atom_long jit_linklist_objptr2index(t_jit_linklist *x, void *p); 46 | t_atom_long jit_linklist_append(t_jit_linklist *x, void *o); 47 | t_atom_long jit_linklist_insertindex(t_jit_linklist *x, void *o, long index); // inserts at index(0 is head) 48 | t_jit_llelem *jit_linklist_insertptr(t_jit_linklist *x, void *o, t_jit_llelem *p); //inserts before ptr 49 | t_atom_long jit_linklist_deleteindex(t_jit_linklist *x, long index); 50 | t_atom_long jit_linklist_chuckindex(t_jit_linklist *x, long index); 51 | long jit_linklist_deleteptr(t_jit_linklist *x, t_jit_llelem *p); 52 | long jit_linklist_chuckptr(t_jit_linklist *x, t_jit_llelem *p); //like delete, but don't free it 53 | void jit_linklist_clear(t_jit_linklist *x); 54 | 55 | long jit_linklist_insertnodeindex(t_jit_linklist *x, t_jit_llelem *p, long index); 56 | t_jit_llelem *jit_linklist_insertnodeptr(t_jit_linklist *x, t_jit_llelem *p1, t_jit_llelem *p2); 57 | long jit_linklist_appendnode(t_jit_linklist *x, t_jit_llelem *p); 58 | 59 | t_jit_llelem *jit_linklistelem_new(void); 60 | void jit_linklistelem_free(t_jit_llelem *x); 61 | 62 | t_atom_long jit_linklist_makearray(t_jit_linklist *x, void **a, long max); 63 | 64 | void jit_linklist_reverse(t_jit_linklist *x); 65 | void jit_linklist_rotate(t_jit_linklist *x, long i); 66 | void jit_linklist_shuffle(t_jit_linklist *x); 67 | void jit_linklist_swap(t_jit_linklist *x, long a, long b); 68 | void jit_linklist_findfirst(t_jit_linklist *x, void **o, long cmpfn(void *, void *), void *cmpdata); 69 | void jit_linklist_findall(t_jit_linklist *x, t_jit_linklist **out, long cmpfn(void *, void *), void *cmpdata); 70 | t_atom_long jit_linklist_findcount(t_jit_linklist *x, long cmpfn(void *, void *), void *cmpdata); 71 | void jit_linklist_methodall(t_jit_linklist *x, t_symbol *s, ...); 72 | void *jit_linklist_methodindex(t_jit_linklist *x, long i, t_symbol *s, ...); 73 | void jit_linklist_sort(t_jit_linklist *x, long cmpfn(void *, void *)); 74 | void jit_linklist_funall(t_jit_linklist *x, method fun, void *arg); 75 | void jit_linklist_funallsafe(t_jit_linklist *x, method fun, void *arg); 76 | void *jit_linklist_funindex(t_jit_linklist *x, long i, method fun, void *arg); 77 | 78 | #else 79 | 80 | #define jit_linklist_new linklist_new 81 | //#define jit_linklist_free linklist_free (private/deprecated) should never be called directly 82 | #define jit_linklist_chuck linklist_chuck 83 | #define jit_linklist_getsize linklist_getsize 84 | #define jit_linklist_getindex linklist_getindex 85 | //#define jit_linklist_index2ptr linklist_index2ptr (private/deprecated) 86 | //#define jit_linklist_ptr2index linklist_ptr2index (private/deprecated) 87 | #define jit_linklist_objptr2index linklist_objptr2index 88 | #define jit_linklist_append linklist_append 89 | #define jit_linklist_insertindex linklist_insertindex 90 | //#define jit_linklist_insertptr linklist_insertptr (private/deprecated) 91 | #define jit_linklist_deleteindex linklist_deleteindex 92 | #define jit_linklist_chuckindex linklist_chuckindex 93 | //#define jit_linklist_deleteptr linklist_deleteptr (private/deprecated) 94 | //#define jit_linklist_chuckptr linklist_chuckptr (private/deprecated) 95 | #define jit_linklist_clear linklist_clear 96 | //#define jit_linklist_insertnodeindex linklist_insertnodeindex(private/deprecated) 97 | //#define jit_linklist_insertnodeptr linklist_insertnodeptr (private/deprecated) 98 | //#define jit_linklist_appendnode linklist_appendnode (private/deprecated) 99 | //#define jit_linklistelem_new linklistelem_new (private/deprecated) 100 | //#define jit_linklistelem_free linklistelem_free (private/deprecated) 101 | #define jit_linklist_makearray linklist_makearray 102 | #define jit_linklist_reverse linklist_reverse 103 | #define jit_linklist_rotate linklist_rotate 104 | #define jit_linklist_shuffle linklist_shuffle 105 | #define jit_linklist_swap linklist_swap 106 | #define jit_linklist_findfirst linklist_findfirst 107 | #define jit_linklist_findall linklist_findall 108 | //#define jit_linklist_findcount linklist_findcount // no linklist counterpart. use findall and count linklist size 109 | #define jit_linklist_methodall linklist_methodall 110 | #define jit_linklist_methodindex linklist_methodindex 111 | #define jit_linklist_sort linklist_sort 112 | #define jit_linklist_funall linklist_funall 113 | #define jit_linklist_funallsafe linklist_funall // no linklist counterpart. funall should be safe 114 | #define jit_linklist_funindex linklist_funindex 115 | 116 | #endif // JIT_LINKLIST_DECLARE_PROTOTYPES 117 | 118 | #if C74_PRAGMA_STRUCT_PACKPUSH 119 | #pragma pack(pop) 120 | #elif C74_PRAGMA_STRUCT_PACK 121 | #pragma pack() 122 | #endif 123 | 124 | #ifdef __cplusplus 125 | } 126 | #endif 127 | 128 | #endif // _JIT_LINKLIST_H_ 129 | 130 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.mac.h: -------------------------------------------------------------------------------- 1 | #ifndef __JIT_MAC_H__ 2 | #define __JIT_MAC_H__ 3 | 4 | #include "ext_prefix.h" 5 | 6 | #if MAC_VERSION 7 | 8 | #ifndef TRUE 9 | #define TRUE 1 10 | #endif 11 | #ifndef FALSE 12 | #define FALSE 0 13 | #endif 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | OSErr jit_mac_gestalt(OSType selector, long *response); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | #endif // MAC_VERSION 26 | #endif //__JIT_MAC_H__ 27 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.matrix.util.h: -------------------------------------------------------------------------------- 1 | #ifndef _JIT_MATRIX_UTIL_H_ 2 | #define _JIT_MATRIX_UTIL_H_ 3 | 4 | #include "jit.common.h" 5 | 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | t_jit_err jit_matrix_list_get_matrices(void *list, long n, void **matrices); 12 | t_jit_err jit_matrix_array_lock(void **matrices, long n, long *savelock); 13 | t_jit_err jit_matrix_array_unlock(void **matrices, long n, long *savelock); 14 | t_jit_err jit_matrix_array_get_matrix_info(void **matrices, long n, t_jit_matrix_info *matrix_info); 15 | t_jit_err jit_matrix_array_get_data(void **matrices, long n, char **data); 16 | t_jit_err jit_matrix_info_equal_matrix_structure(t_jit_matrix_info *minfo1, t_jit_matrix_info *minfo2); 17 | t_jit_err jit_matrix_info_uniform_planecount(t_jit_matrix_info *matrix_info, long n, t_jit_matrix_info *info_list); 18 | t_jit_err jit_matrix_info_uniform_type(t_jit_matrix_info *matrix_info, long n, t_jit_matrix_info *info_list); 19 | t_jit_err jit_matrix_info_uniform_dim(t_jit_matrix_info *matrix_info, long n, t_jit_matrix_info *info_list); 20 | 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif // _JIT_MATRIX_UTIL_H_ -------------------------------------------------------------------------------- /c74support/jit-includes/jit.max.h: -------------------------------------------------------------------------------- 1 | /* 2 | jit.max.h 3 | 4 | Copyright 2001-2005 - Cycling '74 5 | Joshua Kit Clayton jkc@cycling74.com 6 | 7 | */ 8 | 9 | #ifndef __JIT_MAX_H__ 10 | #define __JIT_MAX_H__ 11 | 12 | 13 | #include "ext.h" 14 | #include "ext_proto.h" 15 | #include "ext_strings.h" 16 | #include "ext_critical.h" 17 | #include "jit.error.h" 18 | 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | #if C74_PRAGMA_STRUCT_PACKPUSH 25 | #pragma pack(push, 2) 26 | #elif C74_PRAGMA_STRUCT_PACK 27 | #pragma pack(2) 28 | #endif 29 | 30 | //atom,symbol,method shared with max 31 | typedef t_object t_jit_object; ///< object header @ingroup jitter 32 | typedef t_class t_max_class; 33 | typedef t_object t_max_object; 34 | typedef t_messlist t_max_messlist; 35 | 36 | #define A_DEFER 0x41 37 | #define A_USURP 0x42 38 | #define A_DEFER_LOW 0x43 39 | #define A_USURP_LOW 0x44 40 | 41 | enum { 42 | MAX_JIT_CLASS_FLAGS_GIMMEBACK_WRAP = 0x00000001L, // uses standard dumpout A_DEFER_LOW method 43 | MAX_JIT_CLASS_FLAGS_OWN_INLETINFO = 0x00000002L // override stdinletinfo in class's main 44 | }; 45 | 46 | // BEGIN LEGACY API FOR MAX WRAPPER OBJECTS USING setup() 47 | C74_DEPRECATED( void *max_jit_obex_new(void *mc, t_symbol *classname) ); 48 | C74_DEPRECATED( void max_jit_obex_free(void *x) ); 49 | C74_DEPRECATED( void *max_jit_classex_setup(long oboffset) ); 50 | C74_DEPRECATED( t_jit_err max_jit_classex_addattr(void *x, void *attr) ); 51 | C74_DEPRECATED( void max_jit_classex_standard_wrap(void *mclass, void *jclass, long flags) ); 52 | C74_DEPRECATED( void max_jit_class_addmethods(void *x) ); 53 | C74_DEPRECATED( void max_jit_class_addmethods_flags(void *x, long flags) ); 54 | C74_DEPRECATED( void max_jit_class_attrlist2methods(void *x) ); 55 | C74_DEPRECATED( void max_addmethod_defer(method m, char *s) ); 56 | C74_DEPRECATED( void max_addmethod_defer_low(method m, char *s) ); 57 | C74_DEPRECATED( void max_addmethod_usurp(method m, char *s) ); 58 | C74_DEPRECATED( void max_addmethod_usurp_low(method m, char *s) ); 59 | // END LEGACY API FOR MAX WRAPPER OBJECTS USING setup() 60 | 61 | // new t_class API for constructing max wrapper objects using class_new() 62 | void *max_jit_object_alloc(t_class *mclass, t_symbol *jitter_classname); 63 | void max_jit_object_free(void *x); 64 | void max_jit_class_obex_setup(t_class *mclass, long oboffset); 65 | t_jit_err max_jit_class_addattr(t_class *mclass, void *attr); 66 | void max_jit_class_wrap_standard(t_class *mclass, t_class *jclass, long flags); 67 | void max_jit_class_wrap_addmethods(t_class *mclass, t_class *jclass); 68 | void max_jit_class_wrap_addmethods_flags(t_class *mclass, t_class *jclass, long flags); 69 | void max_jit_class_wrap_ob3d_inletinfo(t_class *mclass, t_class *jclass, long flags); 70 | void max_jit_class_wrap_attrlist2methods(t_class *mclass, t_class *jclass); 71 | void max_jit_class_addmethod_defer(t_class *mclass, method m, char *s); 72 | void max_jit_class_addmethod_defer_low(t_class *mclass, method m, char *s); 73 | void max_jit_class_addmethod_usurp(t_class *mclass, method m, char *s); 74 | void max_jit_class_addmethod_usurp_low(t_class *mclass, method m, char *s); 75 | 76 | // instance specific wrapping 77 | t_jit_err max_jit_object_addattr(t_object *x, void *attr); 78 | void max_jit_object_wrap_standard(t_object *mob, t_object *job, long flags); 79 | void max_jit_object_wrap_complete(t_object *mob, t_object *job, long flags); 80 | void max_jit_object_wrap_addmethods(t_object *mob, t_object *job); 81 | void max_jit_object_wrap_addmethods_flags(t_object *mob, t_object *job, long flags); 82 | void max_jit_object_wrap_attrlist2methods(t_object *mob, t_object *job); 83 | void max_jit_object_addmethod_defer(t_object *x, method m, char *s); 84 | void max_jit_object_addmethod_defer_low(t_object *x, method m, char *s); 85 | void max_jit_object_addmethod_usurp(t_object *x, method m, char *s); 86 | void max_jit_object_addmethod_usurp_low(t_object *x, method m, char *s); 87 | 88 | void max_jit_object_attr_dump(void *x); 89 | long max_jit_attr_args_offset(short ac, t_atom *av); 90 | void max_jit_attr_args(void *x, short ac, t_atom *av); 91 | void max_jit_attr_set(void *x, t_symbol *s, short ac, t_atom *av); 92 | 93 | void *max_jit_obex_attrlist_get(void *x); 94 | t_jit_err max_jit_obex_attr_set(void *x, t_symbol *s, long ac, t_atom *av); 95 | t_jit_err max_jit_obex_attr_get(void *x, t_symbol *s, long *ac, t_atom **av); 96 | void max_jit_obex_attr_getdump(void *x, t_symbol *s, short argc, t_atom *argv); 97 | t_jit_err max_jit_obex_set(void *x, void *p); 98 | void *max_jit_obex_get(void *x); 99 | void *max_jit_obex_jitob_get(void *x); 100 | void max_jit_obex_jitob_set(void *x, void *jitob); 101 | void *max_jit_obex_usurplist_get(void *x); 102 | void max_jit_obex_usurplist_set(void *x, void *usurplist); 103 | void *max_jit_obex_proxylist_get(void *x); 104 | void max_jit_obex_proxylist_set(void *x, void *proxylist); 105 | long max_jit_obex_inletnumber_get(void *x); 106 | void max_jit_obex_inletnumber_set(void *x, long inletnumber); 107 | t_jit_err max_jit_obex_proxy_new(void *x, long c); 108 | t_jit_err max_jit_obex_proxy_resize(void *x, long count); 109 | t_jit_err max_jit_obex_proxy_deletetail(void *x); 110 | t_jit_err max_jit_obex_proxy_append(void *x, long c); 111 | void max_jit_obex_dumpout_set(void *x, void *outlet); 112 | void *max_jit_obex_dumpout_get(void *x); 113 | void max_jit_obex_dumpout(void *x, t_symbol *s, short argc, t_atom *argv); 114 | void *max_jit_obex_adornmentlist_get(void *x); 115 | void max_jit_obex_adornmentlist_set(void *x, void *adornmentlist); 116 | void *max_jit_obex_adornment_get(void *x, t_symbol *classname); 117 | t_jit_err max_jit_obex_addadornment(void *x,void *adornment); 118 | void max_jit_obex_gimmeback(void *x, t_symbol *s, long ac, t_atom *av); 119 | void max_jit_obex_gimmeback_dumpout(void *x, t_symbol *s, long ac, t_atom *av); 120 | 121 | t_atom_long max_jit_method_is_attr(void *x, t_symbol *s); 122 | t_atom_long max_jit_method_is_undocumented(void *x, t_symbol *s); 123 | t_atom_long max_jit_method_is_groupreference(void *x, t_symbol *s); 124 | 125 | long max_jit_getqueuestate(void); 126 | 127 | #if C74_PRAGMA_STRUCT_PACKPUSH 128 | #pragma pack(pop) 129 | #elif C74_PRAGMA_STRUCT_PACK 130 | #pragma pack() 131 | #endif 132 | 133 | #ifdef __cplusplus 134 | } 135 | #endif 136 | 137 | #endif //__JIT_MAX_H__ 138 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.parallel.utils.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _JIT_PARALLEL_UTILS_H_ 3 | #define _JIT_PARALLEL_UTILS_H_ 4 | 5 | #define JIT_PARALLEL_NDIM_MAX_IO 32 6 | #define JIT_PARALLEL_NDIM_FLAGS_FULL_MATRIX 0x00000001 7 | 8 | #include "jit.common.h" 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #if C74_PRAGMA_STRUCT_PACKPUSH 15 | #pragma pack(push, 2) 16 | #elif C74_PRAGMA_STRUCT_PACK 17 | #pragma pack(2) 18 | #endif 19 | 20 | typedef struct _jit_parallel_ndim_io 21 | { 22 | long flags; 23 | t_jit_matrix_info *minfo; 24 | char *bp; 25 | } t_jit_parallel_ndim_io; 26 | 27 | typedef struct _jit_parallel_ndim 28 | { 29 | long flags; 30 | void *data; 31 | long dimcount; 32 | long *dim; 33 | long planecount; 34 | long iocount; 35 | t_jit_parallel_ndim_io io[JIT_PARALLEL_NDIM_MAX_IO]; 36 | method fn; 37 | } t_jit_parallel_ndim; 38 | 39 | typedef struct _jit_parallel_ndim_worker 40 | { 41 | t_jit_parallel_ndim *paralleldata; 42 | long workercount; 43 | long workerid; 44 | long offset[2]; 45 | long extent[2]; 46 | } t_jit_parallel_ndim_worker; 47 | 48 | 49 | void jit_parallel_utils_init(void); 50 | void jit_parallel_ndim_calc(t_jit_parallel_ndim *p); 51 | void jit_parallel_ndim_simplecalc1(method fn, void *data, long dimcount, long *dim, long planecount, t_jit_matrix_info *minfo1, char *bp1, long flags1); 52 | void jit_parallel_ndim_simplecalc2(method fn, void *data, long dimcount, long *dim, long planecount, t_jit_matrix_info *minfo1, char *bp1, 53 | t_jit_matrix_info *minfo2, char *bp2, long flags1, long flags2); 54 | void jit_parallel_ndim_simplecalc3(method fn, void *data, long dimcount, long *dim, long planecount, t_jit_matrix_info *minfo1, char *bp1, 55 | t_jit_matrix_info *minfo2, char *bp2, t_jit_matrix_info *minfo3, char *bp3, long flags1, long flags2, long flags3); 56 | void jit_parallel_ndim_simplecalc4(method fn, void *data, long dimcount, long *dim, long planecount, t_jit_matrix_info *minfo1, char *bp1, 57 | t_jit_matrix_info *minfo2, char *bp2, t_jit_matrix_info *minfo3, char *bp3, t_jit_matrix_info *minfo4, char *bp4, 58 | long flags1, long flags2, long flags3, long flags4); 59 | 60 | #if C74_PRAGMA_STRUCT_PACKPUSH 61 | #pragma pack(pop) 62 | #elif C74_PRAGMA_STRUCT_PACK 63 | #pragma pack() 64 | #endif 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif //_JIT_PARALLEL_UTILS_H_ 71 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.platform.h: -------------------------------------------------------------------------------- 1 | /* 2 | jit.platform.h 3 | 4 | Copyright 2001-2005 - Cycling '74 5 | Joshua Kit Clayton jkc@cycling74.com 6 | 7 | */ 8 | 9 | #ifndef __JIT_PLATFORM_H__ 10 | #define __JIT_PLATFORM_H__ 11 | 12 | #include "ext_infer_system.h" 13 | 14 | #ifdef WIN_VERSION 15 | 16 | #define JIT_EX_DATA_DECL __declspec(dllexport) 17 | #ifdef WIN_JITLIB 18 | #define JIT_EX_DATA extern __declspec(dllexport) 19 | #else 20 | #define JIT_EX_DATA extern __declspec(dllimport) 21 | #endif //WIN_JITLIB 22 | #else 23 | #define JIT_EX_DATA_DECL 24 | #define JIT_EX_DATA extern 25 | 26 | #endif // WIN_VERSION 27 | 28 | #define C74_MAX 29 | 30 | // weak link macros 31 | #ifdef __APPLE_CC__ 32 | #define JIT_WEAKLINK __attribute((weak_import)) 33 | #else 34 | #define JIT_WEAKLINK 35 | #endif 36 | 37 | #ifdef C74_MAX 38 | #include "jit.max.h" 39 | #endif 40 | 41 | 42 | //endian issues 43 | #include "jit.byteorder.h" 44 | 45 | //thread related 46 | #include "jit.critical.h" 47 | 48 | // rbs: altivec is never true now, we should clean this stuff up 49 | #define JIT_CAN_ALTIVEC 0 50 | JIT_EX_DATA long _jit_altivec; 51 | 52 | //speed macros -- we currently always use post inc 53 | 54 | #define PREFER_POST_INC 55 | #ifdef PREFER_POST_INC 56 | #define FAST_INC_SETUP(x) // nothing 57 | #define FAST_INC(x) ((x)++) 58 | #define FAST_INC_DEREF(x) (*((x)++)) 59 | #define FAST_DEC_SETUP(x) // nothing 60 | #define FAST_DEC(x) ((x)--) 61 | #define FAST_DEC_DEREF(x) (*((x)--)) 62 | #else 63 | #define FAST_INC_SETUP(x) (--(x)) // predec 64 | #define FAST_INC(x) (++(x)) 65 | #define FAST_INC_DEREF(x) (*(++(x))) 66 | #define FAST_DEC_SETUP(x) (++(x)) // preinc 67 | #define FAST_DEC(x) (--(x)) 68 | #define FAST_DEC_DEREF(x) (*(--(x))) 69 | #endif 70 | 71 | //utils 72 | #ifndef calcoffset 73 | #define calcoffset(x,y) ((long)(&(((x *)0L)->y))) 74 | #endif 75 | 76 | #ifdef WIN_VERSION 77 | #define hypot _hypot 78 | #endif 79 | 80 | #ifdef MAC_VERSION 81 | 82 | #include 83 | 84 | #endif // #ifdef MAC_VERSION 85 | 86 | #endif // #ifndef __JIT_PLATFORM_H__ 87 | -------------------------------------------------------------------------------- /c74support/jit-includes/jit.window.h: -------------------------------------------------------------------------------- 1 | 2 | // jit.window.h 3 | // 4 | // author: randall jones 5 | // � 2001 cycling '74 6 | 7 | #ifndef __JIT_WINDOW_H__ 8 | #define __JIT_WINDOW_H__ 9 | 10 | #include "jit.common.h" 11 | 12 | #ifndef __max_ext_wind_h 13 | #define __max_ext_wind_h 14 | #include "ext_wind.h" 15 | #endif 16 | 17 | // t_jit_window flags 18 | enum t_jit_window_flag { 19 | JIT_WINDOW_USING_GL = 1 << 0, 20 | JIT_WINDOW_NO_ACCEL = 1 << 1 21 | }; 22 | 23 | enum t_jit_window_constants { 24 | MIN_WIND_DIM = 9, 25 | MAX_WIND_COORD = 8192 26 | }; 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | void jit_window_dragcheck(void *x); 33 | t_jit_err jit_window_init(void); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | 40 | #endif //__JIT_WINDOW_H__ 41 | -------------------------------------------------------------------------------- /c74support/jit-includes/max.jit.mop.h: -------------------------------------------------------------------------------- 1 | /* 2 | max.jit.mop.h 3 | 4 | Copyright 2001-2005 - Cycling '74 5 | Joshua Kit Clayton jkc@cycling74.com 6 | 7 | */ 8 | 9 | #include "jit.common.h" 10 | 11 | #ifndef __MAX_JIT_MOP_H__ 12 | #define __MAX_JIT_MOP_H__ 13 | 14 | //flags for greater control 15 | enum t_max_jit_mop_flag { 16 | MAX_JIT_MOP_FLAGS_NONE = 0x00000000, ///< mop flag @ingroup jitter 17 | MAX_JIT_MOP_FLAGS_OWN_ALL = 0x0FFFFFFF, ///< mop flag @ingroup jitter 18 | 19 | MAX_JIT_MOP_FLAGS_OWN_JIT_MATRIX = 0x00000001, ///< mop flag @ingroup jitter 20 | MAX_JIT_MOP_FLAGS_OWN_BANG = 0x00000002, ///< mop flag @ingroup jitter 21 | MAX_JIT_MOP_FLAGS_OWN_OUTPUTMATRIX = 0x00000004, ///< mop flag @ingroup jitter 22 | MAX_JIT_MOP_FLAGS_OWN_NAME = 0x00000008, ///< mop flag @ingroup jitter 23 | MAX_JIT_MOP_FLAGS_OWN_TYPE = 0x00000010, ///< mop flag @ingroup jitter 24 | MAX_JIT_MOP_FLAGS_OWN_DIM = 0x00000020, ///< mop flag @ingroup jitter 25 | MAX_JIT_MOP_FLAGS_OWN_PLANECOUNT = 0x00000040, ///< mop flag @ingroup jitter 26 | MAX_JIT_MOP_FLAGS_OWN_CLEAR = 0x00000080, ///< mop flag @ingroup jitter 27 | MAX_JIT_MOP_FLAGS_OWN_NOTIFY = 0x00000100, ///< mop flag @ingroup jitter 28 | MAX_JIT_MOP_FLAGS_OWN_ADAPT = 0x00000200, ///< mop flag @ingroup jitter 29 | MAX_JIT_MOP_FLAGS_OWN_OUTPUTMODE = 0x00000400, ///< mop flag @ingroup jitter 30 | 31 | MAX_JIT_MOP_FLAGS_ONLY_MATRIX_PROBE = 0x10000000 ///< mop flag @ingroup jitter 32 | }; 33 | 34 | enum { 35 | JIT_MOP_INPUT = 1, ///< mop flag @ingroup jitter 36 | JIT_MOP_OUTPUT = 2 ///< mop flag @ingroup jitter 37 | }; 38 | 39 | //outputmode: 0=no output, 1=calc, 2=input(no calc), 3=output(no calc) 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | t_jit_err max_jit_classex_mop_wrap(void *mclass, void *jclass, long flags); // legacy api 46 | t_jit_err max_jit_class_mop_wrap(t_class *mclass, t_class *jclass, long flags); // new api 47 | t_jit_err max_jit_classex_mop_mproc(void *mclass, void *jclass, void *mproc); //mproc should be method(void *x, void *mop) 48 | t_jit_err max_jit_object_mop_wrap(t_object *mob, t_object *job, long flags); 49 | t_jit_err max_jit_object_mop_mproc(void *mob, void *job, void *mproc); 50 | 51 | t_jit_err max_jit_mop_setup(void *x); 52 | t_jit_err max_jit_mop_inputs(void *x); 53 | t_jit_err max_jit_mop_inputs_resize(void *x, long count); 54 | t_jit_err max_jit_mop_outputs(void *x); 55 | t_jit_err max_jit_mop_outputs_resize(void *x, long count); 56 | t_jit_err max_jit_mop_matrix_args(void *x, long argc, t_atom *argv); 57 | t_jit_err max_jit_mop_jit_matrix(void *x, t_symbol *s, long argc, t_atom *argv); 58 | t_jit_err max_jit_mop_assist(void *x, void *b, long m, long a, char *s); 59 | t_jit_err max_jit_mop_bang(void *x); 60 | t_jit_err max_jit_mop_outputmatrix(void *x); 61 | t_jit_err max_jit_mop_matrixout_new(void *x, long c); 62 | void max_jit_mop_clear(void *x); 63 | t_jit_err max_jit_mop_notify(void *x, t_symbol *s, t_symbol *msg); 64 | void max_jit_mop_free(void *x); 65 | t_jit_err max_jit_mop_name(void *x, void *attr, long argc, t_atom *argv); 66 | t_jit_err max_jit_mop_getname(void *x, void *attr, long *argc, t_atom **argv); 67 | t_jit_err max_jit_mop_type(void *x, void *attr, long argc, t_atom *argv); 68 | t_jit_err max_jit_mop_gettype(void *x, void *attr, long *argc, t_atom **argv); 69 | t_jit_err max_jit_mop_dim(void *x, void *attr, long argc, t_atom *argv); 70 | t_jit_err max_jit_mop_getdim(void *x, void *attr, long *argc, t_atom **argv); 71 | t_jit_err max_jit_mop_planecount(void *x, void *attr, long argc, t_atom *argv); 72 | t_jit_err max_jit_mop_getplanecount(void *x, void *attr, long *argc, t_atom **argv); 73 | t_jit_err max_jit_mop_parse_name(t_symbol *name, long *type, long *idx); 74 | t_jit_err max_jit_mop_restrict_info(void *x, void *p, t_jit_matrix_info *info); 75 | void *max_jit_mop_get_io_by_name(void *x, t_symbol *s); 76 | t_jit_err max_jit_mop_outputmode(void *x, void *attr, long argc, t_atom *argv); 77 | t_jit_err max_jit_mop_getoutputmode_attr(void *x, void *attr, long *argc, t_atom **argv); 78 | t_jit_err max_jit_mop_adapt(void *x, void *attr, long argc, t_atom *argv); 79 | t_jit_err max_jit_mop_getadapt(void *x, void *attr, long *argc, t_atom **argv); 80 | void *max_jit_mop_getinput(void *x, long c); 81 | void *max_jit_mop_getoutput(void *x, long c); 82 | long max_jit_mop_getoutputmode(void *x); 83 | void *max_jit_mop_io_getoutlet(void *mop_io); 84 | t_jit_err max_jit_mop_io_setoutlet(void *mop_io, void *o); 85 | void *max_jit_mop_getmproc(void *mop); 86 | t_jit_err max_jit_mop_adapt_matrix_all(void *x, void *y); 87 | t_jit_err max_jit_mop_variable_parse_sym(t_symbol *name, t_symbol **msg, long *set); 88 | t_jit_err max_jit_mop_variable_anything(void *x, t_symbol *s, long argc, t_atom *argv); 89 | t_jit_err max_jit_mop_variable_addinputs(void *x, long c); 90 | t_jit_err max_jit_mop_variable_addoutputs(void *x, long c); 91 | 92 | t_jit_err max_jit_mop_setup_simple(void *x, void *o, long argc, t_atom *argv); 93 | /* max_jit_mop_setup_simple is equivalent to : 94 | 95 | max_jit_obex_jitob_set(x,o); 96 | max_jit_obex_dumpout_set(x,outlet_new(x,NULL)); 97 | max_jit_mop_setup(x); 98 | max_jit_mop_inputs(x); 99 | max_jit_mop_outputs(x); 100 | max_jit_mop_matrix_args(x,argc,argv); 101 | 102 | NOTICE: REMOVED max_jit_attr_args from max_jit_mop_setup_simple 103 | 104 | max_jit_mop_classex_mproc 105 | 106 | */ 107 | 108 | t_jit_err max_jit_mop_setup_probing(t_class *mclass); 109 | 110 | #ifdef __cplusplus 111 | } 112 | #endif 113 | 114 | #endif //__MAX_JIT_MOP_H__ 115 | -------------------------------------------------------------------------------- /c74support/jit-includes/x64/jitlib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cycling74/max-sdk-base/a9321e86fdb08d03da9fe4053f3accec4a775b6b/c74support/jit-includes/x64/jitlib.lib -------------------------------------------------------------------------------- /c74support/max-includes/MaxAPI.framework/MaxAPI: -------------------------------------------------------------------------------- 1 | Versions/Current/MaxAPI -------------------------------------------------------------------------------- /c74support/max-includes/MaxAPI.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /c74support/max-includes/MaxAPI.framework/Versions/A/MaxAPI: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cycling74/max-sdk-base/a9321e86fdb08d03da9fe4053f3accec4a775b6b/c74support/max-includes/MaxAPI.framework/Versions/A/MaxAPI -------------------------------------------------------------------------------- /c74support/max-includes/MaxAPI.framework/Versions/A/Resources/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cycling74/max-sdk-base/a9321e86fdb08d03da9fe4053f3accec4a775b6b/c74support/max-includes/MaxAPI.framework/Versions/A/Resources/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /c74support/max-includes/MaxAPI.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | MaxAPI 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.cycling74.MaxAPI 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | CSResourcesFileMapped 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /c74support/max-includes/MaxAPI.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /c74support/max-includes/common/basic_c_strings.c: -------------------------------------------------------------------------------- 1 | #include "ext.h" 2 | 3 | #ifdef WIN_VERSION 4 | 5 | #ifndef _CRT_SECURE_NO_WARNINGS 6 | #define _CRT_SECURE_NO_WARNINGS 7 | #endif 8 | 9 | #include 10 | 11 | #endif // #ifdef WIN_VERSION 12 | 13 | #ifndef WIN_VERSION 14 | #ifndef NDEBUG 15 | 16 | char *strcpy(char *s1, const char *s2) 17 | { 18 | char *ret = s1; 19 | 20 | while ((*s1++ = *s2++) != 0) 21 | ; 22 | 23 | return ret; 24 | } 25 | 26 | char *strcat(char *s1, const char *s2) 27 | { 28 | char *ret = s1; 29 | 30 | while (*s1++) 31 | ; 32 | --s1; 33 | while ((*s1++ = *s2++) != 0) 34 | ; 35 | return ret; 36 | } 37 | 38 | int strcmp(const char *s1, const char *s2) 39 | { 40 | char c1, c2, dif; 41 | 42 | for (;;) { 43 | if (!(c1 = *s1++)) 44 | return *s2 ? -1 : 0; 45 | if (!(c2 = *s2++)) 46 | return 1; 47 | if (!(dif = (c1 - c2))) 48 | continue; 49 | if (dif < 0) 50 | return -1; 51 | else 52 | return 1; 53 | } 54 | 55 | return 0; 56 | } 57 | 58 | unsigned long strlen(const char *s) 59 | { 60 | long len = 0; 61 | 62 | while (*s++) 63 | ++len; 64 | 65 | return len; 66 | } 67 | 68 | char *strncpy(char *s1, const char *s2, unsigned long n) 69 | { 70 | char *res = s1; 71 | 72 | while (n--) { 73 | if ((*s1++ = *s2)!=0) 74 | ++s2; 75 | } 76 | return res; 77 | } 78 | 79 | char *strncat(char *s1, const char *s2, unsigned long n) 80 | { 81 | char *res = s1; 82 | 83 | if (n) { 84 | while (*s1++) 85 | ; 86 | --s1; 87 | while (n--) 88 | if (!(*s1++ = *s2++)) 89 | return res; 90 | *s1 = '\0'; 91 | } 92 | return res; 93 | } 94 | 95 | int strncmp(const char *s1, const char *s2, unsigned long n) 96 | { 97 | char c1, c2, dif; 98 | 99 | while (n--) { 100 | if (!(c1 = *s1++)) 101 | return *s2 ? -1 : 0; 102 | if (!(c2 = *s2++)) 103 | return 1; 104 | if (!(dif = (c1 - c2))) 105 | continue; 106 | if (dif < 0) 107 | return -1; 108 | else 109 | return 1; 110 | } 111 | return 0; 112 | } 113 | 114 | #endif // NDEBUG 115 | #endif // #ifndef WIN_VERSION 116 | 117 | void ctopcpy(unsigned char *p1, char *p2) 118 | { 119 | long len= (long) strlen(p2); 120 | //changed this to not rely on CtoPstr 121 | strcpy((char *)p1+1, p2); 122 | p1[0]=(len>255)?255:(unsigned char)len; 123 | } 124 | 125 | void ptoccpy(char *p1, unsigned char *p2) 126 | { 127 | register int len = (*p2++) & 0xff; 128 | while (len--) *p1++ = *p2++; 129 | *p1 = '\0'; 130 | } 131 | 132 | void setmem(void *ss, long n, short b) 133 | { 134 | register int i; 135 | unsigned char *s = (unsigned char *)ss; 136 | 137 | for (i=0; i < n; i++,s++) 138 | *s = (unsigned char)b; 139 | } 140 | 141 | void pstrcpy(unsigned char *p2, unsigned char *p1) 142 | { 143 | register int len; 144 | 145 | len = *p2++ = *p1++; 146 | while (--len>=0) *p2++=*p1++; 147 | } 148 | -------------------------------------------------------------------------------- /c74support/max-includes/common/commonsyms.c: -------------------------------------------------------------------------------- 1 | /* 2 | commonsyms.c 3 | 4 | Copyright 2001-2008 - Cycling '74 5 | Joshua Kit Clayton jkc@cycling74.com 6 | 7 | */ 8 | 9 | #include "ext.h" 10 | #include "commonsyms.h" 11 | 12 | C74_HIDDEN t_common_symbols_table *_common_symbols = NULL; 13 | 14 | C74_HIDDEN void common_symbols_init(void) 15 | { 16 | _common_symbols = common_symbols_gettable(); 17 | } 18 | -------------------------------------------------------------------------------- /c74support/max-includes/common/commonsyms_max4.h: -------------------------------------------------------------------------------- 1 | /* 2 | commonsyms.h 3 | 4 | */ 5 | 6 | #ifndef __COMMON_SYMBOLS_H__ 7 | #define __COMMON_SYMBOLS_H__ 8 | 9 | #include "ext_mess.h" 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif // __cplusplus 14 | 15 | void common_symbols_init(void); 16 | 17 | extern t_symbol *_sym_nothing; 18 | extern t_symbol *_sym_new; 19 | extern t_symbol *_sym_free; 20 | extern t_symbol *_sym_classname; 21 | extern t_symbol *_sym_getname; 22 | extern t_symbol *_sym_getmethod; 23 | extern t_symbol *_sym_get; 24 | extern t_symbol *_sym_set; 25 | extern t_symbol *_sym_unset; 26 | extern t_symbol *_sym_register; 27 | extern t_symbol *_sym_char; 28 | extern t_symbol *_sym_long; 29 | extern t_symbol *_sym_float32; 30 | extern t_symbol *_sym_float64; 31 | extern t_symbol *_sym_symbol; 32 | extern t_symbol *_sym_pointer; 33 | extern t_symbol *_sym_object; 34 | extern t_symbol *_sym_atom; 35 | extern t_symbol *_sym_list; 36 | extern t_symbol *_sym_type; 37 | extern t_symbol *_sym_dim; 38 | extern t_symbol *_sym_planecount; 39 | extern t_symbol *_sym_val; 40 | extern t_symbol *_sym_plane; 41 | extern t_symbol *_sym_cell; 42 | extern t_symbol *_sym_jit_matrix; 43 | extern t_symbol *_sym_class_jit_matrix; 44 | extern t_symbol *_sym_togworld; 45 | extern t_symbol *_sym_fromgworld; 46 | extern t_symbol *_sym_frommatrix; 47 | extern t_symbol *_sym_class_jit_attribute; 48 | extern t_symbol *_sym_jit_attribute; 49 | extern t_symbol *_sym_jit_attr_offset; 50 | extern t_symbol *_sym_jit_attr_offset_array; 51 | extern t_symbol *_sym_rebuilding; 52 | extern t_symbol *_sym_modified; 53 | extern t_symbol *_sym_lock; 54 | extern t_symbol *_sym_setinfo; 55 | extern t_symbol *_sym_setinfo_ex; 56 | extern t_symbol *_sym_getinfo; 57 | extern t_symbol *_sym_data; 58 | extern t_symbol *_sym_getdata; 59 | extern t_symbol *_sym_outputmatrix; 60 | extern t_symbol *_sym_clear; 61 | extern t_symbol *_sym_err_calculate; 62 | extern t_symbol *_sym_max_jit_classex; 63 | extern t_symbol *_sym_setall; 64 | extern t_symbol *_sym_chuck; 65 | extern t_symbol *_sym_getsize; 66 | extern t_symbol *_sym_getindex; 67 | extern t_symbol *_sym_objptr2index; 68 | extern t_symbol *_sym_append; 69 | extern t_symbol *_sym_insertindex; 70 | extern t_symbol *_sym_deleteindex; 71 | extern t_symbol *_sym_chuckindex; 72 | extern t_symbol *_sym_makearray; 73 | extern t_symbol *_sym_reverse; 74 | extern t_symbol *_sym_rotate; 75 | extern t_symbol *_sym_shuffle; 76 | extern t_symbol *_sym_swap; 77 | extern t_symbol *_sym_findfirst; 78 | extern t_symbol *_sym_findall; 79 | extern t_symbol *_sym_methodall; 80 | extern t_symbol *_sym_methodindex; 81 | extern t_symbol *_sym_sort; 82 | extern t_symbol *_sym_matrix_calc; 83 | extern t_symbol *_sym_genframe; 84 | extern t_symbol *_sym_filter; 85 | extern t_symbol *_sym_jit_mop; 86 | extern t_symbol *_sym_newcopy; 87 | extern t_symbol *_sym_jit_linklist; 88 | extern t_symbol *_sym_inputcount; 89 | extern t_symbol *_sym_outputcount; 90 | extern t_symbol *_sym_getinput; 91 | extern t_symbol *_sym_getoutput; 92 | extern t_symbol *_sym_getinputlist; 93 | extern t_symbol *_sym_getoutputlist; 94 | extern t_symbol *_sym_ioname; 95 | extern t_symbol *_sym_matrixname; 96 | extern t_symbol *_sym_outputmode; 97 | extern t_symbol *_sym_matrix; 98 | extern t_symbol *_sym_getmatrix; 99 | extern t_symbol *_sym_typelink; 100 | extern t_symbol *_sym_dimlink; 101 | extern t_symbol *_sym_planelink; 102 | extern t_symbol *_sym_restrict_type; 103 | extern t_symbol *_sym_restrict_planecount; 104 | extern t_symbol *_sym_restrict_dim; 105 | extern t_symbol *_sym_special; 106 | extern t_symbol *_sym_getspecial; 107 | extern t_symbol *_sym_adapt; 108 | extern t_symbol *_sym_decorator; 109 | extern t_symbol *_sym_frommatrix_trunc; 110 | extern t_symbol *_sym_ioproc; 111 | extern t_symbol *_sym_getioproc; 112 | extern t_symbol *_sym_name; 113 | extern t_symbol *_sym_types; 114 | extern t_symbol *_sym_minplanecount; 115 | extern t_symbol *_sym_maxplanecount; 116 | extern t_symbol *_sym_mindim; 117 | extern t_symbol *_sym_maxdim; 118 | extern t_symbol *_sym_gl_points; 119 | extern t_symbol *_sym_gl_lines; 120 | extern t_symbol *_sym_gl_line_strip; 121 | extern t_symbol *_sym_gl_line_loop; 122 | extern t_symbol *_sym_gl_triangles; 123 | extern t_symbol *_sym_gl_tri_strip; 124 | extern t_symbol *_sym_gl_tri_fan; 125 | extern t_symbol *_sym_gl_quads; 126 | extern t_symbol *_sym_gl_quad_strip; 127 | extern t_symbol *_sym_gl_polygon; 128 | extern t_symbol *_sym_gl_tri_grid; 129 | extern t_symbol *_sym_gl_quad_grid; 130 | extern t_symbol *_sym_err_lockout_stack; 131 | extern t_symbol *_sym_class_jit_namespace; 132 | extern t_symbol *_sym_jit_namespace; 133 | extern t_symbol *_sym_findsize; 134 | extern t_symbol *_sym_attach; 135 | extern t_symbol *_sym_detach; 136 | extern t_symbol *_sym_add; 137 | extern t_symbol *_sym_replace; 138 | extern t_symbol *_sym_gettype; 139 | extern t_symbol *_sym_ob_sym; 140 | extern t_symbol *_sym_resolve_name; 141 | extern t_symbol *_sym_resolve_raw; 142 | extern t_symbol *_sym_notifyall; 143 | extern t_symbol *_sym_anything; 144 | extern t_symbol *_sym_usercanset; 145 | extern t_symbol *_sym_usercanget; 146 | extern t_symbol *_sym_notify; 147 | extern t_symbol *_sym_getvalueof; 148 | extern t_symbol *_sym_setvalueof; 149 | extern t_symbol *_sym_dumpout; 150 | extern t_symbol *_sym_attributes; 151 | extern t_symbol *_sym_adornments; 152 | extern t_symbol *_sym_attr_getnames; 153 | extern t_symbol *_sym_attr_get; 154 | extern t_symbol *_sym_float; 155 | extern t_symbol *_sym_int; 156 | extern t_symbol *_sym_bang; 157 | extern t_symbol *_sym_parent; 158 | extern t_symbol *_sym_global; 159 | extern t_symbol *_sym_arguments; 160 | extern t_symbol *_sym_args; 161 | extern t_symbol *_sym_attr_modified; 162 | extern t_symbol *_sym_hashtab_entry_new; 163 | extern t_symbol *_sym_hashtab_entry_free; 164 | extern t_symbol *_sym_hashtab_free; 165 | 166 | #ifdef __cplusplus 167 | } 168 | #endif // __cplusplus 169 | 170 | 171 | #endif // __COMMON_SYMBOLS_H__ 172 | -------------------------------------------------------------------------------- /c74support/max-includes/common/dllmain_win.c: -------------------------------------------------------------------------------- 1 | #ifdef WIN_VERSION 2 | 3 | #include 4 | 5 | BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved ) 6 | { 7 | // Perform actions based on the reason for calling. 8 | switch( fdwReason ) 9 | { 10 | case DLL_PROCESS_ATTACH: 11 | // Initialize once for each new process. Return FALSE to fail DLL load. 12 | // Since we do nothing in our DLL_THREAD_ATTACH and DLL_THREAD_DETACH calls below, 13 | // we don't need to actually receive those calls. The below call tells the OS to 14 | // optimize those out. 15 | DisableThreadLibraryCalls(hinstDLL); 16 | #if defined(_DEBUG) && defined(PRINT_DLL_PROCESS_ATTACH_MESSAGES) 17 | { 18 | char buff[_MAX_PATH]; 19 | OutputDebugStringA("DLL_PROCESS_ATTACH: "); 20 | GetModuleFileNameA(hinstDLL, buff, _MAX_PATH); 21 | OutputDebugStringA(buff); 22 | OutputDebugStringA("\n"); 23 | } 24 | #endif 25 | break; 26 | case DLL_THREAD_ATTACH: 27 | // Do thread-specific initialization. 28 | break; 29 | case DLL_THREAD_DETACH: 30 | // Do thread-specific cleanup. 31 | break; 32 | case DLL_PROCESS_DETACH: 33 | // Perform any necessary cleanup. 34 | break; 35 | } 36 | return TRUE; 37 | } 38 | 39 | #endif // #ifdef WIN_VERSION 40 | -------------------------------------------------------------------------------- /c74support/max-includes/common/dummy.cpp: -------------------------------------------------------------------------------- 1 | // dummy to prevent compiler warnings 2 | 3 | template 4 | void dummy(){} 5 | 6 | template void dummy(); -------------------------------------------------------------------------------- /c74support/max-includes/common/ext_byteorder.c: -------------------------------------------------------------------------------- 1 | 2 | float byteorder_swapf32(float f){ 3 | unsigned char c,*a; 4 | 5 | a = (unsigned char *)&f; 6 | c=a[3]; a[3]=a[0]; a[0]=c; 7 | c=a[2]; a[2]=a[1]; a[1]=c; 8 | 9 | return f; 10 | } 11 | 12 | double byteorder_swapf64(double f){ 13 | unsigned char c,*a; 14 | 15 | a = (unsigned char *)&f; 16 | c=a[7]; a[7]=a[0]; a[0]=c; 17 | c=a[6]; a[6]=a[1]; a[1]=c; 18 | c=a[5]; a[5]=a[2]; a[2]=c; 19 | c=a[4]; a[4]=a[3]; a[3]=c; 20 | 21 | return f; 22 | } 23 | 24 | // these functions are inplace 25 | void byteorder_swap_pointer_16(unsigned char *p) 26 | { 27 | unsigned char c; 28 | c=p[1]; p[1]=p[0]; p[0]=c; 29 | } 30 | 31 | void byteorder_swap_pointer_32(unsigned char *p) 32 | { 33 | unsigned char c; 34 | c=p[3]; p[3]=p[0]; p[0]=c; 35 | c=p[2]; p[2]=p[1]; p[1]=c; 36 | } 37 | 38 | void byteorder_swap_pointer_64(unsigned char *p) 39 | { 40 | unsigned char c; 41 | c=p[7]; p[7]=p[0]; p[0]=c; 42 | c=p[6]; p[6]=p[1]; p[1]=c; 43 | c=p[5]; p[5]=p[2]; p[2]=c; 44 | c=p[4]; p[4]=p[3]; p[3]=c; 45 | } 46 | 47 | // these function copy from one pointer to another (src!=dst) 48 | void byteorder_swap_pointer_16_copy(unsigned char *src, unsigned char *dst) 49 | { 50 | dst[1] = src[0]; 51 | dst[0] = src[1]; 52 | } 53 | 54 | void byteorder_swap_pointer_32_copy(unsigned char *src, unsigned char *dst) 55 | { 56 | dst[3] = src[0]; 57 | dst[2] = src[1]; 58 | dst[1] = src[2]; 59 | dst[0] = src[3]; 60 | } 61 | 62 | void byteorder_swap_pointer_64_copy(unsigned char *src, unsigned char *dst) 63 | { 64 | dst[7] = src[0]; 65 | dst[6] = src[1]; 66 | dst[5] = src[2]; 67 | dst[4] = src[3]; 68 | dst[3] = src[4]; 69 | dst[2] = src[5]; 70 | dst[1] = src[6]; 71 | dst[0] = src[7]; 72 | } 73 | 74 | // these functions return floating point values from a byteswapped pointer 75 | float byteorder_swap_pointer_32_to_float32(unsigned char *p) 76 | { 77 | float f; 78 | byteorder_swap_pointer_32_copy(p,(unsigned char *)&f); 79 | return f; 80 | } 81 | 82 | double byteorder_swap_pointer_64_to_float64(unsigned char *p) 83 | { 84 | double f; 85 | byteorder_swap_pointer_64_copy(p,(unsigned char *)&f); 86 | return f; 87 | } 88 | 89 | -------------------------------------------------------------------------------- /c74support/max-includes/common/verinfo_win.rc: -------------------------------------------------------------------------------- 1 | 2 | #ifdef APSTUDIO_INVOKED 3 | #error this file is not editable by Microsoft Visual C++ 4 | #endif //APSTUDIO_INVOKED 5 | 6 | #include "max_winversion.h" 7 | #include "winver.h" 8 | 9 | ///////////////////////////////////////////////////////////////////////////// 10 | // 11 | // Version Info 12 | // 13 | VS_VERSION_INFO VERSIONINFO 14 | FILEVERSION VER_EXTERNAL_FILEVERSION 15 | PRODUCTVERSION VER_PRODUCTVERSION 16 | FILEFLAGSMASK VER_FILEFLAGSMASK 17 | FILEFLAGS VER_FILEFLAGS 18 | FILEOS VER_FILEOS 19 | FILETYPE VFT_DLL 20 | FILESUBTYPE VFT2_UNKNOWN 21 | BEGIN 22 | BLOCK "StringFileInfo" 23 | BEGIN 24 | BLOCK LANGUAGE_ANSI 25 | BEGIN 26 | VALUE "CompanyName", VER_COMPANYNAME_STR 27 | VALUE "FileDescription", VER_FILEDESC_STR 28 | VALUE "FileVersion", VER_EXTERNAL_FILEVERSION_STR 29 | VALUE "InternalName", VER_NAME_STR 30 | VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR 31 | VALUE "LegalTrademarks", VER_LEGALTRADEMARKS_STR 32 | VALUE "OriginalFilename", VER_EXTERNAL_FILENAME_STR 33 | VALUE "ProductName", VER_PRODUCTNAME_STR 34 | VALUE "ProductVersion", VER_PRODUCTVERSION_STR 35 | END 36 | END 37 | BLOCK "VarFileInfo" 38 | BEGIN 39 | VALUE "Translation", LANGUAGE_TRANS 40 | END 41 | END 42 | -------------------------------------------------------------------------------- /c74support/max-includes/ext.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_H_ 2 | #define _EXT_H_ 3 | 4 | #define C74_MAX_SDK_VERSION 0x0820 5 | 6 | #include "ext_infer_system.h" 7 | 8 | #include "ext_common.h" 9 | 10 | // include max_types before ext_prefix to get C74_X64 definition 11 | #include "max_types.h" // core type definitions 12 | #include "ext_prefix.h" 13 | 14 | #include "ext_mess.h" 15 | #include "ext_assist.h" 16 | 17 | #define clock_free freeobject 18 | #define binbuf_free freeobject 19 | #define wind_free freeobject 20 | 21 | /** 22 | This macro being defined means that getbytes and sysmem APIs for memory management are unified. 23 | This is correct for Max 5, but should be commented out when compiling for older max targets. 24 | @ingroup memory 25 | */ 26 | #define MM_UNIFIED 27 | 28 | #include "ext_maxtypes.h" 29 | #include "ext_byteorder.h" 30 | 31 | #include "ext_sysmem.h" 32 | #include "ext_sysfile.h" 33 | #include "ext_systime.h" 34 | #include "ext_expr.h" 35 | #include "ext_path.h" 36 | 37 | #include "ext_wind.h" 38 | 39 | #include "ext_proto.h" 40 | 41 | #include "ext_atomarray.h" 42 | #include "ext_atombuf.h" 43 | #include "ext_obstring.h" 44 | #include "ext_hashtab.h" 45 | #include "ext_dictionary.h" 46 | #include "ext_obex_util.h" 47 | #include "commonsyms.h" 48 | #include "ext_strings.h" 49 | #include "ext_obex.h" 50 | #include "ext_systhread.h" 51 | #include "ext_drag.h" 52 | #include "jpatcher_api.h" 53 | #include "ext_charset.h" 54 | #include "ext_typelist.h" 55 | #include "ext_post.h" 56 | 57 | #ifdef C74_LEGACY_DEFINES 58 | // the old post() and error() functions should be avoided since their names are generic and 59 | // could be overloaded by earlier-loading frameworks/dlls in the plugin context. 60 | // for now, we simply redefine post() and error() usage to the object_ variation. See #4779. 61 | #define post(...) object_post(NULL, __VA_ARGS__) 62 | #define error(...) object_error(NULL, __VA_ARGS__) 63 | #endif 64 | 65 | BEGIN_USING_C_LINKAGE 66 | /** ext_main() is the entry point for an extern to be loaded, which all externs must implement 67 | this shared/common prototype ensures that it will be exported correctly on all platforms. 68 | 69 | @ingroup class 70 | @param r Pointer to resources for the external, if applicable. 71 | @see @ref chapter_anatomy 72 | @version Introduced in Max 6.1.9 73 | */ 74 | void C74_EXPORT ext_main(void *r); 75 | END_USING_C_LINKAGE 76 | 77 | #endif /* _EXT_H_ */ 78 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_anim.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_ANIM_H_ 2 | #define _EXT_ANIM_H_ 3 | 4 | // NOTE: This file is obsolete. 5 | 6 | #endif /* _EXT_ANIM_H_ */ 7 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_assist.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_ASSIST_H_ 2 | #define _EXT_ASSIST_H_ 3 | 4 | #include "max_types.h" 5 | #include "ext_prefix.h" 6 | #include "ext_mess.h" 7 | 8 | enum t_assist_function { 9 | ASSIST_INLET = 1, 10 | ASSIST_OUTLET 11 | }; 12 | 13 | enum { 14 | // external object assist methods should limit returned string lengths to this 15 | ASSIST_MAX_STRING_LEN = 500 16 | }; 17 | 18 | BEGIN_USING_C_LINKAGE 19 | 20 | void stdinletinfo(t_object *s, void *b, long a, char *t); 21 | 22 | END_USING_C_LINKAGE 23 | 24 | #endif // #ifndef _EXT_ASSIST_H_ 25 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_atombuf.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_ATOMBUF_H_ 2 | #define _EXT_ATOMBUF_H_ 3 | 4 | #include "ext_prefix.h" 5 | #include "ext_mess.h" 6 | 7 | /** The atombuf struct provides a way to pass a collection of atoms. 8 | @ingroup atombuf 9 | */ 10 | typedef struct atombuf { 11 | long a_argc; ///< the number of atoms 12 | t_atom a_argv[1]; ///< the first of the array of atoms 13 | } t_atombuf; 14 | 15 | // atombuf functions 16 | 17 | BEGIN_USING_C_LINKAGE 18 | 19 | /** 20 | Use atombuf_new() to create a new Atombuf from an array of t_atoms. 21 | 22 | @ingroup atombuf 23 | @param argc Number of t_atoms in the argv array. May be 0. 24 | @param argv Array of t_atoms. If creating an empty Atombuf, you may pass 0. 25 | @return atombuf_new() create a new #t_atombuf and returns a pointer to it. 26 | If 0 is returned, insufficient memory was available. 27 | */ 28 | void *atombuf_new(long argc, t_atom *argv); 29 | 30 | 31 | /** 32 | Use atombuf_free() to dispose of the memory used by a #t_atombuf. 33 | 34 | @ingroup atombuf 35 | @param x The #t_atombuf to free. 36 | */ 37 | void atombuf_free(t_atombuf *x); 38 | 39 | 40 | /** 41 | Use atombuf_text() to convert text to a #t_atom array in a #t_atombuf. 42 | To use this routine to create a new Atombuf from the text buffer, first 43 | create a new empty t_atombuf with a call to atombuf_new(0,NULL). 44 | 45 | @ingroup atombuf 46 | @param x Pointer to existing atombuf variable. 47 | The variable will be replaced by a new Atombuf containing the converted text. 48 | @param text Handle to the text to be converted. It need not be zero-terminated. 49 | @param size Number of characters in the text. 50 | */ 51 | void atombuf_text(t_atombuf **x, char **text, long size); 52 | 53 | // undocumented 54 | 55 | short atombuf_totext(t_atombuf *x, char **text, long *size); 56 | long atombuf_count(t_atombuf *x); 57 | void atombuf_set(t_atombuf *x, long start, long num); 58 | long atombuf_replacepoundargs(t_atombuf *x, long argc, t_atom *argv); 59 | short atombuf_next(t_atombuf* x, long* count, t_atom* atom); 60 | void atombuf_replace(t_atombuf** x, t_symbol* s, long ac, t_atom* av); 61 | void atombuf_prepend(t_atombuf** x, t_symbol* s, long ac, t_atom* av); 62 | void atombuf_append(t_atombuf** x, t_symbol* s, long ac, t_atom* av); 63 | void* atombuf_eval(t_atombuf* x, long ac, t_atom* av, t_object* to); 64 | 65 | END_USING_C_LINKAGE 66 | 67 | #endif // #ifndef _EXT_ATOMBUF_H_ 68 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_backgroundtask.h: -------------------------------------------------------------------------------- 1 | // ext_backgroundtask.h 2 | #ifndef __BACKGROUNDTASK_H__ 3 | #define __BACKGROUNDTASK_H__ 4 | 5 | #include "ext_prefix.h" 6 | #include "ext_mess.h" 7 | 8 | #if C74_PRAGMA_STRUCT_PACKPUSH 9 | #pragma pack(push, 2) 10 | #elif C74_PRAGMA_STRUCT_PACK 11 | #pragma pack(2) 12 | #endif 13 | 14 | BEGIN_USING_C_LINKAGE 15 | 16 | #ifndef __BACKGROUNDTASK_H_INTERNAL__ 17 | 18 | typedef struct _backgroundtask 19 | { 20 | void *opaque; 21 | } t_backgroundtask; 22 | 23 | #endif // __BACKGROUNDTASK_H_INTERNAL__ 24 | 25 | typedef enum { 26 | BACKGROUNDTASK_FLAG_COMPLETE_MAINTHREAD = 0x00000001L // call cbcomplete callback from main thread 27 | } e_backgroundtask_execute_flags; 28 | 29 | long backgroundtask_execute(t_object *owner, void *args, method cbtask, method cbcomplete, t_backgroundtask **task, long flags); 30 | long backgroundtask_execute_method(t_object *obtask, t_symbol *mtask, long actask, t_atom *avtask, 31 | t_object *obcomp, t_symbol *mcomp, long accomp, t_atom *avcomp, t_backgroundtask **task, long flags); 32 | void backgroundtask_purge_object(t_object *owner); 33 | void backgroundtask_join_object(t_object *owner); 34 | long backgroundtask_cancel(t_backgroundtask *task); 35 | long backgroundtask_join(t_backgroundtask *task); 36 | 37 | END_USING_C_LINKAGE 38 | 39 | #if C74_PRAGMA_STRUCT_PACKPUSH 40 | #pragma pack(pop) 41 | #elif C74_PRAGMA_STRUCT_PACK 42 | #pragma pack() 43 | #endif 44 | 45 | #endif // __BACKGROUNDTASK_H__ 46 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_charset.h: -------------------------------------------------------------------------------- 1 | /* 2 | * charset.h 3 | * 4 | * Created by Jeremy Bernstein on 24.05.06. 5 | * Copyright 2006 Cycling '74. All rights reserved. 6 | * 7 | */ 8 | 9 | #ifndef _EXT_CHARSET_H_ 10 | #define _EXT_CHARSET_H_ 11 | 12 | #include "ext_prefix.h" 13 | #include "ext_mess.h" 14 | 15 | BEGIN_USING_C_LINKAGE 16 | 17 | #if C74_PRAGMA_STRUCT_PACKPUSH 18 | #pragma pack(push, 2) 19 | #elif C74_PRAGMA_STRUCT_PACK 20 | #pragma pack(2) 21 | #endif 22 | 23 | 24 | /** The charset_converter object. This struct is provided for debugging convenience, 25 | but should be considered opaque and is subject to change without notice. 26 | 27 | @ingroup unicode 28 | */ 29 | typedef struct _charset_converter 30 | { 31 | t_object ob; 32 | void *conv; 33 | void *src_encoding; 34 | void *dst_encoding; 35 | } t_charset_converter; 36 | 37 | 38 | /** A convenience function that simplifies usage by wrapping the other charset functions. 39 | @ingroup unicode 40 | 41 | @param src_encoding The name encoding of the input. 42 | @param in The input string. 43 | @param inbytes The number of bytes in the input string. 44 | @param dest_encoding The name of the encoding to use for the output. 45 | @param out The address of a char*, which will be allocated and filled with the string in the new encoding. 46 | @param outbytes The address of a value that will hold the number of bytes long the output is upon return. 47 | @return A Max error code. 48 | @remark Remember to call sysmem_freeptr(*out) to free any allocated memory. 49 | */ 50 | t_max_err charset_convert(t_symbol *src_encoding, const char *in, long inbytes, t_symbol *dest_encoding, char **out, long *outbytes); 51 | 52 | 53 | /** Convert a UTF8 C-String into a 16-bit-wide-character array. 54 | @ingroup unicode 55 | @param s The string to be converted to unicode. 56 | @param outlen The address of a variable to hold the size of the number of chars 57 | but does not include the NULL terminator in the count. 58 | @return A pointer to the buffer of unicode (wide) characters. 59 | */ 60 | unsigned short *charset_utf8tounicode(char *s, long *outlen); 61 | 62 | 63 | /** Convert a 16-bit-wide-character array into a UTF C-string. 64 | Accepts either null termination, or not (len is zero in the latter case). 65 | @ingroup unicode 66 | @param s An array of wide (16-bit) unicode characters. 67 | @param len The length of s. 68 | @param outlen The address of a variable to hold the size of the number of chars 69 | but does not include the NULL terminator in the count. 70 | @return A UTF8-encoded C-string. 71 | 72 | */ 73 | char *charset_unicodetoutf8(unsigned short *s, long len, long *outlen); 74 | 75 | 76 | /** Returns utf8 character count, and optionally bytecount. 77 | @ingroup unicode 78 | @param utf8 The UTF-8 encoded string whose characters are to be counted. 79 | @param bytecount The address of a variable to hold the byte count on return. 80 | Pass NULL if you don't require the byte count. 81 | @return The number of characters in the UTF8 string. 82 | */ 83 | long charset_utf8_count(char *utf8, long *bytecount); 84 | 85 | 86 | /** Returns utf8 character offset (positive or negative), and optionally byte offset. 87 | @ingroup unicode 88 | @param utf8 A UTF-8 encoded string. 89 | @param charoffset The char offset into the string at which to find the byte offset. 90 | @param byteoffset The address of a variable to hold the byte offset on return. 91 | Pass NULL if you don't require the byte offset. 92 | @return The character offset. 93 | */ 94 | char *charset_utf8_offset(char *utf8, long charoffset, long *byteoffset); 95 | 96 | 97 | #if C74_PRAGMA_STRUCT_PACKPUSH 98 | #pragma pack(pop) 99 | #elif C74_PRAGMA_STRUCT_PACK 100 | #pragma pack() 101 | #endif 102 | 103 | END_USING_C_LINKAGE 104 | 105 | #endif // _EXT_CHARSET_H_ 106 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_colors.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_COLORS_H_ 2 | #define _EXT_COLORS_H_ 3 | 4 | /* 5 | #define P_WHITE 0 6 | #define P_BLACK 1 7 | #define P_GRAYULITE 20 8 | #define P_GRAYVLITE 21 9 | #define P_GRAYLITE 22 10 | #define P_GRAYMED 25 11 | #define P_GRAYDARK 27 12 | #define P_COLOR1 4 13 | #define P_COLOR16 19 14 | #define P_YELLOW 32 15 | #define P_RED 33 16 | */ 17 | 18 | #endif /* _EXT_COLORS_H_ */ 19 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_common.h: -------------------------------------------------------------------------------- 1 | /* common.h -- those things we define often */ 2 | #ifndef _EXT_COMMON_H_ 3 | #define _EXT_COMMON_H_ 4 | 5 | #include "ext_infer_system.h" 6 | 7 | #ifdef WIN_VERSION 8 | #define C74_EXPORT __declspec(dllexport) 9 | #define C74_HIDDEN 10 | #define C74_MUST_CHECK 11 | #else // MAC_VERSION 12 | 13 | #define C74_EXPORT __attribute__((visibility("default"))) 14 | #define C74_HIDDEN __attribute__((visibility("hidden"))) 15 | 16 | /** If the result of a function is unused, force a compiler warning about it. */ 17 | #define C74_MUST_CHECK __attribute__((warn_unused_result)) 18 | 19 | #endif 20 | 21 | 22 | #if C74_NO_CONST 23 | #define C74_CONST 24 | #else 25 | #define C74_CONST const 26 | #endif 27 | 28 | #ifdef C74_NO_DEPRECATION 29 | #define C74_DEPRECATED(func) func 30 | #endif 31 | 32 | #ifndef C74_DEPRECATED 33 | #ifdef __GNUC__ 34 | #define C74_DEPRECATED(func) func __attribute__ ((deprecated)) 35 | #elif defined(_MSC_VER) 36 | #define C74_DEPRECATED(func) __declspec(deprecated) func 37 | #else 38 | #define C74_DEPRECATED(func) func 39 | #endif 40 | #endif // C74_DEPRECATED 41 | 42 | 43 | /** 44 | If a value is within the specified range, then return true. Otherwise return false. 45 | 46 | @ingroup misc 47 | @param v The value to test. 48 | @param lo The low bound for the range. 49 | @param hi The high bound for the range. 50 | @return Returns true if within range, otherwise false. 51 | */ 52 | #define INRANGE(v,lo,hi) ((v)<=(hi)&&(v)>=(lo)) 53 | 54 | 55 | /** 56 | Return the higher of two values. 57 | 58 | @ingroup misc 59 | @param a The first value to compare. 60 | @param b The second value to compare. 61 | @return Returns the higher of a or b. 62 | */ 63 | #ifndef MAX 64 | #define MAX(a,b) ((a)>(b)?(a):(b)) 65 | #endif 66 | 67 | 68 | /** 69 | Return the lower of two values. 70 | 71 | @ingroup misc 72 | @param a The first value to compare. 73 | @param b The second value to compare. 74 | @return Returns the lower of a or b. 75 | */ 76 | #ifndef MIN 77 | #define MIN(a,b) ((a)<(b)?(a):(b)) 78 | #endif 79 | 80 | 81 | /** 82 | Limit values to within a specified range. 83 | 84 | @ingroup misc 85 | @param a The value to constrain. NB: CLIP_ASSIGN modifies param 'a' but CLAMP only returns limited value 86 | @param lo The low bound for the range. 87 | @param hi The high bound for the range. 88 | @return Returns the value a constrained to the range specified by lo and hi. 89 | */ 90 | #define CLAMP(a, lo, hi) ( (a)>(lo)?( (a)<(hi)?(a):(hi) ):(lo) ) 91 | #define CLIP_ASSIGN(a, lo, hi) ((a) = ( (a)>(lo)?( (a)<(hi)?(a):(hi) ):(lo) )) 92 | 93 | #ifndef ABS 94 | #define ABS(x) ((x)<0?-(x):(x)) 95 | #endif 96 | 97 | #if defined(MAC_VERSION) || defined(LINUX_VERSION) 98 | #define strcmp_case_insensitive strcasecmp 99 | #endif 100 | #ifdef WIN_VERSION 101 | #if _MSC_VER < 1400 102 | #define strcmp_case_insensitive strcmpi 103 | #else 104 | #define strcmp_case_insensitive _strcmpi 105 | #endif 106 | #endif 107 | 108 | #endif /* _EXT_COMMON_H_ */ 109 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_critical.h: -------------------------------------------------------------------------------- 1 | // critical.h -- platform-independent way to define critical regions 2 | 3 | #ifndef _EXT_CRITICAL_H_ 4 | #define _EXT_CRITICAL_H_ 5 | 6 | #include "ext_prefix.h" 7 | 8 | BEGIN_USING_C_LINKAGE 9 | 10 | #if C74_PRAGMA_STRUCT_PACKPUSH 11 | #pragma pack(push, 2) 12 | #elif C74_PRAGMA_STRUCT_PACK 13 | #pragma pack(2) 14 | #endif 15 | 16 | #ifdef WIN_VERSION 17 | 18 | typedef LPCRITICAL_SECTION t_critical; ///< a critical region @ingroup critical 19 | 20 | #endif // WIN_VERSION 21 | 22 | 23 | #if defined(MAC_VERSION) || defined(LINUX_VERSION) 24 | 25 | #include 26 | 27 | typedef pthread_mutex_t* t_critical; ///< a critical region @ingroup critical 28 | 29 | #endif // WIN_VERSION 30 | 31 | 32 | 33 | 34 | 35 | /** 36 | Create a new critical region. 37 | Normally, you do not need to create your own critical region, because 38 | you can use Max’s global critical region. Only use this function (in 39 | your object’s instance creation method) if you are certain you are not 40 | able to use the global critical region. 41 | 42 | @ingroup critical 43 | @param x A #t_critical struct will be returned to you via this pointer. 44 | */ 45 | void critical_new(t_critical *x); 46 | 47 | 48 | /** 49 | Enter a critical region. 50 | Typically you will want the argument to be zero to enter the global 51 | critical region, although you could pass your own critical created with 52 | critical_new(). It is important to try to keep the amount of code in 53 | the critical region to a minimum. 54 | Exit the critical region with critical_exit(). 55 | 56 | @ingroup critical 57 | @param x A pointer to a #t_critical struct, or zero to uses Max’s global critical region. 58 | @see critical_exit() 59 | */ 60 | void critical_enter(t_critical x); 61 | 62 | 63 | /** 64 | Leave a critical region. 65 | Typically you will want the argument to be zero to exit the global 66 | critical region, although, you if you are using your own critical regions 67 | you will want to pass the same one that you previously passed to 68 | critical_enter(). 69 | 70 | @ingroup critical 71 | @param x A pointer to a #t_critical struct, or zero to uses Max’s global critical region. 72 | */ 73 | void critical_exit(t_critical x); 74 | 75 | 76 | /** 77 | Free a critical region created with critical_new(). 78 | If you created your own critical region, you will need to free it in your object’s free method. 79 | 80 | @ingroup critical 81 | @param x The #t_critical struct that will be freed. 82 | */ 83 | void critical_free(t_critical x); 84 | 85 | 86 | /** Try to enter a critical region if it is not locked. 87 | @ingroup critical 88 | @param x A pointer to a #t_critical struct, or zero to uses Max’s global critical region. 89 | @return returns non-zero if there was a problem entering 90 | @see critical_enter() 91 | */ 92 | short critical_tryenter(t_critical x); 93 | 94 | 95 | #if C74_PRAGMA_STRUCT_PACKPUSH 96 | #pragma pack(pop) 97 | #elif C74_PRAGMA_STRUCT_PACK 98 | #pragma pack() 99 | #endif 100 | 101 | END_USING_C_LINKAGE 102 | 103 | #endif // _EXT_CRITICAL_H_ 104 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_default.h: -------------------------------------------------------------------------------- 1 | #ifndef __EXT_DEFAULT_H__ 2 | #define __EXT_DEFAULT_H__ 3 | 4 | #define DEFAULT_GLOBAL (void *)-1L // this will be changed to NULL once hashtab supports it 5 | 6 | #include "ext_prefix.h" 7 | #include "ext_mess.h" 8 | 9 | BEGIN_USING_C_LINKAGE 10 | 11 | t_max_err patcher_setdefault(t_object *patcher, t_symbol *key, long argc, t_atom *argv); 12 | t_max_err patcher_getdefault(t_object *patcher, t_symbol *key, long *argc, t_atom *argv); 13 | t_max_err patcher_removedefault(t_object *patcher, t_symbol *key); 14 | 15 | END_USING_C_LINKAGE 16 | 17 | #endif // __EXT_DEFAULT_H__ 18 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_drag.h: -------------------------------------------------------------------------------- 1 | // ext_drag.h copyright 2008 cycling '74 2 | // functions for handling drag-and-drop from the max file browser (but not from the mac finder) 3 | 4 | #ifndef __EXT_DRAG_H__ 5 | 6 | #define __EXT_DRAG_H__ 7 | 8 | #include "ext_prefix.h" 9 | #include "ext_mess.h" 10 | 11 | BEGIN_USING_C_LINKAGE 12 | 13 | enum { 14 | JDRAG_MATCHFLAGS_ANY = 1 // any item with this role is OK, default is that all must match 15 | }; 16 | 17 | typedef struct _jdrag_inquiry 18 | { 19 | t_symbol *i_role; // kind of file that works (one inquiry per file kind) 20 | t_symbol *i_prepend; // corresponding message 21 | } t_jdrag_inquiry; 22 | 23 | char *jdrag_getitemstring(t_object *dg, long index, long quote, long backslash); 24 | t_object *jdrag_getobject(t_object *dg, long index); 25 | void jdrag_getlocation(t_object *dg, long index, double *xpos, double *ypos); 26 | t_object *jdrag_createobject(t_object *dg, t_object *pv, void *d, long dragobjectindex); 27 | t_object *jdrag_createnewobj(t_object *dg, t_object *pv, char *classname, char *str, long dragobjectindex); 28 | t_object *jdrag_createmessage(t_object *dg, t_object *pv, t_symbol *msg, long ac, t_atom *av, long dragobjectindex); 29 | long jdrag_itemcount(t_object *dg); 30 | 31 | // dg the jdrag object 32 | // rcv the jbox which will have a message called when the dragged thing is released 33 | // msg the message name that will be sent to the box when the dragged thing is released 34 | // desc a description to be displayed in a contextual menu for the drop action 35 | // arg user data to be passed to the drag function (for example, the t_symbol* of the message to call in the case of jdrag_box_add()) 36 | void jdrag_add(t_object *dg, t_object *rcv, t_symbol *msg, const char *desc, void *arg); 37 | 38 | // same as jdrag_add but msg will be sent to rcv for each file in the drag-n-drop 39 | // when using jdrag_add() version caller must iterate directly using jdrag_itemcount, etc. 40 | void jdrag_add_iterated(t_object *dg, t_object *rcv, t_symbol *msg, const char *desc, void *arg); 41 | 42 | void jdrag_process_drop(t_object *dx, t_object *receiver, void *ref, t_symbol *msg, void *src, double x, double y); 43 | 44 | 45 | long jdrag_matchdragrole(t_object *dx, t_symbol *role, long flags); 46 | 47 | 48 | void jdrag_setboxlocation(t_object *dg, t_object *box); 49 | 50 | 51 | void jdrag_object_add(t_object *dg, t_object *obj, t_symbol *msg); 52 | 53 | // a wrapper around jbox_add() used by most ui objects; demonstrated in the pictmeter~ example project in the sdk 54 | void jdrag_box_add(t_object *dg, t_object *box, t_symbol *msg); 55 | 56 | 57 | END_USING_C_LINKAGE 58 | 59 | #endif // __EXT_DRAG_H__ 60 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_dynamiccolor.h: -------------------------------------------------------------------------------- 1 | // 2 | // ext_dynamiccolor.h 3 | // max4 4 | // 5 | // Created by Jeremy Bernstein on 19.10.19. 6 | // 7 | 8 | #ifndef ext_dynamiccolor_h 9 | #define ext_dynamiccolor_h 10 | 11 | #include "jgraphics.h" 12 | 13 | BEGIN_USING_C_LINKAGE 14 | 15 | t_bool object_attr_dynamiccolor_supported(t_object *x, t_symbol *attrname); 16 | t_bool object_attr_dynamiccolor_setsym_setup(t_object *x, t_symbol *attrname, long ac, t_atom *av); 17 | 18 | // Note: object_attr_dynamiccolor_apply needs to be called after setters to make the final color available in the base attribute 19 | t_symbol *object_attr_dynamiccolor_getname(t_object *x, t_symbol *attrname); 20 | t_max_err object_attr_dynamiccolor_setname(t_object *x, t_symbol *attrname, t_symbol *colorname); 21 | t_bool object_attr_dynamiccolor_geton(t_object *x, t_symbol *attrname); 22 | t_max_err object_attr_dynamiccolor_seton(t_object *x, t_symbol *attrname, t_bool on); 23 | t_max_err object_attr_dynamiccolor_getregular(t_object *x, t_symbol *attrname, long *argc, t_atom **argv); 24 | t_max_err object_attr_dynamiccolor_setregular(t_object *x, t_symbol *attrname, long argc, t_atom *argv); 25 | t_jrgba object_attr_dynamiccolor_getregularrgba(t_object *x, t_symbol *attrname); 26 | t_max_err object_attr_dynamiccolor_setregularrgba(t_object *x, t_symbol *attrname, t_jrgba *color); 27 | 28 | t_symbol *object_attr_dynamiccolor_gethumanname(t_object *x, t_symbol *attrname); 29 | 30 | t_jpopupmenu *dynamiccolor_getmenu(t_object *context, t_symbol *current, long mask, long *selecteditem, long *headercount, t_bool filtered); 31 | void dynamiccolor_handlemenu(t_object *context, long itemindex, t_symbol **current, t_bool filtered); 32 | 33 | void object_attr_dynamiccolor_apply(t_object *x, t_symbol *attrname); 34 | 35 | typedef enum { 36 | DYNAMICCOLOR_FLAGS_NONE = 0x0000, 37 | DYNAMICCOLOR_FLAGS_LIVE = 0x0001 // should only be linked in a Live context 38 | } t_dynamiccolor_flags; 39 | 40 | t_max_err class_attr_dynamiccolor_init(t_class *c, t_symbol *name, t_dynamiccolor_flags flags); 41 | 42 | // Adds an attr_attr to this attribute that is not saved to disk but only used to hold the default dynamic color name and to check if this attribute has dynamic color enabled. 43 | #define CLASS_ATTR_DYNAMICCOLOR_FLAGS(c, name, flags, semflags, color_parsestring) \ 44 | class_attr_addattr_parse(c, name, "dynamiccolor_default", gensym("symbol"), flags, color_parsestring); \ 45 | class_attr_dynamiccolor_init(c, gensym(name), semflags); 46 | 47 | #define CLASS_ATTR_DYNAMICCOLOR(c, name, flags, color_parsestring) \ 48 | CLASS_ATTR_DYNAMICCOLOR_FLAGS(c, name, flags, DYNAMICCOLOR_FLAGS_NONE, color_parsestring); 49 | 50 | END_USING_C_LINKAGE 51 | 52 | #endif /* ext_dynamiccolor_h */ 53 | 54 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_event.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_EVENT_H_ 2 | #define _EXT_EVENT_H_ 3 | 4 | // NOTE: This file is obsolete. 5 | 6 | #endif /* _EXT_EVENT_H_ */ 7 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_expr.h: -------------------------------------------------------------------------------- 1 | /* ext_expr.h -- header file for writing expressions */ 2 | 3 | #ifndef _EXT_EXPR_H_ 4 | #define _EXT_EXPR_H_ 5 | 6 | #include "ext_prefix.h" 7 | #include "ext_mess.h" 8 | 9 | BEGIN_USING_C_LINKAGE 10 | 11 | #if C74_PRAGMA_STRUCT_PACKPUSH 12 | #pragma pack(push, 2) 13 | #elif C74_PRAGMA_STRUCT_PACK 14 | #pragma pack(2) 15 | #endif 16 | 17 | #define EXPR_MAX_VARS 9 18 | 19 | /** Defines for ex_type. 20 | We treat parenthesis and brackets special to keep a pointer to their match in the content. 21 | @ingroup expr 22 | */ 23 | typedef enum { 24 | ET_INT = 0x1, ///< an int 25 | ET_FLT = 0x2, ///< a float 26 | ET_OP = 0x3, ///< operator 27 | ET_STR = 0x4, ///< string 28 | ET_TBL = 0x5, ///< a table, the content is a pointer 29 | ET_FUNC = 0x6, ///< a function 30 | ET_SYM = 0x7, ///< symbol ("string") 31 | ET_VSYM = 0x8, ///< variable symbol ("$s?") 32 | ET_LP = 0x9, ///< left parenthesis 33 | ET_LB = 0x10, ///< left bracket 34 | ET_II = 0x11, ///< and integer inlet 35 | ET_FI = 0x12, ///< float inlet 36 | ET_SI = 0x13 ///< string inlet 37 | } e_max_expr_types; 38 | 39 | /** ex_ex. 40 | @ingroup expr 41 | */ 42 | typedef struct ex_ex { 43 | union { 44 | t_atom_long v_int; 45 | double v_flt; 46 | t_atom_long op; 47 | char **ptr; 48 | } ex_cont; ///< content 49 | long ex_type; ///< type of the node 50 | } t_ex_ex; 51 | 52 | 53 | /** Struct for an instance of expr. 54 | @ingroup expr 55 | */ 56 | typedef struct expr { 57 | t_object exp_ob; 58 | void *exp_outlet; 59 | t_ex_ex *exp_stack; 60 | t_ex_ex exp_var[EXPR_MAX_VARS]; 61 | t_ex_ex exp_res; ///< the result of last evaluation 62 | } t_expr; 63 | 64 | /** Create a new expr object. 65 | @ingroup expr 66 | 67 | @param argc Count of arguments in argv. 68 | @param argv Arguments that are used to create the expr. See the example below for details. 69 | @param types A pre-existing array of nine t_atoms, that will hold the 70 | types of any variable arguments created in the expr. 71 | The types are returned in the a_type field of each 72 | #t_atom. If an argument was not present, #A_NOTHING is returned. 73 | @return expr_new() creates an expr object from the arguments in argv and 74 | returns the type of any expr-style arguments contained in argv (i.e. 75 | $i1, etc.) in atoms in an array pointed to by types. 76 | 77 | @remark types should already exist as an array of nine t_atom values, all of which will be filled in by 78 | expr_new(). If an argument was not present, it will set to type 79 | #A_NOTHING. For example, suppose argv pointed to the following atoms: 80 | @code 81 | $i1 (A_SYM) 82 | + (A_SYM) 83 | $f3 (A_SYM) 84 | + (A_SYM) 85 | 3 (A_LONG) 86 | @endcode 87 | 88 | After calling expr_new, types would contain the following: 89 | @code 90 | Index Argument Type Value 91 | 0 1 ($i1) A_LONG 0 92 | 1 2 A_NOTHING 0 93 | 2 3 ($f3) A_FLOAT 0.0 94 | 3 4 A_NOTHING 0 95 | 4 5 A_NOTHING 0 96 | 5 6 A_NOTHING 0 97 | 6 7 A_NOTHING 0 98 | 7 8 A_NOTHING 0 99 | 8 9 A_NOTHING 0 100 | @endcode 101 | */ 102 | void *expr_new(long argc, t_atom *argv, t_atom *types); 103 | 104 | 105 | /** Evaluate an expression in an expr object. 106 | @ingroup expr 107 | 108 | @param x The expr object to evaluate. 109 | @param argc Count of arguments in argv. 110 | @param argv Array of nine t_atom values that will be substituted for 111 | variable arguments (such as $i1) in the expression. 112 | Unused arguments should be of type #A_NOTHING. 113 | @param result A pre-existing t_atom that will hold the type and value 114 | of the result of evaluating the expression. 115 | @return . 116 | 117 | @remark Evaluates the expression in an expr object with arguments in argv and 118 | returns the type and value of the evaluated expression as a t_atom in 119 | result. result need only point to a single #t_atom, but argv should 120 | contain at least argc t_atom values. If, as in the example shown above under 121 | expr_new(), there are “gaps” between arguments, they should be filled 122 | in with t_atom of type #A_NOTHING. 123 | */ 124 | short expr_eval(t_expr *x, long argc, t_atom *argv, t_atom *result); 125 | 126 | 127 | void expr_install(method fun, const char *buf, long argc); 128 | 129 | 130 | 131 | #if C74_PRAGMA_STRUCT_PACKPUSH 132 | #pragma pack(pop) 133 | #elif C74_PRAGMA_STRUCT_PACK 134 | #pragma pack() 135 | #endif 136 | 137 | END_USING_C_LINKAGE 138 | 139 | #endif // _EXT_EXPR_H_ 140 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_fun.h: -------------------------------------------------------------------------------- 1 | /*************************/ 2 | /* Copyright 1988 IRCAM. */ 3 | /*************************/ 4 | 5 | #ifndef _EXT_FUN_H_ 6 | #define _EXT_FUN_H_ 7 | 8 | // NOTE: This file is obsolete. 9 | 10 | #endif /* _EXT_FUN_H_ */ 11 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_globalsymbol.h: -------------------------------------------------------------------------------- 1 | #ifndef __EXT_GLOBALSYMBOL_H__ 2 | #define __EXT_GLOBALSYMBOL_H__ 3 | 4 | #include "ext_prefix.h" 5 | #include "ext_mess.h" 6 | 7 | BEGIN_USING_C_LINKAGE 8 | 9 | /** Get a reference to an object that is bound to a #t_symbol. 10 | @ingroup misc 11 | @param x The object that is getting the reference to the symbol. 12 | @param name The name of the symbol to reference. 13 | @param classname The name of the class of which the object we are referencing should be an instance. 14 | @return The s_thing of the #t_symbol. 15 | 16 | @remark An example of real-world use is to get the buffer~ object associated with a symbol. 17 | @code 18 | // the struct of our object 19 | typedef struct _myobject { 20 | t_object obj; 21 | t_symbol *buffer_name; 22 | t_buffer *buffer_object; 23 | } t_myobject; 24 | 25 | void myobject_setbuffer(t_myobject *x, t_symbol *s, long argc, t_atom *argv) 26 | { 27 | if(s != x->buffer_name){ 28 | // Reference the buffer associated with the incoming name 29 | x->buffer_object = (t_buffer *)globalsymbol_reference((t_object *)x, s->s_name, "buffer~"); 30 | 31 | // If we were previously referencing another buffer, we should not longer reference it. 32 | globalsymbol_dereference((t_object *)x, x->buffer_name->s_name, "buffer~"); 33 | 34 | x->buffer_name = s; 35 | } 36 | } 37 | @endcode 38 | */ 39 | void *globalsymbol_reference(t_object *x, C74_CONST char *name, C74_CONST char *classname); 40 | 41 | 42 | /** Stop referencing an object that is bound to a #t_symbol, previously referenced using globalsymbol_reference(). 43 | @ingroup misc 44 | @param x The object that is getting the reference to the symbol. 45 | @param name The name of the symbol to reference. 46 | @param classname The name of the class of which the object we are referencing should be an instance. 47 | @see globalsymbol_reference() 48 | */ 49 | void globalsymbol_dereference(t_object *x, C74_CONST char *name, C74_CONST char *classname); 50 | 51 | 52 | /** Bind an object to a #t_symbol. 53 | @ingroup misc 54 | @param x The object to bind to the #t_symbol. 55 | @param name The name of the #t_symbol to which the object will be bound. 56 | @param flags Pass 0. 57 | @return A Max error code. 58 | */ 59 | t_max_err globalsymbol_bind(t_object *x, C74_CONST char *name, long flags); 60 | 61 | 62 | /** Remove an object from being bound to a #t_symbol. 63 | @ingroup misc 64 | @param x The object from which to unbind the #t_symbol. 65 | @param name The name of the #t_symbol from which the object will be unbound. 66 | @param flags Pass 0. 67 | */ 68 | void globalsymbol_unbind(t_object *x, C74_CONST char *name, long flags); 69 | 70 | 71 | // private 72 | void globalsymbol_notify(t_object *x, C74_CONST char *name, t_symbol *msg, void *data); 73 | 74 | 75 | END_USING_C_LINKAGE 76 | 77 | #endif // __EXT_GLOBALSYMBOL_H__ 78 | 79 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_infer_system.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_INFER_SYSTEM_H_ 2 | #define _EXT_INFER_SYSTEM_H_ 3 | 4 | #if !(defined(MAC_VERSION)) && !(defined(WIN_VERSION)) && !(defined(LINUX_VERSION)) 5 | 6 | // in case this isn't set let's set it up automatically 7 | #ifdef __APPLE__ 8 | #define MAC_VERSION 1 9 | #elif defined(_WIN32) 10 | #define WIN_VERSION 1 11 | #elif defined(__linux__) 12 | #define LINUX_VERSION 1 13 | #else 14 | #error Unexepected build platform! 15 | #endif 16 | 17 | #endif 18 | 19 | #if defined(_WIN64) || defined(__LP64__) 20 | #define C74_X64 21 | #endif 22 | 23 | #if defined (__arm__) || defined (__arm64__) 24 | #define C74_ARM 1 25 | #else 26 | #define C74_INTEL 1 27 | #endif 28 | 29 | #endif /* _EXT_INFER_SYSTEM_H_ */ 30 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_maxtypes.h: -------------------------------------------------------------------------------- 1 | // ext_maxtypes.h: Max data types and structure definitions for external objects 2 | // Copyright 1990-2004 IRCAM/Cycling '74 -- All rights reserved 3 | 4 | #ifndef _EXT_MAXTYPES_H_ 5 | #define _EXT_MAXTYPES_H_ 6 | 7 | #include "ext_prefix.h" 8 | #include "ext_mess.h" 9 | 10 | BEGIN_USING_C_LINKAGE 11 | 12 | #if C74_PRAGMA_STRUCT_PACKPUSH 13 | #pragma pack(push, 2) 14 | #elif C74_PRAGMA_STRUCT_PACK 15 | #pragma pack(2) 16 | #endif 17 | 18 | 19 | /** A patcher. As of Max 5, the patcher struct is opaque. 20 | Messages can be sent to a patcher using object_method() or object_method_typed(), or by using @ref attr accessors. 21 | @ingroup patcher 22 | */ 23 | typedef t_object t_patcher; 24 | 25 | 26 | /** A box. As of Max 5, the box struct is opaque. 27 | Messages can be sent to a box using object_method() or object_method_typed(), or by using @ref attr accessors. 28 | @ingroup patcher 29 | */ 30 | typedef t_object t_box; 31 | 32 | 33 | /** patcher iteration flags 34 | @ingroup patcher 35 | */ 36 | enum { 37 | PI_DEEP = 1, ///< descend into subpatchers (not used by audio library) 38 | PI_REQUIREFIRSTIN = 2, ///< if b->b_firstin is NULL, do not call function 39 | PI_WANTBOX = 4, ///< instead, of b->b_firstin, pass b to function, whether or not b->b_firstin is NULL 40 | PI_SKIPGEN = 8, 41 | PI_WANTPATCHER = 16 42 | }; 43 | 44 | /** A simple doubly-linked list used by the #t_funbuff object. 45 | @ingroup funbuff 46 | */ 47 | typedef struct zll 48 | { /* note: no obj header */ 49 | long z_x; 50 | long z_y; 51 | struct zll *z_next; 52 | struct zll *z_prev; 53 | } Zll, t_zll; 54 | 55 | 56 | /** The structure of a funbuff object 57 | @ingroup funbuff 58 | */ 59 | typedef struct funbuff 60 | { 61 | t_object f_obj; 62 | void *f_outlet; 63 | void *f_outlet1; 64 | void *f_outlet2; 65 | t_zll f_head; ///< head of double linked list of function elements 66 | t_zll *f_foot; ///< foot in the door pointer for list 67 | long f_gotoDelta; ///< used by goto and next 68 | long f_selectX; ///< selected region start 69 | long f_selectW; ///< selected region width 70 | t_symbol *f_sym; ///< filename 71 | long f_y; ///< y-value from inlet 72 | char f_yvalid; ///< flag that y has been set since x has 73 | char f_embed; ///< flag for embedding funbuff values in patcher 74 | } Funbuff, t_funbuff; 75 | 76 | 77 | #if C74_PRAGMA_STRUCT_PACKPUSH 78 | #pragma pack(pop) 79 | #elif C74_PRAGMA_STRUCT_PACK 80 | #pragma pack() 81 | #endif 82 | 83 | END_USING_C_LINKAGE 84 | 85 | #endif // _EXT_MAXTYPES_H_ 86 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_menu.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_MENU_H_ 2 | #define _EXT_MENU_H_ 3 | 4 | // NOTE: This file is obsolete. 5 | 6 | #endif /* _EXT_MENU_H_ */ 7 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_midi.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_MIDI_H_ 2 | #define _EXT_MIDI_H_ 3 | 4 | // NOTE: This file is obsolete. 5 | 6 | #endif /* _EXT_MIDI_H_ */ 7 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_numc.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_NUMC_H_ 2 | #define _EXT_NUMC_H_ 3 | 4 | // NOTE: This file is obsolete. 5 | 6 | #endif /* _EXT_NUMC_H_ */ 7 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_obstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | * obstring.h 3 | * 4 | * Copyright 2006 Cycling '74. All rights reserved. 5 | * 6 | */ 7 | 8 | #ifndef _EXT_OBSTRING_H_ 9 | #define _EXT_OBSTRING_H_ 10 | 11 | #include "ext_prefix.h" 12 | #include "ext_mess.h" 13 | 14 | BEGIN_USING_C_LINKAGE 15 | 16 | #if C74_PRAGMA_STRUCT_PACKPUSH 17 | #pragma pack(push, 2) 18 | #elif C74_PRAGMA_STRUCT_PACK 19 | #pragma pack(2) 20 | #endif 21 | 22 | 23 | /** 24 | The string object. This struct is provided for debugging convenience, 25 | but should be considered opaque and is subject to change without notice. 26 | 27 | @ingroup string 28 | */ 29 | typedef struct _string 30 | { 31 | t_object s_obj; 32 | char *s_text; 33 | long s_size; // number of bytes allocated 34 | } t_string; 35 | 36 | #if C74_PRAGMA_STRUCT_PACKPUSH 37 | #pragma pack(pop) 38 | #elif C74_PRAGMA_STRUCT_PACK 39 | #pragma pack() 40 | #endif 41 | 42 | 43 | /** 44 | Create a new string object. 45 | @ingroup string 46 | @param psz Pointer to a C-string that will be copied to memory internal to this string object instance. 47 | @return The new string object instance pointer. 48 | */ 49 | t_string* string_new(const char *psz); 50 | 51 | 52 | /** 53 | Fetch a pointer to a string object's internal C-string. 54 | @ingroup string 55 | @param x The string object instance. 56 | @return A pointer to the internally maintained C-string. 57 | */ 58 | const char* string_getptr(t_string *x); 59 | 60 | 61 | /** 62 | Reserve additional memory for future string growth. 63 | @ingroup string 64 | @param x The string object instance. 65 | @param numbytes The total number of bytes to allocate for this string object. 66 | */ 67 | void string_reserve(t_string *x, long numbytes); 68 | 69 | 70 | /** 71 | Append a C-string onto the existing string maintained by a #t_string object. 72 | Memory allocation for the string will grow as needed to hold the concatenated string. 73 | 74 | @ingroup string 75 | @param x The string object instance. 76 | @param s A string to append/concatenate with the existing string. 77 | */ 78 | void string_append(t_string *x, const char *s); 79 | 80 | 81 | /** 82 | Shorten a string by eliminating N characters from the end. 83 | 84 | @ingroup string 85 | @param x The string object instance. 86 | @param numchars The number of characters to chop from the end of the string. 87 | */ 88 | void string_chop(t_string *x, long numchars); 89 | 90 | 91 | // TODO: This object has a number of additional methods exposed via Max's messaging interface 92 | 93 | END_USING_C_LINKAGE 94 | 95 | #endif //#ifndef _EXT_OBSTRING_H_ 96 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_oms.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_OMS_H_ 2 | #define _EXT_OMS_H_ 3 | 4 | // OMS is no longer supported 5 | 6 | #endif /* _EXT_OMS_H_ */ 7 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_packages.h: -------------------------------------------------------------------------------- 1 | /* 2 | ext_packages.h 3 | API for access to Max Packages. 4 | Timothy Place 5 | Copyright 2013 - Cycling '74 6 | */ 7 | 8 | #ifndef _EXT_PACKAGES_H_ 9 | #define _EXT_PACKAGES_H_ 10 | 11 | #include "ext_prefix.h" 12 | #include "ext_mess.h" 13 | #include "ext_linklist.h" 14 | #include "ext_dictionary.h" 15 | 16 | /** A container for a path/filename pair, 17 | together with additional meta fields for special cases 18 | @ingroup packages 19 | */ 20 | typedef struct _package_file { 21 | t_symbol *filename; 22 | t_symbol *name; 23 | short path; 24 | } t_package_file; 25 | 26 | 27 | BEGIN_USING_C_LINKAGE 28 | 29 | 30 | /** return the max path for a named package's folder 31 | 32 | @ingroup packages 33 | @param packagename the name of the package 34 | @return the max path id for the package's folder 35 | */ 36 | short packages_getpackagepath(const char *packagename); 37 | 38 | 39 | /** return linklist of max path ids for a given subpath of a package 40 | 41 | @ingroup packages 42 | @param subfoldername the name of the folder (e.g. templates, prototypes, extensions, etc) 43 | @param includesysfolder 1 if you want it to include the default max copy (e.g. stuff in the C74 folder), 44 | a negative number will use the specified folder as the system folder 45 | 0 will ignore the default location 46 | @return linklist of max path ids -- you are responsible for freeing this linklist. 47 | */ 48 | t_linklist *packages_createsubpathlist(const char *subfoldername, short includesysfolder); 49 | 50 | 51 | /** return a linklist of max path ids for a given subpath of a package 52 | and optionally a dictionary with all of the files contained therein. 53 | 54 | @ingroup packages 55 | @param subfoldername the name of the folder (e.g. templates, prototypes, extensions, etc) 56 | @param suffix_selector a file suffix used to filter only the specified files in the path (e.g., ".maxpat") 57 | @param includesysfolder 1 if you want it to include the default max copy (e.g. stuff in the C74 folder), 58 | a negative number will use the specified folder as the system folder 59 | 0 will ignore the default location 60 | @param subpathlist if not NULL, a linklist is alloc'd and returned here with all of the max path ids 61 | @param names_to_packagefiles if not NULL, a dictionary is alloc'd and returned, keys are the names (suffix stripped) and the values are t_package_file instances 62 | the linklist in the dictionary will have its keys sorted alphabetically 63 | @return the usual max error code 64 | */ 65 | t_max_err packages_getsubpathcontents(const char *subfoldername, const char *suffix_selector, short includesysfolder, t_linklist **subpathlist, t_dictionary **names_to_packagefiles); 66 | 67 | 68 | END_USING_C_LINKAGE 69 | 70 | #endif // _EXT_PACKAGES_H_ 71 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_preferences.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_PREFERENCES_H_ 2 | #define _EXT_PREFERENCES_H_ 3 | 4 | #include "ext_prefix.h" 5 | #include "ext_mess.h" 6 | #include "ext_dictionary.h" 7 | 8 | BEGIN_USING_C_LINKAGE 9 | 10 | t_max_err preferences_getatomforkey(t_symbol *key, t_atom *value); 11 | t_symbol *preferences_getsym(C74_CONST char *name); 12 | void preferences_setsym(C74_CONST char *name, t_symbol *value); 13 | long preferences_getlong(C74_CONST char *name); 14 | void preferences_setlong(C74_CONST char *name, long value); 15 | long preferences_getchar(C74_CONST char *name); 16 | void preferences_setchar(C74_CONST char *name, long value); 17 | t_max_err preferences_getatoms(C74_CONST char *name, long *argc, t_atom **argv); 18 | t_max_err preferences_setatoms(C74_CONST char *name, long argc, t_atom *argv); 19 | void *preferences_define(C74_CONST char *name, C74_CONST char *type, C74_CONST char *label, C74_CONST char *style, C74_CONST char *category, long attrflags, method get, method set, long flags); 20 | void *preferences_class_define(t_class *c, C74_CONST char *name, C74_CONST char *type, C74_CONST char *label, C74_CONST char *style, C74_CONST char *category, long attrflags, method get, method set, long flags); 21 | void *preferences_defineoption(C74_CONST char *name, C74_CONST char *label, C74_CONST char *category, char *ptr, method notify, long flags); 22 | void *preferences_class_defineoption(t_class *c, C74_CONST char *name, C74_CONST char *label, C74_CONST char *category, char *ptr, method notify, long flags); 23 | t_max_err preferences_writedictionary(C74_CONST t_dictionary *d, C74_CONST char *filename); 24 | t_max_err preferences_readdictionary(C74_CONST char *filename, t_dictionary **d); 25 | t_dictionary *simpleprefs_dictionary(); 26 | 27 | END_USING_C_LINKAGE 28 | 29 | enum { 30 | PREFERENCES_FLAGS_INVISIBLE = 1, 31 | PREFERENCES_FLAGS_DONTSAVE = 2 32 | }; 33 | 34 | 35 | #endif // _EXT_PREFERENCES_H_ 36 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_prefix_includes.h: -------------------------------------------------------------------------------- 1 | // 2 | // ext_prefix_includes.h 3 | // max 4 | // 5 | // Created by Jeremy Bernstein on 27.07.21. 6 | // 7 | 8 | #ifndef __EXT_PREFIX_INCLUDES_H__ 9 | #define __EXT_PREFIX_INCLUDES_H__ 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #ifdef MAC_VERSION 16 | 17 | // If the prefix header containing #include is not present, then we include 18 | // a minimal set of required headers here. 19 | #ifndef __MACTYPES__ 20 | #include 21 | #endif 22 | 23 | #include 24 | 25 | #endif // MAC_VERSION 26 | 27 | #ifdef WIN_VERSION 28 | 29 | #ifndef _CRT_SECURE_NO_WARNINGS 30 | #define _CRT_SECURE_NO_WARNINGS 31 | #endif 32 | 33 | #ifndef _SCL_SECURE_NO_WARNINGS 34 | #define _SCL_SECURE_NO_WARNINGS 35 | #endif 36 | 37 | #ifndef WIN32_LEAN_AND_MEAN 38 | #define WIN32_LEAN_AND_MEAN 39 | #endif 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | #endif // WIN_VERSION 47 | 48 | // c standard library 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include 57 | #include 58 | #include 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif /* __EXT_PREFIX_INCLUDES_H__ */ 65 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_proto_win.h: -------------------------------------------------------------------------------- 1 | #ifndef __EXT_PROTO_WIN_H__ 2 | #define __EXT_PROTO_WIN_H__ 3 | 4 | #include "ext_prefix.h" 5 | 6 | BEGIN_USING_C_LINKAGE 7 | 8 | #if C74_PRAGMA_STRUCT_PACKPUSH 9 | #pragma pack(push, 2) 10 | #elif C74_PRAGMA_STRUCT_PACK 11 | #pragma pack(2) 12 | #endif 13 | 14 | #ifdef WIN_VERSION 15 | 16 | HINSTANCE main_get_instance(); 17 | HWND main_get_client(); 18 | HWND main_get_frame(); 19 | LPSTR main_get_commandline(); 20 | LPSTR main_get_appfilename(); 21 | 22 | #endif // WIN_VERSION 23 | 24 | #if C74_PRAGMA_STRUCT_PACKPUSH 25 | #pragma pack(pop) 26 | #elif C74_PRAGMA_STRUCT_PACK 27 | #pragma pack() 28 | #endif 29 | 30 | END_USING_C_LINKAGE 31 | 32 | #endif // __EXT_PROTO_WIN_H__ 33 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_quickmap.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __QUICKMAP_H__ 3 | #define __QUICKMAP_H__ 4 | 5 | #include "ext_prefix.h" 6 | #include "ext_mess.h" 7 | #include "ext_hashtab.h" 8 | 9 | #if C74_PRAGMA_STRUCT_PACKPUSH 10 | #pragma pack(push, 2) 11 | #elif C74_PRAGMA_STRUCT_PACK 12 | #pragma pack(2) 13 | #endif 14 | 15 | 16 | /** The quickmap object. This struct is provided for debugging convenience, 17 | but should be considered opaque and is subject to change without notice. 18 | 19 | @ingroup quickmap 20 | */ 21 | typedef struct _quickmap { 22 | t_object m_obj; 23 | t_hashtab *m_p1key; 24 | t_hashtab *m_p2key; 25 | } t_quickmap; 26 | 27 | 28 | #if C74_PRAGMA_STRUCT_PACKPUSH 29 | #pragma pack(pop) 30 | #elif C74_PRAGMA_STRUCT_PACK 31 | #pragma pack() 32 | #endif 33 | 34 | 35 | BEGIN_USING_C_LINKAGE 36 | 37 | /** 38 | Create a new quickmap object. 39 | 40 | @ingroup quickmap 41 | @return Pointer to the new quickmap object. 42 | */ 43 | void *quickmap_new(void); 44 | 45 | 46 | /** 47 | Add a pair of keys mapped to each other to the quickmap. 48 | Note that these are considered to be a #t_symbol internally. 49 | This means that if you are mapping a #t_symbol to a #t_object, for example, the #t_object will not automatically be 50 | freed when you free the quickmap (unlike what happens when you typically free a #t_hashtab). 51 | 52 | @ingroup quickmap 53 | 54 | @param x The quickmap instance. 55 | @param p1 The (first) key. 56 | @param p2 The value (or the second key). 57 | @return A Max error code. 58 | */ 59 | void quickmap_add(t_quickmap *x, void *p1, void *p2); 60 | 61 | 62 | /** 63 | Drop a pair of keys mapped to each other in the quickmap. 64 | 65 | @ingroup quickmap 66 | 67 | @param x The quickmap instance. 68 | @param p1 The first key. 69 | @param p2 The second key. 70 | @return A Max error code. 71 | */ 72 | void quickmap_drop(t_quickmap *x, void *p1, void *p2); 73 | 74 | 75 | /** 76 | Given a (first) key, lookup the value (the second key). 77 | 78 | @ingroup quickmap 79 | 80 | @param x The quickmap instance. 81 | @param p1 The (first) key. 82 | @param p2 The address of a pointer which will hold the resulting key upon return. 83 | @return A Max error code. 84 | */ 85 | long quickmap_lookup_key1(t_quickmap *x, void *p1, void **p2); 86 | 87 | 88 | /** 89 | Given a (second) key, lookup the value (the first key). 90 | 91 | @ingroup quickmap 92 | 93 | @param x The quickmap instance. 94 | @param p1 The (second) key. 95 | @param p2 The address of a pointer which will hold the resulting key upon return. 96 | @return A Max error code. 97 | */ 98 | long quickmap_lookup_key2(t_quickmap *x, void *p1, void **p2); 99 | 100 | 101 | /** 102 | Set the readonly flag of the quickmap's hash tables. 103 | See hashtab_readonly() for more information about this. 104 | 105 | @ingroup quickmap 106 | 107 | @param x The quickmap instance. 108 | @param way Set to true to make the quickmap readonly (disable thread protection) 109 | or false (the default) to enable thread protection. 110 | */ 111 | void quickmap_readonly(t_quickmap *x, long way); 112 | 113 | 114 | END_USING_C_LINKAGE 115 | 116 | #endif // __QUICKMAP_H__ 117 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_sndfile.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_SNDFILE_H_ 2 | #define _EXT_SNDFILE_H_ 3 | 4 | #include "ext_prefix.h" 5 | #include "ext_mess.h" 6 | #include "ext_sysfile.h" 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | #if C74_PRAGMA_STRUCT_PACKPUSH 13 | #pragma pack(push, 2) 14 | #elif C74_PRAGMA_STRUCT_PACK 15 | #pragma pack(2) 16 | #endif 17 | 18 | typedef struct _sndfileinfo 19 | { 20 | t_int32 sr; 21 | t_ptr_size length; 22 | t_ptr_size sampsize; // in bytes 23 | t_fourcc filetype; 24 | t_uint32 comptype; 25 | t_uint32 format; 26 | char name[128]; 27 | t_int32 byteswap; 28 | t_int32 nchans; 29 | t_ptr_size frames; 30 | void *inst; 31 | void *markers; 32 | t_ptr_size framesize; 33 | t_ptr_size offset; 34 | } t_sndfileinfo; 35 | 36 | short sndfile_info(char *filename, short vol, t_fourcc type, t_sndfileinfo *info); 37 | short soundfile_info(char *filename, short vol, t_fourcc type, t_sndfileinfo *info); 38 | long sndfile_writeheader(t_filehandle fh, t_fourcc type, long size, long nchans, long ssize, long srate, t_fourcc samptype); 39 | 40 | #if C74_PRAGMA_STRUCT_PACKPUSH 41 | #pragma pack(pop) 42 | #elif C74_PRAGMA_STRUCT_PACK 43 | #pragma pack() 44 | #endif 45 | 46 | enum t_sf_filetype { 47 | SF_FILETYPE_AIFF = FOUR_CHAR_CODE('AIFF'), 48 | SF_FILETYPE_SD2 = FOUR_CHAR_CODE('Sd2f'), 49 | SF_FILETYPE_WAVE = FOUR_CHAR_CODE('WAVE'), 50 | SF_FILETYPE_AU = FOUR_CHAR_CODE('ULAW'), 51 | SF_FILETYPE_RAW = FOUR_CHAR_CODE('DATA') 52 | }; 53 | 54 | enum t_sf_samptype { 55 | SF_SAMPTYPE_INT = FOUR_CHAR_CODE('NONE'), 56 | SF_SAMPTYPE_UINT = FOUR_CHAR_CODE('UNSN'), 57 | SF_SAMPTYPE_FL32 = FOUR_CHAR_CODE('FL32'), 58 | SF_SAMPTYPE_FL64 = FOUR_CHAR_CODE('FL64'), 59 | SF_SAMPTYPE_MULAW = FOUR_CHAR_CODE('ULAW'), 60 | SF_SAMPTYPE_ALAW = FOUR_CHAR_CODE('ALAW'), 61 | SF_SAMPTYPE_LE = FOUR_CHAR_CODE('sowt') // little endian twos backwards 62 | }; 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | 69 | enum { 70 | SF_MAXCHANS = 64, 71 | SF_MAXVECS = 66, 72 | //SF_BUFSIZE = 16384, 73 | SF_BUFSIZE_DEF = 120960*4, 74 | SF_BUFSIZE_QUANT = 20160, // 8factorial over two...ensures that we won't have problems wrapping 75 | SF_MULT = 8, 76 | SF_ATOM_MULT = 4, 77 | SF_PRELOAD = 1, 78 | SF_MAXPEND = 128, 79 | SF_EMBED = 1, 80 | SF_WEIRDCUE = 18811, 81 | SF_MAX_SWITCH_PER_VECTOR = 16 82 | }; 83 | 84 | 85 | typedef struct _sfplay_notification { 86 | long cue; 87 | } t_sfplay_notification; 88 | 89 | 90 | typedef struct _soundfile_path { 91 | t_symbol *filename; 92 | short path; 93 | } t_soundfile_path; 94 | 95 | 96 | #endif // _EXT_SNDFILE_H_ 97 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_strings.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_STRINGS_H_ 2 | #define _EXT_STRINGS_H_ 3 | 4 | #include 5 | 6 | #include "ext_prefix.h" 7 | 8 | BEGIN_USING_C_LINKAGE 9 | 10 | #ifndef strncpy_zero 11 | /** Copy the contents of one string to another, in a manner safer than the standard strcpy() or strncpy(). 12 | This is the prefered function to use for this operation in Max. 13 | @ingroup misc 14 | @param dst The destination string (already allocated) for the copy. 15 | @param src The source string that will be copied. 16 | @param size The number of chars allocated to the dst string. 17 | */ 18 | char *strncpy_zero(char *dst, const char* src, long size); 19 | #endif 20 | 21 | 22 | /** Concatenate the contents of one string onto the end of another, 23 | in a manner safer than the standard strcat() or strncat(). 24 | This is the prefered function to use for this operation in Max. 25 | @ingroup misc 26 | @param dst The destination string onto whose end the src string will be appended. 27 | @param src The source string that will be copied. 28 | @param size The number of chars allocated to the dst string. 29 | */ 30 | char *strncat_zero(char *dst, const char* src, long size); 31 | 32 | 33 | /** Copy the contents of a string together with value substitutions, 34 | in a manner safer than the standard sprintf() or snprintf(). 35 | This is the prefered function to use for this operation in Max. 36 | @ingroup misc 37 | @param buffer The destination string (already allocated) for the copy. 38 | @param count The number of chars allocated to the buffer string. 39 | @param format The source string that will be copied, which may include sprintf() formatting codes for substitutions. 40 | @param ... An array of arguments to be substituted into the format string. 41 | */ 42 | int snprintf_zero(char *buffer, size_t count, const char *format, ...); 43 | 44 | 45 | #if TARGET_API_MAC_CARBON 46 | #define CtoPstr(x) CopyCStringToPascal((const char *)(x),(unsigned char *)(x)) 47 | #define PtoCstr(x) CopyPascalStringToC((ConstStr255Param)(x),(char *)(x)) 48 | #endif // TARGET_API_MAC_CARBON 49 | 50 | #define SPRINTF_MAXLEN 4096 51 | 52 | // Legacy 53 | 54 | void ctopcpy(unsigned char *p1, char *p2); 55 | void ptoccpy(char *p1, unsigned char *p2); 56 | void pstrcpy(unsigned char *p2, unsigned char *p1); 57 | 58 | 59 | END_USING_C_LINKAGE 60 | 61 | #endif // _EXT_STRINGS_H_ 62 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_support.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_SUPPORT_H_ 2 | #define _EXT_SUPPORT_H_ 3 | 4 | // NOTE: This file is obsolete. 5 | 6 | #endif /* _EXT_SUPPORT_H_ */ 7 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_symobject.h: -------------------------------------------------------------------------------- 1 | #ifndef __EXT_SYMOBJECT_H__ 2 | #define __EXT_SYMOBJECT_H__ 3 | 4 | #include "ext_prefix.h" 5 | #include "ext_mess.h" 6 | 7 | #if C74_PRAGMA_STRUCT_PACKPUSH 8 | #pragma pack(push, 2) 9 | #elif C74_PRAGMA_STRUCT_PACK 10 | #pragma pack(2) 11 | #endif 12 | 13 | 14 | /** The symobject data structure. 15 | @ingroup symobject 16 | */ 17 | typedef struct _symobject{ 18 | t_object obj; ///< Max object header. 19 | t_symbol *sym; ///< The symbol contained by the object. 20 | long flags; ///< Any user-flags you wish to set or get. 21 | void *thing; ///< A generic pointer for attaching additional data to the symobject. 22 | } t_symobject; 23 | 24 | 25 | #if C74_PRAGMA_STRUCT_PACKPUSH 26 | #pragma pack(pop) 27 | #elif C74_PRAGMA_STRUCT_PACK 28 | #pragma pack() 29 | #endif 30 | 31 | BEGIN_USING_C_LINKAGE 32 | 33 | /** The symobject data structure. 34 | 35 | @ingroup symobject 36 | @param sym A symbol with which to initialize the new symobject. 37 | @return Pointer to the new symobject instance. 38 | */ 39 | void *symobject_new(t_symbol *sym); 40 | 41 | 42 | /** Utility for searching a linklist containing symobjects. 43 | 44 | @ingroup symobject 45 | @param a (opaque) 46 | @param b (opaque) 47 | @return Returns true if a match is found, otherwise returns false. 48 | 49 | @remark The following example shows one common use of the this method. 50 | @code 51 | t_symobject *item = NULL; 52 | long index; 53 | t_symbol *textsym; 54 | 55 | textsym = gensym("something to look for"); 56 | 57 | // search for a symobject with the symbol 'something to look for' 58 | index = linklist_findfirst(s_ll_history, (void **)&item, symobject_linklist_match, textsym); 59 | if(index == -1){ 60 | // symobject not found. 61 | } 62 | else{ 63 | do something with the symobject, or with the index of the symbobject in the linklist 64 | } 65 | @endcode 66 | 67 | */ 68 | long symobject_linklist_match(void *a, void *b); 69 | 70 | 71 | END_USING_C_LINKAGE 72 | 73 | #endif // #ifndef __EXT_SYMOBJECT_H__ 74 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_sysmidi.h: -------------------------------------------------------------------------------- 1 | // sysmidi.h 2 | #ifndef _EXT_SYSMIDI_H_ 3 | #define _EXT_SYSMIDI_H_ 4 | 5 | #include "ext_prefix.h" 6 | #include "ext_mess.h" 7 | 8 | BEGIN_USING_C_LINKAGE 9 | 10 | #if C74_PRAGMA_STRUCT_PACKPUSH 11 | #pragma pack(push, 2) 12 | #elif C74_PRAGMA_STRUCT_PACK 13 | #pragma pack(2) 14 | #endif 15 | 16 | enum { 17 | SYSMIDI_ENABLED = 1, 18 | SYSMIDI_DYNAMIC = 2, 19 | SYSMIDI_PERMANENT = 4 20 | }; 21 | 22 | typedef struct midistate 23 | { 24 | long midicmd; /* top nibble of the most recent status byte */ 25 | long chan; /* midi channel (if not sysex) */ 26 | long sysex; /* true if we are getting a sysex message */ 27 | long argc; /* # of bytes received in msg excluding status byte */ 28 | t_uint8 *data; 29 | } t_midistate; 30 | 31 | typedef struct _midiportinfo { 32 | t_symbol *p_name; 33 | struct _sysmididriver *p_driver; 34 | long p_refnum; 35 | long p_id; 36 | short p_abbrev; 37 | short p_chanoffset; 38 | char p_enabled; 39 | char p_dynamic; // is (was) a dynamically created port 40 | char p_permanent; // should be saved in prefs 41 | char p_delete; 42 | void *p_data1; 43 | long p_data2; 44 | void *p_wait; 45 | t_midistate p_state; 46 | char p_mappingenabled; 47 | } t_midiportinfo; 48 | 49 | typedef struct _sysmididriver { 50 | t_object d_ob; 51 | t_symbol *d_name; 52 | char d_available; // positive response on informational instantiation 53 | char d_hastimer; 54 | method d_sendmethod; 55 | method d_bytesreceivedmethod; 56 | // driver-specific info follows 57 | } t_sysmididriver; 58 | 59 | void sysmidi_enqbigpacket(t_midiportinfo *port, t_uint8 *data, double ts, long len, long contFlags); 60 | long sysmidi_numinports(void); 61 | long sysmidi_numoutports(void); 62 | t_symbol *sysmidi_indextoname(long index, long io); 63 | void sysmidi_iterate(method meth, void *arg, long io); 64 | t_midiportinfo *sysmidi_createport(long id, long refnum, t_symbol *name, t_sysmididriver *dx, long io, long flags); 65 | void sysmidi_deletemarked(long io); 66 | t_midiportinfo *sysmidi_idtoport(long id, long io); 67 | long sysmidi_uniqueid(void); 68 | t_midiportinfo *sysmidi_data1toport(void *data, long io); 69 | t_midiportinfo *sysmidi_nametoport(t_symbol *name, long io); 70 | 71 | #if C74_PRAGMA_STRUCT_PACKPUSH 72 | #pragma pack(pop) 73 | #elif C74_PRAGMA_STRUCT_PACK 74 | #pragma pack() 75 | #endif 76 | 77 | END_USING_C_LINKAGE 78 | 79 | #endif // _EXT_SYSMIDI_H_ 80 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_sysparallel.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_SYSPARALLEL_H_ 2 | #define _EXT_SYSPARALLEL_H_ 3 | 4 | #include "ext_prefix.h" 5 | #include "ext_mess.h" 6 | 7 | #if C74_PRAGMA_STRUCT_PACKPUSH 8 | #pragma pack(push, 2) 9 | #elif C74_PRAGMA_STRUCT_PACK 10 | #pragma pack(2) 11 | #endif 12 | 13 | BEGIN_USING_C_LINKAGE 14 | 15 | enum t_sysparallel_priority { 16 | SYSPARALLEL_PRIORITY_DEFAULT = 0x00, 17 | SYSPARALLEL_PRIORITY_LOW = 0x00, 18 | SYSPARALLEL_PRIORITY_MEDIUM = 0x04, 19 | SYSPARALLEL_PRIORITY_HIGH = 0x08, 20 | SYSPARALLEL_PRIORITY_TASK_LOCAL = 0xa0 21 | }; 22 | 23 | enum { 24 | SYSPARALLEL_STATE_IDLE = 0, 25 | SYSPARALLEL_STATE_RUN = 1, 26 | SYSPARALLEL_STATE_DONE = 0, // changed to be the same as IDLE since it means the same thing 27 | SYSPARALLEL_STATE_QUIT = 3 28 | }; 29 | 30 | enum { 31 | SYSPARALLEL_MAX_WORKERS = 64, 32 | SYSPARALLEL_TASK_FLAG_WORKERTRIGGERS = 0x00000001 // first worker signals other works as necessary 33 | }; 34 | 35 | typedef struct _sysparallel_task 36 | { 37 | t_object ob; 38 | void *obex; 39 | void *data; // global task data 40 | method workerproc; // worker callback function 41 | long workercount; // number of workers to use 42 | struct _sysparallel_worker **workers; // worker array 43 | unsigned char priority; // thread priority 44 | char benchmark; // benchmark 45 | long iteration; // for benchmarking 46 | double begintime; // for benchmarking 47 | double endtime; // for benchmarking 48 | long cancel; // for cancel request 49 | struct _sysparallel_thread_pool *pool; // this will be NULL. unless using SYSPARALLEL_PRIORITY_TASK_LOCAL 50 | long maxworkercount; // maximum number of workers to use 51 | long flags; // flags can be set after sysparallel_task_new but before running 52 | } t_sysparallel_task; 53 | 54 | 55 | typedef struct _sysparallel_worker 56 | { 57 | t_object ob; 58 | void *obex; 59 | void *data; // worker specific data 60 | method workerproc; // worker callback function, worker object passed in 61 | t_sysparallel_task *task; // pointer to task parent (can be used to access global task data) 62 | long id; // worker id 63 | double begintime; // for benchmarking (uses task info) 64 | double endtime; // for benchmarking (uses task info) 65 | 66 | } t_sysparallel_worker; 67 | 68 | 69 | void sysparallel_init(void); 70 | long sysparallel_processorcount(void); 71 | long sysparallel_physical_processorcount(void); 72 | t_sysparallel_task *sysparallel_task_new(void *data, method workerproc, long maxworkercount); 73 | t_max_err sysparallel_task_workercount(t_sysparallel_task *x, long workercount); 74 | t_max_err sysparallel_task_execute(t_sysparallel_task *x); 75 | void sysparallel_task_signalworkers(t_sysparallel_task *x, long count); 76 | t_max_err sysparallel_task_cancel(t_sysparallel_task *x); 77 | void sysparallel_task_free(t_sysparallel_task *x); 78 | void sysparallel_task_benchprint(t_sysparallel_task *x); 79 | void sysparallel_task_data(t_sysparallel_task *x, void * data); 80 | void sysparallel_task_workerproc(t_sysparallel_task *x, method workerproc); 81 | 82 | t_sysparallel_worker *sysparallel_worker_new(void *data, method workerproc, t_sysparallel_task *task); 83 | t_max_err sysparallel_worker_execute(t_sysparallel_worker *x); 84 | void sysparallel_worker_free(t_sysparallel_worker *x); 85 | 86 | END_USING_C_LINKAGE 87 | 88 | #if C74_PRAGMA_STRUCT_PACKPUSH 89 | #pragma pack(pop) 90 | #elif C74_PRAGMA_STRUCT_PACK 91 | #pragma pack() 92 | #endif 93 | 94 | #endif // _EXT_SYSPARALLEL_H_ 95 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_sysprocess.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_SYSPROCESS_H_ 2 | #define _EXT_SYSPROCESS_H_ 3 | 4 | #include "ext_prefix.h" 5 | #include "ext_mess.h" 6 | 7 | BEGIN_USING_C_LINKAGE 8 | 9 | enum { 10 | SYSPROCESS_LAUNCHFLAGS_NONE = 0, 11 | SYSPROCESS_LAUNCHFLAGS_NOWINDOW = 0x01, 12 | SYSPROCESS_LAUNCHFLAGS_NOWINDOW_ALLOWDIALOGS = 0x02 13 | }; 14 | 15 | // returns process id or 0 on error 16 | long sysprocess_launch(const char *utf8path, const char *utf8commandline); 17 | 18 | // returns process id or 0 on error 19 | long sysprocess_launch_withflags(const char *utf8path, const char *utf8commandline, long flags); 20 | 21 | // returns non-zero if process is still running 22 | long sysprocess_isrunning(long id); 23 | 24 | // returns non-zero if process is still running, optional non-running process return value in 'retval' argument 25 | // note that return value will only work reliably the first time the function is called on a terminated process 26 | long sysprocess_isrunning_with_returnvalue(long id, long *retval); 27 | 28 | // kill a running process (SIGKILL), returns 0 if successful 29 | long sysprocess_kill(long id); 30 | 31 | // returns 0 if successful 32 | long sysprocess_activate(long id); 33 | 34 | // returns 0 if process isn't running 35 | long sysprocess_getid(const char *utf8path); // find the process id for a given app 36 | 37 | // returns the id of the currently running process 38 | long sysprocess_getcurrentid(void); 39 | 40 | // given process ID returns path as utf8 string 41 | // note: you must free the returned memory with sysmem_freeptr() 42 | long sysprocess_getpath(long id, char **utf8path); 43 | 44 | // sysprocesswatcher: monitors process with given id and if process quits calls given method with arg. 45 | // note: method is called on a separate thread so you can possibly free a stalled main thread. 46 | // If you are done then free the sysprocesswatcher with object_free() and the monitoring thread will be killed. 47 | t_object* sysprocesswatcher_new(long id, method m, void *arg); 48 | 49 | // determines if the architecture of the named process (x64 or i386) fits the current one 50 | long sysprocess_fitsarch(long id); 51 | 52 | END_USING_C_LINKAGE 53 | 54 | #endif // _EXT_SYSPROCESS_H_ 55 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_syssem.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_SYSSEM_H_ 2 | #define _EXT_SYSSEM_H_ 3 | 4 | #include "ext_prefix.h" 5 | 6 | BEGIN_USING_C_LINKAGE 7 | 8 | // syssem is a platform independent way of using named semaphores 9 | // that can be used to synchronize multiple processes 10 | 11 | typedef void * t_syssem; 12 | 13 | t_max_err syssem_create(t_syssem *x, const char *name, long flags, unsigned int value); 14 | t_max_err syssem_open(t_syssem *x, const char *name, long flags); 15 | t_max_err syssem_close(t_syssem x); 16 | t_max_err syssem_wait(t_syssem x); 17 | t_max_err syssem_trywait(t_syssem x); 18 | t_max_err syssem_post(t_syssem x); 19 | 20 | END_USING_C_LINKAGE 21 | 22 | #endif // #ifndef _EXT_SYSSEM_H_ 23 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_sysshmem.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_SYSSHMEM_H_ 2 | #define _EXT_SYSSHMEM_H_ 3 | 4 | #include "ext_prefix.h" 5 | #include "max_types.h" 6 | 7 | BEGIN_USING_C_LINKAGE 8 | 9 | // sysshmem is a platform independent interface to shared memory 10 | 11 | typedef void *t_sysshmem; 12 | 13 | enum t_sysshmem_flag { 14 | SYSSHMEM_FLAGS_READONLY = 0x00000001 15 | }; 16 | 17 | t_max_err sysshmem_alloc(t_sysshmem *x, const char *name, long size, long flags); // allocate memory that can be shared 18 | t_max_err sysshmem_open(t_sysshmem *x, const char *name, long flags); // open memory allocated elsewhere 19 | t_max_err sysshmem_close(t_sysshmem x); // after this call t_sysshmem handle is no longer valid 20 | 21 | unsigned long sysshmem_getsize(t_sysshmem x); // number of bytes in shared memory block 22 | void* sysshmem_getptr(t_sysshmem x); // pointer to actual memory 23 | 24 | END_USING_C_LINKAGE 25 | 26 | #endif // #ifndef _EXT_SYSSHMEM_H_ 27 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_systime.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _EXT_SYSTIME_H_ 3 | #define _EXT_SYSTIME_H_ 4 | 5 | #include "ext_prefix.h" 6 | #include "max_types.h" 7 | 8 | BEGIN_USING_C_LINKAGE 9 | 10 | #if C74_PRAGMA_STRUCT_PACKPUSH 11 | #pragma pack(push, 2) 12 | #elif C74_PRAGMA_STRUCT_PACK 13 | #pragma pack(2) 14 | #endif 15 | 16 | 17 | /** 18 | The Systime data structure. 19 | @ingroup systime 20 | */ 21 | 22 | typedef struct _datetime { 23 | t_uint32 year; ///< year 24 | t_uint32 month; ///< month, in range 1 through 12 25 | t_uint32 day; ///< day, in range 1 through 31 26 | t_uint32 hour; ///< hour 27 | t_uint32 minute; ///< minute 28 | t_uint32 second; ///< second 29 | t_uint32 millisecond; ///< (reserved for future use) 30 | } t_datetime; 31 | 32 | /** Flags for the sysdateformat_formatdatetime() function. 33 | @ingroup systime 34 | */ 35 | typedef enum { 36 | SYSDATEFORMAT_FLAGS_SHORT = 1, ///< short 37 | SYSDATEFORMAT_FLAGS_MEDIUM = 2, ///< medium 38 | SYSDATEFORMAT_FLAGS_LONG = 3, ///< long 39 | 40 | SYSDATEFORMAT_RELATIVE = 16 41 | } e_max_dateflags; 42 | 43 | /** 44 | Find out the operating system’s time in ticks. 45 | @ingroup systime 46 | @return the system time in ticks. 47 | */ 48 | t_uint32 systime_ticks(void); 49 | 50 | 51 | /** 52 | Find out the operating system’s time in milliseconds. 53 | Note that this is approximately the number of milliseconds since the OS was started up. 54 | @ingroup systime 55 | @return the system time in milliseconds. 56 | */ 57 | t_uint32 systime_ms(void); 58 | 59 | 60 | /** 61 | Find out the current date/time as number of ms since January 1, 1970, GMT. 62 | @ingroup systime 63 | @return the number of milliseconds since January 1, 1970, GMT. 64 | */ 65 | t_int64 systime_datetime_milliseconds(void); 66 | 67 | /** 68 | Find out the operating system’s current local date and time. 69 | @ingroup systime 70 | @param d Returns the system’s date and time in the local time zone in a #t_datetime data structure. 71 | */ 72 | void systime_datetime(t_datetime *d); 73 | 74 | 75 | /** 76 | Find out the operating system’s time in seconds since midnight, January 1, 1904, GMT (mac HFS time). 77 | @ingroup systime 78 | @return the system time in seconds since midnight, January 1, 1904, GMT. 79 | */ 80 | t_ptr_uint systime_seconds(void); 81 | 82 | 83 | /** 84 | Convert a time in seconds into a #t_datetime representation. 85 | @ingroup systime 86 | @param secs A number of seconds since midnight, January 1, 1904, GMT, to be represented as a #t_datetime. 87 | @param d The address of a #t_datetime that will be filled to the corresponding time, in the local time zone. 88 | */ 89 | void systime_secondstodate(t_ptr_uint secs, t_datetime *d); 90 | 91 | 92 | /** 93 | Convert a #t_datetime representation of time into seconds since midnight, January 1, 1904, GMT. 94 | @ingroup systime 95 | @param d The address of a #t_datetime to be converted to seconds. The #t_datetime values are in the local time zone. 96 | @return The number of seconds between midnight, January 1, 1904, GMT and the time represented in d. 97 | */ 98 | t_ptr_uint systime_datetoseconds(const t_datetime *d); 99 | 100 | 101 | /** 102 | Fill a #t_datetime struct with a datetime formatted string. 103 | For example, the string "2007-12-24 12:21:00". 104 | @ingroup systime 105 | @param strf A string containing the datetime. 106 | @param d The address of a #t_datetime to fill. 107 | */ 108 | void sysdateformat_strftimetodatetime(const char *strf, t_datetime *d); 109 | 110 | 111 | /** 112 | Get a human friendly string representation of a #t_datetime. 113 | For example: "Dec 17, 2020 at 10:48 AM" 114 | or, when dateflags is SYSDATEFORMAT_RELATIVE a string like "Today", "Yesterday", etc. 115 | @ingroup systime 116 | @param d The address of a #t_datetime to format as a string. The t_datetime entries correspond to the local time. 117 | @param dateflags One of the values defined in #e_max_dateflags. 118 | @param timeflags Currently unused. Pass 0. 119 | @param s An already allocated string to hold the human friendly result. 120 | @param buflen The number of characters allocated to the string s. 121 | */ 122 | void sysdateformat_formatdatetime(const t_datetime *d, long dateflags, long timeflags, char *s, long buflen); 123 | 124 | #if C74_PRAGMA_STRUCT_PACKPUSH 125 | #pragma pack(pop) 126 | #elif C74_PRAGMA_STRUCT_PACK 127 | #pragma pack() 128 | #endif 129 | 130 | END_USING_C_LINKAGE 131 | 132 | #endif // _EXT_SYSTIME_H_ 133 | 134 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_timeline.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_TIMELINE_H_ 2 | #define _EXT_TIMELINE_H_ 3 | 4 | // NOTE: This file is obsolete. 5 | 6 | #endif // _EXT_TIMELINE_H_ 7 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_track.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXT_TRACK_H_ 2 | #define _EXT_TRACK_H_ 3 | 4 | // NOTE: This file is obsolete. 5 | 6 | #endif /* _EXT_TRACK_H_ */ 7 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_typelist.h: -------------------------------------------------------------------------------- 1 | // ext_typelist.h copyright 2019 cycling '74 all rights reserved 2 | 3 | #ifndef __EXT_TYPELIST_H__ 4 | #define __EXT_TYPELIST_H__ 5 | 6 | #include "ext_prefix.h" 7 | #include "max_types.h" 8 | 9 | BEGIN_USING_C_LINKAGE 10 | 11 | void typelist_make(t_fourcc *types, long include, short *numtypes); 12 | 13 | END_USING_C_LINKAGE 14 | 15 | #endif // #ifndef __EXT_TYPELIST_H__ 16 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_user.h: -------------------------------------------------------------------------------- 1 | #ifndef __EXT_USER 2 | #define __EXT_USER 3 | 4 | // NOTE: This file is obsolete. 5 | 6 | #endif 7 | 8 | -------------------------------------------------------------------------------- /c74support/max-includes/ext_wind.h: -------------------------------------------------------------------------------- 1 | /*************************/ 2 | /* Copyright 1988 IRCAM. */ 3 | /*************************/ 4 | #ifndef _EXT_WIND_H_ 5 | #define _EXT_WIND_H_ 6 | 7 | #include "ext_prefix.h" 8 | #include "ext_mess.h" 9 | 10 | BEGIN_USING_C_LINKAGE 11 | 12 | /** Returned values from wind_advise() 13 | @ingroup misc 14 | */ 15 | typedef enum { 16 | aaYes = 1, ///< Yes button was choosen 17 | aaNo, ///< No button was choosen 18 | aaCancel ///< Cancel button was choosen 19 | } e_max_wind_advise_result; 20 | 21 | 22 | // advise returns... 23 | 24 | enum { 25 | ADVISE_SAVE = 1, 26 | aaSave = ADVISE_SAVE, 27 | ADVISE_DISCARD = 2, 28 | aaDiscard = ADVISE_DISCARD, 29 | ADVISE_CANCEL = 3, 30 | // aaCancel = ADVISE_CANCEL, // see above 31 | ADVISE_FIRST = ADVISE_SAVE, 32 | ADVISE_SECOND = ADVISE_DISCARD, 33 | ADVISE_THIRD = ADVISE_CANCEL 34 | }; 35 | 36 | 37 | /** Throw a dialog which may have text and up to three buttons. 38 | For example, this can be used to ask "Save changes before..." 39 | @ingroup misc 40 | @param w The window with which this dialog is associated. 41 | @param s A string with any sprintf()-like formatting to be displayed. 42 | @param ... Any variables that should be substituted in the string defined by s. 43 | @return One of the values defined in #e_max_wind_advise_result, depending on what the user selected. 44 | */ 45 | short wind_advise(t_object *w, const char *s, ...); 46 | 47 | // internal use only 48 | short wind_advise_explain(t_object *w, const char *note, const char *explanation, const char *b1, const char *b2, const char *b3); 49 | 50 | /** Change the cursor. 51 | @ingroup misc 52 | 53 | @param which One of the following predefined cursors: 54 | @code 55 | #define C_ARROW 1 56 | #define C_WATCH 2 57 | #define C_IBEAM 3 58 | #define C_HAND 4 59 | #define C_CROSS 5 60 | #define C_PENCIL 6 61 | #define C_GROW 8 62 | @endcode 63 | 64 | @remark wind_setcursor() keeps track of what the cursor was previously set 65 | to, so if something else has changed the cursor, you may not see a new 66 | cursor if you set it to the previous argument to wind_setcursor(). 67 | 68 | The solution is to call wind_setcursor(0) before calling it with the 69 | desired cursor constant. Use wind_setcursor(-1) to tell Max you’ll set 70 | the cursor to your own cursor directly. 71 | */ 72 | void wind_setcursor(short which); 73 | 74 | 75 | END_USING_C_LINKAGE 76 | 77 | #endif // _EXT_WIND_H_ 78 | -------------------------------------------------------------------------------- /c74support/max-includes/indexmap.h: -------------------------------------------------------------------------------- 1 | // indexmap.h copyright 2007 Cycling '74 all rights reserved 2 | 3 | #ifndef _INDEXMAP_H_ 4 | #define _INDEXMAP_H_ 5 | 6 | #include "ext_prefix.h" 7 | #include "ext_mess.h" 8 | #include "ext_hashtab.h" 9 | 10 | BEGIN_USING_C_LINKAGE 11 | 12 | #if !defined( _EXT_SYSTHREAD_H_ ) && !defined ( _SYSTHREAD_H_ ) 13 | typedef void *t_systhread_mutex; 14 | #endif 15 | 16 | /** An indexmap element. This struct is provided for debugging convenience, 17 | but should be considered opaque and is subject to change without notice. 18 | 19 | @ingroup indexmap 20 | @see t_indexmap 21 | */ 22 | typedef struct _indexmap_entry 23 | { 24 | long e_index; 25 | void *e_data; 26 | long e_mark; 27 | } t_indexmap_entry; 28 | 29 | 30 | /** An indexmap object. This struct is provided for debugging convenience, 31 | but should be considered opaque and is subject to change without notice. 32 | 33 | @ingroup indexmap 34 | @see t_indexmap_entry 35 | */ 36 | typedef struct _indexmap 37 | { 38 | t_object m_ob; 39 | t_hashtab *m_data2index; // convert from a data reference to an indexmap_entry (and hence index) 40 | t_indexmap_entry **m_index2data; // convert from an index to a data reference 41 | long m_i2dsize; // size of index2data array 42 | long m_count; // how many items 43 | t_systhread_mutex m_mutex; // protector 44 | } t_indexmap; 45 | 46 | 47 | // private -- initialize the indexmap class 48 | void indexmap_initclass(void); 49 | 50 | 51 | /** Create a new indexmap object. 52 | 53 | @ingroup indexmap 54 | @return Pointer to the new indexmap object. 55 | */ 56 | t_indexmap *indexmap_new(void); 57 | 58 | 59 | /** Add an item to an indexmap. 60 | 61 | @ingroup indexmap 62 | @param x The indexmap instance. 63 | @param data The item to add. 64 | */ 65 | void indexmap_append(t_indexmap *x, void *data); 66 | 67 | 68 | /** Move an item to a different position in an indexmap. 69 | 70 | @ingroup indexmap 71 | @param x The indexmap instance. 72 | @param data The item in the indexmap to move. 73 | @param newindex The new index to which to move the item. 74 | @return A Max error code. 75 | */ 76 | t_max_err indexmap_move(t_indexmap *x, void *data, long newindex); 77 | 78 | 79 | /** Delete a specified item from an indexmap. 80 | 81 | @ingroup indexmap 82 | @param x The indexmap instance. 83 | @param data The item pointer to remove from the indexmap. 84 | @return A Max error code. 85 | */ 86 | t_max_err indexmap_delete(t_indexmap *x, void *data); 87 | 88 | 89 | /** Delete an item from the indexmap by index. 90 | 91 | @ingroup indexmap 92 | @param x The indexmap instance. 93 | @param index The index of the item to remove from the indexmap. 94 | @return A Max error code. 95 | */ 96 | t_max_err indexmap_delete_index(t_indexmap *x, long index); 97 | 98 | 99 | /** Delete multiple specified items from an indexmap. 100 | 101 | @ingroup indexmap 102 | @param x The indexmap instance. 103 | @param count The number of items to remove from the indexmap. 104 | @param pdata The address of the first of an array of item pointers to remove from the indexmap. 105 | @return A Max error code. 106 | */ 107 | t_max_err indexmap_delete_multi(t_indexmap *x, long count, void **pdata); 108 | 109 | 110 | /** Delete multiple items from an indexmap by index. 111 | 112 | @ingroup indexmap 113 | @param x The indexmap instance. 114 | @param count The number of items to remove from the indexmap. 115 | @param indices The address of the first of an array of index numbers to remove the indexmap. 116 | @return A Max error code. 117 | */ 118 | t_max_err indexmap_delete_index_multi(t_indexmap *x, long count, long *indices); 119 | 120 | 121 | /** Get an item from an indexmap by index. 122 | 123 | @ingroup indexmap 124 | @param x The indexmap instance. 125 | @param index The index from which to fetch a stored item. 126 | @return The item stored at the specified index. 127 | */ 128 | void *indexmap_datafromindex(t_indexmap *x, long index); 129 | 130 | 131 | /** Find the index of an item given a pointer to the item. 132 | 133 | @ingroup indexmap 134 | @param x The indexmap instance. 135 | @param data The item whose index you wish to look up. 136 | @param index The address of a variable to hold the retrieved index. 137 | @return A Max error code. 138 | */ 139 | t_max_err indexmap_indexfromdata(t_indexmap *x, void *data, long *index); 140 | 141 | 142 | /** Return the number of items in an indexmap. 143 | 144 | @ingroup indexmap 145 | @param x The indexmap instance. 146 | @return The number of items in the indexmap. 147 | */ 148 | long indexmap_getsize(t_indexmap *x); 149 | 150 | 151 | /** Delete all items in an indexmap. 152 | 153 | @ingroup indexmap 154 | @param x The indexmap instance. 155 | */ 156 | void indexmap_clear(t_indexmap *x); 157 | 158 | 159 | /** Sort the items in an indexmap. 160 | Item are sorted using a #t_cmpfn function that is passed in as an argument. 161 | 162 | @ingroup indexmap 163 | @param x The indexmap instance. 164 | @param fn The function used to sort the list. 165 | @see linklist_sort() 166 | */ 167 | void indexmap_sort(t_indexmap *x, t_cmpfn fn); 168 | 169 | void indexmap_insert(t_indexmap *x, long index, void *data); 170 | 171 | 172 | END_USING_C_LINKAGE 173 | 174 | #endif // _INDEXMAP_H_ 175 | -------------------------------------------------------------------------------- /c74support/max-includes/jpatcher_utils.h: -------------------------------------------------------------------------------- 1 | #ifndef _JPATCHER_UTILS_H_ 2 | #define _JPATCHER_UTILS_H_ 3 | 4 | #include "ext_prefix.h" 5 | #include "ext_mess.h" 6 | 7 | BEGIN_USING_C_LINKAGE 8 | 9 | /** Copy an array of atoms. 10 | @ingroup atom 11 | @param argc1 The count of atoms in argv1. 12 | @param argv1 The address to the first of an array of atoms that is the source for the copy. 13 | @param argv2 The address to the first of an array of atoms that is the destination for the copy. 14 | Note that this array must already by allocated using sysmem_newptr() or atom_alloc(). */ 15 | void atom_copy(long argc1, t_atom *argv1, t_atom *argv2); 16 | 17 | /** Print the contents of an array of atoms to the Max window. 18 | @ingroup atom 19 | @param argc The count of atoms in argv. 20 | @param argv The address to the first of an array of atoms. */ 21 | void postargs(long argc, t_atom *argv); 22 | 23 | /** Print the contents of a dictionary to the Max window. 24 | @ingroup dictionary 25 | @param d A pointer to a dictionary object. */ 26 | void postdictionary(t_object *d); 27 | 28 | 29 | /** Return a pointer to an object contained in an atom if it is of the specified class. 30 | @ingroup atom 31 | @param x The address of a pointer to the object contained in av if it is of the specified class upon return. 32 | Otherwise NULL upon return. 33 | @param idx The index of the atom in the array from which to get the object pointer. 34 | @param argc The count of atoms in argv. 35 | @param argv The address to the first of an array of atoms. 36 | @param cls A symbol containing the class name of which the object should be an instance. 37 | @return A Max error code. */ 38 | t_max_err atom_arg_getobjclass(t_object **x, long idx, long argc, t_atom *argv, t_symbol *cls); 39 | 40 | /** Return a pointer to an object contained in an atom if it is of the specified class. 41 | @ingroup atom 42 | @param av A pointer to the atom from which to get the #t_object. 43 | @param cls A symbol containing the class name of which the object should be an instance. 44 | @return A pointer to the object contained in av if it is of the specified class, otherwise NULL. */ 45 | void *atom_getobjclass(t_atom *av, t_symbol *cls); 46 | 47 | 48 | method my_object_getmethod(void *obj, t_symbol *s); 49 | 50 | 51 | END_USING_C_LINKAGE 52 | 53 | #endif // #ifndef _JPATCHER_UTILS_H_ 54 | -------------------------------------------------------------------------------- /c74support/max-includes/macho-prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'MaxExternal' target in the 'MaxExternal' project. 3 | // 4 | 5 | #include 6 | 7 | -------------------------------------------------------------------------------- /c74support/max-includes/max_keydefs.h: -------------------------------------------------------------------------------- 1 | #ifndef _MAX_KEYDEFS_H_ 2 | #define _MAX_KEYDEFS_H_ 3 | 4 | /** Bit mask values for various meta-key presses on the keyboard. 5 | @ingroup jmouse */ 6 | typedef enum _modifiers { 7 | eCommandKey = 1, ///< Command Key 8 | eShiftKey = 2, ///< Shift Key 9 | eControlKey = 4, ///< Control Key 10 | eAltKey = 8, ///< Alt Key 11 | eLeftButton = 16, ///< Left mouse button 12 | eRightButton = 32, ///< Right mouse button 13 | eMiddleButton = 64, ///< Middle mouse button 14 | ePopupMenu = 128, ///< Popup Menu (contextual menu requested) 15 | eCapsLock = 256, ///< Caps lock 16 | eAutoRepeat = 512 ///< Key is generated by key press auto-repeat 17 | } t_modifiers; 18 | 19 | // key codes 20 | // key/keyup objects fourth outlet and key message to objects uses 21 | // the following values for keycodes 22 | typedef enum _keycode { 23 | // keycode is ascii value with modifiers stripped 24 | // a-z keys thus report lowercase keycode regardless of shift key or capslock state 25 | JKEY_NONE = -1, 26 | JKEY_SPACEBAR = -2, 27 | JKEY_ESC = -3, 28 | JKEY_RETURN = -4, 29 | JKEY_ENTER = -4, // same as JKEY_RETURN 30 | JKEY_TAB = -5, 31 | JKEY_DELETE = -6, 32 | JKEY_BACKSPACE = -7, 33 | JKEY_INSERT = -8, 34 | JKEY_UPARROW = -9, 35 | JKEY_DOWNARROW = -10, 36 | JKEY_LEFTARROW = -11, 37 | JKEY_RIGHTARROW = -12, 38 | JKEY_PAGEUP = -13, 39 | JKEY_PAGEDOWN = -14, 40 | JKEY_HOME = -15, 41 | JKEY_END = -16, 42 | JKEY_F1 = -17, 43 | JKEY_F2 = -18, 44 | JKEY_F3 = -19, 45 | JKEY_F4 = -20, 46 | JKEY_F5 = -21, 47 | JKEY_F6 = -22, 48 | JKEY_F7 = -23, 49 | JKEY_F8 = -24, 50 | JKEY_F9 = -25, 51 | JKEY_F10 = -26, 52 | JKEY_F11 = -27, 53 | JKEY_F12 = -28, 54 | JKEY_F13 = -29, 55 | JKEY_F14 = -30, 56 | JKEY_F15 = -31, 57 | JKEY_F16 = -32, 58 | JKEY_NUMPAD0 = -33, 59 | JKEY_NUMPAD1 = -34, 60 | JKEY_NUMPAD2 = -35, 61 | JKEY_NUMPAD3 = -36, 62 | JKEY_NUMPAD4 = -37, 63 | JKEY_NUMPAD5 = -38, 64 | JKEY_NUMPAD6 = -39, 65 | JKEY_NUMPAD7 = -40, 66 | JKEY_NUMPAD8 = -41, 67 | JKEY_NUMPAD9 = -42, 68 | JKEY_NUMPADADD = -43, 69 | JKEY_NUMPADSUBTRACT = -44, 70 | JKEY_NUMPADMULTIPLY = -45, 71 | JKEY_NUMPADDIVIDE = -46, 72 | JKEY_NUMPADSEPARATOR = -47, 73 | JKEY_NUMPADDECIMALPOINT = -48, 74 | JKEY_NUMPADEQUALS = -49, 75 | JKEY_NUMPADDELETE = -50, 76 | JKEY_PLAYPAUSE = -51, 77 | JKEY_STOP = -52, 78 | JKEY_NEXTTRACK = -53, 79 | JKEY_PREVTRACK = -54, 80 | JKEY_HELP = -55 81 | } t_keycode; 82 | 83 | 84 | #endif // #ifndef _MAX_KEYDEFS_H_ 85 | -------------------------------------------------------------------------------- /c74support/max-includes/max_types.h: -------------------------------------------------------------------------------- 1 | #ifndef _MAX_TYPES_H_ 2 | #define _MAX_TYPES_H_ 3 | 4 | #include "ext_infer_system.h" 5 | 6 | #include 7 | 8 | typedef unsigned int t_uint; ///< an unsigned int as defined by the architecture / platform @ingroup misc 9 | typedef int8_t t_int8; ///< a 1-byte int @ingroup misc 10 | typedef uint8_t t_uint8; ///< an unsigned 1-byte int @ingroup misc 11 | typedef int16_t t_int16; ///< a 2-byte int @ingroup misc 12 | typedef uint16_t t_uint16; ///< an unsigned 2-byte int @ingroup misc 13 | typedef int32_t t_int32; ///< a 4-byte int @ingroup misc 14 | typedef uint32_t t_uint32; ///< an unsigned 4-byte int @ingroup misc 15 | typedef int64_t t_int64; ///< an 8-byte int @ingroup misc 16 | typedef uint64_t t_uint64; ///< an unsigned 8-byte int @ingroup misc 17 | typedef t_uint32 t_fourcc; ///< an integer of suitable size to hold a four char code / identifier @ingroup misc 18 | 19 | 20 | typedef uintptr_t t_ptr_uint; ///< an unsigned pointer-sized int @ingroup misc 21 | typedef intptr_t t_ptr_int; ///< a pointer-sized int @ingroup misc 22 | 23 | #ifdef C74_X64 24 | typedef double t_atom_float; ///< the type that is an A_FLOAT in a #t_atom @ingroup misc 25 | typedef t_ptr_uint t_getbytes_size; ///< like size_t but for getbytes() @ingroup misc 26 | #define ATOM_LONG_FMT_MODIFIER "ll" 27 | #define ATOM_FLOAT_FMT_MODIFIER "l" // for scanf "%lf" will read into a double 28 | 29 | #ifdef WIN_VERSION 30 | #define INT32_FMT_MODIFIER "" 31 | #define INT64_FMT_MODIFIER "ll" 32 | #endif 33 | 34 | #if defined(MAC_VERSION) || defined(LINUX_VERSION) 35 | #define INT32_FMT_MODIFIER "" 36 | #define INT64_FMT_MODIFIER "l" 37 | #endif 38 | 39 | #else 40 | typedef float t_atom_float; ///< the type that is an A_FLOAT in a #t_atom @ingroup misc 41 | typedef short t_getbytes_size; ///< like size_t but for getbytes() @ingroup misc 42 | #define ATOM_LONG_FMT_MODIFIER "l" 43 | #define ATOM_FLOAT_FMT_MODIFIER "" // for scanf we just want "%f" for scanf to read a float 44 | #define INT32_FMT_MODIFIER "" 45 | #define INT64_FMT_MODIFIER "ll" 46 | #endif 47 | 48 | #define C74_INT16_MAX INT16_MAX 49 | #define C74_INT32_MAX INT32_MAX 50 | #define C74_INT64_MAX INT64_MAX 51 | #define C74_INT16_MIN INT16_MIN 52 | #define C74_INT32_MIN INT32_MIN 53 | #define C74_INT64_MIN INT64_MIN 54 | #define C74_UINT16_MAX UINT16_MAX 55 | #define C74_UINT32_MAX UINT32_MAX 56 | #define C74_UINT64_MAX UINT64_MAX 57 | 58 | #define C74_PTR_INT_MIN INTPTR_MIN 59 | #define C74_PTR_INT_MAX INTPTR_MAX 60 | #define C74_PTR_UINT_MAX UINTPTR_MAX 61 | 62 | #define C74_ATOM_LONG_MIN C74_PTR_INT_MIN 63 | #define C74_ATOM_LONG_MAX C74_PTR_INT_MAX 64 | 65 | #if defined(MAC_VERSION) || defined(LINUX_VERSION) 66 | #define C74_LONG_INT_MIN C74_PTR_INT_MIN 67 | #define C74_LONG_INT_MAX C74_PTR_INT_MAX 68 | #define C74_ULONG_INT_MAX C74_PTR_UINT_MAX 69 | #else 70 | #define C74_LONG_INT_MIN C74_INT32_MIN 71 | #define C74_LONG_INT_MAX C74_INT32_MAX 72 | #define C74_ULONG_INT_MAX C74_UINT32_MAX 73 | #endif 74 | 75 | typedef t_ptr_int t_int; ///< an integer @ingroup misc 76 | typedef t_ptr_uint t_ptr_size; ///< unsigned pointer-sized value for counting (like size_t) @ingroup misc 77 | typedef t_ptr_int t_atom_long; ///< the type that is an A_LONG in a #t_atom @ingroup misc 78 | typedef t_atom_long t_max_err; ///< an integer value suitable to be returned as an error code @ingroup misc 79 | 80 | typedef char **t_handle; ///< a handle (address of a pointer) @ingroup misc 81 | typedef char *t_ptr; ///< a pointer @ingroup misc 82 | 83 | typedef t_uint8 t_bool; ///< a true/false variable @ingroup misc 84 | typedef t_int16 t_filepath; ///< i.e. path/vol in file APIs identifying a folder @ingroup misc 85 | 86 | #ifdef WIN_VERSION 87 | typedef t_int16 t_refnum; 88 | 89 | #ifndef __cplusplus 90 | #define bool int 91 | #define false (0) 92 | #define true (1) 93 | #endif 94 | 95 | #endif 96 | 97 | #ifdef MAC_VERSION 98 | // typedef FSIORefNum t_refnum; // don't want to require Carbon include for build 99 | #ifdef C74_X64 100 | typedef int t_refnum; // for x64 an FSIORefNum is an int 101 | #else 102 | typedef short t_refnum; 103 | #endif 104 | #endif // #ifdef MAC_VERSION 105 | 106 | #ifdef LINUX_VERSION 107 | typedef int t_refnum; 108 | #endif 109 | 110 | 111 | #ifndef bool 112 | #include 113 | #endif 114 | 115 | /** Standard values returned by function calls with a return type of #t_max_err 116 | @ingroup misc */ 117 | typedef enum { 118 | MAX_ERR_NONE = 0, ///< No error 119 | MAX_ERR_GENERIC = -1, ///< Generic error 120 | MAX_ERR_INVALID_PTR = -2, ///< Invalid Pointer 121 | MAX_ERR_DUPLICATE = -3, ///< Duplicate 122 | MAX_ERR_OUT_OF_MEM = -4 ///< Out of memory 123 | } e_max_errorcodes; 124 | 125 | #endif // #ifdef _MAX_TYPES_H_ 126 | -------------------------------------------------------------------------------- /c74support/max-includes/x64/MaxAPI.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cycling74/max-sdk-base/a9321e86fdb08d03da9fe4053f3accec4a775b6b/c74support/max-includes/x64/MaxAPI.lib -------------------------------------------------------------------------------- /c74support/msp-includes/MaxAudioAPI.framework/MaxAudioAPI: -------------------------------------------------------------------------------- 1 | Versions/Current/MaxAudioAPI -------------------------------------------------------------------------------- /c74support/msp-includes/MaxAudioAPI.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /c74support/msp-includes/MaxAudioAPI.framework/Versions/A/MaxAudioAPI: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cycling74/max-sdk-base/a9321e86fdb08d03da9fe4053f3accec4a775b6b/c74support/msp-includes/MaxAudioAPI.framework/Versions/A/MaxAudioAPI -------------------------------------------------------------------------------- /c74support/msp-includes/MaxAudioAPI.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | MaxAudioAPI 9 | CFBundleIdentifier 10 | com.cycling74.MaxAudioAPI 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | FMWK 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | 20 | 21 | -------------------------------------------------------------------------------- /c74support/msp-includes/MaxAudioAPI.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /c74support/msp-includes/MaxAudioAPI.h: -------------------------------------------------------------------------------- 1 | #include "z_dsp.h" 2 | -------------------------------------------------------------------------------- /c74support/msp-includes/buffer.h: -------------------------------------------------------------------------------- 1 | #ifndef _BUFFER_H_ 2 | #define _BUFFER_H_ 3 | 4 | #include "ext_obex.h" 5 | #include "ext_systhread.h" 6 | #include "ext_critical.h" 7 | #include "ext_atomic.h" 8 | #include "ext_buffer.h" 9 | #include "ext_maxtypes.h" 10 | 11 | #if C74_PRAGMA_STRUCT_PACKPUSH 12 | #pragma pack(push, 2) 13 | #elif C74_PRAGMA_STRUCT_PACK 14 | #pragma pack(2) 15 | #endif 16 | 17 | enum { 18 | MAXCHAN = 4 19 | }; 20 | 21 | enum { 22 | bi_basefreq = 0, 23 | bi_detune, 24 | bi_lowfreq, 25 | bi_hifreq, 26 | bi_lowvel, 27 | bi_hivel, 28 | bi_gain, 29 | bi_numparams 30 | }; 31 | 32 | 33 | /** Data structure for the buffer~ object. 34 | Deprectated. 35 | Use #t_buffer_ref and #t_buffer_obj instead. 36 | */ 37 | struct _buffer 38 | { 39 | t_object b_obj; ///< doesn't have any signals so it doesn't need to be pxobject 40 | long b_valid; ///< flag is off during read replacement or editing operation 41 | float *b_samples; ///< stored with interleaved channels if multi-channel 42 | long b_frames; ///< number of sample frames (each one is sizeof(float) * b_nchans bytes) 43 | long b_nchans; ///< number of channels 44 | long b_size; ///< size of buffer in floats 45 | float b_sr; ///< sampling rate of the buffer 46 | float b_1oversr; ///< 1 / sr 47 | float b_msr; ///< sr * .001 48 | // Mac-specific stuff 49 | float *b_memory; ///< pointer to where memory starts (initial padding for interp) 50 | t_symbol *b_name; ///< name of the buffer 51 | short b_vol; 52 | short b_space; 53 | // looping info (from AIFF file) 54 | long b_susloopstart; ///< looping info (from AIFF file) in samples 55 | long b_susloopend; ///< looping info (from AIFF file) in samples 56 | long b_relloopstart; ///< looping info (from AIFF file) in samples 57 | long b_relloopend; ///< looping info (from AIFF file) in samples 58 | // instrument info (from AIFF file) 59 | short b_inst[bi_numparams]; 60 | // window stuff 61 | void *b_wind; 62 | double b_pixperfr; 63 | double b_frperpix; 64 | long b_imagesize; 65 | short b_unusedshort1; // was Point b_scroll 66 | short b_unusedshort2; // could chop if struct compatibility wasn't important 67 | long b_scrollscale; 68 | long b_selbegin[MAXCHAN]; // unused - do NOT USE - MAXCHAN is retired 69 | long b_selend[MAXCHAN]; // unused - do NOT USE - MAXCHAN is retired 70 | long b_zoom; 71 | long b_zim[11]; 72 | void *b_mouseout; 73 | long b_format; ///< 'AIFF' or 'Sd2f' 74 | t_symbol *b_filename; ///< last file read (not written) for info~ 75 | long b_oldnchans; ///< used for resizing window in case of # of channels change 76 | void *b_doneout; 77 | long b_outputbytes; ///< number of bytes used for output sample (1-4) 78 | long b_modtime; ///< last modified time ("dirty" method) 79 | struct _buffer *b_peer; ///< objects that share this symbol (used as a link in the peers) 80 | t_bool b_owner; ///< b_memory/b_samples "owned" by this object 81 | long b_outputfmt; ///< sample type (A_LONG, A_FLOAT, etc.) 82 | t_int32_atomic b_inuse; ///< objects that use buffer should ATOMIC_INCREMENT / ATOMIC_DECREMENT this in their perform 83 | void *b_dspchain; ///< dspchain used for this instance 84 | long b_padding; ///< amount of padding (number of samples) in b_memory before b_samples starts 85 | long b_paddingchanged; ///< flag indicating that b_padding has changed and needs to be allocated 86 | t_object *b_jsoundfile; ///< internal instance for reading/writing FLAC format 87 | t_systhread_mutex b_mutex; ///< mutex to use when locking and performing operations anywhere except perform method 88 | long b_wasvalid; ///< internal flag used by replacement or editing operation 89 | method b_custom_error_handler_fn; /// used to return error numbers to a caller if this object is embedded inside of another object (e.g. playlist~) 90 | t_object *b_custom_error_handler; /// used to return error numbers to a caller if this object is embedded inside of another object (e.g. playlist~) 91 | t_clock *b_dirty_clock; ///< used to move buffer dirty notifications to the main thread 92 | t_qelem *b_dirty_qelem; ///< used to move buffer dirty notifications to the main thread 93 | t_bool b_dirty_done; ///< a buffer is not only dirty, but needs the 'done' message sent out its b_doneout outlet 94 | t_filepath b_filevol; ///< path of last file read (not written) 95 | }; 96 | 97 | // Direct access to a t_buffer struct is deprecated and will no longer be supported in the future. 98 | // Instead, use t_buffer_ref and t_buffer_obj as defined in the 'ext_buffer.h' header file. 99 | 100 | #ifdef C74_BUFFER_INTERNAL 101 | typedef struct _buffer t_buffer; 102 | #else 103 | C74_DEPRECATED( typedef struct _buffer t_buffer ); 104 | #endif // C74_BUFFER_INTERNAL 105 | 106 | 107 | #define BUFWIND(x) ((t_wind *)(x->b_wind)) 108 | 109 | 110 | #if C74_PRAGMA_STRUCT_PACKPUSH 111 | #pragma pack(pop) 112 | #elif C74_PRAGMA_STRUCT_PACK 113 | #pragma pack() 114 | #endif 115 | 116 | #endif // #ifndef _BUFFER_H_ 117 | -------------------------------------------------------------------------------- /c74support/msp-includes/r_pfft.h: -------------------------------------------------------------------------------- 1 | // public fftpatcher struct 2 | #ifndef _R_PFFT_H_ 3 | #define _R_PFFT_H_ 4 | 5 | #include "ext_prefix.h" 6 | #include "ext_mess.h" 7 | #include "z_dsp.h" 8 | 9 | #if C74_PRAGMA_STRUCT_PACKPUSH 10 | #pragma pack(push, 2) 11 | #elif C74_PRAGMA_STRUCT_PACK 12 | #pragma pack(2) 13 | #endif 14 | 15 | /** Public FFT Patcher struct. 16 | @ingroup pfft 17 | */ 18 | typedef struct _pfftpub { 19 | t_pxobject x_obj; 20 | t_object *x_parent; ///< parent patcher 21 | t_object *x_patcher; ///< patcher loaded 22 | struct _dspchain *x_chain; ///< dsp chain within pfft 23 | long x_fftsize; ///< fft frame size 24 | long x_ffthop; ///< hop between fft frames 25 | long x_fftoffset; ///< n samples offset before fft is started 26 | long x_fftindex; ///< current index into fft frame 27 | short x_fullspect; ///< process half-spectrum (0) or full mirrored spectrum (1)? 28 | } t_pfftpub; 29 | 30 | 31 | #if C74_PRAGMA_STRUCT_PACKPUSH 32 | #pragma pack(pop) 33 | #elif C74_PRAGMA_STRUCT_PACK 34 | #pragma pack() 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /c74support/msp-includes/x64/MaxAudio.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cycling74/max-sdk-base/a9321e86fdb08d03da9fe4053f3accec4a775b6b/c74support/msp-includes/x64/MaxAudio.lib -------------------------------------------------------------------------------- /c74support/msp-includes/z_altivec.h: -------------------------------------------------------------------------------- 1 | #ifdef __ALTIVEC__ 2 | #pragma altivec_model on 3 | 4 | #ifdef __cplusplus 5 | #include // for vec_malloc 6 | #endif 7 | 8 | typedef union 9 | { 10 | float flt[4]; 11 | vector float vFlt; 12 | } floatToVector; 13 | 14 | static floatToVector __vsf_temp; 15 | 16 | // this is what was needed to convince the compiler to copy a float to 17 | // the four float locations in a vector 18 | 19 | #define vec_splat_float(v,f) { \ 20 | __vsf_temp.flt[0] = f; \ 21 | v = vec_splat( vec_lde( 0, __vsf_temp.flt ), 0 ); } 22 | 23 | #define VRSAVE asm { li r0,-1 ; mtspr vrsave,r0 } 24 | 25 | #pragma altivec_model off 26 | #endif 27 | -------------------------------------------------------------------------------- /c74support/msp-includes/z_sampletype.h: -------------------------------------------------------------------------------- 1 | // z_sampletype.h -- defines t_sample and friends copyright 1997-2010 Cycling '74 2 | 3 | #ifndef _Z_SAMPLETYPE_H 4 | #define _Z_SAMPLETYPE_H 5 | 6 | #ifndef MSP64 7 | // tap -- set to build 64-bit audio chains 8 | #define MSP64 1 9 | #endif 10 | 11 | /** A float -- always a 32 bit floating point number. @ingroup msp */ 12 | typedef float t_float; 13 | 14 | /** A double -- always a 64 bit floating point number. @ingroup msp */ 15 | typedef double t_double; 16 | 17 | /** A sample value -- width determined by MSP version. @ingroup msp */ 18 | #if MSP64 19 | typedef double t_sample; 20 | #else 21 | typedef float t_sample; 22 | #endif 23 | 24 | // macro loop for checking for NAN/INF 25 | 26 | // note: this may be platform-dependent 27 | 28 | #define NAN_MASK 0x7F800000 29 | 30 | #define NAN_CHECK(n,o) \ 31 | while (n--) { if ((*(o) & NAN_MASK) == NAN_MASK) *(o) = 0; (o)++; } // now post inc/dec -Rd jun 05 32 | 33 | #define IS_DENORM_FLOAT(v) ((((*(t_uint32 *)&(v))&0x7f800000)==0)&&((v)!=0.f)) 34 | #define IS_DENORM_DOUBLE(v) ((((((t_uint32 *)&(v))[1])&0x7fe00000)==0)&&((v)!=0.)) 35 | 36 | #define IS_NAN_FLOAT(v) (((*(t_uint32 *)&(v))&0x7f800000)==0x7f800000) 37 | #define IS_NAN_DOUBLE(v) (((((t_uint32 *)&(v))[1])&0x7fe00000)==0x7fe00000) 38 | 39 | #define IS_DENORM_NAN_FLOAT(v) (IS_DENORM_FLOAT(v)||IS_NAN_FLOAT(v)) 40 | #define IS_DENORM_NAN_DOUBLE(v) (IS_DENORM_DOUBLE(v)||IS_NAN_DOUBLE(v)) 41 | 42 | // currently all little endian processors are x86 43 | // an external could #define DENORM_WANT_FIX to disable or enable denorm checks 44 | // but now we disable them all by default 45 | #ifndef DENORM_WANT_FIX 46 | #if 0 47 | // || defined(WIN_VERSION) // no longer fixing denormals on Win. Instead using SSE processor flags. 48 | // || (defined(MAC_VERSION)&&TARGET_RT_LITTLE_ENDIAN) // no longer fixing denormals on Mac. Instead using SSE processor flags. 49 | // user can #define DENORM_WANT_FIX to 0 to disable 50 | #define DENORM_WANT_FIX 1 51 | #endif 52 | #endif // #ifndef DENORM_WANT_FIX 53 | 54 | #if DENORM_WANT_FIX 55 | 56 | #define FIX_DENORM_FLOAT(v) ((v)=IS_DENORM_FLOAT(v)?0.f:(v)) 57 | #define FIX_DENORM_DOUBLE(v) ((v)=IS_DENORM_DOUBLE(v)?0.f:(v)) 58 | 59 | #define FIX_DENORM_NAN_FLOAT(v) ((v)=IS_DENORM_NAN_FLOAT(v)?0.f:(v)) 60 | #define FIX_DENORM_NAN_DOUBLE(v) ((v)=IS_DENORM_NAN_DOUBLE(v)?0.:(v)) 61 | 62 | #else 63 | 64 | #define FIX_DENORM_FLOAT(v) 65 | #define FIX_DENORM_DOUBLE(v) 66 | 67 | #define FIX_DENORM_NAN_FLOAT(v) ((v)=IS_NAN_FLOAT(v)?0.0:(v)) 68 | #define FIX_DENORM_NAN_DOUBLE(v) ((v)=IS_NAN_DOUBLE(v)?0.0:(v)) 69 | 70 | #endif // #ifdef DENORM_WANT_FIX 71 | 72 | #if MSP64 73 | #define IS_DENORM_SAMPLE(v) IS_DENORM_DOUBLE(v) 74 | #define IS_NAN_SAMPLE(v) IS_NAN_DOUBLE(v) 75 | #define IS_DENORM_NAN_SAMPLE(v) IS_DENORM_NAN_DOUBLE(v) 76 | #define FIX_DENORM_SAMPLE(v) FIX_DENORM_DOUBLE(v) 77 | #define FIX_DENORM_NAN_SAMPLE(v) FIX_DENORM_NAN_DOUBLE(v) 78 | #else 79 | #define IS_DENORM_SAMPLE(v) IS_DENORM_FLOAT(v) 80 | #define IS_NAN_SAMPLE(v) IS_NAN_FLOAT(v) 81 | #define IS_DENORM_NAN_SAMPLE(v) IS_DENORM_NAN_FLOAT(v) 82 | #define FIX_DENORM_SAMPLE(v) FIX_DENORM_FLOAT(v) 83 | #define FIX_DENORM_NAN_SAMPLE(v) FIX_DENORM_NAN_FLOAT(v) 84 | #endif 85 | 86 | #endif // _Z_SAMPLETYPE_H 87 | 88 | -------------------------------------------------------------------------------- /script/GetGitRevisionDescription.cmake: -------------------------------------------------------------------------------- 1 | # - Returns a version string from Git 2 | # 3 | # These functions force a re-configure on each git commit so that you can 4 | # trust the values of the variables in your build system. 5 | # 6 | # get_git_head_revision( [ ...]) 7 | # 8 | # Returns the refspec and sha hash of the current head revision 9 | # 10 | # git_describe( [ ...]) 11 | # 12 | # Returns the results of git describe on the source tree, and adjusting 13 | # the output so that it tests false if an error occurs. 14 | # 15 | # git_get_exact_tag( [ ...]) 16 | # 17 | # Returns the results of git describe --exact-match on the source tree, 18 | # and adjusting the output so that it tests false if there was no exact 19 | # matching tag. 20 | # 21 | # Requires CMake 2.6 or newer (uses the 'function' command) 22 | # 23 | # Original Author: 24 | # 2009-2010 Ryan Pavlik 25 | # http://academic.cleardefinition.com 26 | # Iowa State University HCI Graduate Program/VRAC 27 | # 28 | # Copyright Iowa State University 2009-2010. 29 | # Distributed under the Boost Software License, Version 1.0. 30 | # (See accompanying file LICENSE_1_0.txt or copy at 31 | # http://www.boost.org/LICENSE_1_0.txt) 32 | 33 | if(__get_git_revision_description) 34 | return() 35 | endif() 36 | set(__get_git_revision_description YES) 37 | 38 | # We must run the following at "include" time, not at function call time, 39 | # to find the path to this module rather than the path to a calling list file 40 | get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) 41 | 42 | function(get_git_head_revision _refspecvar _hashvar) 43 | set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") 44 | set(GIT_DIR "${GIT_PARENT_DIR}/.git") 45 | while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories 46 | set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}") 47 | get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH) 48 | if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT) 49 | # We have reached the root directory, we are not in git 50 | set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE) 51 | set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE) 52 | return() 53 | endif() 54 | set(GIT_DIR "${GIT_PARENT_DIR}/.git") 55 | endwhile() 56 | # check if this is a submodule 57 | if(NOT IS_DIRECTORY ${GIT_DIR}) 58 | file(READ ${GIT_DIR} submodule) 59 | string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule}) 60 | get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH) 61 | get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE) 62 | endif() 63 | set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data") 64 | if(NOT EXISTS "${GIT_DATA}") 65 | file(MAKE_DIRECTORY "${GIT_DATA}") 66 | endif() 67 | 68 | if(NOT EXISTS "${GIT_DIR}/HEAD") 69 | return() 70 | endif() 71 | set(HEAD_FILE "${GIT_DATA}/HEAD") 72 | configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY) 73 | 74 | configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in" 75 | "${GIT_DATA}/grabRef.cmake" 76 | @ONLY) 77 | include("${GIT_DATA}/grabRef.cmake") 78 | 79 | set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE) 80 | set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE) 81 | endfunction() 82 | 83 | function(git_describe _var) 84 | if(NOT GIT_FOUND) 85 | find_package(Git QUIET) 86 | endif() 87 | get_git_head_revision(refspec hash) 88 | if(NOT GIT_FOUND) 89 | set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) 90 | return() 91 | endif() 92 | if(NOT hash) 93 | set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE) 94 | return() 95 | endif() 96 | 97 | # TODO sanitize 98 | #if((${ARGN}" MATCHES "&&") OR 99 | # (ARGN MATCHES "||") OR 100 | # (ARGN MATCHES "\\;")) 101 | # message("Please report the following error to the project!") 102 | # message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}") 103 | #endif() 104 | 105 | #message(STATUS "Arguments to execute_process: ${ARGN}") 106 | 107 | execute_process(COMMAND 108 | "${GIT_EXECUTABLE}" 109 | describe 110 | ${ARGN} 111 | WORKING_DIRECTORY 112 | "${CMAKE_SOURCE_DIR}" 113 | RESULT_VARIABLE 114 | res 115 | OUTPUT_VARIABLE 116 | out 117 | ERROR_QUIET 118 | OUTPUT_STRIP_TRAILING_WHITESPACE) 119 | 120 | set(${_var} "${out}" PARENT_SCOPE) 121 | endfunction() 122 | 123 | function(git_get_exact_tag _var) 124 | git_describe(out --exact-match ${ARGN}) 125 | set(${_var} "${out}" PARENT_SCOPE) 126 | endfunction() 127 | -------------------------------------------------------------------------------- /script/GetGitRevisionDescription.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # Internal file for GetGitRevisionDescription.cmake 3 | # 4 | # Requires CMake 2.6 or newer (uses the 'function' command) 5 | # 6 | # Original Author: 7 | # 2009-2010 Ryan Pavlik 8 | # http://academic.cleardefinition.com 9 | # Iowa State University HCI Graduate Program/VRAC 10 | # 11 | # Copyright Iowa State University 2009-2010. 12 | # Distributed under the Boost Software License, Version 1.0. 13 | # (See accompanying file LICENSE_1_0.txt or copy at 14 | # http://www.boost.org/LICENSE_1_0.txt) 15 | 16 | set(HEAD_HASH) 17 | 18 | file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) 19 | 20 | string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) 21 | if(HEAD_CONTENTS MATCHES "ref") 22 | # named branch 23 | string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") 24 | if(EXISTS "@GIT_DIR@/${HEAD_REF}") 25 | configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 26 | elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}") 27 | configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 28 | set(HEAD_HASH "${HEAD_REF}") 29 | endif() 30 | else() 31 | # detached HEAD 32 | configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) 33 | endif() 34 | 35 | if(NOT HEAD_HASH) 36 | file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) 37 | string(STRIP "${HEAD_HASH}" HEAD_HASH) 38 | endif() 39 | -------------------------------------------------------------------------------- /script/Info.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${MACOSX_BUNDLE_EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | @AUTHOR_DOMAIN@.@BUNDLE_IDENTIFIER@ 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | 16 | CFBundlePackageType 17 | iLaX 18 | CFBundleSignature 19 | max2 20 | 21 | C74ObjectProperties 22 | 23 | c74excludefromcollectives 24 | @EXCLUDE_FROM_COLLECTIVES@ 25 | 26 | 27 | CFBundleVersion 28 | @PACKAGE_VERSION@ 29 | CFBundleShortVersionString 30 | @PACKAGE_VERSION@ 31 | CFBundleLongVersionString 32 | ${MACOSX_BUNDLE_EXECUTABLE_NAME} @PACKAGE_VERSION@ - @COPYRIGHT_STRING@ 33 | NSHumanReadableCopyright 34 | @COPYRIGHT_STRING@ 35 | 36 | CSResourcesFileMapped 37 | 38 | LSRequiresCarbon 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /script/PkgInfo: -------------------------------------------------------------------------------- 1 | iLaX???? -------------------------------------------------------------------------------- /script/excludefromcollectives.json: -------------------------------------------------------------------------------- 1 | { 2 | "c74excludefromcollectives": "yes" 3 | } 4 | -------------------------------------------------------------------------------- /script/git-rev.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Max-API Authors. All rights reserved. 2 | # Use of this source code is governed by the MIT License found in the License.md file. 3 | 4 | include("${CMAKE_CURRENT_LIST_DIR}/GetGitRevisionDescription.cmake") 5 | 6 | set(HASH "error") 7 | get_git_head_revision(REFSPEC HASH --always --tags) 8 | git_describe(GIT_TAG --abbrev=0 --tags) 9 | 10 | if(NOT ${HASH} STREQUAL "error" AND NOT ${HASH} STREQUAL "GIT-NOTFOUND" AND NOT ${GIT_TAG} STREQUAL "HEAD-HASH-NOTFOUND") 11 | string(SUBSTRING ${HASH} 0 7 GIT_SHA_SHORT) 12 | message("building on Git rev : " ${GIT_SHA_SHORT}) 13 | message("Git tag : " ${GIT_TAG}) 14 | 15 | string(REPLACE "v" "" GIT_VERSION_TAG "${GIT_TAG}") 16 | 17 | string(LENGTH "${GIT_VERSION_TAG}" taglen) 18 | #message("Git tag length : " ${taglen}) 19 | if (taglen GREATER 1) 20 | string(REGEX MATCHALL "-.*$|[0-9]+" GIT_TAG_LIST ${GIT_VERSION_TAG}) 21 | list(LENGTH GIT_TAG_LIST len) 22 | if (len GREATER 0) 23 | list(GET GIT_TAG_LIST 0 GIT_VERSION_MAJ) 24 | endif (len GREATER 0) 25 | if (len GREATER 1) 26 | list(GET GIT_TAG_LIST 1 GIT_VERSION_MIN) 27 | endif (len GREATER 1) 28 | if (len GREATER 2) 29 | list(GET GIT_TAG_LIST 2 GIT_VERSION_SUB) 30 | endif (len GREATER 2) 31 | if (len GREATER 3) 32 | list(GET GIT_TAG_LIST 3 GIT_VERSION_MOD_LONG) 33 | endif (len GREATER 3) 34 | list(LENGTH GIT_VERSION_MOD_LONG len2) 35 | if (len2 GREATER 0) 36 | string(REPLACE "-" ";" GIT_VERSION_MOD_LIST ${GIT_VERSION_MOD_LONG}) 37 | list(GET GIT_VERSION_MOD_LIST 0 GIT_VERSION_MOD) 38 | endif (len2 GREATER 0) 39 | endif (taglen GREATER 1) 40 | else() 41 | message("using default version : 1.0.0") 42 | set(GIT_VERSION_MAJ 1) 43 | set(GIT_VERSION_MIN 0) 44 | set(GIT_VERSION_SUB 0) 45 | set(GIT_VERSION_MOD_LONG 0) 46 | endif() 47 | 48 | -------------------------------------------------------------------------------- /script/max-package.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Max-API Authors. All rights reserved. 2 | # Use of this source code is governed by the MIT License found in the License.md file. 3 | 4 | cmake_minimum_required(VERSION 3.19) 5 | 6 | string(REGEX REPLACE "(.*)/" "" THIS_FOLDER_NAME "${CMAKE_CURRENT_SOURCE_DIR}") 7 | project(${THIS_FOLDER_NAME}) 8 | 9 | set(GIT_VERSION_MAJ 0) 10 | set(GIT_VERSION_MIN 0) 11 | set(GIT_VERSION_SUB 0) 12 | # Set version variables based on the current Git tag 13 | include("${CMAKE_CURRENT_LIST_DIR}/git-rev.cmake") 14 | 15 | set(ADD_VERINFO YES) 16 | 17 | # Update package-info.json, if present 18 | if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/package-info.json.in") 19 | set(C74_PACKAGE_NAME "${THIS_FOLDER_NAME}") 20 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/package-info.json.in" "${CMAKE_CURRENT_SOURCE_DIR}/package-info.json" @ONLY) 21 | 22 | message("Reading ${CMAKE_CURRENT_SOURCE_DIR}/package-info.json") 23 | 24 | file(READ "${CMAKE_CURRENT_SOURCE_DIR}/package-info.json" PKGINFOFILE) 25 | 26 | string(JSON AUTHOR GET ${PKGINFOFILE} "author") 27 | 28 | string(JSON PACKAGE_VERSION ERROR_VARIABLE PKG_ERROR GET ${PKGINFOFILE} "version") 29 | if (PACKAGE_VERSION MATCHES "-NOTFOUND") 30 | set(PACKAGE_VERSION "${GIT_VERSION_MAJ}.${GIT_VERSION_MIN}.${GIT_VERSION_SUB}") 31 | endif () 32 | 33 | string(JSON PKG_EXTRA_STR ERROR_VARIABLE PKG_ERROR GET ${PKGINFOFILE} "package_extra") 34 | 35 | string(JSON AUTHOR_DOMAIN ERROR_VARIABLE PKG_ERROR GET ${PKG_EXTRA_STR} "reverse_domain") 36 | if (AUTHOR_DOMAIN MATCHES "-NOTFOUND") 37 | set(AUTHOR_DOMAIN "com.acme") 38 | endif () 39 | 40 | string(JSON COPYRIGHT_STRING ERROR_VARIABLE PKG_ERROR GET ${PKG_EXTRA_STR} "copyright") 41 | if (COPYRIGHT_STRING MATCHES "-NOTFOUND") 42 | set(COPYRIGHT_STRING "Copyright (c) 1974 Acme Inc") 43 | endif () 44 | 45 | string(JSON ADD_VERINFO_STR ERROR_VARIABLE PKG_ERROR GET ${PKG_EXTRA_STR} "add_verinfo") 46 | if (NOT ADD_VERINFO_STR MATCHES "-NOTFOUND" AND NOT ADD_VERINFO_STR STREQUAL true) 47 | set(ADD_VERINFO NO) 48 | endif () 49 | 50 | string(JSON EXCLUDE_FROM_COLLECTIVES ERROR_VARIABLE PKG_ERROR GET ${PKG_EXTRA_STR} "exclude_from_collectives") 51 | if (EXCLUDE_FROM_COLLECTIVES MATCHES "-NOTFOUND") 52 | set(EXCLUDE_FROM_COLLECTIVES "no") 53 | endif () 54 | 55 | message("Building _____ ${PACKAGE_VERSION} _____") 56 | endif () 57 | 58 | 59 | # Copy PkgInfo and update Info.plist files on the Mac 60 | if (APPLE) 61 | message("Generating Info.plist") 62 | 63 | set(BUNDLE_IDENTIFIER "\${PRODUCT_NAME:rfc1034identifier}") 64 | #configure_file("${CMAKE_CURRENT_LIST_DIR}/Info.plist.in" "${CMAKE_CURRENT_LIST_DIR}/Info.plist" @ONLY) 65 | endif () 66 | 67 | if (WIN32 AND ADD_VERINFO) 68 | message("Generating verinfo.rc") 69 | 70 | string(REPLACE "." "," PACKAGE_VERSION ${PACKAGE_VERSION}) 71 | configure_file("${CMAKE_CURRENT_LIST_DIR}/verinfo.rc.in" "${CMAKE_CURRENT_LIST_DIR}/verinfo.rc" @ONLY) 72 | endif() 73 | 74 | # Macro from http://stackoverflow.com/questions/7787823/cmake-how-to-get-the-name-of-all-subdirectories-of-a-directory 75 | MACRO(SUBDIRLIST result curdir) 76 | FILE(GLOB children RELATIVE ${curdir} ${curdir}/*) 77 | SET(dirlist "") 78 | FOREACH(child ${children}) 79 | IF(IS_DIRECTORY ${curdir}/${child}) 80 | LIST(APPEND dirlist ${child}) 81 | ENDIF() 82 | ENDFOREACH() 83 | SET(${result} ${dirlist}) 84 | ENDMACRO() 85 | 86 | -------------------------------------------------------------------------------- /script/max-posttarget.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Max-API Authors. All rights reserved. 2 | # Use of this source code is governed by the MIT License found in the License.md file. 3 | 4 | if (${C74_CXX_STANDARD} EQUAL 98) 5 | if (APPLE) 6 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++98 -stdlib=libstdc++") 7 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -stdlib=libstdc++") 8 | set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -stdlib=libstdc++") 9 | endif () 10 | else () 11 | set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17) 12 | set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) 13 | endif () 14 | 15 | set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "${${PROJECT_NAME}_EXTERN_OUTPUT_NAME}") 16 | #remove the 'lib' prefix for some generators 17 | set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") 18 | 19 | 20 | 21 | ### Output ### 22 | if (APPLE) 23 | find_library( 24 | MSP_LIBRARY "MaxAudioAPI" 25 | REQUIRED 26 | PATHS "${MAX_SDK_MSP_INCLUDES}" 27 | NO_DEFAULT_PATH 28 | #only use the specific path above, don't look in system root 29 | #this enables cross compilation to provide an alternative root 30 | #but also find this specific path 31 | NO_CMAKE_FIND_ROOT_PATH 32 | ) 33 | target_link_libraries(${PROJECT_NAME} PUBLIC ${MSP_LIBRARY}) 34 | find_library( 35 | JITTER_LIBRARY "JitterAPI" 36 | REQUIRED 37 | PATHS "${MAX_SDK_JIT_INCLUDES}" 38 | NO_DEFAULT_PATH 39 | NO_CMAKE_FIND_ROOT_PATH 40 | ) 41 | target_link_libraries(${PROJECT_NAME} PUBLIC ${JITTER_LIBRARY}) 42 | if ("${PROJECT_NAME}" MATCHES "jit.gl.*") 43 | target_link_libraries(${PROJECT_NAME} PUBLIC "-framework OpenGL") 44 | endif() 45 | set_property(TARGET ${PROJECT_NAME} 46 | PROPERTY BUNDLE True) 47 | set_property(TARGET ${PROJECT_NAME} 48 | PROPERTY BUNDLE_EXTENSION "mxo") 49 | set_target_properties(${PROJECT_NAME} PROPERTIES XCODE_ATTRIBUTE_WRAPPER_EXTENSION "mxo") 50 | set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE_BUNDLE_VERSION "${GIT_VERSION_TAG}") 51 | set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_LIST_DIR}/Info.plist.in) 52 | set_target_properties(${PROJECT_NAME} PROPERTIES XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${AUTHOR_DOMAIN}.${BUNDLE_IDENTIFIER}") 53 | elseif (WIN32) 54 | if ("${PROJECT_NAME}" MATCHES "_test") 55 | else () 56 | if ("${PROJECT_NAME}" MATCHES "jit.gl.*") 57 | find_package(OpenGL REQUIRED) 58 | include_directories(${OPENGL_INCLUDE_DIR}) 59 | target_link_libraries(${PROJECT_NAME} PUBLIC ${OPENGL_LIBRARIES}) 60 | endif() 61 | 62 | target_link_libraries(${PROJECT_NAME} PUBLIC ${MaxAPI_LIB}) 63 | target_link_libraries(${PROJECT_NAME} PUBLIC ${MaxAudio_LIB}) 64 | target_link_libraries(${PROJECT_NAME} PUBLIC ${Jitter_LIB}) 65 | endif () 66 | 67 | set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".mxe64") 68 | 69 | if (CMAKE_GENERATOR MATCHES "Visual Studio") 70 | # warning about constexpr not being const in c++14 71 | set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/wd4814") 72 | 73 | # do not generate ILK files 74 | set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/INCREMENTAL:NO") 75 | 76 | # allow parallel builds 77 | set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/MP") 78 | endif () 79 | 80 | if (EXCLUDE_FROM_COLLECTIVES STREQUAL "yes") 81 | target_compile_definitions(${PROJECT_NAME} PRIVATE "-DEXCLUDE_FROM_COLLECTIVES") 82 | endif() 83 | 84 | if (ADD_VERINFO) 85 | target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/verinfo.rc) 86 | endif() 87 | else() 88 | set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".mxl_${CMAKE_SYSTEM_PROCESSOR}") 89 | endif () 90 | 91 | 92 | ### Post Build ### 93 | 94 | if (APPLE AND NOT "${PROJECT_NAME}" MATCHES "_test") 95 | add_custom_command( 96 | TARGET ${PROJECT_NAME} 97 | POST_BUILD 98 | COMMAND cp "${CMAKE_CURRENT_LIST_DIR}/PkgInfo" "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${${PROJECT_NAME}_EXTERN_OUTPUT_NAME}.mxo/Contents/PkgInfo" 99 | VERBATIM 100 | COMMENT "Copy PkgInfo" 101 | ) 102 | 103 | if(MAX_SDK_CODESIGN_EXTERNS) 104 | if(NOT DEFINED MAX_SDK_CODESIGN_IDENTITY) 105 | set(MAX_SDK_CODESIGN_IDENTITY "-") 106 | message(STATUS "Code signing with ad-hoc identity") 107 | else() 108 | execute_process( 109 | COMMAND security find-identity -p codesigning -v 110 | OUTPUT_VARIABLE security_output 111 | ) 112 | if (MAX_SDK_CODESIGN_IDENTITY AND security_output MATCHES "${MAX_SDK_CODESIGN_IDENTITY}") 113 | message(STATUS "Code signing identity found, will sign") 114 | else() 115 | set(MAX_SDK_CODESIGN_IDENTITY "-") 116 | message(STATUS "Code signing with ad-hoc identity") 117 | endif() 118 | endif() 119 | add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD 120 | COMMAND codesign -s ${MAX_SDK_CODESIGN_IDENTITY} -f --deep $ 2>/dev/null 121 | ) 122 | endif() 123 | endif () 124 | -------------------------------------------------------------------------------- /script/max-pretarget.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2018 The Max-API Authors. All rights reserved. 2 | # Use of this source code is governed by the MIT License found in the License.md file. 3 | 4 | option(MAX_SDK_CODESIGN_EXTERNS "Sign macos externs during build" ON) # use MAX_SDK_CODESIGN_IDENTITY to override the default adhoc identity "-" 5 | 6 | string(REGEX REPLACE "(.*)/" "" THIS_FOLDER_NAME "${CMAKE_CURRENT_SOURCE_DIR}") 7 | 8 | string(REPLACE "~" "_tilde" THIS_FOLDER_NAME "${THIS_FOLDER_NAME}") 9 | 10 | if (WIN32) 11 | # These must be prior to the "project" command 12 | # https://stackoverflow.com/questions/14172856/compile-with-mt-instead-of-md-using-cmake 13 | 14 | if (CMAKE_GENERATOR MATCHES "Visual Studio") 15 | set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1") 16 | set(CMAKE_C_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG") 17 | set(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG") 18 | set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG") 19 | 20 | set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1") 21 | set(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG") 22 | set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG") 23 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG") 24 | 25 | add_compile_options( 26 | $<$:/MT> 27 | $<$:/MTd> 28 | $<$:/MT> 29 | $<$:/MT> 30 | $<$:/MT> 31 | ) 32 | else() 33 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static") 34 | endif () 35 | endif () 36 | 37 | project(${THIS_FOLDER_NAME}) 38 | 39 | if ("${PROJECT_NAME}" MATCHES ".*_tilde") 40 | string(REGEX REPLACE "_tilde" "~" EXTERN_OUTPUT_NAME_DEFAULT "${PROJECT_NAME}") 41 | else () 42 | set(EXTERN_OUTPUT_NAME_DEFAULT "${PROJECT_NAME}") 43 | endif () 44 | set("${PROJECT_NAME}_EXTERN_OUTPUT_NAME" "${EXTERN_OUTPUT_NAME_DEFAULT}" CACHE STRING "The name to give to the external output file/directory") 45 | mark_as_advanced("${PROJECT_NAME}_EXTERN_OUTPUT_NAME") 46 | 47 | if (NOT DEFINED C74_SUPPORT_DIR) 48 | set(C74_SUPPORT_DIR ${CMAKE_CURRENT_LIST_DIR}/../c74support) 49 | endif () 50 | 51 | set(MAX_SDK_INCLUDES "${C74_SUPPORT_DIR}/max-includes") 52 | set(MAX_SDK_MSP_INCLUDES "${C74_SUPPORT_DIR}/msp-includes") 53 | set(MAX_SDK_JIT_INCLUDES "${C74_SUPPORT_DIR}/jit-includes") 54 | 55 | set(C74_INCLUDES "${C74_SUPPORT_DIR}" "${MAX_SDK_INCLUDES}" "${MAX_SDK_MSP_INCLUDES}" "${MAX_SDK_JIT_INCLUDES}") 56 | set(C74_SCRIPTS "${CMAKE_CURRENT_LIST_DIR}") 57 | 58 | set(C74_CXX_STANDARD 0) 59 | 60 | if (APPLE) 61 | if (CMAKE_OSX_ARCHITECTURES STREQUAL "") 62 | set(CMAKE_OSX_ARCHITECTURES x86_64) 63 | endif() 64 | set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "Minimum OS X deployment version" FORCE) 65 | endif () 66 | 67 | if (DEFINED C74_LIBRARY_OUTPUT_DIRECTORY) 68 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${C74_LIBRARY_OUTPUT_DIRECTORY}") 69 | else () 70 | if (NOT DEFINED C74_BUILD_MAX_EXTENSION) 71 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../../../externals") 72 | else () 73 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../../../extensions") 74 | endif () 75 | endif() 76 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") 77 | set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") 78 | 79 | if (WIN32) 80 | set(CMAKE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/pdb/$") 81 | 82 | SET(MaxAPI_LIB ${MAX_SDK_INCLUDES}/x64/MaxAPI.lib) 83 | SET(MaxAudio_LIB ${MAX_SDK_MSP_INCLUDES}/x64/MaxAudio.lib) 84 | SET(Jitter_LIB ${MAX_SDK_JIT_INCLUDES}/x64/jitlib.lib) 85 | 86 | MARK_AS_ADVANCED (MaxAPI_LIB) 87 | MARK_AS_ADVANCED (MaxAudio_LIB) 88 | MARK_AS_ADVANCED (Jitter_LIB) 89 | 90 | add_definitions( 91 | -DMAXAPI_USE_MSCRT 92 | -DWIN_VERSION 93 | -D_USE_MATH_DEFINES 94 | ) 95 | elseif (APPLE) 96 | file (STRINGS "${CMAKE_CURRENT_LIST_DIR}/max-linker-flags.txt" C74_SYM_MAX_LINKER_FLAGS) 97 | 98 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${C74_SYM_MAX_LINKER_FLAGS}") 99 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${C74_SYM_MAX_LINKER_FLAGS}") 100 | set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${C74_SYM_MAX_LINKER_FLAGS}") 101 | endif () 102 | -------------------------------------------------------------------------------- /script/verinfo.rc.in: -------------------------------------------------------------------------------- 1 | #include "winver.h" 2 | 3 | VS_VERSION_INFO VERSIONINFO 4 | FILEVERSION @PACKAGE_VERSION@,0 5 | PRODUCTVERSION @PACKAGE_VERSION@,0 6 | FILEFLAGSMASK 0 7 | FILEFLAGS 0 8 | FILEOS VOS_NT_WINDOWS32 9 | FILETYPE VFT_DLL 10 | FILESUBTYPE VFT2_UNKNOWN 11 | BEGIN 12 | BLOCK "StringFileInfo" 13 | BEGIN 14 | BLOCK "040904E4" 15 | BEGIN 16 | VALUE "CompanyName", "@AUTHOR@" 17 | VALUE "LegalCopyright", "@COPYRIGHT_STRING@" 18 | VALUE "ProductVersion", "@PACKAGE_VERSION@,0" 19 | END 20 | END 21 | BLOCK "VarFileInfo" 22 | BEGIN 23 | VALUE "Translation", 0x0409, 1252 24 | END 25 | END 26 | 27 | #ifdef EXCLUDE_FROM_COLLECTIVES 28 | C74OBJECTPROPERTIES C74OBJECTPROPERTIES "excludefromcollectives.json" 29 | #endif 30 | --------------------------------------------------------------------------------