[PD-cvs] externals/unauthorized/probalizer CHANGES.LOG,1.1,1.2 Makefile,1.1,1.2 probalizer.c,1.6,1.7

Yves Degoyon sevyves at users.sourceforge.net
Wed Mar 2 03:47:31 CET 2005


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

Modified Files:
	CHANGES.LOG Makefile probalizer.c 
Log Message:
Added GOP supoort

Index: CHANGES.LOG
===================================================================
RCS file: /cvsroot/pure-data/externals/unauthorized/probalizer/CHANGES.LOG,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CHANGES.LOG	16 Aug 2003 08:29:44 -0000	1.1
--- CHANGES.LOG	2 Mar 2005 02:47:29 -0000	1.2
***************
*** 1,2 ****
--- 1,6 ----
+ 0.3
+   added GOP support
+ 0.2
+   adapted for pd 0.37
  0.1
    first implementation

Index: probalizer.c
===================================================================
RCS file: /cvsroot/pure-data/externals/unauthorized/probalizer/probalizer.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** probalizer.c	30 May 2004 05:20:00 -0000	1.6
--- probalizer.c	2 Mar 2005 02:47:29 -0000	1.7
***************
*** 1,2 ****
--- 1,3 ----
+ /* ---------------------------------------------------------------------------- */
  /* Copyright (c) 2002 Yves Degoyon.                                             */
  /* For information on usage and redistribution, and for a DISCLAIMER OF ALL     */
***************
*** 36,40 ****
  #include <math.h>
  #include <ctype.h>
! #include <m_pd.h>
  #include "m_imp.h"
  #include "g_canvas.h"
--- 37,41 ----
  #include <math.h>
  #include <ctype.h>
! #include "m_pd.h"
  #include "m_imp.h"
  #include "g_canvas.h"
***************
*** 44,48 ****
  #ifdef NT
  #include <io.h>
- #define random rand
  #else
  #include <unistd.h>
--- 45,48 ----
***************
*** 55,59 ****
  #define DEFAULT_PROB_VALUE 10
  
! static char   *probalizer_version = "probalizer : outputs integer values according to a drawn probability curve , version 0.1 (ydegoyon at free.fr)"; 
  
  t_widgetbehavior probalizer_widgetbehavior;
--- 55,59 ----
  #define DEFAULT_PROB_VALUE 10
  
! static char   *probalizer_version = "probalizer : outputs integer values according to a drawn probability curve , version 0.3 (ydegoyon at free.fr)"; 
  
  t_widgetbehavior probalizer_widgetbehavior;
***************
*** 106,137 ****
  
      SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -outline #000000 -fill #6790E2 -tags %xPROBALIZER\n",
! 	     canvas, x->x_obj.te_xpix, x->x_obj.te_ypix,
! 	     x->x_obj.te_xpix+x->x_width, x->x_obj.te_ypix+x->x_height,
  	     x);
      SYS_VGUI5(".x%x.c create text %d %d -font -*-courier-bold--normal--10-* -text \"0\" -tags %xLTCAPTION\n",
!              canvas, x->x_obj.te_xpix-15, x->x_obj.te_ypix + x->x_height, x );
      SYS_VGUI6(".x%x.c create text %d %d -font -*-courier-bold--normal--10-* -text \"%d\" -tags %xLBCAPTION\n",
!              canvas, x->x_obj.te_xpix-15, x->x_obj.te_ypix, x->x_noccurrences, x );
      SYS_VGUI5(".x%x.c create text %d %d -font -*-courier-bold--normal--10-* -text \"1\" -tags %xBLCAPTION\n",
!              canvas, x->x_obj.te_xpix+2, x->x_obj.te_ypix + x->x_height + 10, x );
      SYS_VGUI6(".x%x.c create text %d %d -font -*-courier-bold--normal--10-* -text \"%d\" -tags %xBRCAPTION\n",
!              canvas, x->x_obj.te_xpix + x->x_width-5, x->x_obj.te_ypix + x->x_height + 10, x->x_nvalues, x );
      SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -outline #000000 -fill #000000 -tags %xIN\n",
!              canvas, x->x_obj.te_xpix,
!              x->x_obj.te_ypix - 2,
!              x->x_obj.te_xpix + 5,
!              x->x_obj.te_ypix ,
               x);
      SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -outline #000000 -fill #000000 -tags %xOUT\n",
!              canvas, x->x_obj.te_xpix,
!              x->x_obj.te_ypix + x->x_height,
!              x->x_obj.te_xpix + 5,
!              x->x_obj.te_ypix + x->x_height + 2,
               x);
      SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -outline #000000 -fill #000000 -tags %xOUT2\n",
!              canvas, x->x_obj.te_xpix + x->x_width -5,
!              x->x_obj.te_ypix + x->x_height,
!              x->x_obj.te_xpix + x->x_width,
!              x->x_obj.te_ypix + x->x_height + 2,
               x);
      for ( ei=0; ei<x->x_nvalues; ei++ )
--- 106,137 ----
  
      SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -outline #000000 -fill #6790E2 -tags %xPROBALIZER\n",
! 	     canvas, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),
! 	     text_xpix(&x->x_obj, glist)+x->x_width, text_ypix(&x->x_obj, glist)+x->x_height,
  	     x);
      SYS_VGUI5(".x%x.c create text %d %d -font -*-courier-bold--normal--10-* -text \"0\" -tags %xLTCAPTION\n",
!              canvas, text_xpix(&x->x_obj, glist)-15, text_ypix(&x->x_obj, glist) + x->x_height, x );
      SYS_VGUI6(".x%x.c create text %d %d -font -*-courier-bold--normal--10-* -text \"%d\" -tags %xLBCAPTION\n",
!              canvas, text_xpix(&x->x_obj, glist)-15, text_ypix(&x->x_obj, glist), x->x_noccurrences, x );
      SYS_VGUI5(".x%x.c create text %d %d -font -*-courier-bold--normal--10-* -text \"1\" -tags %xBLCAPTION\n",
!              canvas, text_xpix(&x->x_obj, glist)+2, text_ypix(&x->x_obj, glist) + x->x_height + 10, x );
      SYS_VGUI6(".x%x.c create text %d %d -font -*-courier-bold--normal--10-* -text \"%d\" -tags %xBRCAPTION\n",
!              canvas, text_xpix(&x->x_obj, glist) + x->x_width-5, text_ypix(&x->x_obj, glist) + x->x_height + 10, x->x_nvalues, x );
      SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -outline #000000 -fill #000000 -tags %xIN\n",
!              canvas, text_xpix(&x->x_obj, glist),
!              text_ypix(&x->x_obj, glist) - 2,
!              text_xpix(&x->x_obj, glist) + 5,
!              text_ypix(&x->x_obj, glist) ,
               x);
      SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -outline #000000 -fill #000000 -tags %xOUT\n",
!              canvas, text_xpix(&x->x_obj, glist),
!              text_ypix(&x->x_obj, glist) + x->x_height,
!              text_xpix(&x->x_obj, glist) + 5,
!              text_ypix(&x->x_obj, glist) + x->x_height + 2,
               x);
      SYS_VGUI7(".x%x.c create rectangle %d %d %d %d -outline #000000 -fill #000000 -tags %xOUT2\n",
!              canvas, text_xpix(&x->x_obj, glist) + x->x_width -5,
!              text_ypix(&x->x_obj, glist) + x->x_height,
!              text_xpix(&x->x_obj, glist) + x->x_width,
!              text_ypix(&x->x_obj, glist) + x->x_height + 2,
               x);
      for ( ei=0; ei<x->x_nvalues; ei++ )
***************
*** 139,146 ****
           SYS_VGUI8(".x%x.c create rectangle %d %d %d %d -outline #000000 -fill #118373 -tags %xPROB%d\n",
  	     canvas, 
!              x->x_obj.te_xpix + ei * x->x_width/x->x_nvalues, 
!              x->x_obj.te_ypix + x->x_height - ( *(x->x_probs+ei) * x->x_height / x->x_noccurrences ),
! 	     x->x_obj.te_xpix + (ei+1) * x->x_width/x->x_nvalues, 
!              x->x_obj.te_ypix + x->x_height,
  	     x, ei);
      }
--- 139,146 ----
           SYS_VGUI8(".x%x.c create rectangle %d %d %d %d -outline #000000 -fill #118373 -tags %xPROB%d\n",
  	     canvas, 
!              text_xpix(&x->x_obj, glist) + ei * x->x_width/x->x_nvalues, 
!              text_ypix(&x->x_obj, glist) + x->x_height - ( *(x->x_probs+ei) * x->x_height / x->x_noccurrences ),
! 	     text_xpix(&x->x_obj, glist) + (ei+1) * x->x_width/x->x_nvalues, 
!              text_ypix(&x->x_obj, glist) + x->x_height,
  	     x, ei);
      }
***************
*** 157,164 ****
         SYS_VGUI8(".x%x.c coords %xPROB%d %d %d %d %d\n",
             canvas, x, ei,
!            x->x_obj.te_xpix + ei * x->x_width / x->x_nvalues, 
!            x->x_obj.te_ypix + x->x_height - ( *(x->x_probs+ei) * x->x_height / x->x_noccurrences ),
!            x->x_obj.te_xpix + (ei+1) * x->x_width / x->x_nvalues, 
!            x->x_obj.te_ypix + x->x_height );
      }
      canvas_fixlinesfor( canvas, (t_text*)x );
--- 157,164 ----
         SYS_VGUI8(".x%x.c coords %xPROB%d %d %d %d %d\n",
             canvas, x, ei,
!            text_xpix(&x->x_obj, x->x_glist) + ei * x->x_width / x->x_nvalues, 
!            text_ypix(&x->x_obj, x->x_glist) + x->x_height - ( *(x->x_probs+ei) * x->x_height / x->x_noccurrences ),
!            text_xpix(&x->x_obj, x->x_glist) + (ei+1) * x->x_width / x->x_nvalues, 
!            text_ypix(&x->x_obj, x->x_glist) + x->x_height );
      }
      canvas_fixlinesfor( canvas, (t_text*)x );
***************
*** 171,210 ****
  
      SYS_VGUI7(".x%x.c coords %xPROBALIZER %d %d %d %d \n",
! 	     canvas, x, x->x_obj.te_xpix, x->x_obj.te_ypix,
! 	     x->x_obj.te_xpix+x->x_width, x->x_obj.te_ypix+x->x_height
  	     );
      SYS_VGUI7(".x%x.c coords %xIN %d %d %d %d\n",
! 	     canvas, x, x->x_obj.te_xpix, 
!              x->x_obj.te_ypix - 2,
! 	     x->x_obj.te_xpix + 5, 
!              x->x_obj.te_ypix
  	     );
      SYS_VGUI7(".x%x.c coords %xOUT %d %d %d %d\n",
! 	     canvas, x, x->x_obj.te_xpix, 
!              x->x_obj.te_ypix + x->x_height,
! 	     x->x_obj.te_xpix + 5, 
!              x->x_obj.te_ypix + x->x_height + 2
  	     );
      SYS_VGUI7(".x%x.c coords %xOUT2 %d %d %d %d\n",
! 	     canvas, x, x->x_obj.te_xpix + x->x_width - 5, 
!              x->x_obj.te_ypix + x->x_height,
! 	     x->x_obj.te_xpix + x->x_width, 
!              x->x_obj.te_ypix + x->x_height + 2
  	     );
      SYS_VGUI5(".x%x.c coords %xLTCAPTION %d %d\n",
! 	     canvas, x, x->x_obj.te_xpix-15, 
!              x->x_obj.te_ypix + x->x_height
  	     );
      SYS_VGUI5(".x%x.c coords %xLBCAPTION %d %d\n",
! 	     canvas, x, x->x_obj.te_xpix-15, 
!              x->x_obj.te_ypix 
  	     );
      SYS_VGUI5(".x%x.c coords %xBLCAPTION %d %d\n",
! 	     canvas, x,  x->x_obj.te_xpix+2, 
!              x->x_obj.te_ypix + x->x_height + 10
  	     );
      SYS_VGUI5(".x%x.c coords %xBRCAPTION %d %d\n",
! 	     canvas, x,  x->x_obj.te_xpix + x->x_width - 5,
!              x->x_obj.te_ypix + x->x_height + 10
  	     );
      for ( ei=0; ei<x->x_nvalues; ei++ )
--- 171,210 ----
  
      SYS_VGUI7(".x%x.c coords %xPROBALIZER %d %d %d %d \n",
! 	     canvas, x, text_xpix(&x->x_obj, glist), text_ypix(&x->x_obj, glist),
! 	     text_xpix(&x->x_obj, glist)+x->x_width, text_ypix(&x->x_obj, glist)+x->x_height
  	     );
      SYS_VGUI7(".x%x.c coords %xIN %d %d %d %d\n",
! 	     canvas, x, text_xpix(&x->x_obj, glist), 
!              text_ypix(&x->x_obj, glist) - 2,
! 	     text_xpix(&x->x_obj, glist) + 5, 
!              text_ypix(&x->x_obj, glist)
  	     );
      SYS_VGUI7(".x%x.c coords %xOUT %d %d %d %d\n",
! 	     canvas, x, text_xpix(&x->x_obj, glist), 
!              text_ypix(&x->x_obj, glist) + x->x_height,
! 	     text_xpix(&x->x_obj, glist) + 5, 
!              text_ypix(&x->x_obj, glist) + x->x_height + 2
  	     );
      SYS_VGUI7(".x%x.c coords %xOUT2 %d %d %d %d\n",
! 	     canvas, x, text_xpix(&x->x_obj, glist) + x->x_width - 5, 
!              text_ypix(&x->x_obj, glist) + x->x_height,
! 	     text_xpix(&x->x_obj, glist) + x->x_width, 
!              text_ypix(&x->x_obj, glist) + x->x_height + 2
  	     );
      SYS_VGUI5(".x%x.c coords %xLTCAPTION %d %d\n",
! 	     canvas, x, text_xpix(&x->x_obj, glist)-15, 
!              text_ypix(&x->x_obj, glist) + x->x_height
  	     );
      SYS_VGUI5(".x%x.c coords %xLBCAPTION %d %d\n",
! 	     canvas, x, text_xpix(&x->x_obj, glist)-15, 
!              text_ypix(&x->x_obj, glist) 
  	     );
      SYS_VGUI5(".x%x.c coords %xBLCAPTION %d %d\n",
! 	     canvas, x,  text_xpix(&x->x_obj, glist)+2, 
!              text_ypix(&x->x_obj, glist) + x->x_height + 10
  	     );
      SYS_VGUI5(".x%x.c coords %xBRCAPTION %d %d\n",
! 	     canvas, x,  text_xpix(&x->x_obj, glist) + x->x_width - 5,
!              text_ypix(&x->x_obj, glist) + x->x_height + 10
  	     );
      for ( ei=0; ei<x->x_nvalues; ei++ )
***************
*** 212,219 ****
           SYS_VGUI8(".x%x.c coords %xPROB%d %d %d %d %d\n",
  	     canvas, x, ei,
!              x->x_obj.te_xpix + ei * x->x_width / x->x_nvalues, 
!              x->x_obj.te_ypix + x->x_height - ( *(x->x_probs+ei) * x->x_height / x->x_noccurrences ),
! 	     x->x_obj.te_xpix + (ei+1) * x->x_width / x->x_nvalues, 
!              x->x_obj.te_ypix + x->x_height );
      }
      canvas_fixlinesfor( canvas, (t_text*)x );
--- 212,219 ----
           SYS_VGUI8(".x%x.c coords %xPROB%d %d %d %d %d\n",
  	     canvas, x, ei,
!              text_xpix(&x->x_obj, glist) + ei * x->x_width / x->x_nvalues, 
!              text_ypix(&x->x_obj, glist) + x->x_height - ( *(x->x_probs+ei) * x->x_height / x->x_noccurrences ),
! 	     text_xpix(&x->x_obj, glist) + (ei+1) * x->x_width / x->x_nvalues, 
!              text_ypix(&x->x_obj, glist) + x->x_height );
      }
      canvas_fixlinesfor( canvas, (t_text*)x );
***************
*** 264,271 ****
     t_probalizer* x = (t_probalizer*)z;
  
!    *xp1 = x->x_obj.te_xpix;
!    *yp1 = x->x_obj.te_ypix;
!    *xp2 = x->x_obj.te_xpix+x->x_width;
!    *yp2 = x->x_obj.te_ypix+x->x_height;
  }
  
--- 264,271 ----
     t_probalizer* x = (t_probalizer*)z;
  
!    *xp1 = text_xpix(&x->x_obj, owner);
!    *yp1 = text_ypix(&x->x_obj, owner);
!    *xp2 = text_xpix(&x->x_obj, owner)+x->x_width;
!    *yp2 = text_ypix(&x->x_obj, owner)+x->x_height;
  }
  
***************
*** 276,280 ****
  
     binbuf_addv(b, "ssiisiiiii", gensym("#X"),gensym("obj"),
! 		(t_int)x->x_obj.te_xpix, (t_int)x->x_obj.te_ypix,
  		gensym("probalizer"), x->x_width, x->x_height,
  		x->x_nvalues, x->x_noccurrences, x->x_save );
--- 276,280 ----
  
     binbuf_addv(b, "ssiisiiiii", gensym("#X"),gensym("obj"),
! 		(t_int)text_xpix(&x->x_obj, x->x_glist), (t_int)text_ypix(&x->x_obj, x->x_glist),
  		gensym("probalizer"), x->x_width, x->x_height,
  		x->x_nvalues, x->x_noccurrences, x->x_save );
***************
*** 398,403 ****
  {
      t_probalizer *x = (t_probalizer *)z;
!     int xold = x->x_obj.te_xpix;
!     int yold = x->x_obj.te_ypix;
  
      // post( "probalizer_displace dx=%d dy=%d", dx, dy );
--- 398,403 ----
  {
      t_probalizer *x = (t_probalizer *)z;
!     int xold = text_xpix(&x->x_obj, glist);
!     int yold = text_ypix(&x->x_obj, glist);
  
      // post( "probalizer_displace dx=%d dy=%d", dx, dy );
***************
*** 423,428 ****
         int newvalue;
  
!          nevent = ((float)( xpix - x->x_obj.te_xpix ))/((float)x->x_width/(float)x->x_nvalues);
!          newvalue = ((float)(x->x_obj.te_ypix + x->x_height - ypix))/( (float)x->x_height/(float)x->x_noccurrences);
  
           // post( "changed %d to %d", nevent, newvalue );
--- 423,428 ----
         int newvalue;
  
!          nevent = ((float)( xpix - text_xpix(&x->x_obj, glist) ))/((float)x->x_width/(float)x->x_nvalues);
!          newvalue = ((float)(text_ypix(&x->x_obj, glist) + x->x_height - ypix))/( (float)x->x_height/(float)x->x_noccurrences);
  
           // post( "changed %d to %d", nevent, newvalue );
***************
*** 689,705 ****
      probalizer_widgetbehavior.w_visfn =        probalizer_vis;
      probalizer_widgetbehavior.w_clickfn =      probalizer_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)
      probalizer_widgetbehavior.w_propertiesfn = probalizer_properties;
      probalizer_widgetbehavior.w_savefn =       probalizer_save;
- #else
- 	 class_setsavefn(probalizer_class, &probalizer_save);
- 	 class_setpropertiesfn(probalizer_class, &probalizer_properties);
  #endif
      class_setwidget(probalizer_class, &probalizer_widgetbehavior);
  }
--- 689,702 ----
      probalizer_widgetbehavior.w_visfn =        probalizer_vis;
      probalizer_widgetbehavior.w_clickfn =      probalizer_click;
! 
! #if PD_MINOR_VERSION >= 37
!     class_setpropertiesfn(probalizer_class, probalizer_properties);
!     class_setsavefn(probalizer_class, probalizer_save);
! #else
      probalizer_widgetbehavior.w_propertiesfn = probalizer_properties;
      probalizer_widgetbehavior.w_savefn =       probalizer_save;
  #endif
+ 
      class_setwidget(probalizer_class, &probalizer_widgetbehavior);
+     class_sethelpsymbol(probalizer_class, gensym("probalizer.pd"));
  }

Index: Makefile
===================================================================
RCS file: /cvsroot/pure-data/externals/unauthorized/probalizer/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Makefile	16 Aug 2003 08:29:30 -0000	1.1
--- Makefile	2 Mar 2005 02:47:29 -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 -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 -lc -lm





More information about the Pd-cvs mailing list