VISR  0.12.0
Versatile Interactive Scene Renderer
external_base.hpp
Go to the documentation of this file.
1 /* Copyright Institute of Sound and Vibration Research - All rights reserved */
2 
3 #ifndef VISR_MAXMSP_MAXSUPPORT_EXTERNAL_BASE_HPP_INCLUDED
4 #define VISR_MAXMSP_MAXSUPPORT_EXTERNAL_BASE_HPP_INCLUDED
5 
6 #include "export_symbols.hpp"
7 
8 /* Super-safe determination of the MAX define for setting the operating system. */
9 #ifdef __APPLE_CC__
10 #ifndef MAC_VERSION
11 #define MAC_VERSION
12 #undef WIN_VERSION
13 #endif
14 #else
15 #ifdef _MSC_VER
16 #ifndef WIN_VERSION
17 #define WIN_VERSION
18 #endif
19 #undef MAC_VERSION
20 #endif
21 #endif
22 
23 #include <ext.h>
24 #include <ext_obex.h>
25 #include <z_dsp.h>
26 
27 // Obviously Max/MSP is defining macros as max /min. This clashes badly with C++ code if max/min are defined as functions somewhere
28 #undef max
29 #undef min
30 
31 namespace visr
32 {
33 namespace maxmsp
34 {
35 
41 {
42 public:
47  explicit ExternalBase( t_pxobject & maxProxy );
48 
54  virtual ~ExternalBase();
55 
56  virtual void initDsp( t_object *dsp64, short *count, double samplerate, long maxvectorsize, long flags) = 0;
57 
58  virtual void perform( t_object *dsp64, double **ins,
59  long numins, double **outs, long numouts,
60  long sampleframes, long flags, void *userparam) = 0;
61 
62  virtual void getFloat( double f ) {}
63 
64  virtual void assist( void *b, long msg, long arg, char *dst ) = 0;
65 
66 protected:
67  t_pxobject * getMaxProxy() { return &mMaxProxy; }
68  t_pxobject const * getMaxProxy() const { return &mMaxProxy; }
69 
70 private:
71  t_pxobject& mMaxProxy;
72 };
73 
74 } // namespace visr
75 } // namespace maxmsp
76 
77 #endif // VISR_MAXMSP_MAXSUPPORT_EXTERNAL_BASE_HPP_INCLUDED
#define VISR_MAXSUPPORT_LIBRARY_SYMBOL
Definition: export_symbols.hpp:30
t_pxobject * getMaxProxy()
Definition: external_base.hpp:67
Definition: options.cpp:10
t_pxobject const * getMaxProxy() const
Definition: external_base.hpp:68
virtual void getFloat(double f)
Definition: external_base.hpp:62
Definition: external_base.hpp:40