24 TTPtr graphOutlets[16];
28 typedef MidiOut* MidiOutPtr;
32 MidiOutPtr MidiOutNew (t_symbol* msg,
long argc, t_atom* argv);
33 void MidiOutFree (MidiOutPtr
self);
34 void MidiOutAssist (MidiOutPtr
self,
void* b,
long msg,
long arg,
char* dst);
35 void MidiOutGetDeviceNames (MidiOutPtr
self);
36 t_max_err MidiOutSetDevice (MidiOutPtr
self,
void* attr,
long argc, t_atom* argv);
37 t_max_err MidiOutGetDevice (MidiOutPtr
self,
void* attr,
long* argc, t_atom** argv);
41 static t_class* sMidiOutClass;
52 common_symbols_init();
54 c = class_new(
"j.midi.out-", (method)MidiOutNew, (method)MidiOutFree,
sizeof(MidiOut), (method)0L, A_GIMME, 0);
56 class_addmethod(c, (method)MidiOutGetDeviceNames,
"getAvailableDeviceNames", 0);
57 class_addmethod(c, (method)MaxGraphReset,
"graph.reset", A_CANT, 0);
58 class_addmethod(c, (method)MaxGraphSetup,
"graph.setup", A_CANT, 0);
59 class_addmethod(c, (method)MaxGraphConnect,
"graph.connect", A_OBJ, A_LONG, 0);
60 class_addmethod(c, (method)MaxGraphDrop,
"graph.drop", A_CANT, 0);
61 class_addmethod(c, (method)MaxGraphObject,
"graph.object", A_CANT, 0);
62 class_addmethod(c, (method)MidiOutAssist,
"assist", A_CANT, 0);
63 class_addmethod(c, (method)object_obex_dumpout,
"dumpout", A_CANT, 0);
65 CLASS_ATTR_SYM(c,
"device", 0, MidiOut, obj);
66 CLASS_ATTR_ACCESSORS(c,
"device", MidiOutGetDevice, MidiOutSetDevice);
68 class_register(_sym_box, c);
77 MidiOutPtr MidiOutNew(t_symbol* msg,
long argc, t_atom* argv)
83 self = MidiOutPtr(object_alloc(sMidiOutClass));
85 object_obex_store((
void*)
self, _sym_dumpout, (t_object*)outlet_new(
self, NULL));
86 self->graphOutlets[0] = outlet_new(
self,
"graph.connect");
93 if (!self->graphObject->mKernel.valid()) {
94 object_error(SELF,
"cannot load Jamoma object");
98 attr_args_process(
self, argc, argv);
105 void MidiOutFree(MidiOutPtr
self)
115 void MidiOutAssist(MidiOutPtr
self,
void* b,
long msg,
long arg,
char* dst)
118 strcpy (dst,
"dictionary input and control messages");
121 strcpy(dst,
"dictionary output");
123 strcpy(dst,
"dumpout");
128 void MidiOutGetDeviceNames(MidiOutPtr
self)
136 err =
self->graphObject->mKernel.send(
TT(
"getAvailableDeviceNames"), none, v);
141 for (
long i=0; i<ac; i++) {
143 atom_setsym(ap+i, gensym((
char*)name.
c_str()));
145 object_obex_dumpout(
self, gensym(
"getAvailableDeviceNames"), ac, ap);
151 t_max_err MidiOutSetDevice(MidiOutPtr
self,
void* attr,
long argc, t_atom* argv)
154 t_symbol* s = atom_getsym(argv);
155 self->graphObject->mKernel.set(
TT(
"device"),
TT(s->s_name));
161 t_max_err MidiOutGetDevice(MidiOutPtr
self,
void* attr,
long* argc, t_atom** argv)
166 self->graphObject->mKernel.get(
TT(
"device"), v);
169 return MAX_ERR_GENERIC;
173 *argv = (t_atom *)sysmem_newptr(
sizeof(t_atom));
174 atom_setsym(*argv, gensym((
char*)s.
c_str()));
The TTGraphObjectBase wraps a TTDSP object such that it is possible to build a dynamic graph of audio...
TTErr TTObjectBaseRelease(TTObjectBasePtr *anObject)
DEPRECATED.
size_type size() const noexcept
Return the number of elements.
Base class for all first-class Jamoma objects.
#define TT
This macro is defined as a shortcut for doing a lookup in the symbol table.
void * TTPtr
A generic pointer.
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
TTErr TTObjectBaseInstantiate(const TTSymbol className, TTObjectBasePtr *returnedObjectPtr, const TTValue arguments)
DEPRECATED.
const char * c_str() const
Return a pointer to the internal string as a C-string.
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
int C74_EXPORT main(void)
Set up this class as a Max external the first time an object of this kind is instantiated.
void resize(size_type n)
Change the number of elements.
[doxygenAppendixC_copyExample]