Commit ef94718e authored by Miller Puckette's avatar Miller Puckette
Browse files

small cleanups

parent 6cf2517e
......@@ -177,11 +177,15 @@ static void pd_tilde_donew(t_pd_tilde *x, char *pddir, char *schedlibdir,
snprintf(pdexecbuf, MAXPDSTRING, "%s/bin/pd", pddir);
if (stat(pdexecbuf, &statbuf) < 0)
{
snprintf(pdexecbuf, MAXPDSTRING, "%s/pd", pddir);
snprintf(pdexecbuf, MAXPDSTRING, "%s/../../../bin/pd", pddir);
if (stat(pdexecbuf, &statbuf) < 0)
{
ERROR "pd~: can't stat %s", pdexecbuf);
goto fail1;
snprintf(pdexecbuf, MAXPDSTRING, "%s/pd", pddir);
if (stat(pdexecbuf, &statbuf) < 0)
{
ERROR "pd~: can't stat %s", pdexecbuf);
goto fail1;
}
}
}
snprintf(schedbuf, MAXPDSTRING, "%s/pdsched%s", schedlibdir,
......
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
for original notes on source stype and organization.
for original notes on source style and organization.
0.42.0
......
---------------- dolist --------------------
done:
reproduce canvas complaint: find "s scatsinger" & move any box...
test:
compile on various versions of linux
......@@ -29,7 +29,6 @@ look again at array vis/invis conundrum, g_template.c
TK commands to nonexistent windows? (occasionally still happens)
still can't detect when a window is moved or resized
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
graph names don't appear until graph moved? (invis/vis on new array/rename)
don't filter locked click() through getrect
......
......@@ -175,7 +175,7 @@ void sys_setchsr(int chin, int chout, int sr)
/* set audio device settings (after cleaning up the specified device and
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. */
void sys_set_audio_settings(int naudioindev, int *audioindev, int nchindev,
......
......@@ -70,7 +70,6 @@ t_sample *sys_soundin;
/* OSS-specific private variables */
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";
/* don't assume we can turn all 31 bits when doing float-to-fix;
......@@ -109,12 +108,6 @@ void oss_init(void)
countedthem = 1;
}
void oss_set32bit( void)
{
oss_32bit = 1;
}
typedef struct _multidev {
int fd;
int channels;
......@@ -128,15 +121,6 @@ int oss_reset(int fd) {
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)
{
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)
audio_buf_info ainfo;
/* set resolution - first try 4 byte samples */
if (oss_32bit && (ioctl(fd,SNDCTL_DSP_GETFMTS,&param) >= 0) &&
(param & AFMT_S32_BLOCKED))
{
wantformat = AFMT_S32_BLOCKED;
dev->d_bytespersamp = 4;
}
else
{
wantformat = AFMT_S16_NE;
dev->d_bytespersamp = 2;
}
/* we only know how to do 2 byte samples */
wantformat = AFMT_S16_NE;
dev->d_bytespersamp = 2;
param = wantformat;
if (sys_verbose)
post("bytes per sample = %d", dev->d_bytespersamp);
if (ioctl(fd, SNDCTL_DSP_SETFMT, &param) == -1)
fprintf(stderr,"OSS: Could not set DSP format\n");
else if (wantformat != param)
......@@ -740,18 +714,7 @@ int oss_send_dacs(void)
linux_dacs[dev].d_dropcount--;
else
{
if (linux_dacs[dev].d_bytespersamp == 4)
{
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
if (linux_dacs[dev].d_bytespersamp == 2)
{
for (i = DEFDACBLKSIZE, fp1 = sys_soundout +
DEFDACBLKSIZE*thischan,
......@@ -798,16 +761,7 @@ int oss_send_dacs(void)
}
timeref = timenow;
if (linux_adcs[dev].d_bytespersamp == 4)
{
for (i = DEFDACBLKSIZE*nchannels,
fp1 = sys_soundin + thischan*DEFDACBLKSIZE,
lp = (t_oss_int32 *)buf; i--; fp1++, lp++)
{
*fp1 = ((float)(*lp))*(float)(1./2147483648.);
}
}
else
if (linux_adcs[dev].d_bytespersamp == 2)
{
for (i = DEFDACBLKSIZE,fp1 = sys_soundin + thischan*DEFDACBLKSIZE,
sp = (t_oss_int16 *)buf; i--; fp1++, sp += nchannels)
......
......@@ -333,7 +333,6 @@ static char *(usagemessage[]) = {
#ifdef USEAPI_OSS
"-oss -- use OSS audio API\n",
"-32bit ----- allow 32 bit OSS audio (for RME Hammerfall)\n",
#endif
#ifdef USEAPI_ALSA
......@@ -619,12 +618,6 @@ int sys_argparse(int argc, char **argv)
sys_set_audio_api(API_OSS);
argc--; argv++;
}
else if (!strcmp(*argv, "-32bit"))
{
sys_set_audio_api(API_OSS);
oss_set32bit();
argc--; argv++;
}
#endif
#ifdef USEAPI_ALSA
else if (!strcmp(*argv, "-alsa"))
......
......@@ -49,7 +49,7 @@ EXTERN int sys_hostfontsize(int fontsize);
extern int sys_defaultfont;
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 */
int sys_load_lib(t_canvas *canvas, char *filename);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment