aboutsummaryrefslogtreecommitdiff
path: root/pd/src
diff options
context:
space:
mode:
authorMiller Puckette <millerpuckette@users.sourceforge.net>2004-11-11 04:58:21 +0000
committerMiller Puckette <millerpuckette@users.sourceforge.net>2004-11-11 04:58:21 +0000
commit6e17759e69d5d51bafebc4e5e44e1ee5dbaf58fe (patch)
treeae58db56873db98e0255a0a33c431bb14b51192b /pd/src
parent7ca685c4bc0b2881555f317db6408ae488fe05aa (diff)
More bug fixes... version 0.38 test10.
svn path=/trunk/; revision=2259
Diffstat (limited to 'pd/src')
-rw-r--r--pd/src/d_array.c21
-rw-r--r--pd/src/makefile8
-rw-r--r--pd/src/s_audio_pablio.c2
-rw-r--r--pd/src/s_entry.c62
-rw-r--r--pd/src/s_main.c3
-rw-r--r--pd/src/u_main.tk33
6 files changed, 50 insertions, 79 deletions
diff --git a/pd/src/d_array.c b/pd/src/d_array.c
index 38beff5d..d9f9d280 100644
--- a/pd/src/d_array.c
+++ b/pd/src/d_array.c
@@ -792,6 +792,7 @@ typedef struct _tabreceive
{
t_object x_obj;
float *x_vec;
+ int x_vecsize;
t_symbol *x_arrayname;
} t_tabreceive;
@@ -801,7 +802,15 @@ static t_int *tabreceive_perform(t_int *w)
t_float *out = (t_float *)(w[2]);
int n = w[3];
t_float *from = x->x_vec;
- if (from) while (n--) *out++ = *from++;
+ if (from)
+ {
+ int vecsize = x->x_vecsize;
+ while (vecsize--)
+ *out++ = *from++;
+ vecsize = n - x->x_vecsize;
+ while (vecsize--)
+ *out++ = 0;
+ }
else while (n--) *out++ = 0;
return (w+4);
}
@@ -809,21 +818,19 @@ static t_int *tabreceive_perform(t_int *w)
static void tabreceive_dsp(t_tabreceive *x, t_signal **sp)
{
t_garray *a;
- int vecsize;
-
if (!(a = (t_garray *)pd_findbyclass(x->x_arrayname, garray_class)))
{
if (*x->x_arrayname->s_name)
pd_error(x, "tabsend~: %s: no such array", x->x_arrayname->s_name);
}
- else if (!garray_getfloatarray(a, &vecsize, &x->x_vec))
+ else if (!garray_getfloatarray(a, &x->x_vecsize, &x->x_vec))
pd_error(x, "%s: bad template for tabreceive~", x->x_arrayname->s_name);
else
{
- int n = sp[0]->s_n;
- if (n < vecsize) vecsize = n;
+ if (x->x_vecsize > sp[0]->s_n)
+ x->x_vecsize = sp[0]->s_n;
garray_usedindsp(a);
- dsp_add(tabreceive_perform, 3, x, sp[0]->s_vec, vecsize);
+ dsp_add(tabreceive_perform, 3, x, sp[0]->s_vec, sp[0]->s_n);
}
}
diff --git a/pd/src/makefile b/pd/src/makefile
index 3db69e30..06723100 100644
--- a/pd/src/makefile
+++ b/pd/src/makefile
@@ -10,14 +10,14 @@ GFLAGS = -DINSTALL_PREFIX=\"$(INSTALL_PREFIX)\"
MANDIR = ${prefix}/man
-MORECFLAGS = -DDL_OPEN -DPA_USE_OSS -DPA_LITTLE_ENDIAN -DUNIX -DUNISTD -DUSEAPI_OSS -I../portaudio/pa_common -I../portaudio/pablio -I../portaudio/portmidi-macosx -fno-strict-aliasing
+MORECFLAGS = -DDL_OPEN -DPA_USE_OSS -DPA_LITTLE_ENDIAN -DUNIX -DUNISTD -DUSEAPI_OSS -I../portaudio/pa_common -I../portaudio/pablio -I../portaudio/portmidi-macosx -fno-strict-aliasing -DPA_USE_ALSA -DUSEAPI_ALSA
INCLUDE = -I.
GINCLUDE = $(INCLUDE)
GLIB = -ltk8.4 -ltcl8.4 -lX11 -L/usr/X11R6/lib -lrt
-LDFLAGS = -Wl,-export-dynamic
-LIB = -ldl -lpthread
+LDFLAGS = -Wl,-export-dynamic -lasound
+LIB = -ldl -lpthread -lasound
OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
WARN_CFLAGS = -Wall -W -Wstrict-prototypes \
@@ -28,7 +28,7 @@ CFLAGS = -Werror $(ARCH_CFLAGS) $(WARN_CFLAGS) $(OPT_CFLAGS) $(MORECFLAGS)
# the sources
-SYSSRC += s_midi_oss.c s_audio_oss.c
+SYSSRC += s_midi_oss.c s_audio_oss.c s_audio_alsa.c s_audio_alsamm.c
SRC = g_canvas.c g_graph.c g_text.c g_rtext.c g_array.c g_template.c g_io.c \
g_scalar.c g_traversal.c g_guiconnect.c g_readwrite.c g_editor.c \
diff --git a/pd/src/s_audio_pablio.c b/pd/src/s_audio_pablio.c
index e6c1a272..03ef42b3 100644
--- a/pd/src/s_audio_pablio.c
+++ b/pd/src/s_audio_pablio.c
@@ -1,5 +1,5 @@
/*
- * $Id: s_audio_pablio.c,v 1.3 2004-11-07 04:04:18 millerpuckette Exp $
+ * $Id: s_audio_pablio.c,v 1.4 2004-11-11 04:58:21 millerpuckette Exp $
* pablio.c
* Portable Audio Blocking Input/Output utility.
*
diff --git a/pd/src/s_entry.c b/pd/src/s_entry.c
index e81e45c6..eb49cfc1 100644
--- a/pd/src/s_entry.c
+++ b/pd/src/s_entry.c
@@ -1,78 +1,26 @@
/* In MSW, this is all there is to pd; the rest sits in a "pdlib" dll so
that externs can link back to functions defined in pd. */
-#include <stdio.h>
-
int sys_main(int argc, char **argv);
#ifdef MSW
#include <windows.h>
#include <stdio.h>
-#include <malloc.h>
-
-#define MAXARGS 1024
-#define MAXARGLEN 1024
-/* jsarlo { */
-int tokenizeCommandLineString(char *clString, char **tokens)
-{
- int i, charCount = 0;
- int tokCount= 0;
- int quoteOpen = 0;
-
- for (i = 0; i < (int)strlen(clString); i++)
- {
- if (clString[i] == '"')
- {
- quoteOpen = !quoteOpen;
- }
- else if (clString[i] == ' ' && !quoteOpen)
- {
- tokens[tokCount][charCount] = 0;
- tokCount++;
- charCount = 0;
- }
- else
- {
- tokens[tokCount][charCount] = clString[i];
- charCount++;
- }
- }
- tokens[tokCount][charCount] = 0;
- tokCount++;
- return tokCount;
-}
-
-int WINAPI WinMain(HINSTANCE hInstance,
+int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
-{
- int i, argc;
- char *argv[MAXARGS];
-
- __try
- {
- for (i = 0; i < MAXARGS; i++)
- {
- argv[i] = (char *)malloc(MAXARGLEN * sizeof(char));
- }
- GetModuleFileName(NULL, argv[0], MAXARGLEN);
- argc = tokenizeCommandLineString(lpCmdLine, argv + 1) + 1;
- sys_main(argc, argv);
- for (i = 0; i < MAXARGS; i++)
- {
- free(argv[i]);
- }
+{
+ __try {
+ sys_main(__argc,__argv);
}
__finally
- {
+ {
printf("caught an exception; stopping\n");
}
}
-/* } jsarlo */
-
#else /* not MSW */
int main(int argc, char **argv)
{
diff --git a/pd/src/s_main.c b/pd/src/s_main.c
index 056f5bbf..53a5d39f 100644
--- a/pd/src/s_main.c
+++ b/pd/src/s_main.c
@@ -7,7 +7,7 @@
* 1311:forum::für::umläute:2001
*/
-char pd_version[] = "Pd version 0.38 TEST9\n";
+char pd_version[] = "Pd version 0.38 TEST10\n";
char pd_compiletime[] = __TIME__;
char pd_compiledate[] = __DATE__;
@@ -765,6 +765,7 @@ int sys_argparse(int argc, char **argv)
else if (!strcmp(*argv, "-stderr"))
{
sys_printtostderr = 1;
+ fprintf(stderr, "set it\n");
argc--; argv++;
}
else if (!strcmp(*argv, "-guicmd") && argc > 1)
diff --git a/pd/src/u_main.tk b/pd/src/u_main.tk
index 8d32f954..5320acdc 100644
--- a/pd/src/u_main.tk
+++ b/pd/src/u_main.tk
@@ -3,13 +3,10 @@
# set pd_nt (bad name) 0 for unix, 1 for microsoft, and 2 for Mac OSX.
if { $tcl_platform(platform) == "windows" } {
set pd_nt 1
- puts stderr {Configuring for Windows}
} elseif { $tcl_platform(os) == "Darwin" } {
set pd_nt 2
- puts stderr {Configuring for MacOS X}
} else {
set pd_nt 0
- puts stderr {Configuring for UNIX}
}
# Copyright (c) 1997-1999 Miller Puckette.
@@ -969,10 +966,20 @@ proc pdtk_canvas_new {name width height geometry editable} {
bind $name.c <Button> {pdtk_canvas_click %W %x %y %b 0}
bind $name.c <Shift-Button> {pdtk_canvas_click %W %x %y %b 1}
bind $name.c <Control-Shift-Button> {pdtk_canvas_click %W %x %y %b 3}
- bind $name.c <Alt-Button> {pdtk_canvas_click %W %x %y %b 4}
- bind $name.c <Alt-Shift-Button> {pdtk_canvas_click %W %x %y %b 5}
- bind $name.c <Alt-Control-Button> {pdtk_canvas_click %W %x %y %b 6}
- bind $name.c <Alt-Control-Shift-Button> {pdtk_canvas_click %W %x %y %b 7}
+ # Alt key is called Option on the Mac
+ if {$pd_nt == 2} {
+ bind $name.c <Option-Button> {pdtk_canvas_click %W %x %y %b 4}
+ bind $name.c <Option-Shift-Button> {pdtk_canvas_click %W %x %y %b 5}
+ bind $name.c <Option-Control-Button> {pdtk_canvas_click %W %x %y %b 6}
+ bind $name.c <Option-Control-Shift-Button> \
+ {pdtk_canvas_click %W %x %y %b 7}
+ } else {
+ bind $name.c <Alt-Button> {pdtk_canvas_click %W %x %y %b 4}
+ bind $name.c <Alt-Shift-Button> {pdtk_canvas_click %W %x %y %b 5}
+ bind $name.c <Alt-Control-Button> {pdtk_canvas_click %W %x %y %b 6}
+ bind $name.c <Alt-Control-Shift-Button> \
+ {pdtk_canvas_click %W %x %y %b 7}
+ }
global pd_nt
# button 2 is the right button on Mac; on other platforms it's button 3.
if {$pd_nt == 2} {
@@ -993,7 +1000,11 @@ proc pdtk_canvas_new {name width height geometry editable} {
bind $name.c <ButtonRelease> {pdtk_canvas_mouseup %W %x %y %b}
bind $name.c <Control-Key> {pdtk_canvas_ctrlkey %W %K 0}
bind $name.c <Control-Shift-Key> {pdtk_canvas_ctrlkey %W %K 1}
- bind $name.c <Alt-Key> {pdtk_canvas_altkey %W %K %A}
+ if {$pd_nt == 2} {
+ bind $name.c <Option-Key> {pdtk_canvas_altkey %W %K %A}
+ } else {
+ bind $name.c <Alt-Key> {pdtk_canvas_altkey %W %K %A}
+ }
# bind $name.c <Mod1-Key> {puts stderr [concat mod1 %W %K %A]}
if {$pd_nt == 2} {
bind $name.c <Mod1-Key> {pdtk_canvas_ctrlkey %W %K 0}
@@ -1003,7 +1014,11 @@ proc pdtk_canvas_new {name width height geometry editable} {
bind $name.c <Shift-Key> {pdtk_canvas_key %W %K %A 1}
bind $name.c <KeyRelease> {pdtk_canvas_keyup %W %K %A}
bind $name.c <Motion> {pdtk_canvas_motion %W %x %y 0}
- bind $name.c <Alt-Motion> {pdtk_canvas_motion %W %x %y 4}
+ if {$pd_nt == 2} {
+ bind $name.c <Option-Motion> {pdtk_canvas_motion %W %x %y 4}
+ } else {
+ bind $name.c <Alt-Motion> {pdtk_canvas_motion %W %x %y 4}
+ }
bind $name.c <Map> {pdtk_canvas_map %W}
bind $name.c <Unmap> {pdtk_canvas_unmap %W}
focus $name.c