mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-04-18 05:31:02 +00:00
use fluid_atomic types in fluid_ladspa and fluid_winmidi
This commit is contained in:
parent
39993f3963
commit
6d9081e1a5
3 changed files with 7 additions and 7 deletions
|
@ -94,7 +94,7 @@ fluid_ladspa_fx_t *new_fluid_ladspa_fx(fluid_real_t sample_rate, int audio_group
|
|||
/* Setup recursive mutex to protect access to public API */
|
||||
fluid_rec_mutex_init(fx->api_mutex);
|
||||
|
||||
fx->state = FLUID_LADSPA_INACTIVE;
|
||||
fluid_atomic_int_set(&fx->state, FLUID_LADSPA_INACTIVE);
|
||||
|
||||
/* add 0.5 to minimize overall casting error */
|
||||
fx->sample_rate = (unsigned long)(sample_rate + 0.5);
|
||||
|
|
|
@ -119,7 +119,7 @@ typedef struct _fluid_ladspa_fx_t
|
|||
|
||||
fluid_rec_mutex_t api_mutex;
|
||||
|
||||
int state;
|
||||
fluid_atomic_int_t state;
|
||||
int pending_deactivation;
|
||||
|
||||
fluid_cond_mutex_t *run_finished_mutex;
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
typedef struct {
|
||||
fluid_midi_driver_t driver;
|
||||
HMIDIIN hmidiin;
|
||||
int closing; /* Set to TRUE when closing driver, to prevent endless SYSEX lockup loop */
|
||||
fluid_atomic_int_t closing; /* Set to TRUE when closing driver, to prevent endless SYSEX lockup loop */
|
||||
|
||||
fluid_thread_t *sysExAddThread; /* Thread for SYSEX re-add thread */
|
||||
fluid_cond_mutex_t *mutex; /* Lock for condition */
|
||||
|
@ -54,7 +54,7 @@ typedef struct {
|
|||
MIDIHDR sysExHdrs[MIDI_SYSEX_BUF_COUNT];
|
||||
|
||||
/* TRUE for each MIDIHDR buffer which should be re-added to MIDI device */
|
||||
int sysExHdrAdd[MIDI_SYSEX_BUF_COUNT];
|
||||
fluid_atomic_int_t sysExHdrAdd[MIDI_SYSEX_BUF_COUNT];
|
||||
|
||||
/* Sysex data buffer */
|
||||
unsigned char sysExBuf[MIDI_SYSEX_BUF_COUNT * MIDI_SYSEX_MAX_SIZE];
|
||||
|
@ -129,7 +129,7 @@ new_fluid_winmidi_driver(fluid_settings_t* settings,
|
|||
dev->hmidiin = NULL;
|
||||
dev->driver.handler = handler;
|
||||
dev->driver.data = data;
|
||||
dev->closing = FALSE;
|
||||
fluid_atomic_int_set (&dev->closing, FALSE);
|
||||
|
||||
/* get the device name. if none is specified, use the default device. */
|
||||
if(fluid_settings_dupstr(settings, "midi.winmidi.device", &devname) != FLUID_OK || !devname) {
|
||||
|
@ -181,7 +181,7 @@ new_fluid_winmidi_driver(fluid_settings_t* settings,
|
|||
/* Prepare and add SYSEX buffers */
|
||||
for (i = 0; i < MIDI_SYSEX_BUF_COUNT; i++)
|
||||
{
|
||||
dev->sysExHdrAdd[i] = FALSE;
|
||||
fluid_atomic_int_set (dev->sysExHdrAdd[i], FALSE);
|
||||
hdr = &dev->sysExHdrs[i];
|
||||
|
||||
hdr->lpData = &dev->sysExBuf[i * MIDI_SYSEX_MAX_SIZE];
|
||||
|
@ -305,7 +305,7 @@ fluid_winmidi_callback(HMIDIIN hmi, UINT wMsg, DWORD_PTR dwInstance,
|
|||
break;
|
||||
|
||||
case MIM_LONGDATA: /* SYSEX data */
|
||||
if (dev->closing) break; /* Prevent MIM_LONGDATA endless loop, don't re-add buffer if closing */
|
||||
if (fluid_atomic_int_get (&dev->closing)) break; /* Prevent MIM_LONGDATA endless loop, don't re-add buffer if closing */
|
||||
|
||||
pMidiHdr = (LPMIDIHDR)dwParam1;
|
||||
data = (unsigned char *)(pMidiHdr->lpData);
|
||||
|
|
Loading…
Reference in a new issue