Commit 51cf6e81 authored by Ivica Bukvic's avatar Ivica Bukvic Committed by Hans-Christoph Steiner
Browse files

Pd-0.42.5-extended-l2ork-dev-20110109.tar.bz2

parent 7567cb69
......@@ -677,6 +677,7 @@ void canvas_drawredrect(t_canvas *x, int doit)
called from the GUI after the fact to "notify" us that we're mapped. */
void canvas_map(t_canvas *x, t_floatarg f)
{
//fprintf(stderr,"canvas_map\n");
int flag = (f != 0);
t_gobj *y;
if (flag)
......@@ -689,6 +690,28 @@ void canvas_map(t_canvas *x, t_floatarg f)
bug("canvas_map");
canvas_vis(x, 1);
}
/* if parent has editor enabled and we're a sub-patch,
(but not an abstraction) match its edit mode to that
of its parent patch. */
/*t_glist *parentx;
if (!canvas_isabstraction(x)) {
if (x->gl_owner) {
parentx = x->gl_owner;
while (parentx->gl_owner)
parentx = parentx->gl_owner;
if (parentx->gl_edit)
canvas_editmode(x, 1);
else if (x->gl_edit)
canvas_editmode(x, 0);
}
}*/
/* for parent windows, let's make sure the cursor is updated
as soon as the window is open (if in edit mode) */
//else if (x->gl_edit) {
//canvas_setcursor(x, CURSOR_EDITMODE_NOTHING);
//}
for (y = x->gl_list; y; y = y->g_next)
gobj_vis(y, x, 1);
for (sel = x->gl_editor->e_selection; sel; sel = sel->sel_next)
......@@ -1231,11 +1254,11 @@ static void canvas_dodsp(t_canvas *x, int toplevel, t_signal **sp)
/* find all the "dsp" boxes and add them to the graph */
// jsarlo
ob = &x->gl_magic_glass->x_obj;
if (ob)
ugen_add(dc, ob); // this t_canvas could be an array, hence no gl_magic_glass
// end jsarlo
if (ob && x->gl_magic_glass->x_connectedObj != NULL) {
fprintf(stderr,"adding cord inspector to dsp\n");
ugen_add(dc, ob); // this t_canvas could be an array, hence no gl_magic_glass
}
for (y = x->gl_list; y; y = y->g_next)
if ((ob = pd_checkobject(&y->g_pd)) && zgetfn(&y->g_pd, dspsym))
......
......@@ -1314,6 +1314,7 @@ void canvas_vis(t_canvas *x, t_floatarg f)
x->gl_edit);
canvas_reflecttitle(x);
x->gl_havewindow = 1;
/*
//newly opened arrays created prior to pd-l2ork require fittograph
t_gobj *g, *gg = NULL;
......@@ -2584,7 +2585,7 @@ void canvas_key(t_canvas *x, t_symbol *s, int ac, t_atom *av)
if (x && keynum == 0 && x->gl_edit &&
!strncmp(gotkeysym->s_name, "Control", 7))
canvas_setcursor(x, down ?
CURSOR_RUNMODE_NOTHING :CURSOR_EDITMODE_NOTHING);
CURSOR_RUNMODE_NOTHING : CURSOR_EDITMODE_NOTHING);
}
void canvas_motion(t_canvas *x, t_floatarg xpos, t_floatarg ypos,
......@@ -3543,9 +3544,13 @@ void glob_key(void *dummy, t_symbol *s, int ac, t_atom *av)
void canvas_editmode(t_canvas *x, t_floatarg fyesplease)
{
//fprintf(stderr,"canvas_editmode %f\n", fyesplease);
int yesplease = fyesplease;
if (yesplease && x->gl_edit)
if (yesplease && x->gl_edit) {
//if (x->gl_edit && glist_isvisible(x) && glist_istoplevel(x))
// canvas_setcursor(x, CURSOR_EDITMODE_NOTHING);
return;
}
x->gl_edit = !x->gl_edit;
if (x->gl_edit && glist_isvisible(x) && glist_istoplevel(x))
canvas_setcursor(x, CURSOR_EDITMODE_NOTHING);
......
......@@ -39,6 +39,7 @@ void magicGlass_clearText(t_magicGlass *x);
void magicGlass_bind(t_magicGlass *x, t_object *obj, int outno)
{
//fprintf(stderr,"magicglass_bind\n");
if (x->x_connectedObj != obj)
{
if (x->x_connectedObj != NULL)
......@@ -58,6 +59,7 @@ void magicGlass_bind(t_magicGlass *x, t_object *obj, int outno)
void magicGlass_unbind(t_magicGlass *x)
{
//fprintf(stderr,"magicglass_unbind\n");
if (x->x_connectedObj != NULL)
{
obj_disconnect(x->x_connectedObj,
......@@ -75,6 +77,7 @@ void magicGlass_unbind(t_magicGlass *x)
void magicGlass_updateText(t_magicGlass *x, int moved)
{
//fprintf(stderr,"magicglass_updateText\n");
int bgSize;
/* change second argument (10.0) to provide optimal scaling in the following entry */
float font = (float)(sys_hostfontsize(glist_getfont((t_glist *)(x->x_c))))/10.0;
......@@ -134,6 +137,7 @@ void magicGlass_updateText(t_magicGlass *x, int moved)
void magicGlass_drawNew(t_magicGlass *x)
{
//fprintf(stderr,"magicglass_drawNew\n");
sys_vgui(".x%x.c create rectangle 0 0 0 0 -outline #ffffff -fill #000000 -tags magicGlassBg\n",
x->x_c);
sys_vgui(".x%x.c create polygon 0 0 0 0 0 0 -fill #000000 -width 4 -tags magicGlassLine\n",
......@@ -150,6 +154,7 @@ void magicGlass_drawNew(t_magicGlass *x)
void magicGlass_undraw(t_magicGlass *x)
{
//fprintf(stderr,"magicglass_undraw\n");
sys_vgui(".x%x.c delete magicGlassBg\n", x->x_c);
sys_vgui(".x%x.c delete magicGlassLine\n", x->x_c);
sys_vgui(".x%x.c delete magicGlassText\n", x->x_c);
......@@ -157,12 +162,14 @@ void magicGlass_undraw(t_magicGlass *x)
void magicGlass_flashText(t_magicGlass *x)
{
//fprintf(stderr,"magicglass_flashText\n");
sys_vgui(".x%x.c itemconfigure magicGlassText -fill #ffffff\n",
x->x_c);
}
void magicGlass_clearText(t_magicGlass *x)
{
//fprintf(stderr,"magicglass_clearText\n");
strcpy(x->x_old_string, x->x_string);
x->x_string[0] = 0;
magicGlass_updateText(x, 0);
......@@ -262,6 +269,7 @@ void magicGlass_setCanvas(t_magicGlass *x, int c)
void magicGlass_show(t_magicGlass *x)
{
//fprintf(stderr,"magicglass_show\n");
if (!x->x_visible) {
x->x_sampleCount = 0;
x->x_maxSample = -999999;
......@@ -273,16 +281,19 @@ void magicGlass_show(t_magicGlass *x)
void magicGlass_hide(t_magicGlass *x)
{
if (x->x_visible)
//fprintf(stderr,"magicglass_hide\n");
if (x->x_visible) {
magicGlass_undraw(x);
x->x_sampleCount = 0;
x->x_maxSample = -999999;
x->x_string[0] = 0;
x->x_visible = 0;
x->x_sampleCount = 0;
x->x_maxSample = -999999;
x->x_string[0] = 0;
x->x_visible = 0;
}
}
void magicGlass_moveText(t_magicGlass *x, int pX, int pY)
{
//fprintf(stderr,"magicglass_moveText\n");
int bgSize;
x->x_x = pX;
......@@ -292,6 +303,7 @@ void magicGlass_moveText(t_magicGlass *x, int pX, int pY)
int magicGlass_bound(t_magicGlass *x)
{
//fprintf(stderr,"magicglass_bound\n");
if (x->x_connectedObj)
return 1;
else
......@@ -300,6 +312,7 @@ int magicGlass_bound(t_magicGlass *x)
int magicGlass_isOn(t_magicGlass *x)
{
//fprintf(stderr,"magicglass_isOn\n");
if (x->x_viewOn)
return 1;
else
......@@ -308,6 +321,7 @@ int magicGlass_isOn(t_magicGlass *x)
void magicGlass_setOn(t_magicGlass *x, int i)
{
//fprintf(stderr,"magicglass_setOn\n");
if (i)
{
x->x_viewOn = 1;
......@@ -320,6 +334,7 @@ void magicGlass_setOn(t_magicGlass *x, int i)
void magicGlass_setDsp(t_magicGlass *x, int i)
{
//fprintf(stderr,"magicglass_setDsp\n");
if (i != x->x_dspOn) {
if (i)
{
......@@ -337,11 +352,12 @@ void magicGlass_setDsp(t_magicGlass *x, int i)
t_int *magicGlass_perform(t_int *w)
{
t_magicGlass *x = (t_magicGlass *)(w[1]);
float *in = (float *)(w[2]);
int N = (int)(w[3]);
int i;
if (x->x_dspOn)
if (x->x_dspOn && x->x_connectedObj != NULL)
{
fprintf(stderr,"magicglass_perform\n");
float *in = (float *)(w[2]);
int N = (int)(w[3]);
int i;
for (i = 0; i < N; i++)
{
if (in[i] > x->x_maxSample)
......@@ -361,12 +377,14 @@ t_int *magicGlass_perform(t_int *w)
void magicGlass_dsp(t_magicGlass *x, t_signal **sp)
{
//fprintf(stderr,"magicglass_dsp\n");
dsp_add(magicGlass_perform, 3, x, sp[0]->s_vec, sp[0]->s_n);
x->x_issignal = 1;
}
void *magicGlass_new(int c)
{
//fprintf(stderr,"magicglass_new\n");
t_magicGlass *x = (t_magicGlass *)pd_new(magicGlass_class);
x->x_connectedObj= NULL;
x->x_connectedOutno = 0;
......@@ -387,6 +405,7 @@ void *magicGlass_new(int c)
void magicGlass_free(t_magicGlass *x)
{
//fprintf(stderr,"magicglass_free\n");
x->x_dspOn = 0;
clock_free(x->x_clearClock);
}
......
......@@ -11,7 +11,7 @@ extern "C" {
#define PD_MAJOR_VERSION 0
#define PD_MINOR_VERSION 42
#define PD_BUGFIX_VERSION 5
#define PD_TEST_VERSION "extended-l2ork-20110108"
#define PD_TEST_VERSION "extended-l2ork-20110109"
/* old name for "MSW" flag -- we have to take it for the sake of many old
"nmakefiles" for externs, which will define NT and not MSW */
......
......@@ -2067,7 +2067,13 @@ proc pdtk_canvas_new {name width height geometry editable} {
-command [concat menu_editmode $name] \
-accelerator [accel_munge "Ctrl+e"]
$name.m.edit entryconfigure "Edit mode" -background "#7dd37d"
if { $editable == 1 } {
$name.m.edit entryconfigure "Edit mode" -background "#7dd37d"
#if { $ctrl_l_down == 0 $ctrl_r_down == 0 } {
# $name configure -cursor $cursor_editmode_nothing
#pd [concat $name editmode 1 \;]
#}
}
#if { $editable == 0 } {
# $name.m.edit entryconfigure "Edit mode" -indicatoron false
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment