flext  0.6.0
flmspbuffer.h
Go to the documentation of this file.
1 /*
2 flext - C++ layer for Max and Pure Data externals
3 
4 Copyright (c) 2001-2015 Thomas Grill (gr@grrrr.org)
5 For information on usage and redistribution, and for a DISCLAIMER OF ALL
6 WARRANTIES, see the file, "license.txt," in this distribution.
7 */
8 
17 #if (FLEXT_SYS == FLEXT_SYS_MAX) && !defined(__FLEXT_MSPBUFFER_H)
18 #define __FLEXT_MSPBUFFER_H
19 
20 enum {
21  MAXCHAN = 4
22 };
23 
24 enum {
25  bi_basefreq = 0,
26  bi_detune,
27  bi_lowfreq,
28  bi_hifreq,
29  bi_lowvel,
30  bi_hivel,
31  bi_gain,
32  bi_numparams
33 };
34 
35 typedef struct _buffer
36 {
37  t_object b_obj; // doesn't have any signals so it doesn't need to be pxobject
38  long b_valid; // flag is off during read replacement or editing operation
39  float *b_samples; // stored with interleaved channels if multi-channel
40  long b_frames; // number of sample frames (each one is sizeof(float) * b_nchans bytes)
41  long b_nchans; // number of channels
42  long b_size; // size of buffer in floats
43  float b_sr; // sampling rate of the buffer
44  float b_1oversr; // 1 / sr
45  float b_msr; // sr * .001
46  // Mac-specific stuff
47  float *b_memory; // pointer to where memory starts (initial padding for interp)
48  t_symbol *b_name;
49  short b_vol;
50  short b_space;
51  // looping info (from AIFF file)
52  long b_susloopstart; // in samples
53  long b_susloopend; // in samples
54  long b_relloopstart; // in samples
55  long b_relloopend; // in samples
56  // instrument info (from AIFF file)
57  short b_inst[bi_numparams];
58  // window stuff
59  void *b_wind;
60  double b_pixperfr;
61  double b_frperpix;
62  long b_imagesize;
63  Point b_scroll;
64  long b_scrollscale;
65  long b_selbegin[MAXCHAN];
66  long b_selend[MAXCHAN];
67  long b_zoom;
68  long b_zim[11];
69  void *b_mouseout;
70  long b_format; // 'AIFF' or 'Sd2f'
71  t_symbol *b_filename; // last file read (not written) for readagain message
72  long b_oldnchans; // used for resizing window in case of # of channels change
73  void *b_doneout;
74  long b_outputbytes; // number of bytes used for output sample (1-4)
75  long b_modtime; // last modified time ("dirty" method)
76 } t_buffer;
77 
78 #define BUFWIND(x) ((t_wind *)(x->b_wind))
79 
80 #endif