Commit e943e225 authored by Roman Haefeli's avatar Roman Haefeli
Browse files

add check if target canvas exists and do not draw if not

parent 0e73357b
......@@ -1709,24 +1709,24 @@ float hilite float ihilite;
#X connect 13 0 9 0;
#X connect 14 0 13 0;
#X restore 15 152 pd event.add;
#N canvas 594 963 356 230 event.remove 0;
#N canvas 326 511 356 230 event.remove 0;
#X obj 47 110 text delete \$0.sequence;
#X obj 14 11 r \$0.sequencer.event.remove;
#X obj 14 80 sel -1;
#X obj 14 143 list append;
#X obj 14 34 t a a;
#X obj 14 189 s error;
#X msg 14 166 sequencer: note (id=\$2) not found for deletion;
#X obj 14 57 text search \$0.sequence 2 3;
#X text 186 55 remove by velocity and id;
#X obj 14 189 s \$0.error;
#X connect 1 0 4 0;
#X connect 2 0 3 0;
#X connect 2 1 0 0;
#X connect 3 0 6 0;
#X connect 4 0 7 0;
#X connect 3 0 5 0;
#X connect 4 0 6 0;
#X connect 4 1 3 1;
#X connect 6 0 5 0;
#X connect 7 0 2 0;
#X connect 5 0 8 0;
#X connect 6 0 2 0;
#X restore 15 175 pd event.remove;
#X msg 17 230 -1;
#X obj 17 253 text delete \$0.sequence;
......@@ -1741,7 +1741,6 @@ float hilite float ihilite;
#X obj 212 247 b;
#X obj 24 158 t a a;
#X obj 212 272 list append;
#X obj 212 319 s error;
#X obj 69 282 f;
#X obj 69 252 t b a b, f 13;
#X obj 24 16 r \$0.seq.receive;
......@@ -1750,27 +1749,28 @@ float hilite float ihilite;
#X obj 24 186 text search \$0.sequence 3;
#X msg 212 296 sequence: note change velocity: note not found (id=\$1)
;
#X obj 212 319 s \$0.error;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 15 0;
#X connect 3 1 14 0;
#X connect 3 0 14 0;
#X connect 3 1 13 0;
#X connect 5 0 4 2;
#X connect 6 0 7 0;
#X connect 6 1 12 0;
#X connect 6 1 11 0;
#X connect 7 0 9 0;
#X connect 8 0 16 0;
#X connect 8 0 15 0;
#X connect 8 1 9 1;
#X connect 9 0 17 0;
#X connect 11 0 4 0;
#X connect 12 0 11 0;
#X connect 12 1 4 1;
#X connect 12 2 5 0;
#X connect 13 0 0 0;
#X connect 14 0 11 1;
#X connect 15 0 8 0;
#X connect 16 0 6 0;
#X connect 17 0 10 0;
#X connect 9 0 16 0;
#X connect 10 0 4 0;
#X connect 11 0 10 0;
#X connect 11 1 4 1;
#X connect 11 2 5 0;
#X connect 12 0 0 0;
#X connect 13 0 10 1;
#X connect 14 0 8 0;
#X connect 15 0 6 0;
#X connect 16 0 17 0;
#X restore 13 88 pd note.change.velocity;
#N canvas 0 297 334 470 play.notes.by.index 0;
#X obj 18 77 text search \$0.sequence 0;
......@@ -2073,7 +2073,7 @@ the note was being moved while playing.;
#X obj 19 508 outlet;
#X obj 19 445 inlet;
#X obj 476 244 s \$1;
#X obj 461 49 r \$0.redraw;
#X obj 461 19 r \$0.redraw;
#N canvas 294 116 433 523 redraw.notes 0;
#X obj 11 15 inlet;
#X msg 11 41 1000;
......@@ -2814,8 +2814,8 @@ the note was being moved while playing.;
#X connect 16 0 13 0;
#X restore 19 275 pd inspector;
#N canvas 0 99 393 172 errors 0;
#X obj 15 14 r error;
#X obj 15 37 print ERROR:;
#X obj 15 14 r \$0.error;
#X obj 15 37 print UNPUNCH_ERROR:;
#X connect 0 0 1 0;
#X restore 19 305 pd errors;
#X obj 339 374 t a a a;
......@@ -4155,7 +4155,7 @@ by clicking on two coordinates on the grid with Mod-key pressed.;
#X connect 40 1 42 1;
#X connect 42 0 39 1;
#X restore 19 18 pd note.create;
#N canvas 202 212 325 576 note.delete 0;
#N canvas 182 262 325 576 note.delete 0;
#X obj 6 8 r \$0.global.receive;
#X obj 6 31 route note;
#X obj 6 54 route delete;
......@@ -4178,7 +4178,6 @@ by clicking on two coordinates on the grid with Mod-key pressed.;
#X obj 6 152 route -1;
#X obj 6 175 b;
#X msg 6 229 note delete: no such note (\$1 \$2);
#X obj 6 256 s error;
#X obj 6 198 list append;
#X obj 51 303 t a a;
#X obj 78 377 route -1;
......@@ -4194,36 +4193,37 @@ by clicking on two coordinates on the grid with Mod-key pressed.;
#X msg 161 423 0;
#X obj 51 486 t a a;
#X obj 51 534 s \$0.marked;
#X obj 6 252 s \$0.error;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 2 0 18 0;
#X connect 4 0 24 0;
#X connect 2 0 17 0;
#X connect 4 0 23 0;
#X connect 5 0 6 0;
#X connect 6 0 13 0;
#X connect 6 0 12 0;
#X connect 7 0 8 0;
#X connect 7 1 12 0;
#X connect 8 0 11 0;
#X connect 9 0 10 0;
#X connect 11 0 9 0;
#X connect 12 0 4 0;
#X connect 12 1 5 0;
#X connect 13 1 15 0;
#X connect 15 0 22 0;
#X connect 15 1 23 0;
#X connect 15 2 16 0;
#X connect 15 3 17 0;
#X connect 15 4 14 4;
#X connect 16 0 14 2;
#X connect 17 0 14 3;
#X connect 18 0 19 0;
#X connect 18 1 11 1;
#X connect 19 0 7 0;
#X connect 20 0 19 1;
#X connect 21 0 5 0;
#X connect 22 0 14 0;
#X connect 23 0 14 1;
#X connect 24 0 25 0;
#X connect 24 1 3 0;
#X connect 7 1 11 0;
#X connect 8 0 10 0;
#X connect 9 0 25 0;
#X connect 10 0 9 0;
#X connect 11 0 4 0;
#X connect 11 1 5 0;
#X connect 12 1 14 0;
#X connect 14 0 21 0;
#X connect 14 1 22 0;
#X connect 14 2 15 0;
#X connect 14 3 16 0;
#X connect 14 4 13 4;
#X connect 15 0 13 2;
#X connect 16 0 13 3;
#X connect 17 0 18 0;
#X connect 17 1 10 1;
#X connect 18 0 7 0;
#X connect 19 0 18 1;
#X connect 20 0 5 0;
#X connect 21 0 13 0;
#X connect 22 0 13 1;
#X connect 23 0 24 0;
#X connect 23 1 3 0;
#X restore 19 41 pd note.delete;
#N canvas 0 473 333 520 note.change.duration 0;
#X obj 6 8 r \$0.global.receive;
......@@ -5230,22 +5230,22 @@ by clicking on two coordinates on the grid with Mod-key pressed.;
#X obj 32 123 f;
#X obj 32 13 inlet;
#X obj 32 190 outlet;
#X obj 94 176 s error;
#X msg 94 152 note create: note buffer full!;
#X obj 59 123 t b b;
#X msg 59 146 -1;
#X obj 32 36 b;
#X obj 94 176 s \$0.error;
#X connect 0 0 1 0;
#X connect 0 1 2 1;
#X connect 1 0 2 0;
#X connect 1 1 7 0;
#X connect 1 1 6 0;
#X connect 2 0 4 0;
#X connect 3 0 9 0;
#X connect 6 0 5 0;
#X connect 7 0 8 0;
#X connect 7 1 6 0;
#X connect 8 0 4 0;
#X connect 9 0 0 0;
#X connect 3 0 8 0;
#X connect 5 0 9 0;
#X connect 6 0 7 0;
#X connect 6 1 5 0;
#X connect 7 0 4 0;
#X connect 8 0 0 0;
#X restore 13 200 pd prepend.id;
#X obj 13 223 s \$0.create.id;
#X obj 13 45 route note;
......@@ -5657,6 +5657,62 @@ internally (standalone mode) or sent to right outlet only.;
#X msg 14 16 unpunch-help;
#X restore 8 46 pd abslist;
#X restore 653 30 pd NETPD 2 0;
#N canvas 0 99 418 378 check.if.target.exists 0;
#X obj 37 37 inlet;
#X obj 37 310 outlet;
#X obj 37 84 list append \$1;
#X obj 37 60 b;
#N canvas 0 99 484 335 count.canvases.with.name 0;
#X obj 48 144 s \$1;
#X obj 96 169 s \$1-test-canvas;
#X obj 96 199 r \$1-test-canvas-r;
#X msg 80 75 obj 20 20 r \$1-test-canvas \, obj 20 50 s \$1-test-canvas-r
\, connect 0 0 1 0;
#X msg 48 117 clear;
#X obj 96 222 f;
#X obj 96 245 + 1;
#X obj 96 268 t a a;
#X obj 33 51 t b b b a b;
#X msg 111 132 0;
#X obj 33 272 f;
#X obj 33 295 outlet;
#X obj 33 17 inlet;
#X connect 2 0 5 0;
#X connect 3 0 0 0;
#X connect 4 0 0 0;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 7 0 10 1;
#X connect 7 1 5 1;
#X connect 8 0 10 0;
#X connect 8 1 4 0;
#X connect 8 2 1 0;
#X connect 8 3 3 0;
#X connect 8 4 9 0;
#X connect 9 0 5 1;
#X connect 10 0 11 0;
#X connect 12 0 8 0;
#X restore 37 116 pd count.canvases.with.name;
#X obj 37 139 sel 1 0;
#X obj 56 286 s \$0.error;
#X obj 56 236 list append \$1;
#X msg 56 259 There is no canvas named \$1;
#X obj 76 163 b;
#X obj 76 188 list append \$1;
#X msg 76 211 There are more than 1 canvas named \$1;
#X connect 0 0 3 0;
#X connect 2 0 4 0;
#X connect 3 0 2 0;
#X connect 4 0 5 0;
#X connect 5 0 1 0;
#X connect 5 1 7 0;
#X connect 5 2 9 0;
#X connect 7 0 8 0;
#X connect 8 0 6 0;
#X connect 9 0 10 0;
#X connect 10 0 11 0;
#X connect 11 0 6 0;
#X restore 461 52 pd check.if.target.exists;
#X connect 0 0 21 0;
#X connect 1 0 2 0;
#X connect 2 0 43 0;
......@@ -5675,7 +5731,7 @@ internally (standalone mode) or sent to right outlet only.;
#X connect 16 0 19 0;
#X connect 18 0 33 0;
#X connect 20 0 16 0;
#X connect 22 0 37 0;
#X connect 22 0 53 0;
#X connect 33 0 14 0;
#X connect 33 1 34 0;
#X connect 33 2 42 0;
......@@ -5689,3 +5745,4 @@ internally (standalone mode) or sent to right outlet only.;
#X connect 46 0 47 0;
#X connect 49 0 17 0;
#X connect 50 0 33 0;
#X connect 53 0 37 0;
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