aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--blinkenlights/blinkenlights.c3
-rw-r--r--cooled~/cooled~.c11
-rw-r--r--countund/countund.c3
-rw-r--r--exciter/exciter.c20
-rw-r--r--filterbank~/filterbank~.c1
-rw-r--r--probalizer/probalizer.c1
-rw-r--r--randomblock~/randomblock~.c3
-rw-r--r--scratcher~/scratcher~.c29
-rw-r--r--sonogram~/sonogram~-yves.c7
-rw-r--r--sonogram~/sonogram~.c7
10 files changed, 66 insertions, 19 deletions
diff --git a/blinkenlights/blinkenlights.c b/blinkenlights/blinkenlights.c
index 4281a41..b99d57d 100644
--- a/blinkenlights/blinkenlights.c
+++ b/blinkenlights/blinkenlights.c
@@ -40,9 +40,6 @@
#endif
#include <ctype.h>
#include <unistd.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
#include <time.h>
#include <sys/time.h>
diff --git a/cooled~/cooled~.c b/cooled~/cooled~.c
index 51e97f3..1e67ad3 100644
--- a/cooled~/cooled~.c
+++ b/cooled~/cooled~.c
@@ -43,7 +43,11 @@
#include <unistd.h>
#endif
#ifdef NT
-#define M_PI 3.14159265358979323846
+#include <windows.h>
+int usleep (unsigned int us) {
+ Sleep((long)(us/1000.));
+ return 0;
+}
#endif
#include <math.h>
@@ -1363,8 +1367,13 @@ void cooled_tilde_setup(void)
cooled_widgetbehavior.w_deletefn = cooled_delete;
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 );
class_addmethod(cooled_class, (t_method)cooled_dsp, gensym("dsp"), A_NULL);
diff --git a/countund/countund.c b/countund/countund.c
index ac21f8e..0d554a2 100644
--- a/countund/countund.c
+++ b/countund/countund.c
@@ -37,9 +37,6 @@
#endif
#include <ctype.h>
#include <unistd.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
#include <time.h>
#include <sys/time.h>
diff --git a/exciter/exciter.c b/exciter/exciter.c
index 0faf3d4..16c584f 100644
--- a/exciter/exciter.c
+++ b/exciter/exciter.c
@@ -37,8 +37,6 @@
#include <math.h>
#include <ctype.h>
#include <time.h>
-#include <sys/time.h>
-
#include <m_pd.h>
#include "m_imp.h"
@@ -48,7 +46,10 @@
#ifdef NT
#include <io.h>
+#include <winsock2.h>
+#include <sys/timeb.h>
#else
+#include <sys/time.h>
#include <unistd.h>
#endif
@@ -687,16 +688,27 @@ static t_int *exciter_perform(t_int *w)
t_int ei, gi;
t_int gstart, gend;
t_exciter* x = (t_exciter*)(w[1]);
+#ifdef NT
+ time_t et;
+ struct _timeb tv;
+#else
struct timeval tv;
struct timezone tz;
+#endif
long long looptime = 0L;
double preltime = x->x_reltime;
if ( x->x_started )
{
// get current time in ms
- gettimeofday( &tv, &tz );
- looptime = tv.tv_sec*1000 + tv.tv_usec/1000;
+#ifdef NT
+ time( &et );
+ _ftime( &tv );
+ looptime = et*1000 + tv.millitm;
+#else
+ gettimeofday( &tv, &tz );
+ looptime = tv.tv_sec*1000 + tv.tv_usec/1000;
+#endif
if ( x->x_plooptime == 0L )
{
x->x_plooptime = looptime;
diff --git a/filterbank~/filterbank~.c b/filterbank~/filterbank~.c
index 2ef8dad..09dcb8f 100644
--- a/filterbank~/filterbank~.c
+++ b/filterbank~/filterbank~.c
@@ -35,6 +35,7 @@
#ifdef NT
#include <io.h>
+#define random rand
#else
#include <unistd.h>
#endif
diff --git a/probalizer/probalizer.c b/probalizer/probalizer.c
index cae6178..973e1d2 100644
--- a/probalizer/probalizer.c
+++ b/probalizer/probalizer.c
@@ -43,6 +43,7 @@
#ifdef NT
#include <io.h>
+#define random rand
#else
#include <unistd.h>
#endif
diff --git a/randomblock~/randomblock~.c b/randomblock~/randomblock~.c
index c5ca687..9fbbc2c 100644
--- a/randomblock~/randomblock~.c
+++ b/randomblock~/randomblock~.c
@@ -37,9 +37,6 @@
#endif
#include <ctype.h>
#include <unistd.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
#include <time.h>
#include <sys/time.h>
diff --git a/scratcher~/scratcher~.c b/scratcher~/scratcher~.c
index 1045ff0..87be8a2 100644
--- a/scratcher~/scratcher~.c
+++ b/scratcher~/scratcher~.c
@@ -48,7 +48,8 @@
#include <unistd.h>
#endif
#ifdef NT
-#define M_PI 3.14159265358979323846
+#include <winsock2.h>
+#include <sys/timeb.h>
#endif
#include <math.h>
@@ -325,8 +326,13 @@ static void scratcher_displace(t_gobj *z, t_glist *glist, int dx, int dy)
static void scratcher_motion(t_scratcher *x, t_floatarg dx, t_floatarg dy)
{
+#ifdef NT
+ time_t et;
+ struct _timeb tv;
+#else
struct timeval tv;
struct timezone tz;
+#endif
// post( "scratcher_motion dx=%f dy=%f", dx, dy );
@@ -334,8 +340,14 @@ static void scratcher_motion(t_scratcher *x, t_floatarg dx, t_floatarg dy)
x->x_mousemoved = 1;
// get current time in ms
+#ifdef NT
+ time( &et );
+ _ftime( &tv );
+ x->x_lastmovetime = et*1000 + tv.millitm;
+#else
gettimeofday( &tv, &tz );
x->x_lastmovetime = tv.tv_sec*1000 + tv.tv_usec/1000;
+#endif
// post( "scratcher~ : move time : %ld", x->x_lastmovetime );
if ( x->x_showspeed )
@@ -477,8 +489,13 @@ static t_int *scratcher_perform(t_int *w)
t_float *out = (t_float *)(w[2]);
t_int n = (int)(w[3]); /* number of samples */
t_scratcher *x = (t_scratcher *)(w[4]);
+#ifdef NT
+ time_t et;
+ struct _timeb tv;
+#else
struct timeval tv;
struct timezone tz;
+#endif
long long perftime = 0L;
x->x_readspeed += x->x_speedinc;
@@ -497,8 +514,14 @@ static t_int *scratcher_perform(t_int *w)
if ( x->x_mousemoved )
{
// get current time in ms
- gettimeofday( &tv, &tz );
- perftime = tv.tv_sec*1000 + tv.tv_usec/1000;
+#ifdef NT
+ time( &et );
+ _ftime( &tv );
+ perftime = et*1000 + tv.millitm;
+#else
+ gettimeofday( &tv, &tz );
+ perftime = tv.tv_sec*1000 + tv.tv_usec/1000;
+#endif
if ( perftime - x->x_lastmovetime > SCRATCHER_MOVE_TIMEOUT )
{
// post( "scratcher~ : mouse timeout (m=%ld)", perftime );
diff --git a/sonogram~/sonogram~-yves.c b/sonogram~/sonogram~-yves.c
index 02e5f47..df957b1 100644
--- a/sonogram~/sonogram~-yves.c
+++ b/sonogram~/sonogram~-yves.c
@@ -46,7 +46,12 @@
#include <unistd.h>
#endif
#ifdef NT
-#define M_PI 3.14159265358979323846
+#define random rand
+#include <windows.h>
+static int usleep (unsigned int us) {
+ Sleep((long)(us/1000.));
+ return 0;
+}
#endif
#include <math.h>
diff --git a/sonogram~/sonogram~.c b/sonogram~/sonogram~.c
index a0b8472..7a41da7 100644
--- a/sonogram~/sonogram~.c
+++ b/sonogram~/sonogram~.c
@@ -44,7 +44,12 @@
#include <unistd.h>
#endif
#ifdef NT
-#define M_PI 3.14159265358979323846
+#define random rand
+#include <windows.h>
+static int usleep (unsigned int us) {
+ Sleep((long)(us/1000.));
+ return 0;
+}
#endif
#include <math.h>