Update of /cvsroot/pure-data/externals/unauthorized/cooled~ In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3733
Modified Files: CHANGES.LOG cooled~.c Log Message: fixed coordinates for GOP
Index: CHANGES.LOG =================================================================== RCS file: /cvsroot/pure-data/externals/unauthorized/cooled~/CHANGES.LOG,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CHANGES.LOG 2 Mar 2005 02:44:30 -0000 1.3 --- CHANGES.LOG 26 Jul 2006 16:44:53 -0000 1.4 *************** *** 1,2 **** --- 1,4 ---- + 0.14 + remove GOP support 0.13 added GOP support
Index: cooled~.c =================================================================== RCS file: /cvsroot/pure-data/externals/unauthorized/cooled~/cooled~.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** cooled~.c 18 Dec 2005 18:55:03 -0000 1.11 --- cooled~.c 26 Jul 2006 16:44:53 -0000 1.12 *************** *** 37,60 **** #include <fcntl.h> #include <sys/stat.h> - - #ifdef __APPLE__ - #include <sys/malloc.h> - #else #include <malloc.h> - #endif - #include <ctype.h> #include <pthread.h> ! #ifdef _WIN32 ! #include <io.h> ! #define usleep(a) _sleep(a/1000) ! #else #include <unistd.h> #endif ! ! #include <math.h> ! #ifndef M_PI #define M_PI 3.14159265358979323846 #endif
#include "m_pd.h" --- 37,50 ---- #include <fcntl.h> #include <sys/stat.h> #include <malloc.h> #include <ctype.h> #include <pthread.h> ! #ifdef UNIX #include <unistd.h> #endif ! #ifdef NT #define M_PI 3.14159265358979323846 #endif + #include <math.h>
#include "m_pd.h" *************** *** 126,135 **** t_object x_obj;
! t_int x_size; /* size of the stored sound */ t_float x_readpos; /* data's playing position */ ! t_int x_writepos; /* data's recording position */ t_float x_readstart; /* data's starting position for reading */ t_float x_readend; /* data's ending position for reading */ ! t_int x_play; /* playing on/off flag */ t_float x_readspeed; /* speed increment */ t_float x_record; /* flag to start recording process */ --- 116,125 ---- t_object x_obj;
! int x_size; /* size of the stored sound */ t_float x_readpos; /* data's playing position */ ! int x_writepos; /* data's recording position */ t_float x_readstart; /* data's starting position for reading */ t_float x_readend; /* data's ending position for reading */ ! int x_play; /* playing on/off flag */ t_float x_readspeed; /* speed increment */ t_float x_record; /* flag to start recording process */ *************** *** 146,168 **** char* x_gifdata; /* buffer to store graphic data */ char* x_guicommand; /* buffer to store gui command */ ! t_int x_draw; /* drawing option */
/* graphical data block */ ! t_int x_width; /* graphical width */ ! t_int x_height; /* graphical height */ ! t_int x_selected; /* flag to remember if we are seleted or not */ ! t_int x_erase; /* flag used when an erase is needed */ ! t_int x_redraw; /* flag used when drawing is needed */ t_glist *x_glist; /* keep graphic context for various operations */ ! t_int x_zoom; /* zoom factor */ pthread_t x_updatechild; /* thread id for the update child */ ! t_int x_updatestart; /* starting position for update */ ! t_int x_updateend; /* ending position for update */ ! t_int x_xpos; /* stuck x position */ ! t_int x_ypos; /* stuck y position */ ! t_int x_shifted; /* remember shift state from last click */ ! t_int x_alted; /* remember alt state from last click */ ! t_int x_xdraw; /* x drawing position */ ! t_int x_edraw; /* end of drawing */
t_float x_f; /* float needed for signal input */ --- 136,158 ---- char* x_gifdata; /* buffer to store graphic data */ char* x_guicommand; /* buffer to store gui command */ ! int x_draw; /* drawing option */
/* graphical data block */ ! int x_width; /* graphical width */ ! int x_height; /* graphical height */ ! int x_selected; /* flag to remember if we are seleted or not */ ! int x_erase; /* flag used when an erase is needed */ ! int x_redraw; /* flag used when drawing is needed */ t_glist *x_glist; /* keep graphic context for various operations */ ! int x_zoom; /* zoom factor */ pthread_t x_updatechild; /* thread id for the update child */ ! int x_updatestart; /* starting position for update */ ! int x_updateend; /* ending position for update */ ! int x_xpos; /* stuck x position */ ! int x_ypos; /* stuck y position */ ! int x_shifted; /* remember shift state from last click */ ! int x_alted; /* remember alt state from last click */ ! int x_xdraw; /* x drawing position */ ! int x_edraw; /* end of drawing */
t_float x_f; /* float needed for signal input */ *************** *** 172,180 **** /* ------------------------ drawing functions ---------------------------- */
! static void cooled_update_block(t_cooled *x, t_glist *glist, t_int bnumber) { ! t_int hi, i=0; t_float fspectrum=0.0; ! t_int phase=0; char color[8];
--- 162,170 ---- /* ------------------------ drawing functions ---------------------------- */
! static void cooled_update_block(t_cooled *x, t_glist *glist, int bnumber) { ! int hi, i=0; t_float fspectrum=0.0; ! int phase=0; char color[8];
*************** *** 204,210 **** // set all points { ! t_int fsamp = ( bnumber * x->x_size ) / x->x_width; ! t_int lsamp = ( ( bnumber+1) * x->x_size ) / x->x_width; ! t_int si;
// post ( "cooled~ : updating samples [%d,%d]", fsamp, lsamp ); --- 194,200 ---- // set all points { ! int fsamp = ( bnumber * x->x_size ) / x->x_width; ! int lsamp = ( ( bnumber+1) * x->x_size ) / x->x_width; ! int si;
// post ( "cooled~ : updating samples [%d,%d]", fsamp, lsamp ); *************** *** 214,218 **** // calculate right channel index { ! t_int rind = 3*x->x_height/4 + ( *(x->x_rdata+si) * (x->x_height/4) ) - 1;
if ( rind > x->x_height - 1 ) rind = x->x_height - 1; --- 204,208 ---- // calculate right channel index { ! int rind = 3*x->x_height/4 + ( *(x->x_rdata+si) * (x->x_height/4) ) - 1;
if ( rind > x->x_height - 1 ) rind = x->x_height - 1; *************** *** 228,232 **** // calculate left channel index { ! t_int lind = x->x_height/4 + ( *(x->x_ldata+si) * (x->x_height/4) ) - 1;
if ( lind > x->x_height/2 - 1 ) lind = x->x_height/2 - 1; --- 218,222 ---- // calculate left channel index { ! int lind = x->x_height/4 + ( *(x->x_ldata+si) * (x->x_height/4) ) - 1;
if ( lind > x->x_height/2 - 1 ) lind = x->x_height/2 - 1; *************** *** 251,258 **** }
! 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 ]; --- 241,248 ---- }
! static void cooled_erase_block(t_cooled *x, t_glist *glist, int sample ) { t_canvas *canvas=glist_getcanvas(glist); ! int hi; t_float fspectrum=0.0; char fillColor[ 16 ]; *************** *** 278,283 **** 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;
--- 268,273 ---- t_cooled *x = (t_cooled*) tdata; t_canvas *canvas=glist_getcanvas(x->x_glist); ! int si; ! int nbpoints = 0; t_float percentage = 0, opercentage = 0;
*************** *** 343,348 **** }
! static void cooled_update_part(t_cooled *x, t_glist *glist, t_int bstart, t_int bend, ! t_int erase, t_int redraw, t_int keepframe) { pthread_attr_t update_child_attr; --- 333,338 ---- }
! static void cooled_update_part(t_cooled *x, t_glist *glist, int bstart, int bend, ! int erase, int redraw, int keepframe) { pthread_attr_t update_child_attr; *************** *** 602,606 ****
binbuf_addv(b, "ssiisiiii", gensym("#X"),gensym("obj"), ! (t_int)x->x_xpos, (t_int)x->x_ypos, gensym("cooled~"), x->x_size, x->x_width, x->x_height, x->x_draw ); binbuf_addv(b, ";"); --- 592,596 ----
binbuf_addv(b, "ssiisiiii", gensym("#X"),gensym("obj"), ! (int)x->x_obj.te_xpix, (int)x->x_obj.te_ypix, gensym("cooled~"), x->x_size, x->x_width, x->x_height, x->x_draw ); binbuf_addv(b, ";"); *************** *** 639,644 **** { t_cooled *x = (t_cooled *)z; ! t_int xold = x->x_xpos; ! t_int yold = x->x_ypos;
x->x_xpos += dx; --- 629,634 ---- { t_cooled *x = (t_cooled *)z; ! int xold = x->x_xpos; ! int yold = x->x_ypos;
x->x_xpos += dx; *************** *** 666,671 **** static void cooled_erase( t_cooled *x ) { ! t_int startsamp, endsamp, si; ! t_int lreadstart = x->x_readstart, lreadend = x->x_readend;
if (x->x_allocate) { --- 656,661 ---- static void cooled_erase( t_cooled *x ) { ! int startsamp, endsamp, si; ! int lreadstart = x->x_readstart, lreadend = x->x_readend;
if (x->x_allocate) { *************** *** 695,700 **** static void cooled_paste( t_cooled *x ) { ! t_int startsamp, endsamp, si, inssamp, hlimit, csize; ! t_int lreadstart = x->x_readstart, lreadend = x->x_readend;
if (x->x_allocate) { --- 685,690 ---- static void cooled_paste( t_cooled *x ) { ! int startsamp, endsamp, si, inssamp, hlimit, csize; ! int lreadstart = x->x_readstart, lreadend = x->x_readend;
if (x->x_allocate) { *************** *** 736,741 **** static void cooled_replace( t_cooled *x ) { ! t_int startsamp, endsamp, si, inssamp, hlimit, csize; ! t_int lreadstart = x->x_readstart, lreadend = x->x_readend;
if (x->x_allocate) { --- 726,731 ---- static void cooled_replace( t_cooled *x ) { ! int startsamp, endsamp, si, inssamp, hlimit, csize; ! int lreadstart = x->x_readstart, lreadend = x->x_readend;
if (x->x_allocate) { *************** *** 839,843 **** { t_cooled* x = (t_cooled *)z; ! t_int pipos; t_canvas *canvas=glist_getcanvas(x->x_glist);
--- 829,833 ---- { t_cooled* x = (t_cooled *)z; ! int pipos; t_canvas *canvas=glist_getcanvas(x->x_glist);
*************** *** 925,931 ****
/* allocate tables for storing sound and temporary copy */ ! static t_int cooled_allocate(t_cooled *x) { ! t_int fi;
if ( !(x->x_rdata = getbytes( x->x_size*sizeof(float) ) ) ) { --- 915,921 ----
/* allocate tables for storing sound and temporary copy */ ! static int cooled_allocate(t_cooled *x) { ! int fi;
if ( !(x->x_rdata = getbytes( x->x_size*sizeof(float) ) ) ) { *************** *** 970,976 ****
/* allocate tables for storing sound and temporary copy */ ! static t_int cooled_reallocate(t_cooled *x, t_int ioldsize, t_int inewsize) { ! t_int fi, csize; t_float *prdata=x->x_rdata, *pldata=x->x_ldata, *prsemp=x->x_rsemp, *plsemp=x->x_lsemp;
--- 960,966 ----
/* allocate tables for storing sound and temporary copy */ ! static int cooled_reallocate(t_cooled *x, int ioldsize, int inewsize) { ! int fi, csize; t_float *prdata=x->x_rdata, *pldata=x->x_ldata, *prsemp=x->x_rsemp, *plsemp=x->x_lsemp;
*************** *** 1040,1048 **** t_float *rout = (t_float *)(w[3]); t_float *lout = (t_float *)(w[4]); ! t_int is; ! t_int n = (int)(w[5]); /* number of samples */ ! t_int startsamp, endsamp; t_cooled *x = (t_cooled *)(w[6]); ! t_int lreadstart = x->x_readstart, lreadend = x->x_readend;
if ( lreadstart <= lreadend ) --- 1030,1038 ---- t_float *rout = (t_float *)(w[3]); t_float *lout = (t_float *)(w[4]); ! int is; ! int n = (int)(w[5]); /* number of samples */ ! int startsamp, endsamp; t_cooled *x = (t_cooled *)(w[6]); ! int lreadstart = x->x_readstart, lreadend = x->x_readend;
if ( lreadstart <= lreadend ) *************** *** 1122,1126 **** static void cooled_stereo(t_cooled *x) { ! t_int si;
if (x->x_allocate) { --- 1112,1116 ---- static void cooled_stereo(t_cooled *x) { ! int si;
if (x->x_allocate) { *************** *** 1227,1231 **** { char *operator = soperator->s_name; ! t_int ci; t_float fvalue, freadstart = x->x_readstart, freadend = x->x_readend;
--- 1217,1221 ---- { char *operator = soperator->s_name; ! int ci; t_float fvalue, freadstart = x->x_readstart, freadend = x->x_readend;