19 void ui_return_preset_names(
TTPtr self, t_symbol *msg,
long argc, t_atom* argv)
21 t_ui* obj = (t_ui*)
self;
23 obj->preset_num = argc;
25 if (obj->preset_names)
26 sysmem_freeptr(obj->preset_names);
27 obj->preset_names = (t_atom*)sysmem_newptr(
sizeof(t_atom) * argc);
29 for (
int i=0; i<argc; i++) {
30 atom_setsym(&obj->preset_names[i], atom_getsym(&argv[i]));
34 void ui_preset_interface(t_ui *x)
36 char filename[MAX_FILENAME_CHARS];
39 t_fourcc filetype =
'JSON';
44 strncpy_zero(filename,
"j.preset_interface.maxpat", MAX_FILENAME_CHARS);
45 locatefile_extended(filename, &path, &type, &filetype, 1);
46 dictionary_read(filename, path, &d);
49 p = (t_object*)object_new_typed(_sym_nobox, _sym_jpatcher, 1, &a);
50 object_attr_setlong(p, _sym_locked, 1);
51 object_attr_setchar(p, _sym_enablehscroll, 0);
52 object_attr_setchar(p, _sym_enablevscroll, 0);
53 object_attr_setchar(p, _sym_openinpresentation, 1);
54 object_attr_setchar(p, _sym_toolbarvisible, 0);
55 object_attr_setsym(p, _sym_title, gensym(
"preset_interface"));
56 object_method_parse(p, _sym_window,
"constrain 5 320 179 595", NULL);
57 object_attach_byptr_register(x, p, _sym_nobox);
59 object_method(p, _sym_vis);
60 object_attr_setobj(jpatcher_get_firstview(p), _sym_owner, (t_object*)x);
62 OBJ_ATTR_SYM(p,
"arguments", 0, gensym((
char*)x->modelAddress.c_str()));
64 object_method(p, _sym_loadbang);
void * TTPtr
A generic pointer.
j.ui : Provide standard user interface component for modules