Jamoma API  0.6.0.a19
JamomaModularForMax.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup implementationMaxLibrary
4  *
5  * @brief JamomaModular For Max Shared Library
6  *
7  * @details Functions and resources based on Modular framework used by Max objects
8  *
9  * @authors Théo de la Hogue, Tim Place
10  *
11  * @copyright © 2013, Théo de la Hogue & 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 #ifndef __JAMOMA_MODULAR_FOR_MAX_H__
17 #define __JAMOMA_MODULAR_FOR_MAX_H__
18 
19 #include "JamomaForMax.h"
20 
21 #include "TTNode.h"
22 #include "TTNodeDirectory.h"
23 #include "TTRegex.h"
24 #include "TTSubscriber.h"
25 #include "TTInput.h"
26 #include "TTOutput.h"
27 
28 extern JAMOMA_EXPORT TTSymbol kTTSym_Jamoma; ///<
29 extern JAMOMA_EXPORT TTObject JamomaApplicationManager;///<
30 extern JAMOMA_EXPORT TTObject JamomaApplication; ///<
31 
32 extern JAMOMA_EXPORT TTRegex* ttRegexForJmod; ///< A global regex to parse jmod. (usefull to detect a 0.5 module)
33 extern JAMOMA_EXPORT TTRegex* ttRegexForJcom; ///< A global regex to parse j.
34 extern JAMOMA_EXPORT TTRegex* ttRegexForModel; ///< A global regex to parse .model
35 extern JAMOMA_EXPORT TTRegex* ttRegexForModule; ///< A global regex to parse .module
36 extern JAMOMA_EXPORT TTRegex* ttRegexForView; ///< A global regex to parse .view
37 extern JAMOMA_EXPORT TTRegex* ttRegexForMaxpat; ///< A global regex to parse .maxpat
38 extern JAMOMA_EXPORT TTRegex* ttRegexForMaxhelp; ///< A global regex to parse .maxhelp
39 extern JAMOMA_EXPORT TTRegex* ttRegexForBracket; ///< A global regex to parse [ and ]
40 
41 extern JAMOMA_EXPORT TTString* ModelPatcherFormat; ///<
42 extern JAMOMA_EXPORT TTString* ModelPresetFormat; ///<
43 extern JAMOMA_EXPORT TTString* ViewPresetFormat; ///<
44 extern JAMOMA_EXPORT TTString* HelpPatcherFormat; ///<
45 extern JAMOMA_EXPORT TTString* RefpageFormat; ///<
46 extern JAMOMA_EXPORT TTString* DocumentationFormat; ///<
47 
48 #define ModelPatcher "model"
49 #define ViewPatcher "view"
50 
51 #define JamomaDebug if (accessApplicationLocalDebug)
52 
53 
54 // Methods to deal with TTSubscriber
55 ///////////////////////////////////////////////////////////////////////
56 
57 /** Create a #TTSubscriber object and register a #TTObject into the tree
58  or, if aTTObject is NULL, retrieve all context info to bind on an object.
59  @param x
60  @param anObject
61  @param relativeAddress
62  @param returnedSubscriber Pointer to the new #TTSubscriber object.
63  @param returnedAddress
64  @param returnedNode
65  @param returnedContextNode
66  @return #TTErr error message if the method does not execute as expected.
67  */
68 TTErr JAMOMA_EXPORT jamoma_subscriber_create(t_object *x, TTObject& anObject, TTAddress relativeAddress, TTObject& returnedSubscriber, TTSymbol& returnedAddress, TTNodePtr *returnedNode, TTNodePtr *returnedContextNode);
69 
70 
71 /** Get the <patcher name, patcher pointer> list above an external.
72  @details To understand what this method have to provide see in TTSubscriber.h and TTSubscriber.cpp.
73  @param x
74  @param aContextListToFill
75  */
76 void JAMOMA_EXPORT jamoma_subscriber_get_patcher_list(t_object *x, TTList& aContextListToFill);
77 void jamoma_subscriber_fill_list(TTList& listToFill, TTAddress address, TTPtr pointer);
78 
79 
80 // Method to deal with #TTContainer
81 ///////////////////////////////////////////////////////////////////////
82 
83 /** Create a #TTContainer object.
84  @param x
85  @param returnedContainer
86  @return #TTErr error message if the method does not execute as expected.
87  */
88 TTErr JAMOMA_EXPORT jamoma_container_create(t_object *x, TTObject& returnedContainer);
89 
90 
91 /** Send Max data to a node (e.g., a j.parameter object) using a #TTContainer object.
92  @param aContainer
93  @param relativeAddressAndAttribute The relative address and attribute of the node that the message is to be sent to.
94  @param argc The number of arguments of the message.
95  @param argv Pointer to the array of arguments.
96  @return #TTErr error message if the method does not execute as expected.
97  */
98 TTErr JAMOMA_EXPORT jamoma_container_send(TTObject& aContainer, t_symbol *relativeAddressAndAttribute, long argc, const t_atom *argv);
99 
100 
101 
102 // Method to deal with #TTNodeInfo
103 ///////////////////////////////////////////////////////////////////////
104 
105 /** Create a #TTNodeInfo object.
106  @param x
107  @param returnedNodeInfo
108  @return #TTErr error message if the method does not execute as expected.
109  */
110 TTErr JAMOMA_EXPORT jamoma_node_info_create(t_object *x, TTObject& returnedNodeInfo);
111 
112 
113 
114 // Method to deal with #TTData
115 ///////////////////////////////////////////////////////////////////////
116 
117 /** Create a #TTData object.
118  @param x
119  @param returnedData
120  @param service
121  @return #TTErr error message if the method does not execute as expected.
122  */
123 TTErr JAMOMA_EXPORT jamoma_data_create(t_object *x, TTObject& returnedData, TTSymbol service);
124 
125 
126 /** Set the #TTData value attribute using the #TTData::Command method.
127  @param aData #TTData instance (the Modular class which handles parameter, message or return)
128  @param msg A symbol describing the Max type (_sym_bang, _sym_float, ...)
129  @param argc The number of arguments of the command
130  @param argv Pointer to the array of arguments.
131  @return #TTErr error message if the method does not execute as expected.
132  */
133 TTErr JAMOMA_EXPORT jamoma_data_command(TTObject& aData, t_symbol *msg, long argc, const t_atom *argv);
134 
135 
136 
137 // Methods to deal with #TTSender
138 ///////////////////////////////////////////////////////////////////////
139 
140 /** Create a #TTSender object.
141  @param x
142  @param returnedSender
143  @return #TTErr error message if the method does not execute as expected.
144  */
145 TTErr JAMOMA_EXPORT jamoma_sender_create(t_object *x, TTObject& returnedSender);
146 
147 
148 /** Create a #TTSender object for audio signal.
149  @param x
150  @param returnedSender
151  @return #TTErr error message if the method does not execute as expected.
152  */
153 TTErr JAMOMA_EXPORT jamoma_sender_create_audio(t_object *x, TTObject& returnedSender);
154 
155 
156 /** Send Max data using a #TTSender object.
157  @param aSender
158  @param msg
159  @param arc The number of arguments of the message.
160  @param argv Pointer to the array of arguments.
161  @return #TTErr error message if the method does not execute as expected.
162  */
163 TTErr JAMOMA_EXPORT jamoma_sender_send(TTObject& aSender, t_symbol *msg, long argc, const t_atom *argv);
164 
165 
166 
167 // Method to deal with #TTReceiver
168 ///////////////////////////////////////////////////////////////////////
169 
170 /** Create a #TTReceiver object.
171  @param x
172  @param returnedReceiver
173  @return #TTErr error message if the method does not execute as expected.
174  */
175 TTErr JAMOMA_EXPORT jamoma_receiver_create(t_object *x, TTObject& returnedReceiver);
176 
177 
178 /** Create a #TTReceiver object for audio signal.
179  @param x
180  @param returnedReceiver
181  @return #TTErr error message if the method does not execute as expected.
182  */
183 TTErr JAMOMA_EXPORT jamoma_receiver_create_audio(t_object *x, TTObject& returnedReceiver);
184 
185 
186 
187 // Method to deal with TTPresetManager and TTCueManager
188 ///////////////////////////////////////////////////////////////////////
189 
190 /** Create a #TTPresetManager object.
191  @param x
192  @param returnedPresetManager
193  @return #TTErr error message if the method does not execute as expected.
194  */
195 TTErr JAMOMA_EXPORT jamoma_presetManager_create(t_object *x, TTObject& returnedPresetManager);
196 
197 
198 /** Create a #TTCueManager object.
199  @param x
200  @param returnedCueManager
201  @return #TTErr error message if the method does not execute as expected.
202  */
203 TTErr JAMOMA_EXPORT jamoma_cueManager_create(t_object *x, TTObject& returnedCueManager);
204 
205 
206 
207 // Method to deal with TTInput
208 ///////////////////////////////////////////////////////////////////////
209 
210 /** Create a #TTInput object for signal.
211  @param x
212  @param returnedInput
213  @return #TTErr error message if the method does not execute as expected.
214  */
215 TTErr JAMOMA_EXPORT jamoma_input_create(t_object *x, TTObject& returnedInput);
216 
217 
218 /** Create a #TTInput object for audio signal.
219  @param x
220  @param returnedInput
221  @return #TTErr error message if the method does not execute as expected.
222  */
223 TTErr JAMOMA_EXPORT jamoma_input_create_audio(t_object *x, TTObject& returnedInput);
224 
225 
226 /** Send any signal to a TTInput object.
227  @param anInput
228  @param msg
229  @param argc The number of arguments of the message.
230  @param argv Pointer to the array of arguments.
231  @return #TTErr error message if the method does not execute as expected.
232  */
233 TTErr JAMOMA_EXPORT jamoma_input_send(TTObject& anInput, t_symbol *msg, long argc, const t_atom *argv);
234 
235 
236 
237 // Method to deal with TTOutput
238 ///////////////////////////////////////////////////////////////////////
239 
240 /** Create a TTOutput object for signal.
241  @param x
242  @param returnedOutput
243  @return #TTErr error message if the method does not execute as expected.
244  */
245 TTErr JAMOMA_EXPORT jamoma_output_create(t_object *x, TTObject& returnedOutput);
246 
247 
248 /** Create an output object for audio signal.
249  @param x
250  @param returnedOutput
251  @return #TTErr error message if the method does not execute as expected.
252  */
253 TTErr JAMOMA_EXPORT jamoma_output_create_audio(t_object *x, TTObject& returnedOutput);
254 
255 
256 /** Send any signal to a TTOutput object.
257  @param anOutput
258  @param msg
259  @param argc The number of arguments of the message.
260  @param argv Pointer to the array of arguments.
261  @return #TTErr error message if the method does not execute as expected.
262  */
263 TTErr JAMOMA_EXPORT jamoma_output_send(TTObject& anOutput, t_symbol *msg, long argc, const t_atom *argv);
264 
265 
266 // Method to deal with TTMapper
267 ///////////////////////////////////////////////////////////////////////
268 
269 /** Create a TTMapper object.
270  @param x
271  @param returnedMapper
272  @return #TTErr error message if the method does not execute as expected.
273  */
274 TTErr JAMOMA_EXPORT jamoma_mapper_create(t_object *x, TTObject& returnedMapper);
275 
276 
277 
278 // Method to deal with #TTViewer
279 ///////////////////////////////////////////////////////////////////////
280 
281 /** Create a #TTViewer object.
282  @param x
283  @param returnedViewer
284  @return #TTErr error message if the method does not execute as expected.
285  */
286 TTErr JAMOMA_EXPORT jamoma_viewer_create(t_object *x, TTObject& returnedViewer);
287 
288 
289 /** Send Max data using a #TTViewer object.
290  @param aViewer
291  @param msg
292  @param argc The number of arguments of the message.
293  @param argv Pointer to the array of arguments.
294  @return #TTErr error message if the method does not execute as expected.
295  */
296 TTErr JAMOMA_EXPORT jamoma_viewer_send(TTObject& aViewer, t_symbol *msg, long argc, const t_atom *argv);
297 
298 
299 
300 // Method to deal with #TTExplorer
301 ///////////////////////////////////////////////////////////////////////
302 
303 /** Create a #TTExplorer object.
304  @param x
305  @param returnedExplorer
306  @return #TTErr error message if the method does not execute as expected.
307  */
308 TTErr JAMOMA_EXPORT jamoma_explorer_create(t_object *x, TTObject& returnedExplorer);
309 
310 
311 /**
312  @return
313  */
315 
316 
317 
318 // Method to deal with TTRamp
319 ///////////////////////////////////////////////////////////////////////
320 
321 /** Create a #TTRamp object.
322  @param x
323  @param returnedRamp
324  @return #TTErr error message if the method does not execute as expected.
325  */
326 TTErr JAMOMA_EXPORT jamoma_ramp_create(t_object *x, TTObject& returnedRamp);
327 
328 
329 /**
330  @param o
331  @param n
332  @param v
333  */
334 void JAMOMA_EXPORT jamoma_callback_return_ramped_value(void *o, TTUInt32 n, TTFloat64 *v);
335 
336 
337 
338 // Method to return data
339 ///////////////////////////////////////////////////////////////////////
340 
341 /** Return an address to a j. external.
342  @param baton
343  @param v
344  */
345 void JAMOMA_EXPORT jamoma_callback_return_address(const TTValue& baton, const TTValue& v);
346 
347 
348 /** Return the value to a j.* external as msg, argc, argv.
349  @param baton The Max wrapper object
350  @param v The value(s) being passed back. This is passed back as an array of three argumens: msg, argc and argv
351  */
352 void JAMOMA_EXPORT jamoma_callback_return_value(const TTValue& baton, const TTValue& v);
353 
354 
355 /** Return the value to a j.* external as msg, argc, argv. The msg part carries information about what type of atom(s) we are getting,
356  @param baton The Max wrapper object
357  @param v The value(s) being passed back. This is passed back as an array of three argumens: msg, argc and argv
358  */
359 void JAMOMA_EXPORT jamoma_callback_return_value_typed(const TTValue& baton, const TTValue& v);
360 
361 
362 /** Return any signal.
363  @param baton
364  @param v
365  */
366 void JAMOMA_EXPORT jamoma_callback_return_signal(const TTValue& baton, const TTValue& v);
367 
368 
369 /** Return audio signal.
370  @param baton
371  @param v
372  */
373 void JAMOMA_EXPORT jamoma_callback_return_signal_audio(const TTValue& baton, const TTValue& v);
374 
375 
376 
377 // Patcher
378 ///////////////////////////////////////////////
379 
380 /** Convenient method to get the patcher easily.
381  @param obj
382  */
383 t_object JAMOMA_EXPORT *jamoma_patcher_get(t_object *obj);
384 
385 
386 /** Convenient method to get the patcher argument easily.
387  In poly case it also return the voice index (0 else)
388  @param patcher
389  @param argc The number of arguments of the message.
390  @param argv Pointer to the array of arguments.
391  */
392 void JAMOMA_EXPORT jamoma_patcher_get_args(t_object *patcher, long *argc, t_atom **argv);
393 
394 
395 /** Get the hierarchy of the patcher : bpatcher, subpatcher or toplevel.
396  @param patcher
397  @return
398  */
399 t_symbol JAMOMA_EXPORT *jamoma_patcher_get_hierarchy(t_object *patcher);
400 
401 
402 /** Get the context from the upper jcom model|view in the patcher or from patcher's name.
403  @param patcher
404  @param returnedContext
405  */
406 void JAMOMA_EXPORT jamoma_patcher_get_context(t_object **patcher, TTSymbol& returnedContext);
407 
408 
409 /** Get the class of the patcher from the file name (removing .model and .view convention name if they are in) */
410 void JAMOMA_EXPORT jamoma_patcher_get_class(t_object *patcher, TTSymbol context, TTSymbol& returnedClass);
411 
412 
413 /** Get the name of the patcher from his arguments.
414  @param patcher
415  @param context
416  @param returnedName
417  */
418 void JAMOMA_EXPORT jamoma_patcher_get_name(t_object *patcher, TTSymbol context, TTSymbol& returnedName);
419 
420 /** Get all context info from the root jcom model|view in the patcher.
421  @param patcher
422  @param returnedPatcher
423  @param returnedContext
424  @param returnedClass
425  @param returnedName
426  */
427 void JAMOMA_EXPORT jamoma_patcher_share_info(t_object *patcher, t_object **returnedPatcher, TTSymbol& returnedContext, TTSymbol& returnedClass, TTSymbol& returnedName);
428 
429 
430 /** Get patcher's node from the root jcom model|view in the patcher.
431  @param obj
432  @param patcherNode
433  */
434 void JAMOMA_EXPORT jamoma_patcher_share_node(t_object *obj, TTNodePtr *patcherNode);
435 
436 
437 /** Get all context info from an object (his patcher and the context, the class and the name of his patcher).
438  @param obj
439  @param returnedPatcher
440  @param returnedContext
441  @param modelClass
442  @param returnedName
443  @return #TTErr error message if the method does not execute as expected.
444  */
445 TTErr JAMOMA_EXPORT jamoma_patcher_get_info(t_object *obj, t_object **returnedPatcher, TTSymbol& returnedContext, TTSymbol& returnedClass, TTSymbol& returnedName);
446 
447 /** Get j.model or j.view of a patcher
448  @param patcher
449  @param returnedModelOrView
450  */
451 void JAMOMA_EXPORT jamoma_patcher_get_model_or_view(t_object *patcher, t_object **returnedModelOrView);
452 
453 /** Get the "aClass.model" external in the patcher.
454  @param patcher
455  @param modelClass
456  @param returnedModelPatcher
457  */
458 void JAMOMA_EXPORT jamoma_patcher_get_model_patcher(t_object *patcher, TTSymbol modelClass, t_object **returnedModelPatcher);
459 
460 /** Look into the given patcher to know if there are data or audio inputs and outputs
461  @param patcher
462  @param dataInput is there a data input in the patcher ?
463  @param dataOutput is there a data output in the patcher ?
464  @param audioInput is there an audio input in the patcher ?
465  @param audioOutput is there an audio output in the patcher ?
466  */
467 void JAMOMA_EXPORT jamoma_patcher_get_input_output(t_object *patcher, TTBoolean& dataInput, TTBoolean& dataOutput, TTBoolean& audioInput, TTBoolean& audioOutput);
468 
469 /** Look into the given patcher to know if there is a j.ui
470  @param patcher
471  @return true if there is a j.ui in the patcher
472  */
473 TTBoolean JAMOMA_EXPORT jamoma_patcher_get_ui(t_object *patcher);
474 
475 
476 // Tools
477 ///////////////////////////////////////////////
478 
479 /** Make a typed Atom array from a #TTValue. (NB: This method allocate memory for the Atom array. Make sure to free it afterwards!)
480  @param v
481  @param msg
482  @param argc The number of arguments of the message.
483  @param argv Pointer to the array of arguments.
484  @param shifted
485  */
486 void JAMOMA_EXPORT jamoma_ttvalue_to_typed_Atom(const TTValue& v, t_symbol **msg, long *argc, t_atom **argv, TTBoolean& shifted);
487 
488 
489 /** Make an Atom array from a #TTValue. (NB: This method allocate memory for the Atom array. Make sure to free it afterwards!)
490  @param v
491  @param argc The number of arguments of the message.
492  @param argv Pointer to the array of arguments.
493  */
494 void JAMOMA_EXPORT jamoma_ttvalue_to_Atom(const TTValue& v, long *argc, t_atom **argv);
495 
496 
497 /** Make a #TTValue from Atom array.
498  @param v
499  @param msg
500  @param argc The number of arguments of the message.
501  @param argv Pointer to the array of arguments.
502  */
503 void JAMOMA_EXPORT jamoma_ttvalue_from_Atom(TTValue& v, t_symbol *msg, long argc, const t_atom *argv);
504 
505 
506 /** Convert a TTSymbol "MyObjectMessage" into a t_symbol *"my/object/message"
507  or return NULL if the TTSymbol doesn't begin by an uppercase letter.
508  @param TTName
509  @return
510  */
511 t_symbol JAMOMA_EXPORT *jamoma_TTName_To_MaxName(TTSymbol TTName);
512 
513 
514 /** Load an external for internal use. Returns true if successful.
515  @param objectname
516  @param argc The number of arguments of the message.
517  @param argv Pointer to the array of arguments.
518  @param object
519  @return
520  */
521 TTBoolean JAMOMA_EXPORT jamoma_extern_load(t_symbol *objectname, long argc, const t_atom *argv, t_object** object);
522 
523 
524 /** Returned the N inside "pp/xx.[N]/yyy" and a format string as "pp/xx.%d/yy" and a format string as "pp/xx.%s/yy".
525  @param s
526  @param si_format
527  @param ss_format
528  @return
529  */
530 TTUInt32 JAMOMA_EXPORT jamoma_parse_bracket(t_symbol *s, TTString& si_format, TTString& ss_format);
531 
532 
533 /** Edit a new instance of the given format address using interger.
534  @param format
535  @param returnedName
536  @param i
537  */
538 void JAMOMA_EXPORT jamoma_edit_numeric_instance(TTString format, t_symbol** returnedName, long i);
539 
540 
541 /** Edit a new instance of the given format address using string.
542  @param format
543  @param returnedName
544  @param s
545  */
546 void JAMOMA_EXPORT jamoma_edit_string_instance(TTString format, t_symbol** returnedName, TTString s);
547 
548 
549 /** Edit a file name from a given file format and a class name.
550  @param format
551  @param className
552  @param returnedFileName
553  */
554 void JAMOMA_EXPORT jamoma_edit_filename(TTString format, TTSymbol className, t_symbol** returnedFileName);
555 
556 
557 /** Parse #N inside address and replace them by parent patcher arguments if there are.
558  @param x
559  @param address
560  @return
561  */
562 t_symbol JAMOMA_EXPORT *jamoma_parse_dieze(t_object *x, t_symbol *address);
563 
564 
565 
566 // Files
567 ///////////////////////////////////////////////
568 
569 /** Get BOOT style filepath from args or, if no args open a dialog to write a file.
570  @param x
571  @param argc The number of arguments of the message.
572  @param argv Pointer to the array of arguments.
573  @param default_filename
574  @return
575  */
576 TTSymbol JAMOMA_EXPORT jamoma_file_write(t_object *x, long argc, const t_atom *argv, char* default_filename);
577 
578 
579 /** Get BOOT style filepath from args or, if no args open a dialog to read a file.
580  @param x
581  @param argc The number of arguments of the message.
582  @param argv Pointer to the array of arguments.
583  @param filetype
584  @return
585  */
586 TTSymbol JAMOMA_EXPORT jamoma_file_read(t_object *x, long argc, const t_atom *argv, t_fourcc filetype);
587 
588 #endif // __JAMOMA_MODULAR_FOR_MAX_H__
589 
590 
591 
void JAMOMA_EXPORT jamoma_patcher_get_args(t_object *patcher, long *argc, t_atom **argv)
Convenient method to get the patcher argument easily.
TTErr JAMOMA_EXPORT jamoma_patcher_get_info(t_object *obj, t_object **returnedPatcher, TTSymbol &returnedContext, TTSymbol &returnedClass, TTSymbol &returnedName)
Get all context info from an object (his patcher and the context, the class and the name of his patch...
JAMOMA_EXPORT TTRegex * ttRegexForJmod
A global regex to parse jmod. (usefull to detect a 0.5 module)
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
Definition: TTBase.h:167
void JAMOMA_EXPORT jamoma_edit_filename(TTString format, TTSymbol className, t_symbol **returnedFileName)
Edit a file name from a given file format and a class name.
void JAMOMA_EXPORT jamoma_edit_numeric_instance(TTString format, t_symbol **returnedName, long i)
Edit a new instance of the given format address using interger.
TTErr JAMOMA_EXPORT jamoma_explorer_create(t_object *x, TTObject &returnedExplorer)
Create a TTExplorer object.
t_symbol JAMOMA_EXPORT * jamoma_parse_dieze(t_object *x, t_symbol *address)
Parse #N inside address and replace them by parent patcher arguments if there are.
We build a directory of TTNodes, and you can request a pointer for any TTNode, or add an observer to ...
Definition: TTNode.h:59
TTErr JAMOMA_EXPORT jamoma_output_send(TTObject &anOutput, t_symbol *msg, long argc, const t_atom *argv)
Send any signal to a TTOutput object.
TTErr JAMOMA_EXPORT jamoma_sender_create_audio(t_object *x, TTObject &returnedSender)
Create a TTSender object for audio signal.
TTErr JAMOMA_EXPORT jamoma_mapper_create(t_object *x, TTObject &returnedMapper)
Create a TTMapper object.
void JAMOMA_EXPORT jamoma_patcher_share_node(t_object *obj, TTNodePtr *patcherNode)
Get patcher's node from the root jcom model|view in the patcher.
TTErr JAMOMA_EXPORT jamoma_cueManager_create(t_object *x, TTObject &returnedCueManager)
Create a #TTCueManager object.
TTBoolean JAMOMA_EXPORT jamoma_extern_load(t_symbol *objectname, long argc, const t_atom *argv, t_object **object)
Load an external for internal use.
TTErr JAMOMA_EXPORT jamoma_receiver_create_audio(t_object *x, TTObject &returnedReceiver)
Create a TTReceiver object for audio signal.
The TTAddress class is used to represent a string and efficiently pass and compare that string...
Definition: TTAddress.h:29
Create and use Jamoma object instances.
Definition: TTObject.h:29
void JAMOMA_EXPORT jamoma_callback_return_signal(const TTValue &baton, const TTValue &v)
Return any signal.
JAMOMA_EXPORT TTRegex * ttRegexForJcom
A global regex to parse j.
TTHashPtr JAMOMA_EXPORT jamoma_explorer_default_filter_bank(void)
TTErr JAMOMA_EXPORT jamoma_node_info_create(t_object *x, TTObject &returnedNodeInfo)
Create a TTNodeInfo object.
TTErr JAMOMA_EXPORT jamoma_container_send(TTObject &aContainer, t_symbol *relativeAddressAndAttribute, long argc, const t_atom *argv)
Send Max data to a node (e.g., a j.parameter object) using a TTContainer object.
void JAMOMA_EXPORT jamoma_callback_return_value(const TTValue &baton, const TTValue &v)
Return the value to a j.
t_object JAMOMA_EXPORT * jamoma_patcher_get(t_object *obj)
Convenient method to get the patcher easily.
TTSymbol JAMOMA_EXPORT jamoma_file_read(t_object *x, long argc, const t_atom *argv, t_fourcc filetype)
Get BOOT style filepath from args or, if no args open a dialog to read a file.
TTErr JAMOMA_EXPORT jamoma_data_create(t_object *x, TTObject &returnedData, TTSymbol service)
Create a TTData object.
TTErr JAMOMA_EXPORT jamoma_receiver_create(t_object *x, TTObject &returnedReceiver)
Create a TTReceiver object.
Maintain a collection of TTValue objects indexed by TTSymbol pointers.
Definition: TTHash.h:36
double TTFloat64
64 bit floating point number
Definition: TTBase.h:188
JAMOMA_EXPORT TTRegex * ttRegexForModel
A global regex to parse .model.
void JAMOMA_EXPORT jamoma_patcher_get_input_output(t_object *patcher, TTBoolean &dataInput, TTBoolean &dataOutput, TTBoolean &audioInput, TTBoolean &audioOutput)
Look into the given patcher to know if there are data or audio inputs and outputs.
TTErr JAMOMA_EXPORT jamoma_output_create(t_object *x, TTObject &returnedOutput)
Create a TTOutput object for signal.
void * TTPtr
A generic pointer.
Definition: TTBase.h:248
void JAMOMA_EXPORT jamoma_ttvalue_to_Atom(const TTValue &v, long *argc, t_atom **argv)
Make an Atom array from a TTValue.
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
TTSymbol JAMOMA_EXPORT jamoma_file_write(t_object *x, long argc, const t_atom *argv, char *default_filename)
Get BOOT style filepath from args or, if no args open a dialog to write a file.
TTErr JAMOMA_EXPORT jamoma_ramp_create(t_object *x, TTObject &returnedRamp)
Create a TTRamp object.
TTErr JAMOMA_EXPORT jamoma_data_command(TTObject &aData, t_symbol *msg, long argc, const t_atom *argv)
Set the TTData value attribute using the #TTData::Command method.
t_symbol JAMOMA_EXPORT * jamoma_TTName_To_MaxName(TTSymbol TTName)
Convert a TTSymbol "MyObjectMessage" into a t_symbol *"my/object/message" or return NULL if the TTSym...
JAMOMA_EXPORT TTRegex * ttRegexForMaxpat
A global regex to parse .maxpat.
Various utilities for interfacing with Max that are not specific to JamomaModular as such...
void JAMOMA_EXPORT jamoma_ttvalue_to_typed_Atom(const TTValue &v, t_symbol **msg, long *argc, t_atom **argv, TTBoolean &shifted)
Make a typed Atom array from a TTValue.
JAMOMA_EXPORT TTRegex * ttRegexForModule
A global regex to parse .module.
TTErr JAMOMA_EXPORT jamoma_container_create(t_object *x, TTObject &returnedContainer)
Create a TTContainer object.
Handles any signal input.
void JAMOMA_EXPORT jamoma_callback_return_signal_audio(const TTValue &baton, const TTValue &v)
Return audio signal.
JAMOMA_EXPORT TTRegex * ttRegexForBracket
A global regex to parse [ and ].
void JAMOMA_EXPORT jamoma_ttvalue_from_Atom(TTValue &v, t_symbol *msg, long argc, const t_atom *argv)
Make a TTValue from Atom array.
JAMOMA_EXPORT TTRegex * ttRegexForMaxhelp
A global regex to parse .maxhelp.
void JAMOMA_EXPORT jamoma_callback_return_value_typed(const TTValue &baton, const TTValue &v)
Return the value to a j.
TTErr JAMOMA_EXPORT jamoma_presetManager_create(t_object *x, TTObject &returnedPresetManager)
Create a #TTPresetManager object.
void JAMOMA_EXPORT jamoma_patcher_share_info(t_object *patcher, t_object **returnedPatcher, TTSymbol &returnedContext, TTSymbol &returnedClass, TTSymbol &returnedName)
Get all context info from the root jcom model|view in the patcher.
void JAMOMA_EXPORT jamoma_subscriber_get_patcher_list(t_object *x, TTList &aContextListToFill)
Get the list above an external.
void JAMOMA_EXPORT jamoma_callback_return_address(const TTValue &baton, const TTValue &v)
Return an address to a j.
TTErr JAMOMA_EXPORT jamoma_sender_send(TTObject &aSender, t_symbol *msg, long argc, const t_atom *argv)
Send Max data using a TTSender object.
TTErr JAMOMA_EXPORT jamoma_viewer_create(t_object *x, TTObject &returnedViewer)
Create a #TTViewer object.
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
TTErr JAMOMA_EXPORT jamoma_output_create_audio(t_object *x, TTObject &returnedOutput)
Create an output object for audio signal.
TTErr JAMOMA_EXPORT jamoma_input_send(TTObject &anInput, t_symbol *msg, long argc, const t_atom *argv)
Send any signal to a TTInput object.
std::uint32_t TTUInt32
32 bit unsigned integer
Definition: TTBase.h:178
void JAMOMA_EXPORT jamoma_patcher_get_context(t_object **patcher, TTSymbol &returnedContext)
Get the context from the upper jcom model|view in the patcher or from patcher's name.
void JAMOMA_EXPORT jamoma_patcher_get_model_patcher(t_object *patcher, TTSymbol modelClass, t_object **returnedModelPatcher)
Get the "aClass.model" external in the patcher.
JAMOMA_EXPORT TTRegex * ttRegexForView
A global regex to parse .view.
t_symbol JAMOMA_EXPORT * jamoma_patcher_get_hierarchy(t_object *patcher)
Get the hierarchy of the patcher : bpatcher, subpatcher or toplevel.
void JAMOMA_EXPORT jamoma_patcher_get_name(t_object *patcher, TTSymbol context, TTSymbol &returnedName)
Get the name of the patcher from his arguments.
References an object using a name, an instance and any contextual environnement information.
Handles any signal output.
void JAMOMA_EXPORT jamoma_callback_return_ramped_value(void *o, TTUInt32 n, TTFloat64 *v)
A contextual subscriber to register TTObject as TTNode in a TTNodeDirectory.
TTErr JAMOMA_EXPORT jamoma_subscriber_create(t_object *x, TTObject &anObject, TTAddress relativeAddress, TTObject &returnedSubscriber, TTSymbol &returnedAddress, TTNodePtr *returnedNode, TTNodePtr *returnedContextNode)
Create a #TTSubscriber object and register a TTObject into the tree or, if aTTObject is NULL...
The TTString class is used to represent a string.
Definition: TTString.h:34
TTUInt32 JAMOMA_EXPORT jamoma_parse_bracket(t_symbol *s, TTString &si_format, TTString &ss_format)
Returned the N inside "pp/xx.[N]/yyy" and a format string as "pp/xx.%d/yy" and a format string as "pp...
TTErr JAMOMA_EXPORT jamoma_input_create_audio(t_object *x, TTObject &returnedInput)
Create a #TTInput object for audio signal.
void JAMOMA_EXPORT jamoma_patcher_get_class(t_object *patcher, TTSymbol context, TTSymbol &returnedClass)
Get the class of the patcher from the file name (removing .model and .view convention name if they ar...
TTErr JAMOMA_EXPORT jamoma_viewer_send(TTObject &aViewer, t_symbol *msg, long argc, const t_atom *argv)
Send Max data using a #TTViewer object.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34
void JAMOMA_EXPORT jamoma_edit_string_instance(TTString format, t_symbol **returnedName, TTString s)
Edit a new instance of the given format address using string.
TTErr JAMOMA_EXPORT jamoma_input_create(t_object *x, TTObject &returnedInput)
Create a #TTInput object for signal.
void JAMOMA_EXPORT jamoma_patcher_get_model_or_view(t_object *patcher, t_object **returnedModelOrView)
Get j.model or j.view of a patcher.
TTErr JAMOMA_EXPORT jamoma_sender_create(t_object *x, TTObject &returnedSender)
Create a TTSender object.
TTBoolean JAMOMA_EXPORT jamoma_patcher_get_ui(t_object *patcher)
Look into the given patcher to know if there is a j.ui.