[PD-cvs] externals/unauthorized/cooled~ cooled~.tk2c,NONE,1.1 help-cooled~.pd,1.2,1.3 tk2c.bash,NONE,1.1 CHANGES.LOG,1.1,1.2 Makefile,1.1,1.2 cooled~.c,1.5,1.6

Yves Degoyon sevyves at users.sourceforge.net
Tue Mar 30 06:25:13 CEST 2004


Update of /cvsroot/pure-data/externals/unauthorized/cooled~
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2502

Modified Files:
	CHANGES.LOG Makefile cooled~.c 
Added Files:
	cooled~.tk2c help-cooled~.pd tk2c.bash 
Log Message:
cooled~ 0.12

--- NEW FILE: help-cooled~.pd ---
#N canvas 29 25 986 675 10;
#X msg 30 628 \; pd dsp 1;
#X msg 104 629 \; pd dsp 0;
#X obj 122 567 dac~;
#X obj 29 599 loadbang;
#X obj 115 531 *~ 1;
#X obj 156 530 *~ 1;
#X floatatom 204 531 5 0 0;
#X text 557 36 Cooled~ : a micro sound editor;
#X text 555 48 it supports selection and cut/paste modifications;
#X text 686 645 Comments and bugs @ ydegoyon at noos.fr;
#X obj 277 506 print recend;
#X obj 362 540 print playend;
#X msg 28 31 bang;
#X obj 27 53 openpanel;
#X msg 62 226 resize \$1;
#X obj 27 73 t s b;
#X obj 76 73 float \$0;
#X text 27 6 Step 1 : Load a sound file;
#X obj 27 96 route float;
#X text 95 25 ( a small one );
#X msg 208 218 record;
#X msg 315 10 bang;
#X text 355 9 Step 2 : Record the sound;
#X obj 63 163 pack s s s;
#X obj 19 117 makefilename %d-right-channel;
#X obj 23 140 makefilename %d-left-channel;
#X obj 180 611 table \$0-right-channel;
#X obj 181 636 table \$0-left-channel;
#X msg 62 184 read -resize \$1 \$2 \$3;
#X obj 289 41 tabplay~ \$0-right-channel;
#X obj 288 67 tabplay~ \$0-left-channel;
#X msg 18 298 refresh;
#X msg 23 467 play;
#X msg 22 445 bang;
#X text 11 494 Step 3 : Play it back;
#X obj 146 249 cooled~ 81839 400 200 1;
#X obj 397 157 hsl 128 15 0 100 0 0 empty empty empty 20 8 0 8 -262144
-1 -1 0 1;
#X obj 397 179 hsl 128 15 0 100 0 0 empty empty empty 20 8 0 8 -262144
-1 -1 12700 1;
#X text 400 131 Reading positions;
#X text 539 153 Start;
#X text 538 179 End;
#X msg 301 106 readspeed \$1;
#X floatatom 438 106 5 0 0;
#X obj 397 106 / 100;
#X msg 489 106 100;
#X text 521 105 Reading speed;
#X msg 18 328 zoom 2;
#X msg 19 357 zoom 1;
#X msg 361 179 100;
#X obj 297 179 loadbang;
#X obj 600 187 random 100;
#X msg 660 137 bang;
#X obj 681 186 random 100;
#X text 641 114 Random play;
#X obj 602 164 metro 1000;
#X text 601 507 Mouse modifications :;
#X text 601 522 <alt> <cli<k> : erase selection;
#X text 601 537 <shift> <cli<k> : replace by selection;
#X text 418 612 The red area is the selection;
#X text 419 596 point for paste and replace;
#X text 420 581 Note : the blue line is the insertion;
#X msg 361 155 0;
#X text 600 552 <shift> <alt> <cli<k> : add selection [ noize ];
#X text 706 429 (invoke with <right mouse>Properties );
#X text 709 419 You can set the following properties :;
#X text 733 460 * Width : graphical x size;
#X text 733 476 * Height : graphical y size;
#X msg 704 138 stop;
#X text 686 631 Part of unauthorized PD;
#X obj 683 163 metro 1000;
#X msg 23 391 stereo;
#X text 19 413 Map to stereo;
#X floatatom 448 481 8 0 0;
#X floatatom 521 481 8 0 0;
#X text 447 502 start;
#X text 510 503 end;
#X text 469 518 Selection;
#X msg 460 219 loop *2;
#X msg 401 218 loop /2;
#X msg 342 218 loop <1;
#X obj 62 206 soundfiler;
#X msg 282 218 loop >1;
#X text 520 220 loop operators ( accept any float value );
#X connect 3 0 0 0;
#X connect 4 0 2 0;
#X connect 5 0 2 1;
#X connect 6 0 4 1;
#X connect 6 0 5 1;
#X connect 12 0 13 0;
#X connect 13 0 15 0;
#X connect 14 0 35 0;
#X connect 15 0 23 0;
#X connect 15 1 16 0;
#X connect 16 0 18 0;
#X connect 18 0 24 0;
#X connect 18 0 25 0;
#X connect 20 0 35 0;
#X connect 21 0 20 0;
#X connect 21 0 29 0;
#X connect 21 0 30 0;
#X connect 23 0 28 0;
#X connect 24 0 23 1;
#X connect 25 0 23 2;
#X connect 28 0 80 0;
#X connect 29 0 35 0;
#X connect 30 0 35 1;
#X connect 31 0 35 0;
#X connect 32 0 35 0;
#X connect 33 0 32 0;
#X connect 35 0 4 0;
#X connect 35 1 5 0;
#X connect 35 2 10 0;
#X connect 35 3 11 0;
#X connect 35 3 32 0;
#X connect 35 4 72 0;
#X connect 35 5 73 0;
#X connect 36 0 35 2;
#X connect 37 0 35 3;
#X connect 41 0 35 0;
#X connect 42 0 43 0;
#X connect 43 0 41 0;
#X connect 44 0 42 0;
#X connect 46 0 35 0;
#X connect 47 0 35 0;
#X connect 48 0 37 0;
#X connect 49 0 48 0;
#X connect 50 0 35 2;
#X connect 51 0 54 0;
#X connect 51 0 69 0;
#X connect 52 0 35 3;
#X connect 54 0 50 0;
#X connect 61 0 36 0;
#X connect 67 0 54 0;
#X connect 67 0 69 0;
#X connect 69 0 52 0;
#X connect 70 0 35 0;
#X connect 77 0 35 0;
#X connect 78 0 35 0;
#X connect 79 0 35 0;
#X connect 80 0 14 0;
#X connect 81 0 35 0;

--- NEW FILE: cooled~.tk2c ---
// ########### cooled procedures -- ydegoyon at free.fr #########
sys_gui("proc cooled_apply {id} {\n");
// strip "." from the TK id to make a variable name suffix
sys_gui("set vid [string trimleft $id .]\n");
// for each variable, make a local variable to hold its name...
sys_gui("set var_graph_width [concat graph_width_$vid]\n");
sys_gui("global $var_graph_width\n");
sys_gui("set var_graph_height [concat graph_height_$vid]\n");
sys_gui("global $var_graph_height\n");
sys_gui("set var_graph_draw [concat graph_draw_$vid]\n");
sys_gui("global $var_graph_draw\n");
sys_gui("set cmd [concat $id dialog [eval concat $$var_graph_width] [eval concat $$var_graph_height] [eval concat $$var_graph_draw] \\;]\n");
// puts stderr $cmd
sys_gui("pd $cmd\n");
sys_gui("}\n");
sys_gui("proc cooled_cancel {id} {\n");
sys_gui("set cmd [concat $id cancel \\;]\n");
// puts stderr $cmd
sys_gui("pd $cmd\n");
sys_gui("}\n");
sys_gui("proc cooled_ok {id} {\n");
sys_gui("cooled_apply $id\n");
sys_gui("cooled_cancel $id\n");
sys_gui("}\n");
sys_gui("proc pdtk_cooled_dialog {id width height draw} {\n");
sys_gui("set vid [string trimleft $id .]\n");
sys_gui("set var_graph_width [concat graph_width_$vid]\n");
sys_gui("global $var_graph_width\n");
sys_gui("set var_graph_height [concat graph_height_$vid]\n");
sys_gui("global $var_graph_height\n");
sys_gui("set var_graph_draw [concat graph_draw_$vid]\n");
sys_gui("global $var_graph_draw\n");
sys_gui("set $var_graph_width $width\n");
sys_gui("set $var_graph_height $height\n");
sys_gui("set $var_graph_draw $draw\n");
sys_gui("toplevel $id\n");
sys_gui("wm title $id {cooled}\n");
sys_gui("wm protocol $id WM_DELETE_WINDOW [concat cooled_cancel $id]\n");
sys_gui("label $id.label -text {EDITOR PROPERTIES}\n");
sys_gui("pack $id.label -side top\n");
sys_gui("frame $id.buttonframe\n");
sys_gui("pack $id.buttonframe -side bottom -fill x -pady 2m\n");
sys_gui("button $id.buttonframe.cancel -text {Cancel} -command \"cooled_cancel $id\"\n");
sys_gui("button $id.buttonframe.apply -text {Apply} -command \"cooled_apply $id\"\n");
sys_gui("button $id.buttonframe.ok -text {OK} -command \"cooled_ok $id\"\n");
sys_gui("pack $id.buttonframe.cancel -side left -expand 1\n");
sys_gui("pack $id.buttonframe.apply -side left -expand 1\n");
sys_gui("pack $id.buttonframe.ok -side left -expand 1\n");
sys_gui("frame $id.1rangef\n");
sys_gui("pack $id.1rangef -side top\n");
sys_gui("label $id.1rangef.lwidth -text \"Width :\"\n");
sys_gui("entry $id.1rangef.width -textvariable $var_graph_width -width 7\n");
sys_gui("pack $id.1rangef.lwidth $id.1rangef.width -side left\n");
sys_gui("frame $id.2rangef\n");
sys_gui("pack $id.2rangef -side top\n");
sys_gui("label $id.2rangef.lheight -text \"Height :\"\n");
sys_gui("entry $id.2rangef.height -textvariable $var_graph_height -width 7\n");
sys_gui("pack $id.2rangef.lheight $id.2rangef.height -side left\n");
sys_gui("checkbutton $id.draw -text {Draw Sample} -variable $var_graph_draw -anchor w\n");
sys_gui("pack $id.draw -side top\n");
sys_gui("bind $id.1rangef.width <KeyPress-Return> [concat cooled_ok $id]\n");
sys_gui("bind $id.2rangef.height <KeyPress-Return> [concat cooled_ok $id]\n");
sys_gui("focus $id.1rangef.width\n");
sys_gui("}\n");
// ########### cooled procedures END -- ydegoyon at free.fr #########

Index: CHANGES.LOG
===================================================================
RCS file: /cvsroot/pure-data/externals/unauthorized/cooled~/CHANGES.LOG,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CHANGES.LOG	16 Aug 2003 08:08:13 -0000	1.1
--- CHANGES.LOG	30 Mar 2004 04:25:10 -0000	1.2
***************
*** 1,2 ****
--- 1,4 ----
+ 0.12
+   adapted for pd 0.37
  0.11
    prevent crashes during reallocation

Index: Makefile
===================================================================
RCS file: /cvsroot/pure-data/externals/unauthorized/cooled~/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Makefile	16 Aug 2003 08:08:40 -0000	1.1
--- Makefile	30 Mar 2004 04:25:10 -0000	1.2
***************
*** 68,72 ****
  
  .c.pd_linux:
! 	../tk2c.bash < $*.tk > $*.tk2c
  	cc $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
  	ld -export_dynamic  -shared -o $*.pd_linux $*.o -lpthread -lc -lm
--- 68,72 ----
  
  .c.pd_linux:
! 	./tk2c.bash < $*.tk > $*.tk2c
  	cc $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
  	ld -export_dynamic  -shared -o $*.pd_linux $*.o -lpthread -lc -lm

Index: cooled~.c
===================================================================
RCS file: /cvsroot/pure-data/externals/unauthorized/cooled~/cooled~.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** cooled~.c	25 Sep 2003 20:58:53 -0000	1.5
--- cooled~.c	30 Mar 2004 04:25:10 -0000	1.6
***************
*** 37,43 ****
  #include <fcntl.h>
  #include <sys/stat.h>
- #ifndef MACOSX
  #include <malloc.h>
- #endif
  #include <ctype.h>
  #include <pthread.h>
--- 37,41 ----
***************
*** 49,54 ****
  #endif
  #include <math.h>
- #include <m_pd.h>
  
  #include "m_imp.h"
  #include "g_canvas.h"
--- 47,52 ----
  #endif
  #include <math.h>
  
+ #include "m_pd.h"
  #include "m_imp.h"
  #include "g_canvas.h"
***************
*** 109,113 ****
  #define COOLED_DEFAULT_HEIGHT 200
  
! static char   *cooled_version = "cooled~: version 0.11, written by Yves Degoyon (ydegoyon at free.fr)";
  
  static t_class *cooled_class;
--- 107,111 ----
  #define COOLED_DEFAULT_HEIGHT 200
  
! static char   *cooled_version = "cooled~: version 0.12, written by Yves Degoyon (ydegoyon at free.fr)";
  
  static t_class *cooled_class;
***************
*** 1356,1359 ****
--- 1354,1358 ----
      cooled_class = class_new(gensym("cooled~"), (t_newmethod)cooled_new, (t_method)cooled_free,
                      sizeof(t_cooled), 0, A_GIMME, 0);
+     class_sethelpsymbol( cooled_class, gensym("cooled~.pd") );
  
      // set callbacks
***************
*** 1365,1381 ****
      cooled_widgetbehavior.w_visfn =        cooled_vis;
      cooled_widgetbehavior.w_clickfn =      cooled_click;
- 	 /* 
- 	  * <hans at eds.org>: As of 0.37, pd does not have these last 
- 	  * two elements in t_widgetbehavoir anymore.
- 	  * see pd/src/notes.txt:
- 	  *           savefunction and dialog into class structure
- 	  */
- #if PD_MINOR_VERSION < 37  || !defined(PD_MINOR_VERSION)
      cooled_widgetbehavior.w_propertiesfn = cooled_properties;
      cooled_widgetbehavior.w_savefn =       cooled_save;
- #else
- 	 class_setsavefn(cooled_class, &cooled_save);
- 	 class_setpropertiesfn(cooled_class, &cooled_properties);
- #endif
  
      CLASS_MAINSIGNALIN( cooled_class, t_cooled, x_f );
--- 1364,1369 ----

--- NEW FILE: tk2c.bash ---
#!/bin/bash

#set -x

while read line
do
  for word in $line
  do
    if [ "X"$word != "X"${word#\#} ]
    then
       echo // ${line#\#}
       break
    else
       line=${line//\'/\\\'}
#useless, slashes never gets in
       line=${line//\\/\\\\}
#this one's dirty, i know
       line=${line//;/\\\\;}
       line=${line//\"/\\\"}
       echo 'sys_gui("'$line'\n");'
       break
    fi
  done
done





More information about the Pd-cvs mailing list