aboutsummaryrefslogtreecommitdiff
path: root/pd/src
diff options
context:
space:
mode:
authorMiller Puckette <millerpuckette@users.sourceforge.net>2006-10-04 19:35:06 +0000
committerMiller Puckette <millerpuckette@users.sourceforge.net>2006-10-04 19:35:06 +0000
commitc65adb37b42c1c2134fd09d90ed7c6ced6817ae0 (patch)
tree381d7d125c72f102397031ec8cca2e812ac17f2e /pd/src
parentfe06559c2970160ea141bbfc42f0ac21598321b1 (diff)
release 0.40-0
svn path=/trunk/; revision=6076
Diffstat (limited to 'pd/src')
-rw-r--r--pd/src/g_editor.c10
-rw-r--r--pd/src/g_text.c6
-rw-r--r--pd/src/m_binbuf.c2
-rw-r--r--pd/src/m_pd.h2
-rw-r--r--pd/src/notes.txt4
-rw-r--r--pd/src/s_audio.c19
-rw-r--r--pd/src/s_audio_pablio.c3
-rw-r--r--pd/src/s_main.c5
-rw-r--r--pd/src/s_midi.c4
-rw-r--r--pd/src/u_main.tk43
10 files changed, 59 insertions, 39 deletions
diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c
index 8b146fc1..cbc9e1d7 100644
--- a/pd/src/g_editor.c
+++ b/pd/src/g_editor.c
@@ -1027,12 +1027,6 @@ static void canvas_done_popup(t_canvas *x, float which, float xpos, float ypos)
#define ALTMOD 4
#define RIGHTCLICK 8
-/* on one-button-mouse machines, you can use double click to
- mean right click (which gets the popup menu.) Do this for Mac. */
-#ifdef __APPLE__
-#define SIMULATERIGHTCLICK
-#endif
-
static double canvas_upclicktime;
static int canvas_upx, canvas_upy;
#define DCLICKINTERVAL 0.25
@@ -1067,11 +1061,7 @@ void canvas_doclick(t_canvas *x, int xpos, int ypos, int which,
if (doit && !runmode && xpos == canvas_upx && ypos == canvas_upy &&
sys_getrealtime() - canvas_upclicktime < DCLICKINTERVAL)
-#ifdef SIMULATERIGHTCLICK
- rightclick = 1;
-#else
doublemod = 1;
-#endif
x->gl_editor->e_lastmoved = 0;
if (doit)
{
diff --git a/pd/src/g_text.c b/pd/src/g_text.c
index a146ae91..fa28f70e 100644
--- a/pd/src/g_text.c
+++ b/pd/src/g_text.c
@@ -359,7 +359,11 @@ static void message_adddollar(t_message *x, t_floatarg f)
static void message_adddollsym(t_message *x, t_symbol *s)
{
t_atom a;
- SETDOLLSYM(&a, s);
+ char buf[MAXPDSTRING];
+ buf[0] = '$';
+ strncpy(buf+1, s->s_name, MAXPDSTRING-2);
+ buf[MAXPDSTRING-1] = 0;
+ SETDOLLSYM(&a, gensym(buf));
binbuf_add(x->m_text.te_binbuf, 1, &a);
glist_retext(x->m_glist, &x->m_text);
}
diff --git a/pd/src/m_binbuf.c b/pd/src/m_binbuf.c
index 3d417560..e12bad5f 100644
--- a/pd/src/m_binbuf.c
+++ b/pd/src/m_binbuf.c
@@ -359,7 +359,7 @@ void binbuf_restore(t_binbuf *x, int argc, t_atom *argv)
if (!strcmp(str, ";")) SETSEMI(ap);
else if (!strcmp(str, ",")) SETCOMMA(ap);
else if ((str2 = strchr(str, '$')) && str2[1] >= '0'
- & str2[1] <= '9')
+ && str2[1] <= '9')
{
int dollsym = 0;
if (*str != '$')
diff --git a/pd/src/m_pd.h b/pd/src/m_pd.h
index e76b541e..d733a6cd 100644
--- a/pd/src/m_pd.h
+++ b/pd/src/m_pd.h
@@ -11,7 +11,7 @@ extern "C" {
#define PD_MAJOR_VERSION 0
#define PD_MINOR_VERSION 40
#define PD_BUGFIX_VERSION 0
-#define PD_TEST_VERSION "test08"
+#define PD_TEST_VERSION ""
/* old name for "MSW" flag -- we have to take it for the sake of many old
"nmakefiles" for externs, which will define NT and not MSW */
diff --git a/pd/src/notes.txt b/pd/src/notes.txt
index bdf362bb..363741f9 100644
--- a/pd/src/notes.txt
+++ b/pd/src/notes.txt
@@ -1,5 +1,9 @@
---------------- dolist --------------------
check bug reports on sourceforge
+double-click fix on mac?
+http://sourceforge.net/tracker/index.php?
+func=detail&aid=1564617&group_id=55736&atid=478072
+
PC device counting problem (first device invoked by -audiodev 0)
test:
diff --git a/pd/src/s_audio.c b/pd/src/s_audio.c
index 623b073b..f33a135b 100644
--- a/pd/src/s_audio.c
+++ b/pd/src/s_audio.c
@@ -607,11 +607,6 @@ static void audio_getdevs(char *indevlist, int *nindevs,
}
}
-#ifdef MSW
-#define DEVONSET 0 /* microsoft device list starts at 0 (the "mapper"). */
-#else /* (see also MSW ifdef in sys_parsedevlist(), s_main.c) */
-#define DEVONSET 1 /* To agree with command line flags, normally start at 1 */
-#endif
static void sys_listaudiodevs(void )
{
@@ -625,17 +620,23 @@ static void sys_listaudiodevs(void )
post("no audio input devices found");
else
{
- post("input devices:");
+ /* To agree with command line flags, normally start at 1 */
+ /* But microsoft "MMIO" device list starts at 0 (the "mapper"). */
+ /* (see also sys_mmio variable in s_main.c) */
+
+ post("audio input devices:");
for (i = 0; i < nindevs; i++)
- post("%d. %s", i + DEVONSET, indevlist + i * DEVDESCSIZE);
+ post("%d. %s", i + (sys_audioapi != API_MMIO),
+ indevlist + i * DEVDESCSIZE);
}
if (!noutdevs)
post("no audio output devices found");
else
{
- post("output devices:");
+ post("audio output devices:");
for (i = 0; i < noutdevs; i++)
- post("%d. %s", i + DEVONSET, outdevlist + i * DEVDESCSIZE);
+ post("%d. %s", i + (sys_audioapi != API_MMIO),
+ outdevlist + i * DEVDESCSIZE);
}
post("API number %d\n", sys_audioapi);
}
diff --git a/pd/src/s_audio_pablio.c b/pd/src/s_audio_pablio.c
index a7d1a4fe..5827533f 100644
--- a/pd/src/s_audio_pablio.c
+++ b/pd/src/s_audio_pablio.c
@@ -222,10 +222,11 @@ PaError OpenAudioStream( PABLIO_Stream **rwblPtr, double sampleRate,
long doWrite = 0;
PaError err;
PABLIO_Stream *aStream;
- long minNumBuffers;
long numFrames;
#ifdef PA19
PaStreamParameters instreamparams, outstreamparams; /* MSP */
+#else
+ long minNumBuffers;
#endif
/* fprintf(stderr,
diff --git a/pd/src/s_main.c b/pd/src/s_main.c
index dd4e7cb7..a7156c20 100644
--- a/pd/src/s_main.c
+++ b/pd/src/s_main.c
@@ -61,6 +61,7 @@ int sys_midioutdevlist[MAXMIDIOUTDEV] = {1};
char sys_font[100] = "courier"; /* tb: font name */
static int sys_main_srate;
static int sys_main_advance;
+static int sys_listplease;
int sys_externalschedlib;
char sys_externalschedlibname[MAXPDSTRING];
@@ -800,7 +801,7 @@ int sys_argparse(int argc, char **argv)
}
else if (!strcmp(*argv, "-listdev"))
{
- sys_listdevs();
+ sys_listplease = 1;
argc--; argv++;
}
else if (!strcmp(*argv, "-schedlib"))
@@ -920,6 +921,8 @@ static void sys_afterargparse(void)
sys_midiindevlist[i]--;
for (i = 0; i < sys_nmidiout; i++)
sys_midioutdevlist[i]--;
+ if (sys_listplease)
+ sys_listdevs();
/* get the current audio parameters. These are set
by the preferences mechanism (sys_loadpreferences()) or
diff --git a/pd/src/s_midi.c b/pd/src/s_midi.c
index 12c31258..508b3ff2 100644
--- a/pd/src/s_midi.c
+++ b/pd/src/s_midi.c
@@ -576,7 +576,7 @@ void sys_listmididevs(void )
post("no midi input devices found");
else
{
- post("input devices:");
+ post("MIDI input devices:");
for (i = 0; i < nindevs; i++)
post("%d. %s", i+1, indevlist + i * DEVDESCSIZE);
}
@@ -584,7 +584,7 @@ void sys_listmididevs(void )
post("no midi output devices found");
else
{
- post("output devices:");
+ post("MIDI output devices:");
for (i = 0; i < noutdevs; i++)
post("%d. %s", i+DEVONSET, outdevlist + i * DEVDESCSIZE);
}
diff --git a/pd/src/u_main.tk b/pd/src/u_main.tk
index e8a57f10..97fc77b4 100644
--- a/pd/src/u_main.tk
+++ b/pd/src/u_main.tk
@@ -432,15 +432,6 @@ proc menu_doc_browser {dir} {
}
proc doc_make_listbox {base dir count} {
- global pd_guidir
- if {![file isdirectory $dir]} {
- regsub -- $pd_guidir [file dirname $dir] "" subdir
- set file [file tail $dir]
- if { [catch {menu_doc_open $subdir $file} fid] } {
- puts stderr "Could not open $pd_guidir/$subdir/$file\n"
- }
- return;
- }
# check for [file readable]?
if { [info tclversion] >= 8.5 } {
# requires Tcl 8.5 but probably deals with special chars better
@@ -461,14 +452,36 @@ proc doc_make_listbox {base dir count} {
[lsort -dictionary [glob -directory $dir -nocomplain -types {f} -- *]]] {
$current_listbox insert end "[file tail $item][expr {[file isdirectory $item] ? {/} : {}}]"
}
- bind $current_listbox <Button-1> [list doc_navigate $dir [incr count] %W %x %y]
+ bind $current_listbox <Button-1> [list doc_navigate $dir $count %W %x %y]
+ bind $current_listbox <Double-Button-1> [list doc_double_button $dir $count %W %x %y]
}
proc doc_navigate {dir count width x y} {
- if {[set subdir [$width get [$width index "@$x,$y"]]] eq {}} {
+ if {[set newdir [$width get [$width index "@$x,$y"]]] eq {}} {
+ return
+ }
+ set dir_to_open [file join $dir $newdir]
+ if {[file isdirectory $dir_to_open]} {
+ doc_make_listbox [winfo parent $width] $dir_to_open [incr count]
+ }
+}
+
+proc doc_double_button {dir count width x y} {
+ global pd_guidir
+ if {[set newdir [$width get [$width index "@$x,$y"]]] eq {}} {
return
}
- doc_make_listbox [winfo parent $width] [file join $dir $subdir] $count
+ set dir_to_open [file join $dir $newdir]
+ if {[file isdirectory $dir_to_open]} {
+ doc_navigate $dir $count $width $x $y
+ } else {
+ regsub -- $pd_guidir [file dirname $dir_to_open] "" subdir
+ set file [file tail $dir_to_open]
+ if { [catch {menu_doc_open $subdir $file} fid] } {
+ puts stderr "Could not open $pd_guidir/$subdir/$file\n"
+ }
+ return;
+ }
}
############# routine to add media, help, and apple menu items ###############
@@ -3413,7 +3426,11 @@ proc pdtk_openpanel {target localdir} {
}
proc pdtk_savepanel {target localdir} {
- set filename [tk_getSaveFile -initialdir $localdir]
+ if {$localdir == ""} {
+ set filename [tk_getSaveFile]
+ } else {
+ set filename [tk_getSaveFile -initialdir $localdir]
+ }
if {$filename != ""} {
pd [concat $target callback [pdtk_enquote $filename] \;]
}