20 typedef struct _loader{
26 void* loader_new(t_symbol *name,
long argc, t_atom *argv);
30 static t_class *loader_class;
36 #ifdef STUFF_INHERITED_FROM_PLUGTASTIC
38 static t_class* sPlugtasticClass;
39 static (t_object*) sPlugtasticObject;
40 static t_symbol* ps_plugtastic;
41 static long sPlugtasticSplash = 1;
44 typedef struct _plugtastic {
51 t_plugtastic* plugtastic_new()
53 t_plugtastic*
self = (t_plugtastic*)(object_alloc(sPlugtasticClass));
58 c = class_findbyname(_sym_box, _sym_forward);
60 p = (t_object*)newinstance(_sym_forward, 0, NULL);
62 c = class_findbyname(_sym_box, _sym_forward);
82 t_max_err plugtastic_getpref(
void *dummy,
void *attr,
long *argc, t_atom **argv)
86 atom_alloc_array(1, argc, argv, &alloc);
87 atom_setlong(*argv, sPlugtasticSplash);
91 t_max_err plugtastic_setpref(
void *dummy,
void *attr,
long argc, t_atom *argv)
93 sPlugtasticSplash = atom_getlong(argv);
100 void plugtastic_get_splash(t_plugtastic*
self)
105 if (self->forward != NULL) {
106 atom_setlong(&a, *self->openSplash);
107 object_method_typed(self->forward, _sym_int, 1, &a, NULL);
112 void plugtastic_set_splash(t_plugtastic*
self,
long state)
114 *
self->openSplash = state;
117 void plugtastic_classinit()
119 sPlugtasticClass = class_new((
char*)
"plugtastic", (method)plugtastic_new, (method)NULL,
sizeof(t_plugtastic), (method)NULL, 0);
124 class_register(_sym_nobox, sPlugtasticClass);
131 #endif // STUFF_INHERITED_FROM_PLUGTASTIC
138 int JAMOMA_EXPORT_MAXOBJ
main(
void)
143 common_symbols_init();
146 c = class_new(
"j.loader",(method)loader_new, (method)NULL,
sizeof(t_loader), (method)NULL, A_GIMME, 0);
149 #ifdef STUFF_INHERITED_FROM_PLUGTASTIC
150 plugtastic_classinit();
151 sPlugtasticObject = (t_object*)plugtastic_new();
152 ps_plugtastic = GENSYM(
"plugtastic");
153 ps_plugtastic->s_thing = sPlugtasticObject;
155 post(
"Plugtastic Version %s | jamoma.org", PLUGTASTIC_VERSION);
169 if (sPlugtasticSplash) {
170 char name[MAX_FILENAME_CHARS];
173 long typelist[2] = {
'JSON',
'TEXT'};
179 strncpy_zero(name,
"Plugtastic.maxpat", MAX_FILENAME_CHARS);
180 err = locatefile_extended(name, &path, &type, typelist, 2);
181 dictionary_read(name, path, &d);
184 p = (t_object*)object_new_typed(_sym_nobox, _sym_jpatcher, 1, a);
185 object_attr_setlong(p, _sym_locked, 1);
186 object_attr_setchar(p, _sym_enablehscroll, 0);
187 object_attr_setchar(p, _sym_enablevscroll, 0);
188 object_attr_setchar(p, _sym_toolbarvisible, 0);
189 object_attr_setsym(p, _sym_title, gensym(
"Welcome to Plugtastic"));
190 object_attr_setparse(p, _sym_rect,
"271 170 799 489");
191 object_attr_setparse(p, _sym_defrect,
"271 170 799 489");
193 object_method(p, _sym_vis);
194 object_method(p, _sym_loadbang);
197 object_method_parse(p, _sym_window,
"flags nozoom", NULL);
198 object_method_parse(p, _sym_window,
"flags nogrow", NULL);
199 object_method_parse(p, _sym_window,
"exec", NULL);
201 #endif // STUFF_INHERITED_FROM_PLUGTASTIC
205 class_register(CLASS_BOX, c);
214 void *loader_new(t_symbol *name,
long argc, t_atom *argv)
218 obj = (t_loader*)object_alloc(loader_class);
int JAMOMA_EXPORT_MAXOBJ main(void)
Set up this class as a Max external the first time an object of this kind is instantiated.