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

bug fixes

parent ff8ea10d
......@@ -243,7 +243,8 @@ to a note-on;
#X obj 18 3558 rzero~;
#X text 118 3558 - raw real-valued one-zero filter;
#X obj 18 3588 rzero_rev~;
#X text 121 3588 - time-reversed;
#X obj 113 3588 rzero~;
#X text 166 3588 - time-reversed;
#X obj 18 3618 cpole~;
#X obj 77 3618 czero~;
#X text 214 3618 - corresponding complex-valued filters;
......
......@@ -19,7 +19,7 @@ PDNTLIB = $(PDNTLDIR)\libc.lib \
.c.dll:
cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c
link /dll /export:$(CSYM)_setup $*.obj $(PDNTLIB)
link /nologo /dll /export:$(CSYM)_setup $*.obj $(PDNTLIB)
# ----------------------- IRIX 5.x -----------------------
......
......@@ -251,7 +251,6 @@ dnl This should be fixed so Pd can use ALSA shared libraries where appropriate.
LDFLAGS=$LDFLAGS" -lrt -ljack"
fi
echo MORECFLAGS --------------- $MORECFLAGS
OSNUMBER=0
fi
......
......@@ -28,6 +28,8 @@ int sys_schedblocksize = DEFDACBLKSIZE;
int sys_usecsincelastsleep(void);
int sys_sleepgrain;
int sched_reopenmeplease = 0; /* request from s_audio for deferred reopen */
typedef void (*t_clockmethod)(void *client);
struct _clock
......@@ -342,10 +344,13 @@ void sched_set_using_audio(int flag)
sched_referencerealtime = sys_getrealtime();
sched_referencelogicaltime = clock_getlogicaltime();
}
if (flag == SCHED_AUDIO_CALLBACK && sched_useaudio != SCHED_AUDIO_CALLBACK)
if (flag == SCHED_AUDIO_CALLBACK &&
sched_useaudio != SCHED_AUDIO_CALLBACK)
sys_quit = SYS_QUIT_RESTART;
if (flag != SCHED_AUDIO_CALLBACK && sched_useaudio == SCHED_AUDIO_CALLBACK)
post("sorry, can't turn off callbacks yet; restart Pd"); /* not right yet! */
if (flag != SCHED_AUDIO_CALLBACK &&
sched_useaudio == SCHED_AUDIO_CALLBACK)
post("sorry, can't turn off callbacks yet; restart Pd");
/* not right yet! */
sys_time_per_dsp_tick = (TIMEUNITPERSEC) *
((double)sys_schedblocksize) / sys_dacsr;
......
......@@ -17,7 +17,6 @@ turn on paMacCore_ChangeDeviceParameters for mac (pa_mac_core.h)
Gnome: why don't windows pop up when clicked on?
problems:
check real-time gaps in writesf~
fix declare to update current patch when changed
objects on GOP don't erase if you edit the GOP while they're showing
MSTACKSIZE limitation in m_binbuf.c
......
......@@ -39,7 +39,7 @@ int sys_outchannels;
int sys_advance_samples; /* scheduler advance in samples */
int sys_blocksize = 0; /* audio I/O block size in sample frames */
int sys_audioapi = API_DEFAULT;
int sys_audioapiopened = -1; /* save last API opened for later closing */
static int sys_meters; /* true if we're metering */
static float sys_inmax; /* max input amplitude */
static float sys_outmax; /* max output amplitude */
......@@ -68,6 +68,7 @@ static int audio_advance;
static int audio_callback;
void sched_audio_callbackfn(void);
extern int sched_reopenmeplease;
static int audio_isopen(void)
{
......@@ -339,32 +340,33 @@ void sys_close_audio(void)
if (!audio_isopen())
return;
#ifdef USEAPI_PORTAUDIO
if (sys_audioapi == API_PORTAUDIO)
if (sys_audioapiopened == API_PORTAUDIO)
pa_close_audio();
else
#endif
#ifdef USEAPI_JACK
if (sys_audioapi == API_JACK)
if (sys_audioapiopened == API_JACK)
jack_close_audio();
else
#endif
#ifdef USEAPI_OSS
if (sys_audioapi == API_OSS)
if (sys_audioapiopened == API_OSS)
oss_close_audio();
else
#endif
#ifdef USEAPI_ALSA
if (sys_audioapi == API_ALSA)
if (sys_audioapiopened == API_ALSA)
alsa_close_audio();
else
#endif
#ifdef USEAPI_MMIO
if (sys_audioapi == API_MMIO)
if (sys_audioapiopened == API_MMIO)
mmio_close_audio();
else
#endif
post("sys_close_audio: unknown API %d", sys_audioapi);
sys_inchannels = sys_outchannels = 0;
sys_audioapiopened = -1;
sched_set_using_audio(SCHED_AUDIO_NONE);
}
......@@ -426,12 +428,14 @@ void sys_reopen_audio( void)
{
audio_state = 0;
sched_set_using_audio(SCHED_AUDIO_NONE);
sys_audioapiopened = -1;
}
else
{
audio_state = 1;
sched_set_using_audio(
(callback ? SCHED_AUDIO_CALLBACK : SCHED_AUDIO_POLL));
sys_audioapiopened = sys_audioapi;
}
sys_vgui("set pd_whichapi %d\n", (outcome == 0 ? sys_audioapi : 0));
}
......@@ -732,13 +736,14 @@ void glob_audio_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv)
if (newcallback < 0)
newcallback = 0;
if (audio_callback == newcallback)
if (!audio_callback && !newcallback)
sys_close_audio();
sys_set_audio_settings(nindev, newaudioindev, nindev, newaudioinchan,
noutdev, newaudiooutdev, noutdev, newaudiooutchan,
newrate, newadvance, (newcallback >= 0 ? newcallback : 0));
if (audio_callback == newcallback)
if (!audio_callback && !newcallback)
sys_reopen_audio();
else sched_reopenmeplease = 1;
}
void sys_listdevs(void )
......
......@@ -36,10 +36,10 @@ static int pa_lowlevel_callback(const void *inputBuffer,
int i;
unsigned int j;
float *fbuf, *fp2, *fp3, *soundiop;
if (framesPerBuffer != DEFDACBLKSIZE)
{
fprintf(stderr, "ignoring buffer size %d\n", framesPerBuffer);
return;
if (framesPerBuffer != DEFDACBLKSIZE)
{
fprintf(stderr, "ignoring buffer size %d\n", framesPerBuffer);
return 0;
}
if (inputBuffer != NULL)
{
......@@ -51,6 +51,8 @@ static int pa_lowlevel_callback(const void *inputBuffer,
}
else memset((void *)pa_soundin, 0,
framesPerBuffer * pa_inchans * sizeof(float));
memset((void *)pa_soundout, 0,
framesPerBuffer * pa_outchans * sizeof(float));
(*pa_callback)();
if (outputBuffer != NULL)
{
......@@ -60,7 +62,6 @@ static int pa_lowlevel_callback(const void *inputBuffer,
for (j = 0, fp3 = fp2; j < framesPerBuffer; j++, fp3 += pa_outchans)
*fp3 = *soundiop++;
}
return 0;
}
......
......@@ -77,8 +77,8 @@ void postatom(int argc, t_atom *argv)
int i;
for (i = 0; i < argc; i++)
{
char buf[80];
atom_string(argv+i, buf, 80);
char buf[MAXPDSTRING];
atom_string(argv+i, buf, MAXPDSTRING);
poststring(buf);
}
}
......
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