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