aboutsummaryrefslogtreecommitdiff
path: root/pd/extra/pd~
diff options
context:
space:
mode:
Diffstat (limited to 'pd/extra/pd~')
-rw-r--r--pd/extra/pd~/GNUmakefile.am31
-rw-r--r--pd/extra/pd~/makefile3
-rw-r--r--pd/extra/pd~/pdsched.c25
-rw-r--r--pd/extra/pd~/pd~.c9
4 files changed, 61 insertions, 7 deletions
diff --git a/pd/extra/pd~/GNUmakefile.am b/pd/extra/pd~/GNUmakefile.am
new file mode 100644
index 00000000..6110c88c
--- /dev/null
+++ b/pd/extra/pd~/GNUmakefile.am
@@ -0,0 +1,31 @@
+## Makefile.am -- Process this file with automake to produce Makefile.in
+
+NAME=pd~
+
+PATCHES = pd~-help.pd pd~-subprocess.pd
+OTHERDATA =
+
+pd__la_SOURCES = pd~.c
+pdsched_la_SOURCES = pdsched.c
+
+external_LTLIBRARIES = pd~.la pdsched.la
+dist_external_DATA = $(PATCHES) $(OTHERDATA)
+
+
+
+
+AUTOMAKE_OPTIONS = foreign
+AM_CPPFLAGS = -I$(top_srcdir)/src -DPD
+AM_CFLAGS = @ARCH_CFLAGS@
+AM_LIBS = $(LIBM)
+AM_LDFLAGS = -module -avoid-version -shared @ARCH_LDFLAGS@ -shrext .@EXTERNAL_EXTENSION@ -L$(top_srcdir)/src
+
+externaldir = $(pkglibdir)/extra/$(NAME)
+
+
+if MINGW
+AM_LIBS += -lpd
+endif
+
+libtool: $(LIBTOOL_DEPS)
+ $(SHELL) ./config.status --recheck
diff --git a/pd/extra/pd~/makefile b/pd/extra/pd~/makefile
index d069c73d..5fc5d26b 100644
--- a/pd/extra/pd~/makefile
+++ b/pd/extra/pd~/makefile
@@ -1,7 +1,7 @@
NAME=pd~
CSYM=pd_tilde
-include ../makefile
+include ../makefile.subdir
pd_linux: pdsched.pd_linux
@@ -11,5 +11,4 @@ d_ppc: pdsched.d_ppc
pdsched.pd_linux: pdsched.c
$(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
$(CC) -shared -o $*.pd_linux $*.o -lc -lm
- strip --strip-unneeded $*.pd_linux
rm -f $*.o
diff --git a/pd/extra/pd~/pdsched.c b/pd/extra/pd~/pdsched.c
index 7efe49a9..6c6060c1 100644
--- a/pd/extra/pd~/pdsched.c
+++ b/pd/extra/pd~/pdsched.c
@@ -17,15 +17,33 @@ outputs audio and messages. */
#define BUFSIZE 65536
static char inbuf[BUFSIZE];
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
+void glob_watchdog(t_pd *dummy);
+
+static void pollwatchdog( void)
+{
+ static int sched_diddsp, sched_nextpingtime;
+ sched_diddsp++;
+ if (sys_nogui && sys_hipriority && (sched_diddsp - sched_nextpingtime > 0))
+ {
+ glob_watchdog(0);
+ /* ping every 2 seconds */
+ sched_nextpingtime = sched_diddsp +
+ 2 * (int)(sys_dacsr /(double)sys_schedblocksize);
+ }
+}
+#endif
+
int pd_extern_sched(char *flags)
{
int naudioindev, audioindev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV];
int naudiooutdev, audiooutdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV];
- int i, j, rate, advance, callback, chin, chout, fill = 0, c;
+ int i, j, rate, advance, callback, chin, chout, fill = 0, c, blocksize;
t_binbuf *b = binbuf_new();
sys_get_audio_params(&naudioindev, audioindev, chindev,
- &naudiooutdev, audiooutdev, choutdev, &rate, &advance, &callback);
+ &naudiooutdev, audiooutdev, choutdev, &rate, &advance, &callback,
+ &blocksize);
chin = (naudioindev < 1 ? 0 : chindev[0]);
chout = (naudiooutdev < 1 ? 0 : choutdev[0]);
@@ -57,6 +75,9 @@ int pd_extern_sched(char *flags)
*fp++ = 0;
sched_tick(sys_time+sys_time_per_dsp_tick);
sys_pollgui();
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
+ pollwatchdog();
+#endif
printf(";\n");
for (i = chout*DEFDACBLKSIZE, fp = sys_soundout; i--; fp++)
{
diff --git a/pd/extra/pd~/pd~.c b/pd/extra/pd~/pd~.c
index 165065f8..dc2eca4c 100644
--- a/pd/extra/pd~/pd~.c
+++ b/pd/extra/pd~/pd~.c
@@ -15,7 +15,7 @@
#include <sys/stat.h>
#include <sys/wait.h>
-#ifdef NT
+#ifdef _MSC_VER
#pragma warning (disable: 4305 4244)
#endif
@@ -47,7 +47,7 @@ char *class_gethelpdir(t_class *c);
#endif
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
#ifdef __x86_64__
static char pd_tilde_dllextent[] = ".l_ia64",
pd_tilde_dllextent2[] = ".pd_linux";
@@ -60,6 +60,9 @@ static char pd_tilde_dllextent[] = ".l_i386",
static char pd_tilde_dllextent[] = ".d_fat",
pd_tilde_dllextent2[] = ".pd_darwin";
#endif
+#if defined(_WIN32) || defined(__CYGWIN__)
+static char pd_tilde_dllextent[] = ".m_i386", pd_tilde_dllextent2[] = ".dll";
+#endif
/* ------------------------ pd_tilde~ ----------------------------- */
@@ -512,7 +515,7 @@ static void *pd_tilde_new(t_symbol *s, int argc, t_atom *argv)
int ninsig = 2, noutsig = 2, j, fifo = 5;
float sr = sys_getsr();
t_sample **g;
- t_symbol *pddir = sys_guidir,
+ t_symbol *pddir = sys_libdir,
*scheddir = gensym(class_gethelpdir(pd_tilde_class));
/* fprintf(stderr, "pd %s, sched %s\n", pddir->s_name, scheddir->s_name); */
while (argc > 0)