Revision: 10340 http://pure-data.svn.sourceforge.net/pure-data/?rev=10340&view=rev Author: fzotter Date: 2008-10-23 08:33:15 +0000 (Thu, 23 Oct 2008)
Log Message: ----------- made changes to account for iemmatrix structures in the new files. mtx_pack~ crashes (!)
Modified Paths: -------------- trunk/externals/iem/iemmatrix/src/mtx_dispersive_dline.c trunk/externals/iem/iemmatrix/src/mtx_pack~.c trunk/externals/iem/iemmatrix/src/mtx_sndfileread.c
Modified: trunk/externals/iem/iemmatrix/src/mtx_dispersive_dline.c =================================================================== --- trunk/externals/iem/iemmatrix/src/mtx_dispersive_dline.c 2008-10-22 12:52:33 UTC (rev 10339) +++ trunk/externals/iem/iemmatrix/src/mtx_dispersive_dline.c 2008-10-23 08:33:15 UTC (rev 10340) @@ -39,7 +39,7 @@
*/
-#include "m_pd.h" +#include "iemmatrix.h"
static t_class *mtx_dispersive_dline_class;
@@ -240,3 +240,8 @@
class_addmethod(mtx_dispersive_dline_class, (t_method)mtx_dispersive_dline_helper, gensym("help"), 0); } + +void iemtx_dispersive_dline_setup(void) +{ + mtx_dispersive_dline_setup(); +}
Modified: trunk/externals/iem/iemmatrix/src/mtx_pack~.c =================================================================== --- trunk/externals/iem/iemmatrix/src/mtx_pack~.c 2008-10-22 12:52:33 UTC (rev 10339) +++ trunk/externals/iem/iemmatrix/src/mtx_pack~.c 2008-10-23 08:33:15 UTC (rev 10340) @@ -1,4 +1,4 @@ -#include "m_pd.h" +#include "iemmatrix.h" #define MTX_PACK_MAXCHANNELS 200
static t_class *mtx_pack_tilde_class; @@ -77,4 +77,9 @@ class_addmethod (mtx_pack_tilde_class, (t_method) mTxPackTildeDsp, gensym("dsp"),0); }
+void iemtx_pack__setup(void) +{ + mtx_pack_tilde_setup(); +}
+
Modified: trunk/externals/iem/iemmatrix/src/mtx_sndfileread.c =================================================================== --- trunk/externals/iem/iemmatrix/src/mtx_sndfileread.c 2008-10-22 12:52:33 UTC (rev 10339) +++ trunk/externals/iem/iemmatrix/src/mtx_sndfileread.c 2008-10-23 08:33:15 UTC (rev 10340) @@ -1,6 +1,7 @@ -#include <stdio.h> -#include <sndfile.h> -#include "m_pd.h" +#ifdef HAVE_SNDFILE_H +# include <sndfile.h> +#endif +#include "iemmatrix.h"
#ifdef __WIN32__ # include <io.h> @@ -103,8 +104,10 @@ typedef struct mtx_sndfileread { t_object x_ob; +#ifdef HAVE_SNDFILE_H SNDFILE *x_sndfileread; SF_INFO x_sfinfo; +#endif t_outlet *x_message_outlet; t_outlet *x_readybang_outlet; t_canvas *x_canvas; @@ -117,9 +120,11 @@
static void mtx_sndfileread_close (t_mtx_sndfileread *x) { +#ifdef HAVE_SNDFILE_H if(x->x_sndfileread) sf_close (x->x_sndfileread); x->x_sndfileread=0; +#endif
if(x->x_outlist) freebytes(x->x_outlist, sizeof(t_atom)*(2+x->num_chan*x->num_frames)); @@ -132,6 +137,7 @@
static void mtx_sndfileread_open (t_mtx_sndfileread *x, t_symbol *s, t_symbol*type) { +#ifdef HAVE_SNDFILE_H char filenamebuf[MAXPDSTRING], *filenamebufptr; char*dirname=canvas_getdir(x->x_canvas)->s_name; int fd; @@ -150,10 +156,14 @@ return; } x->num_chan = x->x_sfinfo.channels; +#else + pd_error(x,"mtx_sndfileread: compiled without libsndfile: no file opened!"); +#endif }
static void mtx_sndfileread_frame (t_mtx_sndfileread *x) { +#ifdef HAVE_SNDFILE_H int n; t_atom *ptr;
@@ -189,11 +199,15 @@ } outlet_anything(x->x_message_outlet,gensym("matrix"),x->num_chan+2,x->x_outlist); } +#else + pd_error(x,"mtx_sndfileread: compiled without libsndfile: no file opened for reading!"); +#endif
}
static void mtx_sndfileread_frames (t_mtx_sndfileread *x, t_float f) { +#ifdef HAVE_SNDFILE_H int n,n2,c; sf_count_t frames_read; int num_frames=(int)f; @@ -239,7 +253,9 @@ outlet_bang(x->x_readybang_outlet); } } - +#else + pd_error(x,"mtx_sndfileread: compiled without libsndfile: no file opened!"); +#endif }
static void mtx_sndfileread_free (t_mtx_sndfileread *x) @@ -254,7 +270,11 @@ t_mtx_sndfileread *x = (t_mtx_sndfileread *)pd_new(mtx_sndfileread_class); x->x_message_outlet = outlet_new(&x->x_ob, &s_list); x->x_readybang_outlet = outlet_new(&x->x_ob, &s_bang); +#ifdef HAVE_SNDFILE_H x->x_sndfileread=0; +#else + pd_error(x,"mtx_sndfileread won't work: compiled without libsndfile!"); +#endif x->num_chan=0; x->num_frames=0; x->x_canvas = canvas_getcurrent(); @@ -269,6 +289,13 @@ class_addmethod(mtx_sndfileread_class, (t_method)mtx_sndfileread_close, gensym("close"), A_NULL, 0); class_addbang(mtx_sndfileread_class, (t_method)mtx_sndfileread_frame); class_addfloat(mtx_sndfileread_class, (t_method)mtx_sndfileread_frames); +#ifndef HAVE_SNDFILE_H + post("mtx_sndfileread won't work: compiled without libsndfile!"); +#endif +}
+void iemtx_sndfileread_setup (void) +{ + mtx_sndfileread_setup(); }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.