Update of /cvsroot/pure-data/externals/unauthorized/cooled~ In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4721
Modified Files: CHANGES.LOG cooled~.c Log Message: Added GOP supoort
Index: CHANGES.LOG =================================================================== RCS file: /cvsroot/pure-data/externals/unauthorized/cooled~/CHANGES.LOG,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CHANGES.LOG 30 Mar 2004 04:25:10 -0000 1.2 --- CHANGES.LOG 2 Mar 2005 02:44:30 -0000 1.3 *************** *** 1,2 **** --- 1,4 ---- + 0.13 + added GOP support 0.12 adapted for pd 0.37
Index: cooled~.c =================================================================== RCS file: /cvsroot/pure-data/externals/unauthorized/cooled~/cooled~.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** cooled~.c 14 Aug 2004 02:30:50 -0000 1.8 --- cooled~.c 2 Mar 2005 02:44:30 -0000 1.9 *************** *** 37,47 **** #include <fcntl.h> #include <sys/stat.h> - - #ifdef __APPLE__ - #include <sys/malloc.h> - #else #include <malloc.h> - #endif - #include <ctype.h> #include <pthread.h> --- 37,41 ---- *************** *** 50,58 **** #endif #ifdef NT ! #include <windows.h> ! int usleep (unsigned int us) { ! Sleep((long)(us/1000.)); ! return 0; ! } #endif #include <math.h> --- 44,48 ---- #endif #ifdef NT ! #define M_PI 3.14159265358979323846 #endif #include <math.h> *************** *** 117,121 **** #define COOLED_DEFAULT_HEIGHT 200
! static char *cooled_version = "cooled~: version 0.12, written by Yves Degoyon (ydegoyon@free.fr)";
static t_class *cooled_class; --- 107,111 ---- #define COOLED_DEFAULT_HEIGHT 200
! static char *cooled_version = "cooled~: version 0.13, written by Yves Degoyon (ydegoyon@free.fr)";
static t_class *cooled_class; *************** *** 253,260 **** static void cooled_erase_block(t_cooled *x, t_glist *glist, t_int sample ) { ! t_canvas *canvas=glist_getcanvas(glist); ! t_int hi; ! t_float fspectrum=0.0; ! char fillColor[ 16 ];
for ( hi=0; hi<x->x_height; hi++) --- 243,250 ---- static void cooled_erase_block(t_cooled *x, t_glist *glist, t_int sample ) { ! t_canvas *canvas=glist_getcanvas(glist); ! t_int hi; ! t_float fspectrum=0.0; ! char fillColor[ 16 ];
for ( hi=0; hi<x->x_height; hi++) *************** *** 276,283 **** static void *cooled_do_update_part(void *tdata) { ! t_cooled *x = (t_cooled*) tdata; ! t_int si; ! t_int nbpoints = 0; ! t_float percentage = 0, opercentage = 0;
// loose synchro --- 266,274 ---- static void *cooled_do_update_part(void *tdata) { ! t_cooled *x = (t_cooled*) tdata; ! t_canvas *canvas=glist_getcanvas(x->x_glist); ! t_int si; ! t_int nbpoints = 0; ! t_float percentage = 0, opercentage = 0;
// loose synchro *************** *** 325,338 **** { SYS_VGUI3( ".x%x.c delete rectangle %xCLIPZONE\n", ! glist_getcanvas( x->x_glist ), x); if ( ( x->x_readstart != 0 ) || ( x->x_readend != 100 ) ) { SYS_VGUI7( ".x%x.c create rectangle %d %d %d %d -outline #FF0000 -tags %xCLIPZONE -width 2\n", ! glist_getcanvas( x->x_glist ), x->x_xpos+(int)(x->x_readstart*(x->x_width)/100 ), x->x_ypos, x->x_xpos+(int)(x->x_readend*(x->x_width)/100 ), x->x_ypos+x->x_height*x->x_zoom, x ); } // set borders in black ! SYS_VGUI3(".x%x.c itemconfigure %xCOOLED -outline #000000\n", glist_getcanvas(x->x_glist), x); }
--- 316,329 ---- { SYS_VGUI3( ".x%x.c delete rectangle %xCLIPZONE\n", ! canvas, x); if ( ( x->x_readstart != 0 ) || ( x->x_readend != 100 ) ) { SYS_VGUI7( ".x%x.c create rectangle %d %d %d %d -outline #FF0000 -tags %xCLIPZONE -width 2\n", ! canvas, x->x_xpos+(int)(x->x_readstart*(x->x_width)/100 ), x->x_ypos, x->x_xpos+(int)(x->x_readend*(x->x_width)/100 ), x->x_ypos+x->x_height*x->x_zoom, x ); } // set borders in black ! SYS_VGUI3(".x%x.c itemconfigure %xCOOLED -outline #000000\n", canvas, x); }
*************** *** 345,350 **** t_int erase, t_int redraw, t_int keepframe) { ! pthread_attr_t update_child_attr; ! t_canvas *canvas=glist_getcanvas(x->x_glist);
if ( x->x_updatechild != 0 ) --- 336,341 ---- t_int erase, t_int redraw, t_int keepframe) { ! pthread_attr_t update_child_attr; ! t_canvas *canvas=glist_getcanvas(x->x_glist);
if ( x->x_updatechild != 0 ) *************** *** 369,374 **** if ( ( bstart == 0 ) && ( bend == x->x_width-1 ) && !keepframe ) { ! SYS_VGUI3(".x%x.c delete %xCOOLEDL\n", glist_getcanvas(glist), x ); ! SYS_VGUI3(".x%x.c delete %xCOOLEDR\n", glist_getcanvas(glist), x ); SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -fill #FFFFFF -tags %xCOOLEDR\n", canvas, x->x_xpos, x->x_ypos, --- 360,365 ---- if ( ( bstart == 0 ) && ( bend == x->x_width-1 ) && !keepframe ) { ! SYS_VGUI3(".x%x.c delete %xCOOLEDL\n", canvas, x ); ! SYS_VGUI3(".x%x.c delete %xCOOLEDR\n", canvas, x ); SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -fill #FFFFFF -tags %xCOOLEDR\n", canvas, x->x_xpos, x->x_ypos, *************** *** 383,398 **** x); SYS_VGUI2("image delete COOLEDIMAGE%x\n", x ); ! SYS_VGUI3(".x%x.c delete ICOOLEDIMAGE%x\n", glist_getcanvas(glist), x ); SYS_VGUI4("image create photo COOLEDIMAGE%x -format gif -width %d -height %d\n", x, x->x_width*x->x_zoom, x->x_height*x->x_zoom ); SYS_VGUI2("COOLEDIMAGE%x blank\n", x ); SYS_VGUI6(".x%x.c create image %d %d -image COOLEDIMAGE%x -tags ICOOLEDIMAGE%x\n", ! glist_getcanvas( x->x_glist ), x->x_xpos+(x->x_width*x->x_zoom)/2, x->x_ypos+(x->x_height*x->x_zoom)/2, x, x ); ! canvas_fixlinesfor( glist_getcanvas(x->x_glist), (t_text*)x ); } // set borders in red ! SYS_VGUI3(".x%x.c itemconfigure %xCOOLED -outline #FF0000\n", glist_getcanvas(glist), x); }
--- 374,389 ---- x); SYS_VGUI2("image delete COOLEDIMAGE%x\n", x ); ! SYS_VGUI3(".x%x.c delete ICOOLEDIMAGE%x\n", canvas, x ); SYS_VGUI4("image create photo COOLEDIMAGE%x -format gif -width %d -height %d\n", x, x->x_width*x->x_zoom, x->x_height*x->x_zoom ); SYS_VGUI2("COOLEDIMAGE%x blank\n", x ); SYS_VGUI6(".x%x.c create image %d %d -image COOLEDIMAGE%x -tags ICOOLEDIMAGE%x\n", ! canvas, x->x_xpos+(x->x_width*x->x_zoom)/2, x->x_ypos+(x->x_height*x->x_zoom)/2, x, x ); ! canvas_fixlinesfor( canvas, (t_text*)x ); } // set borders in red ! SYS_VGUI3(".x%x.c itemconfigure %xCOOLED -outline #FF0000\n", canvas, x); }
*************** *** 421,432 **** static void cooled_draw_new(t_cooled *x, t_glist *glist) { ! t_canvas *canvas=glist_getcanvas(glist);
! if ( x->x_xpos == -1 ) ! { ! x->x_xpos=x->x_obj.te_xpix; ! x->x_ypos=x->x_obj.te_ypix; ! x->x_xdraw=x->x_obj.te_xpix; ! } SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -fill #FFFFFF -tags %xCOOLEDR\n", canvas, x->x_xpos, x->x_ypos, --- 412,420 ---- static void cooled_draw_new(t_cooled *x, t_glist *glist) { ! t_canvas *canvas=glist_getcanvas(glist);
! x->x_xpos=text_xpix(&x->x_obj, glist); ! x->x_ypos=text_ypix(&x->x_obj, glist); ! x->x_xdraw=text_xpix(&x->x_obj, glist); SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -fill #FFFFFF -tags %xCOOLEDR\n", canvas, x->x_xpos, x->x_ypos, *************** *** 444,448 **** SYS_VGUI2("COOLEDIMAGE%x blank\n", x ); SYS_VGUI6(".x%x.c create image %d %d -image COOLEDIMAGE%x -tags ICOOLEDIMAGE%x\n", ! glist_getcanvas( x->x_glist ), x->x_xpos+(x->x_width*x->x_zoom)/2, x->x_ypos+(x->x_height*x->x_zoom)/2, x, x ); --- 432,436 ---- SYS_VGUI2("COOLEDIMAGE%x blank\n", x ); SYS_VGUI6(".x%x.c create image %d %d -image COOLEDIMAGE%x -tags ICOOLEDIMAGE%x\n", ! canvas, x->x_xpos+(x->x_width*x->x_zoom)/2, x->x_ypos+(x->x_height*x->x_zoom)/2, x, x ); *************** *** 453,467 **** static void cooled_draw_delete(t_cooled *x, t_glist *glist) { if ( glist_isvisible( glist ) ) { ! SYS_VGUI3( ".x%x.c delete %xCAPTURE\n", glist_getcanvas( glist ), x ); if ( ( x->x_readstart != 0 ) || ( x->x_readend != 100 ) ) { ! SYS_VGUI3( ".x%x.c delete rectangle %xCLIPZONE\n", glist_getcanvas( glist ), x); } ! SYS_VGUI3( ".x%x.c delete line %xINSERTHERE\n", glist_getcanvas( glist ), x); ! SYS_VGUI3(".x%x.c delete %xCOOLEDR\n", glist_getcanvas( glist ), x ); ! SYS_VGUI3(".x%x.c delete %xCOOLEDL\n", glist_getcanvas( glist ), x ); ! SYS_VGUI3(".x%x.c delete ICOOLEDIMAGE%x\n", glist_getcanvas( glist ), x ); SYS_VGUI2("image delete COOLEDIMAGE%x\n", x ); } --- 441,457 ---- static void cooled_draw_delete(t_cooled *x, t_glist *glist) { + t_canvas *canvas=glist_getcanvas(glist); + if ( glist_isvisible( glist ) ) { ! SYS_VGUI3( ".x%x.c delete %xCAPTURE\n", canvas, x ); if ( ( x->x_readstart != 0 ) || ( x->x_readend != 100 ) ) { ! SYS_VGUI3( ".x%x.c delete rectangle %xCLIPZONE\n", canvas, x); } ! SYS_VGUI3( ".x%x.c delete line %xINSERTHERE\n", canvas, x); ! SYS_VGUI3(".x%x.c delete %xCOOLEDR\n", canvas, x ); ! SYS_VGUI3(".x%x.c delete %xCOOLEDL\n", canvas, x ); ! SYS_VGUI3(".x%x.c delete ICOOLEDIMAGE%x\n", canvas, x ); SYS_VGUI2("image delete COOLEDIMAGE%x\n", x ); } *************** *** 470,474 **** static void cooled_draw_move(t_cooled *x, t_glist *glist) { ! t_canvas *canvas=glist_getcanvas(glist);
if ( glist_isvisible( x->x_glist ) ) --- 460,464 ---- static void cooled_draw_move(t_cooled *x, t_glist *glist) { ! t_canvas *canvas=glist_getcanvas(glist);
if ( glist_isvisible( x->x_glist ) ) *************** *** 510,514 **** static void cooled_draw_select(t_cooled* x,t_glist* glist) { ! t_canvas *canvas=glist_getcanvas(glist);
if ( glist_isvisible( x->x_glist ) ) --- 500,504 ---- static void cooled_draw_select(t_cooled* x,t_glist* glist) { ! t_canvas *canvas=glist_getcanvas(glist);
if ( glist_isvisible( x->x_glist ) ) *************** *** 535,538 **** --- 525,529 ---- { t_float startpoint = fstart; + t_canvas *canvas=glist_getcanvas(x->x_glist);
if (startpoint < 0) startpoint = 0; *************** *** 545,553 **** { SYS_VGUI3( ".x%x.c delete rectangle %xCLIPZONE\n", ! glist_getcanvas( x->x_glist ), x); if ( ( x->x_readstart != 0 ) || ( x->x_readend != 100 ) ) { SYS_VGUI7( ".x%x.c create rectangle %d %d %d %d -outline #FF0000 -tags %xCLIPZONE -width 2\n", ! glist_getcanvas( x->x_glist ), x->x_xpos+(int)(x->x_readstart*x->x_width*x->x_zoom/100 ), x->x_ypos, x->x_xpos+(int)(x->x_readend*x->x_width*x->x_zoom/100 ), x->x_ypos+x->x_height*x->x_zoom, x ); --- 536,544 ---- { SYS_VGUI3( ".x%x.c delete rectangle %xCLIPZONE\n", ! canvas, x); if ( ( x->x_readstart != 0 ) || ( x->x_readend != 100 ) ) { SYS_VGUI7( ".x%x.c create rectangle %d %d %d %d -outline #FF0000 -tags %xCLIPZONE -width 2\n", ! canvas, x->x_xpos+(int)(x->x_readstart*x->x_width*x->x_zoom/100 ), x->x_ypos, x->x_xpos+(int)(x->x_readend*x->x_width*x->x_zoom/100 ), x->x_ypos+x->x_height*x->x_zoom, x ); *************** *** 561,564 **** --- 552,556 ---- { t_float endpoint = fend; + t_canvas *canvas=glist_getcanvas(x->x_glist);
if (endpoint < 0) endpoint = 0; *************** *** 571,579 **** { SYS_VGUI3( ".x%x.c delete rectangle %xCLIPZONE\n", ! glist_getcanvas( x->x_glist ), x); if ( ( x->x_readstart != 0 ) || ( x->x_readend != 100 ) ) { SYS_VGUI7( ".x%x.c create rectangle %d %d %d %d -outline #FF0000 -tags %xCLIPZONE -width 2\n", ! glist_getcanvas( x->x_glist ), x->x_xpos+(int)(x->x_readstart*x->x_width*x->x_zoom/100 ), x->x_ypos, x->x_xpos+(int)(x->x_readend*x->x_width*x->x_zoom/100 ), --- 563,571 ---- { SYS_VGUI3( ".x%x.c delete rectangle %xCLIPZONE\n", ! canvas, x); if ( ( x->x_readstart != 0 ) || ( x->x_readend != 100 ) ) { SYS_VGUI7( ".x%x.c create rectangle %d %d %d %d -outline #FF0000 -tags %xCLIPZONE -width 2\n", ! canvas, x->x_xpos+(int)(x->x_readstart*x->x_width*x->x_zoom/100 ), x->x_ypos, x->x_xpos+(int)(x->x_readend*x->x_width*x->x_zoom/100 ), *************** *** 587,591 **** int *xp1, int *yp1, int *xp2, int *yp2) { ! t_cooled* x = (t_cooled*)z;
*xp1 = x->x_xpos; --- 579,583 ---- int *xp1, int *yp1, int *xp2, int *yp2) { ! t_cooled* x = (t_cooled*)z;
*xp1 = x->x_xpos; *************** *** 597,601 **** static void cooled_save(t_gobj *z, t_binbuf *b) { ! t_cooled *x = (t_cooled *)z;
binbuf_addv(b, "ssiisiiii", gensym("#X"),gensym("obj"), --- 589,593 ---- static void cooled_save(t_gobj *z, t_binbuf *b) { ! t_cooled *x = (t_cooled *)z;
binbuf_addv(b, "ssiisiiii", gensym("#X"),gensym("obj"), *************** *** 607,611 **** static void cooled_select(t_gobj *z, t_glist *glist, int selected) { ! t_cooled *x = (t_cooled *)z;
x->x_selected = selected; --- 599,603 ---- static void cooled_select(t_gobj *z, t_glist *glist, int selected) { ! t_cooled *x = (t_cooled *)z;
x->x_selected = selected; *************** *** 615,620 **** static void cooled_vis(t_gobj *z, t_glist *glist, int vis) { ! t_cooled *x = (t_cooled *)z; ! t_rtext *y;
if (vis) --- 607,612 ---- static void cooled_vis(t_gobj *z, t_glist *glist, int vis) { ! t_cooled *x = (t_cooled *)z; ! t_rtext *y;
if (vis) *************** *** 636,642 **** static void cooled_displace(t_gobj *z, t_glist *glist, int dx, int dy) { ! t_cooled *x = (t_cooled *)z; ! int xold = x->x_xpos; ! int yold = x->x_ypos;
x->x_xpos += dx; --- 628,634 ---- static void cooled_displace(t_gobj *z, t_glist *glist, int dx, int dy) { ! t_cooled *x = (t_cooled *)z; ! t_int xold = x->x_xpos; ! t_int yold = x->x_ypos;
x->x_xpos += dx; *************** *** 836,841 **** int xpix, int ypix, int shift, int alt, int dbl, int doit) { ! t_cooled* x = (t_cooled *)z; ! t_int pipos;
// post( "cooled_click : x=%d y=%d doit=%d alt=%d, shift=%d", xpix, ypix, doit, alt, shift ); --- 828,834 ---- int xpix, int ypix, int shift, int alt, int dbl, int doit) { ! t_cooled* x = (t_cooled *)z; ! t_int pipos; ! t_canvas *canvas=glist_getcanvas(x->x_glist);
// post( "cooled_click : x=%d y=%d doit=%d alt=%d, shift=%d", xpix, ypix, doit, alt, shift ); *************** *** 868,874 **** { SYS_VGUI3( ".x%x.c delete line %xINSERTHERE\n", ! glist_getcanvas( x->x_glist ), x); SYS_VGUI7( ".x%x.c create line %d %d %d %d -fill #00FFFF -tags %xINSERTHERE -width 2\n", ! glist_getcanvas( x->x_glist ), x->x_xdraw, x->x_ypos, x->x_xdraw, x->x_ypos+x->x_height*x->x_zoom, x ); --- 861,867 ---- { SYS_VGUI3( ".x%x.c delete line %xINSERTHERE\n", ! canvas, x); SYS_VGUI7( ".x%x.c create line %d %d %d %d -fill #00FFFF -tags %xINSERTHERE -width 2\n", ! canvas, x->x_xdraw, x->x_ypos, x->x_xdraw, x->x_ypos+x->x_height*x->x_zoom, x ); *************** *** 1374,1384 **** cooled_widgetbehavior.w_visfn = cooled_vis; cooled_widgetbehavior.w_clickfn = cooled_click; ! #if PD_MINOR_VERSION >= 37 class_setpropertiesfn(cooled_class, cooled_properties); class_setsavefn(cooled_class, cooled_save); - #else - cooled_widgetbehavior.w_propertiesfn = cooled_properties; - cooled_widgetbehavior.w_savefn = cooled_save; - #endif
CLASS_MAINSIGNALIN( cooled_class, t_cooled, x_f ); --- 1367,1373 ---- cooled_widgetbehavior.w_visfn = cooled_vis; cooled_widgetbehavior.w_clickfn = cooled_click; ! class_setpropertiesfn(cooled_class, cooled_properties); class_setsavefn(cooled_class, cooled_save);
CLASS_MAINSIGNALIN( cooled_class, t_cooled, x_f );