Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
David MacDonald
purr-data
Commits
ef94718e
Commit
ef94718e
authored
Dec 11, 2008
by
Miller Puckette
Browse files
small cleanups
parent
6cf2517e
Changes
7
Hide whitespace changes
Inline
Side-by-side
extra/pd~/pd~.c
View file @
ef94718e
...
@@ -177,11 +177,15 @@ static void pd_tilde_donew(t_pd_tilde *x, char *pddir, char *schedlibdir,
...
@@ -177,11 +177,15 @@ static void pd_tilde_donew(t_pd_tilde *x, char *pddir, char *schedlibdir,
snprintf
(
pdexecbuf
,
MAXPDSTRING
,
"%s/bin/pd"
,
pddir
);
snprintf
(
pdexecbuf
,
MAXPDSTRING
,
"%s/bin/pd"
,
pddir
);
if
(
stat
(
pdexecbuf
,
&
statbuf
)
<
0
)
if
(
stat
(
pdexecbuf
,
&
statbuf
)
<
0
)
{
{
snprintf
(
pdexecbuf
,
MAXPDSTRING
,
"%s/pd"
,
pddir
);
snprintf
(
pdexecbuf
,
MAXPDSTRING
,
"%s/
../../../bin/
pd"
,
pddir
);
if
(
stat
(
pdexecbuf
,
&
statbuf
)
<
0
)
if
(
stat
(
pdexecbuf
,
&
statbuf
)
<
0
)
{
{
ERROR
"pd~: can't stat %s"
,
pdexecbuf
);
snprintf
(
pdexecbuf
,
MAXPDSTRING
,
"%s/pd"
,
pddir
);
goto
fail1
;
if
(
stat
(
pdexecbuf
,
&
statbuf
)
<
0
)
{
ERROR
"pd~: can't stat %s"
,
pdexecbuf
);
goto
fail1
;
}
}
}
}
}
snprintf
(
schedbuf
,
MAXPDSTRING
,
"%s/pdsched%s"
,
schedlibdir
,
snprintf
(
schedbuf
,
MAXPDSTRING
,
"%s/pdsched%s"
,
schedlibdir
,
...
...
src/CHANGELOG.txt
View file @
ef94718e
This file describes implementation and API changes; stuff more visible to the
This file describes implementation and API changes; stuff more visible to the
user appears in the "release notes" instead. See the bottom of this file
user appears in the "release notes" instead. See the bottom of this file
for original notes on source sty
p
e and organization.
for original notes on source sty
l
e and organization.
0.42.0
0.42.0
...
...
src/notes.txt
View file @
ef94718e
---------------- dolist --------------------
---------------- dolist --------------------
done:
reproduce canvas complaint: find "s scatsinger" & move any box...
test:
test:
compile on various versions of linux
compile on various versions of linux
...
@@ -29,7 +29,6 @@ look again at array vis/invis conundrum, g_template.c
...
@@ -29,7 +29,6 @@ look again at array vis/invis conundrum, g_template.c
TK commands to nonexistent windows? (occasionally still happens)
TK commands to nonexistent windows? (occasionally still happens)
still can't detect when a window is moved or resized
still can't detect when a window is moved or resized
open_via_path call in d_soundfile.c isn't threadsafe
open_via_path call in d_soundfile.c isn't threadsafe
crashed Pd putting vec and template in wrong order in array element of struct
floor, ciel functions in expr misdeclared
floor, ciel functions in expr misdeclared
graph names don't appear until graph moved? (invis/vis on new array/rename)
graph names don't appear until graph moved? (invis/vis on new array/rename)
don't filter locked click() through getrect
don't filter locked click() through getrect
...
...
src/s_audio.c
View file @
ef94718e
...
@@ -175,7 +175,7 @@ void sys_setchsr(int chin, int chout, int sr)
...
@@ -175,7 +175,7 @@ void sys_setchsr(int chin, int chout, int sr)
/* set audio device settings (after cleaning up the specified device and
/* set audio device settings (after cleaning up the specified device and
channel vectors). The audio devices are "zero based" (i.e. "0" means the
channel vectors). The audio devices are "zero based" (i.e. "0" means the
first one.) We can later re-open audio and/or show the settings on a
\
first one.) We can later re-open audio and/or show the settings on a
dialog window. */
dialog window. */
void
sys_set_audio_settings
(
int
naudioindev
,
int
*
audioindev
,
int
nchindev
,
void
sys_set_audio_settings
(
int
naudioindev
,
int
*
audioindev
,
int
nchindev
,
...
...
src/s_audio_oss.c
View file @
ef94718e
...
@@ -70,7 +70,6 @@ t_sample *sys_soundin;
...
@@ -70,7 +70,6 @@ t_sample *sys_soundin;
/* OSS-specific private variables */
/* OSS-specific private variables */
static
int
oss_blockmode
=
1
;
/* flag to use "blockmode" */
static
int
oss_blockmode
=
1
;
/* flag to use "blockmode" */
static
int
oss_32bit
=
0
;
/* allow 23 bit transfers in OSS */
static
char
ossdsp
[]
=
"/dev/dsp%d"
;
static
char
ossdsp
[]
=
"/dev/dsp%d"
;
/* don't assume we can turn all 31 bits when doing float-to-fix;
/* don't assume we can turn all 31 bits when doing float-to-fix;
...
@@ -109,12 +108,6 @@ void oss_init(void)
...
@@ -109,12 +108,6 @@ void oss_init(void)
countedthem
=
1
;
countedthem
=
1
;
}
}
void
oss_set32bit
(
void
)
{
oss_32bit
=
1
;
}
typedef
struct
_multidev
{
typedef
struct
_multidev
{
int
fd
;
int
fd
;
int
channels
;
int
channels
;
...
@@ -128,15 +121,6 @@ int oss_reset(int fd) {
...
@@ -128,15 +121,6 @@ int oss_reset(int fd) {
return
err
;
return
err
;
}
}
/* The AFMT_S32_BLOCKED format is not defined in standard linux kernels
but is proposed by Guenter Geiger to support extending OSS to handle
32 bit sample. This is user in Geiger's OSS driver for RME Hammerfall.
I'm not clear why this isn't called AFMT_S32_[SLN]E... */
#ifndef AFMT_S32_BLOCKED
#define AFMT_S32_BLOCKED 0x0000400
#endif
void
oss_configure
(
t_oss_dev
*
dev
,
int
srate
,
int
dac
,
int
skipblocksize
)
void
oss_configure
(
t_oss_dev
*
dev
,
int
srate
,
int
dac
,
int
skipblocksize
)
{
{
int
orig
,
param
,
nblk
,
fd
=
dev
->
d_fd
,
wantformat
;
int
orig
,
param
,
nblk
,
fd
=
dev
->
d_fd
,
wantformat
;
...
@@ -145,22 +129,12 @@ void oss_configure(t_oss_dev *dev, int srate, int dac, int skipblocksize)
...
@@ -145,22 +129,12 @@ void oss_configure(t_oss_dev *dev, int srate, int dac, int skipblocksize)
audio_buf_info
ainfo
;
audio_buf_info
ainfo
;
/* set resolution - first try 4 byte samples */
/* we only know how to do 2 byte samples */
if
(
oss_32bit
&&
(
ioctl
(
fd
,
SNDCTL_DSP_GETFMTS
,
&
param
)
>=
0
)
&&
wantformat
=
AFMT_S16_NE
;
(
param
&
AFMT_S32_BLOCKED
))
dev
->
d_bytespersamp
=
2
;
{
wantformat
=
AFMT_S32_BLOCKED
;
dev
->
d_bytespersamp
=
4
;
}
else
{
wantformat
=
AFMT_S16_NE
;
dev
->
d_bytespersamp
=
2
;
}
param
=
wantformat
;
param
=
wantformat
;
if
(
sys_verbose
)
post
(
"bytes per sample = %d"
,
dev
->
d_bytespersamp
);
if
(
ioctl
(
fd
,
SNDCTL_DSP_SETFMT
,
&
param
)
==
-
1
)
if
(
ioctl
(
fd
,
SNDCTL_DSP_SETFMT
,
&
param
)
==
-
1
)
fprintf
(
stderr
,
"OSS: Could not set DSP format
\n
"
);
fprintf
(
stderr
,
"OSS: Could not set DSP format
\n
"
);
else
if
(
wantformat
!=
param
)
else
if
(
wantformat
!=
param
)
...
@@ -740,18 +714,7 @@ int oss_send_dacs(void)
...
@@ -740,18 +714,7 @@ int oss_send_dacs(void)
linux_dacs
[
dev
].
d_dropcount
--
;
linux_dacs
[
dev
].
d_dropcount
--
;
else
else
{
{
if
(
linux_dacs
[
dev
].
d_bytespersamp
==
4
)
if
(
linux_dacs
[
dev
].
d_bytespersamp
==
2
)
{
for
(
i
=
DEFDACBLKSIZE
*
nchannels
,
fp1
=
sys_soundout
+
DEFDACBLKSIZE
*
thischan
,
lp
=
(
t_oss_int32
*
)
buf
;
i
--
;
fp1
++
,
lp
++
)
{
float
f
=
*
fp1
*
2147483648
.;
*
lp
=
(
f
>=
2147483647
.
?
2147483647
.
:
(
f
<
-
2147483648
.
?
-
2147483648
.
:
f
));
}
}
else
{
{
for
(
i
=
DEFDACBLKSIZE
,
fp1
=
sys_soundout
+
for
(
i
=
DEFDACBLKSIZE
,
fp1
=
sys_soundout
+
DEFDACBLKSIZE
*
thischan
,
DEFDACBLKSIZE
*
thischan
,
...
@@ -798,16 +761,7 @@ int oss_send_dacs(void)
...
@@ -798,16 +761,7 @@ int oss_send_dacs(void)
}
}
timeref
=
timenow
;
timeref
=
timenow
;
if
(
linux_adcs
[
dev
].
d_bytespersamp
==
4
)
if
(
linux_adcs
[
dev
].
d_bytespersamp
==
2
)
{
for
(
i
=
DEFDACBLKSIZE
*
nchannels
,
fp1
=
sys_soundin
+
thischan
*
DEFDACBLKSIZE
,
lp
=
(
t_oss_int32
*
)
buf
;
i
--
;
fp1
++
,
lp
++
)
{
*
fp1
=
((
float
)(
*
lp
))
*
(
float
)(
1
.
/
2147483648
.);
}
}
else
{
{
for
(
i
=
DEFDACBLKSIZE
,
fp1
=
sys_soundin
+
thischan
*
DEFDACBLKSIZE
,
for
(
i
=
DEFDACBLKSIZE
,
fp1
=
sys_soundin
+
thischan
*
DEFDACBLKSIZE
,
sp
=
(
t_oss_int16
*
)
buf
;
i
--
;
fp1
++
,
sp
+=
nchannels
)
sp
=
(
t_oss_int16
*
)
buf
;
i
--
;
fp1
++
,
sp
+=
nchannels
)
...
...
src/s_main.c
View file @
ef94718e
...
@@ -333,7 +333,6 @@ static char *(usagemessage[]) = {
...
@@ -333,7 +333,6 @@ static char *(usagemessage[]) = {
#ifdef USEAPI_OSS
#ifdef USEAPI_OSS
"-oss -- use OSS audio API
\n
"
,
"-oss -- use OSS audio API
\n
"
,
"-32bit ----- allow 32 bit OSS audio (for RME Hammerfall)
\n
"
,
#endif
#endif
#ifdef USEAPI_ALSA
#ifdef USEAPI_ALSA
...
@@ -619,12 +618,6 @@ int sys_argparse(int argc, char **argv)
...
@@ -619,12 +618,6 @@ int sys_argparse(int argc, char **argv)
sys_set_audio_api
(
API_OSS
);
sys_set_audio_api
(
API_OSS
);
argc
--
;
argv
++
;
argc
--
;
argv
++
;
}
}
else
if
(
!
strcmp
(
*
argv
,
"-32bit"
))
{
sys_set_audio_api
(
API_OSS
);
oss_set32bit
();
argc
--
;
argv
++
;
}
#endif
#endif
#ifdef USEAPI_ALSA
#ifdef USEAPI_ALSA
else
if
(
!
strcmp
(
*
argv
,
"-alsa"
))
else
if
(
!
strcmp
(
*
argv
,
"-alsa"
))
...
...
src/s_stuff.h
View file @
ef94718e
...
@@ -49,7 +49,7 @@ EXTERN int sys_hostfontsize(int fontsize);
...
@@ -49,7 +49,7 @@ EXTERN int sys_hostfontsize(int fontsize);
extern
int
sys_defaultfont
;
extern
int
sys_defaultfont
;
extern
t_symbol
*
sys_libdir
;
/* library directory for auxilliary files */
extern
t_symbol
*
sys_libdir
;
/* library directory for auxilliary files */
extern
t_symbol
*
sys_guidir
;
/* directory holding pd_gui
(also pd
, u_pdsend, etc
)
*/
extern
t_symbol
*
sys_guidir
;
/* directory holding pd_gui, u_pdsend, etc */
/* s_loader.c */
/* s_loader.c */
int
sys_load_lib
(
t_canvas
*
canvas
,
char
*
filename
);
int
sys_load_lib
(
t_canvas
*
canvas
,
char
*
filename
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment