Jamoma API  0.6.0.a19
j.oscroute.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup implementationMaxExternals
4  *
5  * @brief j.oscroute - parse and pass OSC messages
6  *
7  * @details
8  *
9  * @authors Tim Place, Trond Lossius
10  *
11  * @copyright Copyright © 2006 Tim Place @n
12  * This code is licensed under the terms of the "New BSD License" @n
13  * http://creativecommons.org/licenses/BSD/
14  */
15 
16 #include "JamomaForMax.h"
17 
18 #define MAX_ARGCOUNT 100
19 #define MAX_MESS_SIZE 2048
20 
21 typedef struct _oscroute{ ///< Data Structure for this object.
22  t_object ob; ///< REQUIRED: Our object,
23  void *outlets[MAX_ARGCOUNT]; ///< my outlet array.
24  void *outlet_overflow; ///< This outlet doubles as the dumpout outlet.
25  t_symbol *arguments[MAX_ARGCOUNT]; ///< Symbols to match.
26  long unsigned arglen[MAX_ARGCOUNT]; ///< strlen of symbols to match,
27  short num_args;
28  void* proxy_inlet[MAX_ARGCOUNT]; ///< Array of pointers to inlets for changing what symbols to route.
29 } t_oscroute;
30 
31 // Prototypes for our methods:
32 
33 /** Object instance constructor.
34  @param s Symbol passed as an argument to the new object instance.
35  @param argc The number of arguments passed to the new object instance.
36  @param argv The arguments passed to the object instance as a pointer to an array.
37  */
38 void *oscroute_new(t_symbol *s, long argc, t_atom *argv);
39 
40 
41 
42 /** Object instance destructor, ensures that all memory assigned is properly freed.
43  @param x Pointer to the object instance to free.
44  */
45 void oscroute_free(t_oscroute *x);
46 
47 
48 /** Provide assistance on input and output while patching.
49  @param x The object instance.
50  @param b
51  @param msg Determines if assistance is requested for an input or output.
52  @param arg Determines what input/output assistance is requested for.
53  @param dst Destination address that assistance string is copied to.
54  */
55 void oscroute_assist(t_oscroute *x, void *b, long msg, long arg, char *dst);
56 
57 
58 /** Method called when a "bang" is passed to the object.
59  The bang is passed straight on to the rightmost (overflow) outlet.
60  @param x The object instance.
61  */
62 void oscroute_bang(t_oscroute *x);
63 
64 
65 /** Method called when an "int" is passed to the object.
66  @details Integer values are passed straight to the rightmost (overflow) outlet.
67  @param x The object instance.
68  @param n The integer value passed to the object instance.
69  */
70 void oscroute_int(t_oscroute *x, long n);
71 
72 
73 /** Method called when a "float" is passed to the object.
74  @details Floats are passed straight to the rightmost (overflow) outlet.
75  @param x The object instance.
76  @param f The float value passed to the object instance.
77  */
78 void oscroute_float(t_oscroute *x, double f);
79 
80 
81 /** Method called when a list is passed to the object.
82  @details Lists are passed straight to the rightmost (overflow) outlet.
83  @param x The object instance.
84  @param msg The message passed to the object, usually "list".
85  @param argc The number of arguments.
86  @param argv The arguments of the list as a pointer to an array.
87  */
88 void oscroute_list(t_oscroute *x, t_symbol *msg, long argc, t_atom *argv);
89 
90 
91 /** Method called when a symbol is passed to the object.
92  @details The symbol is compared to the various symbols that the object instance is looking for.
93  If there's a match, the message is stripped of the matched part of the message, and passed to the appropriate outlet.
94  If not the messae is passed on to the rightmost (overflow) outlet.
95  @param x The object instance.
96  @param msg The message passed to the object.
97  @param argc The number of arguments.
98  @param argv The arguments of the list as a pointer to an array.
99  */
100 void oscroute_symbol(t_oscroute *x, t_symbol *msg, long argc, t_atom *argv);
101 
102 
103 // Globals
104 t_class *oscroute_class; ///< Required: Global pointer for our class
105 
void oscroute_int(t_oscroute *x, long n)
Method called when an "int" is passed to the object.
Definition: j.oscroute.cpp:144
void * oscroute_new(t_symbol *s, long argc, t_atom *argv)
Object instance constructor.
Definition: j.oscroute.cpp:52
void oscroute_list(t_oscroute *x, t_symbol *msg, long argc, t_atom *argv)
Method called when a list is passed to the object.
Definition: j.oscroute.cpp:156
void oscroute_bang(t_oscroute *x)
Method called when a "bang" is passed to the object.
Definition: j.oscroute.cpp:138
void oscroute_free(t_oscroute *x)
Object instance destructor, ensures that all memory assigned is properly freed.
Definition: j.oscroute.cpp:109
void oscroute_float(t_oscroute *x, double f)
Method called when a "float" is passed to the object.
Definition: j.oscroute.cpp:150
Various utilities for interfacing with Max that are not specific to JamomaModular as such...
t_class * oscroute_class
Required: Global pointer for our class.
Definition: j.oscroute.h:104
void oscroute_symbol(t_oscroute *x, t_symbol *msg, long argc, t_atom *argv)
Method called when a symbol is passed to the object.
Definition: j.oscroute.cpp:194
void oscroute_assist(t_oscroute *x, void *b, long msg, long arg, char *dst)
Provide assistance on input and output while patching.
Definition: j.oscroute.cpp:124