This repository has been archived by the owner on Oct 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
c.library.cpp
131 lines (117 loc) · 3.89 KB
/
c.library.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
// Copyright (c) 2012-2014 Eliott Paris, Julien Colafrancesco & Pierre Guillot, CICM, Universite Paris 8.
// For information on usage and redistribution, and for a DISCLAIMER OF ALL
// WARRANTIES, see the file, "LICENSE.txt," in this distribution.
*/
#include "c.library.hpp"
char creamversion[] = "Beta 0.4";
extern "C" void libpd_loadcream(void)
{
cream_setup();
}
static t_eclass *cream_class;
static void *cream_new(t_symbol *s)
{
t_eobj *x = (t_eobj *)eobj_new(cream_class);
if(x)
{
logpost(x, 3, "Cream Library by Pierre Guillot\n© 2013 - 2015 CICM | Paris 8 University\nVersion %s (%s) for Pure Data %i.%i\n", creamversion, __DATE__, PD_MAJOR_VERSION, PD_MINOR_VERSION);
}
return (x);
}
/*
static void epd_add_lib(const char* name)
{
char path[MAXPDSTRING];
t_namelist* var = sys_searchpath;
while (var)
{
sprintf(path, "%s/%s",var->nl_string, name);
if(strncmp(var->nl_string, name, strlen(name)) == 0)
{
//post(var->nl_string);
sys_vgui((char *)"set creammenu .menubar.help\n $creammenu insert 3 command -label [_ \"Cream\"] -command {pdsend {pd open cream-help.pd %s}}\n", var->nl_string);
return;
}
else if(access(path, O_RDONLY) != -1)
{
//post(path);
sys_vgui((char *)"set creammenu .menubar.help\n $creammenu insert 3 command -label [_ \"Cream\"] -command {pdsend {pd open cream-help.pd %s}}\n", path);
return;
}
var = var->nl_next;
}
var = sys_staticpath;
while (var)
{
sprintf(path, "%s/%s",var->nl_string, name);
if(strncmp(var->nl_string, name, strlen(name)) == 0)
{
//post(var->nl_string);
sys_vgui((char *)"set creammenu .menubar.help\n $creammenu insert 3 command -label [_ \"Cream\"] -command {pdsend {pd open cream-help.pd %s}}\n", var->nl_string);
return;
}
else if(access(path, O_RDONLY) != -1)
{
//post(path);
sys_vgui((char *)"set creammenu .menubar.help\n $creammenu insert 3 command -label [_ \"Cream\"] -command {pdsend {pd open cream-help.pd %s}}\n", path);
return;
}
var = var->nl_next;
}
}
*/
extern "C" void cream_setup(void)
{
cream_class = eclass_new("cream", (method)cream_new, (method)eobj_free, (short)sizeof(t_eobj), CLASS_PD, A_NULL, 0);
cream_class = eclass_new("Cream", (method)cream_new, (method)eobj_free, (short)sizeof(t_eobj), CLASS_PD, A_NULL, 0);
t_eobj* obj = (t_eobj *)cream_new(NULL);
if(!obj)
{
verbose(3, "Cream Library by Pierre Guillot\n© 2013 - 2015 CICM | Paris 8 University\nVersion %s (%s) for Pure Data %i.%i\n", creamversion, __DATE__, PD_MAJOR_VERSION, PD_MINOR_VERSION);
eobj_free(obj);
}
//epd_add_lib("cream");
setup_c0x2ebang();
setup_c0x2eblackboard();
setup_c0x2ebreakpoints();
setup_c0x2ecolorpanel();
setup_c0x2edsp_tilde();
setup_c0x2egain_tilde();
setup_c0x2eincdec();
setup_c0x2eknob();
setup_c0x2ematrix();
setup_c0x2emenu();
setup_c0x2emeter_tilde();
setup_c0x2enumber();
setup_c0x2enumber_tilde();
setup_c0x2eplane();
setup_c0x2epreset();
setup_c0x2eradio();
setup_c0x2erslider();
setup_c0x2escope_tilde();
setup_c0x2eslider();
setup_c0x2etab();
setup_c0x2etoggle();
#ifdef __APPLE__
setup_c0x2ekeyboard();
setup_c0x2ecamomile();
setup_c0x2ewavesel();
#endif
// Deprecated
setup_c0x2econvolve_tilde();
setup_c0x2efreeverb_tilde();
setup_c0x2epak();
setup_c0x2epatcherargs();
setup_c0x2epatcherinfos();
setup_c0x2epatchermess();
setup_c0x2eloadmess();
setup_c0x2eprepend();
epd_add_folder("Cream", "misc");
epd_add_folder("Cream", "helps");
}
typedef t_object *(*t_returnnewmethod)(t_symbol *s);
extern "C" void Cream_setup(void)
{
cream_setup();
}