Max 5 API Reference
00001 #include "ext_critical.h" 00002 #include "ext_atomic.h" 00003 00004 #if C74_PRAGMA_STRUCT_PACKPUSH 00005 #pragma pack(push, 2) 00006 #elif C74_PRAGMA_STRUCT_PACK 00007 #pragma pack(2) 00008 #endif 00009 00010 enum { 00011 MAXCHAN = 4 00012 }; 00013 00014 enum { 00015 bi_basefreq = 0, 00016 bi_detune, 00017 bi_lowfreq, 00018 bi_hifreq, 00019 bi_lowvel, 00020 bi_hivel, 00021 bi_gain, 00022 bi_numparams 00023 }; 00024 00025 00026 /** Data structure for the buffer~ object. 00027 @ingroup buffers 00028 */ 00029 typedef struct _buffer 00030 { 00031 t_object b_obj; ///< doesn't have any signals so it doesn't need to be pxobject 00032 long b_valid; ///< flag is off during read replacement or editing operation 00033 float *b_samples; ///< stored with interleaved channels if multi-channel 00034 long b_frames; ///< number of sample frames (each one is sizeof(float) * b_nchans bytes) 00035 long b_nchans; ///< number of channels 00036 long b_size; ///< size of buffer in floats 00037 float b_sr; ///< sampling rate of the buffer 00038 float b_1oversr; ///< 1 / sr 00039 float b_msr; ///< sr * .001 00040 // Mac-specific stuff 00041 float *b_memory; ///< pointer to where memory starts (initial padding for interp) 00042 t_symbol *b_name; ///< name of the buffer 00043 short b_vol; 00044 short b_space; 00045 // looping info (from AIFF file) 00046 long b_susloopstart; ///< looping info (from AIFF file) in samples 00047 long b_susloopend; ///< looping info (from AIFF file) in samples 00048 long b_relloopstart; ///< looping info (from AIFF file) in samples 00049 long b_relloopend; ///< looping info (from AIFF file) in samples 00050 // instrument info (from AIFF file) 00051 short b_inst[bi_numparams]; 00052 // window stuff 00053 void *b_wind; 00054 double b_pixperfr; 00055 double b_frperpix; 00056 long b_imagesize; 00057 Point b_scroll; 00058 long b_scrollscale; 00059 long b_selbegin[MAXCHAN]; 00060 long b_selend[MAXCHAN]; 00061 long b_zoom; 00062 long b_zim[11]; 00063 void *b_mouseout; 00064 long b_format; ///< 'AIFF' or 'Sd2f' 00065 t_symbol *b_filename; ///< last file read (not written) for readagain message 00066 long b_oldnchans; ///< used for resizing window in case of # of channels change 00067 void *b_doneout; 00068 long b_outputbytes; ///< number of bytes used for output sample (1-4) 00069 long b_modtime; ///< last modified time ("dirty" method) 00070 struct _buffer *b_peer; ///< objects that share this symbol (used as a link in the peers) 00071 Boolean b_owner; ///< b_memory/b_samples "owned" by this object 00072 long b_outputfmt; ///< sample type (A_LONG, A_FLOAT, etc.) 00073 t_int32_atomic b_inuse; ///< objects that use buffer should ATOMIC_INCREMENT / ATOMIC_DECREMENT this in their perform 00074 void *b_dspchain; ///< dspchain used for this instance 00075 } t_buffer; 00076 00077 #define BUFWIND(x) ((t_wind *)(x->b_wind)) 00078 00079 #if C74_PRAGMA_STRUCT_PACKPUSH 00080 #pragma pack(pop) 00081 #elif C74_PRAGMA_STRUCT_PACK 00082 #pragma pack() 00083 #endif
Copyright © 2008, Cycling '74