Commit Graph

2267 Commits

Author SHA1 Message Date
Chris Robinson
9dd16f8b9c Attempt to restore the Neon-enhanced ApplyCoeffsStep method
Unable to test, but it hopefully works.
2014-02-23 21:28:34 -08:00
Chris Robinson
9a4ded2491 Revert "Apply HRTF coefficient stepping separately"
This reverts commit 25b9c3d0c1.

Conflicts:
	Alc/mixer_neon.c

Unfortunately this also undoes the Neon-enhanced ApplyCoeffsStep method.
2014-02-23 21:17:09 -08:00
Chris Robinson
c68ce288d0 Move HRTF macros and function declarations to a separate header 2014-02-23 21:11:01 -08:00
Chris Robinson
5731534e8d Move the default hrtf table to an external file 2014-02-23 21:02:11 -08:00
Chris Robinson
9f43de62ab Add a return value to FindHrtfFormat 2014-02-23 20:14:07 -08:00
Chris Robinson
ef8002a832 Check the hrtf config option earlier
This is to make sure it tries to find an HRTF-compatible format before reseting
the device, just like when using ALC_HRTF_SOFT.
2014-02-23 20:00:52 -08:00
Chris Robinson
e6e3bdee83 Avoid checking the hrtf config option twice 2014-02-23 19:18:54 -08:00
Chris Robinson
0e51becd58 Search system-dependant data paths for relative hrtf table filenames 2014-02-23 17:58:34 -08:00
Chris Robinson
46b2115bfb Avoid using a global static buffer for config loading 2014-02-23 14:07:09 -08:00
Chris Robinson
0626a44eb1 Fix indentation 2014-02-23 09:54:26 -08:00
Chris Robinson
29e0af5ef0 Fix a race condition in the mmdevapi message queue thread 2014-02-09 18:55:51 -08:00
Chris Robinson
09d1319e82 Add some extra traces to the mmdevapi backend
Trying to track down the cause of some reported errors.
2014-02-09 10:52:12 -08:00
Chris Robinson
ea0aea6508 Change the autowah to have a cutoff range of 20Hz to 20KHz
This is the same as allowed in the SF2 spec for its filter cutoff generator,
which can be used for a wah effect in MIDI. It makes sense to use a similar
range here.
2014-02-07 03:23:49 -08:00
Chris Robinson
6f711c32ba Fix some types 2014-02-07 03:20:27 -08:00
Chris Robinson
926ecc2dbe Slightly shorten a long line 2014-02-02 16:11:53 -08:00
Chris Robinson
7c4339c195 Rework MIDI clock timing
It's best to avoid using doubles in the mixer since the FPU's set to single-
precision mode. The new clock timing is similar to the device clock timing, and
should hopefully be less prone to drift caused by fp rounding errors.
2014-02-02 02:39:56 -08:00
Chris Robinson
755f161fc5 Use nanosecond resolution for MIDI
This makes the MIDI clock use the same resolution as the device clock and
source latency and the device clock.
2014-02-01 23:01:06 -08:00
Chris Robinson
7bfea9087e Remove an unnecessary special-case for the click removal 2014-02-01 19:31:05 -08:00
Chris Robinson
11a7b3e8f8 Avoid duplicating code in alcGetIntegerv 2014-02-01 18:40:36 -08:00
Chris Robinson
112b0f166f Add an alcGetInteger64vSOFT method and a way to get the device clock 2014-02-01 17:55:42 -08:00
Chris Robinson
69f3a7da6d Keep track of a device clock time, based on the number of samples processed 2014-02-01 16:37:11 -08:00
Chris Robinson
9e2a8843a8 Properly fill the SF2 sample buffer on big endian 2014-02-01 14:33:57 -08:00
Chris Robinson
68a32a3486 Fix an infinite loop when loading SF2 samples on big endian machines 2014-02-01 14:29:47 -08:00
Chris Robinson
a4bc0a46e9 Implement dry and wet mixers for Neon
Code provided by Philippe Simons <simons.philippe@gmail.com>.
2014-01-26 01:34:39 -08:00
Chris Robinson
49baa9128d bufferQueue's Clear method doesn't take any parameters 2014-01-19 17:26:51 -08:00
Chris Robinson
f193b539ce Clear the OpenSL buffer queue when stopping 2014-01-19 02:45:51 -08:00
Chris Robinson
35fd4dcf77 Check and trace INFO properties when reading them 2014-01-19 02:44:55 -08:00
Chris Robinson
748be9a97d Include sys/sysconf.h if available for sysconf() 2014-01-18 19:16:46 -08:00
Chris Robinson
1a90c7f498 Check for 0-sized sf2 structure arrays 2014-01-17 06:48:40 -08:00
Chris Robinson
be883131a7 Remove redundancy in a couple error messages 2014-01-17 06:33:23 -08:00
Chris Robinson
658d35a1b0 Put the version and irom storage into the Soundfont struct 2014-01-17 06:20:39 -08:00
Chris Robinson
d387deb3e8 Fix a couple warning messages to show the correct instrument ID 2014-01-17 06:10:29 -08:00
Chris Robinson
7206f5873c Partially handle the irom sub-chunk
Reject soundfonts that have ROM sample types without a valid irom sub-chunk.
2014-01-17 06:03:53 -08:00
Chris Robinson
05e9c824d5 Better handle original key and overriding root key 2014-01-17 05:14:58 -08:00
Chris Robinson
65a5311449 Rename aftertouch to keypressure 2014-01-17 04:18:49 -08:00
Chris Robinson
50c8d9181a Add a config option to specify the extra MIDI volume scaling
The value specified is in decibels.
2014-01-17 00:58:47 -08:00
Chris Robinson
08ba5d9dba Use a proper struct for envelope properties 2014-01-17 00:36:33 -08:00
Chris Robinson
e118ac93a0 Handle fontsound sample types using explicit enum values
Uses AL_MONO_SOFT, AL_RIGHT_SOFT, and AL_LEFT_SOFT. "Linked" samples types
aren't explicitly supported due to being under-defined in the SF2 spec, nor are
ROM samples currently.
2014-01-15 22:18:07 -08:00
Chris Robinson
9ebeae6228 Use ALfontsound_setPropi to set fontsound sample properties
And make sure the loop mode is properly translated for FluidSynth.
2014-01-15 21:17:46 -08:00
Chris Robinson
50b74629dd Add a flag to specify the device being paused
Used to prevent UpdateDeviceParams from restarting the device, if a new context
is created while paused.
2014-01-15 16:44:12 -08:00
Chris Robinson
8d7559d9d0 Stop the device when updating parameters, don't close it 2014-01-15 16:30:23 -08:00
Chris Robinson
56899716d6 Add an extension to pause audio processing 2014-01-15 16:27:17 -08:00
Chris Robinson
443e6b73b2 Use the 64-bit clamp method when getting the MIDI clock time 2014-01-15 15:38:54 -08:00
Chris Robinson
5fdc3c093e Don't use the same buffer segment for enqueueing in OpenSL 2014-01-15 15:27:38 -08:00
Chris Robinson
1739998045 Stop the OpenSL buffer queue when stopping the device 2014-01-15 15:14:25 -08:00
Chris Robinson
bdc5850120 Don't reset presets when loading/unloading soundfonts 2014-01-13 16:57:56 -08:00
Chris Robinson
24ffb5b464 Be more thorough when converting sf2 modulator properties 2014-01-13 16:50:12 -08:00
Chris Robinson
90fd92628d Use FluidSynth enums when handling generators 2014-01-13 16:15:56 -08:00
Chris Robinson
0c80f62de7 Add a method to get soundfont samples 2014-01-13 00:20:14 -08:00
Chris Robinson
a5bfc1e30b Add a method to get the current MIDI state 2014-01-12 12:27:46 -08:00
Chris Robinson
da2c9732da Don't break with an override root key generator value of -1
An accidental hold-over from when it was using a switch.
2014-01-06 13:21:08 -08:00
Chris Robinson
cf66516a27 Load soundfont modulators into FluidSynth 2014-01-06 13:07:12 -08:00
Chris Robinson
4079ee2200 Add methods to get and set modulator properties on fontsounds 2014-01-05 17:21:34 -08:00
Chris Robinson
5f961a392e Move some soundfont methods to ALsoundfont 2014-01-05 05:11:07 -08:00
Chris Robinson
540a99e71f Allow "deleting" the default soundfont
The ID remains valid and the soundfont will be reloaded as needed, but this
provides a way for the application to clear up the soundfont memory.
2014-01-04 05:30:57 -08:00
Chris Robinson
86f250a3f5 Trace preset, instrument, and sample names with invalid key and velocity ranges 2014-01-04 04:34:32 -08:00
Chris Robinson
4834f56779 Don't create presets that don't have any usable sounds 2014-01-04 03:20:17 -08:00
Chris Robinson
2dd87946fd Update some trace messages to be more useful 2014-01-03 23:19:52 -08:00
Chris Robinson
13066bbf87 Allow selecting the default soundfont using ID 0 2014-01-03 22:58:51 -08:00
Chris Robinson
42a67731c4 Add storage for a default soundfont object 2014-01-03 20:21:12 -08:00
Chris Robinson
3a31402b1e Remove an unused method 2014-01-03 19:35:55 -08:00
Chris Robinson
d9846f3219 Move ALsoundfont methods to the right source file 2014-01-03 19:18:06 -08:00
Chris Robinson
e6e7e461c0 Avoid using alFontsoundiSOFT when loading a soundfont
This should now make the soundfont loader thread-safe.
2014-01-03 18:52:17 -08:00
Chris Robinson
5dc4ea15bb Don't handle the list type in the RiffHdr struct 2014-01-03 18:09:51 -08:00
Chris Robinson
49c17ad520 Mostly load into fontsound objects directly
This leaves only one unsafe alFontsoundiSOFT call.
2014-01-02 13:53:16 -08:00
Chris Robinson
fcf9e72202 Load presets directly into objects 2014-01-02 11:40:30 -08:00
Chris Robinson
01f547b93e Move some preset alloc/dealloc code to separate functions 2014-01-02 10:39:21 -08:00
Chris Robinson
3ff33e2f79 Update the soundfont preset count after loading a soundfont 2014-01-02 09:09:57 -08:00
Chris Robinson
7d94e9c52f Don't allow soundfonts with existing presets in alLoadSoundfontSOFT 2014-01-01 07:33:48 -08:00
Chris Robinson
0a5a08c0fb Pass the ALsoundfont object to loadSf2, rather than its ID 2014-01-01 07:25:23 -08:00
Chris Robinson
e699ab8614 Force all FluidSynth sounds off when changing soundfonts
Selecting soundfonts should only happen when the MIDI engine is stopped or
reset. When stopped some notes may be left in a release phase, but we need to
ensure all fluid_sample_t objects are finished before unloading since the
soundfont (and associated sample memory) may be deleted at any time afterward.
2013-12-31 00:49:43 -08:00
Chris Robinson
6b2d3c3cfa Remove some unused MIDI backend methods 2013-12-29 06:02:48 -08:00
Chris Robinson
396a2f1595 Don't destroy the fluid_sfont_t if any of its samples are still playing
FluidSynth apparently doesn't check for this itself before calling the free
callback.
2013-12-29 05:58:40 -08:00
Chris Robinson
37d183efc0 Update soundfont selection functions
A filename is no longer specified, and alMidiSoundfontsSOFT is renamed to
alMidiSoundfontvSOFT.
2013-12-29 05:44:18 -08:00
Chris Robinson
4e73b95fc0 Add the last remaining "real-time" properties 2013-12-29 05:09:50 -08:00
Chris Robinson
4c35f7c632 Add chorus and reverb send properties 2013-12-29 04:36:01 -08:00
Chris Robinson
15aa12847d Check for negative soundfont indices getting passed to the loader 2013-12-29 04:25:28 -08:00
Chris Robinson
699d84491f Add pan and attenuation properties 2013-12-29 04:24:32 -08:00
Chris Robinson
d030e07879 Add tuning properties 2013-12-29 03:43:00 -08:00
Chris Robinson
1d41122372 Add filter properties 2013-12-29 03:18:31 -08:00
Chris Robinson
deecbbc55d Add modulation envelope properties 2013-12-29 02:40:12 -08:00
Chris Robinson
d9aedc1416 Add a few more pitch properties 2013-12-29 02:25:40 -08:00
Chris Robinson
fc928bb75a Add volume envelope properties 2013-12-29 02:14:10 -08:00
Chris Robinson
4659669a74 Fix copy-paste errors in error messages 2013-12-29 00:56:01 -08:00
Chris Robinson
5aa274999c Accumulate with default modulator amounts 2013-12-29 00:52:03 -08:00
Chris Robinson
09665715ed Add support for the fontsound loop mode 2013-12-29 00:34:58 -08:00
Chris Robinson
0d7996409e Ensure the soundfont version is 2.x 2013-12-28 10:34:26 -08:00
Chris Robinson
fe55cd6de8 Add alLoadSoundfontSOFT to load a soundfont via callback
Some hefty caveats:
This function is not thread-safe. In particular, the current context affecting
the thread must not be changed, and the provided soundfont must not be
altered while the function is executing. Ideally, this will be fixed.

Error handling is poor. Some RIFF structure errors may not be caught (e.g. sub-
chunks with sizes greater than the parent chunk allows for), and generated AL
errors are ignored, possibly leading to resource leaks in certain situations.
These should be fixed in time.

There is minimal error checking on the provided soundfont ID. It does not
ensure a valid ID has been provided, nor does it ensure the provided soundfont
can be modified. These short-comings should be fixed eventually.

Proper cleanup is the responsibility of the caller. The caller must get the
preset objects from the soundfont before deleting it, and the fontsound objects
from each preset before deleting them, to make sure all resources are properly
deleted.
2013-12-28 09:58:55 -08:00
Chris Robinson
7156f4439c Allow loading multiple soundfonts with FluidSynth 2013-12-27 06:41:57 -08:00
Chris Robinson
0678e3fc2b Create a custom fluid_sfloader_t loader
This allows us to load and use soundfont objects the app specifies (the first
one, at least), rather than having to load from a file. It doesn't sound that
good since modulators and most generators aren't yet available, but this will
steadily improve.
2013-12-27 06:23:07 -08:00
Chris Robinson
f85d733f9d Add a method to set and get soundfonts
The main purpose of this is to select soundfonts for playback, eventually,
instead of the existing method that takes a filename.
2013-12-27 02:59:50 -08:00
Chris Robinson
cc30c5754f Remove the generator list 2013-12-26 22:10:41 -08:00
Chris Robinson
d5f687b2fa Allow specifying key and velocity ranges on fontsounds 2013-12-26 21:45:16 -08:00
Chris Robinson
35f9e35aa3 Add methods to set and get sounds on a preset 2013-12-25 22:39:38 -08:00
Chris Robinson
b5ae424dbd Store a list of sounds in the preset 2013-12-25 19:50:46 -08:00
Chris Robinson
677b864565 Remove the zone, sample, and instrument object types 2013-12-25 19:35:43 -08:00
Chris Robinson
b650ecbc23 Add methods to add generators and modulators to fontsounds 2013-12-25 19:23:34 -08:00
Chris Robinson
94ddc5cb18 Add a new fontsound object type
This is basically a combined preset and intrument zone with sample header.
2013-12-25 19:13:59 -08:00
Chris Robinson
a43b296c60 Add methods to get and set presets on a soundfont 2013-12-23 04:07:53 -08:00
Chris Robinson
d7de86966d Add methods to get and set a preset object's preset and bank numbers 2013-12-23 03:23:42 -08:00
Chris Robinson
0df5eb90ea Make sure key and velocity ranges are the first two generators 2013-12-21 15:28:46 -08:00
Chris Robinson
ede3c20880 Free thunk entry in the object destructor 2013-12-20 01:04:38 -08:00
Chris Robinson
5dc3f3626d Better protect against improper alSoundfontSamplesSOFT calls 2013-12-20 00:50:43 -08:00
Chris Robinson
d596cf9cf3 Use a different autowah filter range
Still just guesses, but this seems to avoid math problems with low peak gains.
2013-12-20 00:16:23 -08:00
Chris Robinson
1bd828603e Add functions to set a soundfont's sample data 2013-12-19 04:19:03 -08:00
Chris Robinson
03a6bf22a5 Fix compiling without FluidSynth 2013-12-19 02:12:01 -08:00
Chris Robinson
99933fac49 Allow creating instrument objects 2013-12-19 00:57:07 -08:00
Chris Robinson
666acb314b Rename some ALsoundfont fields 2013-12-19 00:37:56 -08:00
Chris Robinson
1b5c3495c9 Add methods to create and destroy presets 2013-12-19 00:09:55 -08:00
Chris Robinson
1e536cf7ca Properly initialize and cleanup the soundfont map 2013-12-18 23:21:59 -08:00
Chris Robinson
8083fb5be7 Add a new ALsoundfont object type
Includes a basic hierarchy for presets, instruments, samples, zones,
generators, and modulators.
2013-12-18 22:51:53 -08:00
Chris Robinson
b9468dc917 Fix header guard and remove duplicate code 2013-12-18 19:17:03 -08:00
Chris Robinson
0653680690 Move the base MidiSynth to a separate file 2013-12-17 23:03:34 -08:00
Chris Robinson
0095a59fc9 Move the dummy MIDI handler to a separate file 2013-12-17 22:43:10 -08:00
Chris Robinson
ee92b3142d Move FluidSynth to its own file 2013-12-17 22:36:25 -08:00
Chris Robinson
1dd05bac5c Add a alMidiResetSOFT method to reset the synth
Playback is stopped, the queue is flushed, the clock is reset to 0, and the
MIDI system is reset to power-up status.
2013-12-13 14:15:01 -08:00
Chris Robinson
ac525db845 Fix numeric constant type (double->float) 2013-12-08 05:01:06 -08:00
Chris Robinson
a846418964 Rename pthread wrappers used for Windows to althread 2013-12-06 02:12:45 -08:00
Chris Robinson
c834713526 Add methods to set and get the MIDI gain 2013-11-30 23:47:42 -08:00
Chris Robinson
2633fbfc4b Add a method to check if a file is a soundfont 2013-11-30 20:37:37 -08:00
Chris Robinson
be446366fb Add a method to specifying MIDI SysEx messages 2013-11-29 05:37:45 -08:00
Chris Robinson
ea1d7d56d3 Add infrastructure for handling SysEx MIDI events 2013-11-29 04:56:33 -08:00
Chris Robinson
f8c68291d3 Add a method to stop MIDI playback
Unlike pausing, this resets the MIDI clock time to 0, clears the existing event
queue, stops all MIDI sounds, and resets MIDI controllers.
2013-11-28 04:52:53 -08:00
Chris Robinson
bb0207d784 Add a method to load a soundfont 2013-11-28 03:38:17 -08:00
Chris Robinson
a48f362d28 Start a MIDI interface extension 2013-11-28 01:53:05 -08:00
Chris Robinson
182b08d8bc Create and use a MidiSynth on playback devices 2013-11-27 18:52:56 -08:00
Chris Robinson
37fa82f138 Use a 64-bit uint for MIDI event times 2013-11-27 04:33:33 -08:00
Chris Robinson
d315feae40 Add a MIDI event queue
In preparation for a MIDI extension.
2013-11-27 03:49:26 -08:00
Chris Robinson
08dfbcfd5c Add min/max/clamp methods for doubles 2013-11-27 00:30:13 -08:00
Chris Robinson
80ea801204 Add a macro for GCC to ensure stack alignment 2013-11-25 17:29:39 -08:00
Chris Robinson
191e8172f0 Use a macro to help condense some repeated code 2013-11-24 18:11:45 -08:00
Chris Robinson
b029b77784 Add some missing 'static's 2013-11-24 17:43:20 -08:00
Chris Robinson
25b9c3d0c1 Apply HRTF coefficient stepping separately 2013-11-10 05:52:22 -08:00
Chris Robinson
4386ee32ce Use one long buffer for the chorus and flanger delay lines 2013-11-10 02:48:03 -08:00
Chris Robinson
a603dd55ff Rename lfo_coeff to lfo_scale 2013-11-08 16:54:45 -08:00
Chris Robinson
9228d13333 Use integer modulo for chorus and flanger
Also simplify LFO coefficient calculations.
2013-11-08 16:33:42 -08:00
Chris Robinson
bca959f372 Only use the inner loop for the chorus/flanger template method 2013-11-08 05:26:43 -08:00
Chris Robinson
d6eff654be Redo the autowah effect
It's now a low-pass filter with a cutoff that varies according to the input
signal amplitude.

There remains issues with apparent feedback in the resonant frequency with high
resonance values. The actual cutoff range for the filter is also a guess.
2013-11-07 17:46:14 -08:00
Chris Robinson
e0fecdcaaa Reimplement the compressor to work per-sample 2013-11-06 23:39:41 -08:00
Chris Robinson
10dbb1bc9b Remove the Lock and Unlock methods from BackendFuncs
All backends that still use the old interface use the default locking methods,
which is also used by the ALCbackend base.
2013-11-04 23:34:18 -08:00
Chris Robinson
ca83629e4e Forward some wrapper functions to the base method 2013-11-04 23:19:30 -08:00
Chris Robinson
d3c70e63b4 Use C99 inline in more places 2013-11-04 13:44:46 -08:00
Chris Robinson
551f893ae9 Use C99 inline semantics 2013-11-04 12:12:31 -08:00
Chris Robinson
692ab1085d Only set device functions when needed 2013-11-04 10:52:03 -08:00
Chris Robinson
94aeb5f52e Use a unique backend type for loopback 2013-11-04 10:51:22 -08:00
Chris Robinson
9760a592b2 Rename VCALL and VCALL0 to V and V0 2013-11-02 17:30:28 -07:00
Chris Robinson
f868d881d9 Constify some function pointers 2013-11-02 16:58:26 -07:00
Chris Robinson
3d921e0e6f Make backend factory methods static as needed 2013-11-02 16:35:05 -07:00
Chris Robinson
a1a3f51be2 Convert the OSS backend to the new interface 2013-11-02 15:42:45 -07:00
Chris Robinson
c851e2c611 Set vtables in the constructor 2013-11-02 13:23:20 -07:00
Chris Robinson
ddf521eddc Make LockContext and UnlockContext inline again 2013-11-02 12:05:02 -07:00
Chris Robinson
7142e3828f Rename alcGetLatency to ALCdevice_GetLatency 2013-11-02 12:01:58 -07:00
Chris Robinson
90a51d7897 Move a macro definition up nearer to where it's used 2013-10-29 23:54:10 -07:00
Chris Robinson
bc9c3de969 Use a helper macro for making vtable thunks 2013-10-29 20:13:42 -07:00
Chris Robinson
9f0e49917d Add default handlers for reset, captureSamples, and availableSamples 2013-10-29 15:07:13 -07:00
Chris Robinson
779eb4b82b Convert the PulseAudio backend to the new interface 2013-10-29 14:44:07 -07:00
Chris Robinson
d4aa4e16a0 Add a macro to forward methods to a base type 2013-10-29 11:22:18 -07:00
Chris Robinson
d2b3615943 Convert the loopback backend to the new interface 2013-10-29 10:38:55 -07:00
Chris Robinson
3437769ba0 Remove a couple unnecessary (and incorrect) parameter names 2013-10-28 22:29:59 -07:00
Chris Robinson
3c65c946d4 Fix capture with the new backend interface 2013-10-28 22:03:54 -07:00
Chris Robinson
16d5d5760c Convert ALSA to the new backend interface 2013-10-28 21:56:14 -07:00
Chris Robinson
7a424ab4bf Don't return a void 2013-10-28 20:23:41 -07:00
Chris Robinson
823782a33f Declare LoadLib functions in one place 2013-10-28 17:48:48 -07:00
Chris Robinson
321644de7c Add a missing compat.h include for portaudio 2013-10-28 17:48:03 -07:00
Chris Robinson
a407d57639 Rename the support method to querySupport 2013-10-28 17:23:19 -07:00
Chris Robinson
6fd857739c Support capture backends with the new interface 2013-10-28 17:04:44 -07:00
Chris Robinson
21f1e54cb9 Create and use a backend wrapper for capture 2013-10-28 14:38:55 -07:00
Chris Robinson
f8c95f1e90 Add audio capture methods to ALCbackend 2013-10-28 13:51:55 -07:00
Chris Robinson
8d9fb5109b Move some stuff out of alMain.h 2013-10-28 12:48:13 -07:00
Chris Robinson
20bcb68ad6 Move ALCbackend base stuff to a separate file 2013-10-28 12:30:57 -07:00
Chris Robinson
0617df9b5f Fix a couple casts 2013-10-28 12:12:26 -07:00
Chris Robinson
f24cb44781 Move the device mutex to the backend 2013-10-28 12:05:33 -07:00
Chris Robinson
2912d130c2 Separate compatibility declarations 2013-10-28 11:26:26 -07:00
Chris Robinson
034935b2e1 Modify how VCALL is handled
Now instead of specifying the arguments as a third argument to the macro, like
VCALL(object,function,(arg1, arg2));
they are specified separately after the macro, like
VCALL(object,function)(arg1, arg2);

Also, VCALL_NOARGS has been removed in favor of VCALL0, which behaves like
above but expects an empty argument list (a separate macro is needed to work
around preprocessor limitations).
2013-10-28 11:06:04 -07:00
Chris Robinson
c1cdd3095b Convert the Null backend to the ALCbackend style 2013-10-28 08:29:19 -07:00
Chris Robinson
dc7ed39fa7 Add a backend factory base type 2013-10-28 07:27:35 -07:00
Chris Robinson
c8603092d3 Add a default getLatency to ALCbackend
And make sure the backend is properly deleted.
2013-10-28 05:57:07 -07:00
Chris Robinson
f065700ef9 Move the lock/unlock methods to the backend 2013-10-28 05:10:28 -07:00
Chris Robinson
e54983694b Add missing header to git 2013-10-27 16:37:40 -07:00
Chris Robinson
3ed425d7ef Move the ALCdevice handle to the ALCbackend base 2013-10-27 16:20:47 -07:00
Chris Robinson
af8be56f17 Use an ALCbackend object to access playback backends
This is the start of a backend redesign. Currently, a wrapper object is used to
avoid having to redo all the backends at once, but they should slowly be
converted to derive from ALCbackend instead. The ALCbackend interface can
change as needed.
2013-10-27 14:24:55 -07:00
Chris Robinson
bf465eb2eb Move SetThreadName to threads.c 2013-10-27 08:32:58 -07:00
Chris Robinson
8ceb800def Rework threading functions 2013-10-27 08:14:13 -07:00
Chris Robinson
f93bfab824 Set a name for the mixer and recording threads 2013-10-27 07:00:44 -07:00
Chris Robinson
ff5277f4d7 Add a method to set the running thread's name 2013-10-26 12:39:19 -07:00
Chris Robinson
54b8690781 Fix a comment 2013-10-26 08:49:37 -07:00
Chris Robinson
a421e515be Use a helper macro for pi*2 2013-10-08 16:31:23 -07:00
Chris Robinson
11365b42c7 Use helper macros to convert between degrees and radians 2013-10-08 12:39:22 -07:00
Chris Robinson
b42fcce014 Use inline initialization for effect state factory vtables 2013-10-07 14:49:36 -07:00
Chris Robinson
fc31a41473 Constify the effect parameter of effect getters 2013-10-07 12:56:41 -07:00
Chris Robinson
997f6228de Use the UNUSED macro in the effects 2013-10-07 08:34:54 -07:00
Chris Robinson
32e85d469b Use the UNUSED macro in the backends 2013-10-07 08:00:18 -07:00
Chris Robinson
1518895e15 Use an UNUSED macro instead of void-tagging unused parameters 2013-10-07 07:44:09 -07:00
Chris Robinson
b5fece0381 Add a CMake option to not define the IDs used on Windows
This includes the GUIDs, IIDs, CLSID, and PropertyKeys. It is up to the user
to ensure the appropriate IDs are defined when linked.
2013-10-07 06:36:58 -07:00
Chris Robinson
79edd2cf3b Use a macro for the silence threshold 2013-10-06 17:25:47 -07:00
Chris Robinson
6425480d40 Don't store the effect slot in SendParams
This makes it much more like DirectParams.
2013-10-06 10:11:01 -07:00
Chris Robinson
8448b94c0b Rename Filter param member to LpFilter 2013-10-06 09:33:02 -07:00
Chris Robinson
9ee3d01f6e Use a simpler U64 macro to make 64-bit constants 2013-10-06 04:21:03 -07:00
Chris Robinson
ba52ac9bcd Finalize AL_SOFT_deferred_updates 2013-10-05 06:14:04 -07:00
Chris Robinson
43c375716a Only rest as long as needed in the Null renderer 2013-10-05 00:33:56 -07:00
Chris Robinson
ead8573aaf Add some more missing enums 2013-10-03 07:57:54 -07:00
Chris Robinson
41175ec84c Implement the Compressor effect 2013-10-03 07:55:12 -07:00
Chris Robinson
b9fd3f9eb4 Add missing enum to the list 2013-10-03 07:32:01 -07:00
Chris Robinson
01a5946a2e Compile using -std=c99 when available 2013-10-03 05:45:12 -07:00
Chris Robinson
2e605590a2 Convert autowah.c line-endings 2013-10-03 05:04:39 -07:00
Chris Robinson
764ea95781 Use helpers to set channel gain arrays
Also avoid unnecessary clearing.
2013-10-03 05:02:16 -07:00
Chris Robinson
99fa5911bc Implement the Autowah effect. 2013-10-03 03:37:03 -07:00
Chris Robinson
2f676832bc Avoid a divide-by-0 when distortion edge is 1 2013-09-04 15:46:05 -07:00
Chris Robinson
94884ed04b Use a separate value for the maximum buffer channels
Unlike the device, input buffers are accessed based on channel numbers
instead of enums. This means the maximum number of channels they hold
depends on the number of channels any one format can have, rather than
the total number of recognized channels. Currently, this is 8 for 7.1.
2013-07-23 00:13:15 -07:00
Chris Robinson
2219ce2475 Implement master high-pass filter for EAXREVERB 2013-07-21 22:12:50 -07:00
Chris Robinson
51791e6a54 Remove an unused function 2013-07-21 03:22:14 -07:00
Chris Robinson
d85f0c0bb2 Improve the source's low-pass filter response 2013-07-20 22:18:44 -07:00
Chris Robinson
52096234e1 Limit the source step to 10
This means the combination of the buffer frequency, source pitch, and
doppler shift can't exceed 10x the device playback frequency.

This is needed to keep the mixer from starving with a really high
increment, causing small DstBufferSize values that require a lot of
iterations.
2013-07-02 06:57:27 -07:00
Chris Robinson
ed0568bb24 Fix a potential infinite loop.
If the first XDG_CONFIG_DIRS entry isn't a proper relative path,
it would never break the loop.
2013-06-19 23:24:06 -07:00
Chris Robinson
a9fac12969 Work around some problems with KDevelop's parser 2013-06-18 14:33:39 -07:00
Chris Robinson
3c90ed95af Look for alsoft.conf in the XDG_CONFIG_DIRS and XDG_CONFIG_HOME directories
This follows the XDG Base Directory Specification. The old files/locations are
still supported, but configs found in XDG_CONFIG_DIRS take precedence over
/etc/openal/alsoft.conf, and a config found in XDG_CONFIG_HOME takes precedence
over $HOME/.alsoftrc.
2013-06-16 22:55:11 -07:00
Chris Robinson
48d5002190 Trace config file names being loaded 2013-06-16 20:43:31 -07:00
Chris Robinson
784e396cc7 Don't split config sections into separate blocks 2013-06-16 19:52:56 -07:00
Chris Robinson
8bd77be522 Improve parsing of the config files
This will also now recognize (and strip) quotation marks from around values.
2013-06-16 18:42:27 -07:00
Chris Robinson
a5471ce0a4 Better handle spaces between string list entries 2013-06-16 15:44:41 -07:00
Chris Robinson
817ca82e4b Fix input and feedback in the echo effect 2013-06-10 05:57:27 -07:00
Chris Robinson
68898dad1e Don't open the log file with both 'truncate' and 'append' flags 2013-06-07 03:38:09 -07:00
Chris Robinson
024374e0ce Use explicit bit offsets when checking for SSE and SSE2
Clang's cpuid.h doesn't contain the bit_* macros.
2013-06-06 19:30:55 -07:00
Chris Robinson
647398d7c6 Use ALfilterState for the distortion effect filters 2013-06-06 03:24:44 -07:00
Chris Robinson
a371de080b Silence some clang warnings 2013-06-05 01:52:49 -07:00
Chris Robinson
0e0f70b288 Avoid a NULL dereference 2013-06-04 17:36:54 -07:00
Chris Robinson
7257aa3ed2 Allow enabling HRTF through a context creation attribute 2013-05-31 19:29:32 -07:00
Chris Robinson
69e0c19767 Start an extension that can query the status of HRTF rendering 2013-05-31 16:03:59 -07:00
Chris Robinson
a7a3d1e194 Avoid an unnecessary loop 2013-05-29 22:34:57 -07:00
Chris Robinson
9c3f1d11f0 Check the right flag for tracing SSE2 support 2013-05-29 21:28:27 -07:00
Chris Robinson
764e3aa496 Fix up the naming convention of effect methods 2013-05-29 11:17:45 -07:00
Chris Robinson
e96cc656e9 Use C99's inline instead of __inline 2013-05-28 22:27:07 -07:00
Chris Robinson
48aa1e10d6 Use the high-shelf filter in place of low-pass
They effectively both work to lower (or raise) high frequencies. However, the
high-shelf performs better when gain=1.
2013-05-28 10:57:38 -07:00
Chris Robinson
6556626055 Simplify and fix some filter gain calculations 2013-05-27 21:57:22 -07:00
Chris Robinson
59a38442ac Use ALfilterState for the modulator high pass filter 2013-05-27 21:24:28 -07:00
Chris Robinson
0c7c5327c9 Use ALfilterState for the master echo and reverb filters 2013-05-27 19:55:00 -07:00
Chris Robinson
feeec34333 Use ALfilterState for the source direct and send filters 2013-05-27 19:14:02 -07:00
Chris Robinson
b1ae44206f Move ALEQFilter to alFilter.c/h and rename it to ALfilterState 2013-05-27 15:32:02 -07:00
Chris Robinson
334a7c1d59 Cleanup the ALeffectStateFactory_create methods
Get rid of the ALeffectStateFactory_create macro, and use the VCALL_NOARGS
helper (requires adding the 'this' factory parameter).
2013-05-27 13:16:17 -07:00
Chris Robinson
9e84f38a46 Use generic VCALL[_NOARGS] macros instead of type-specific wrappers 2013-05-27 11:48:29 -07:00
Chris Robinson
06c8442af6 Rename a variable 2013-05-26 17:10:57 -07:00
Chris Robinson
0a4be3470e Pre-apply the a[0] EQ filter coefficient
Saves 20 fp divisions per sample
2013-05-26 17:04:45 -07:00
Chris Robinson
82caba6bbe Use the helper macros in more places 2013-05-26 08:54:34 -07:00
Chris Robinson
8808159d55 Add helper macros to set an error and return, and use it in a few places 2013-05-26 00:01:07 -07:00
Chris Robinson
d1c5599c8e Use an ALeffectProps union to store the effect properties 2013-05-25 22:07:31 -07:00
Chris Robinson
6571d80540 Use a Delete method for deletable objects 2013-05-25 21:04:00 -07:00
Chris Robinson
2da6caeaa6 Update the Null effect so it can act as a guide to new effects 2013-05-25 17:42:34 -07:00
Chris Robinson
e157238ce7 Use vtables for setting effect properties 2013-05-24 23:26:59 -07:00
Chris Robinson
357cf72ab3 Move remaining effects to the effects subdir 2013-05-23 21:33:16 -07:00
Chris Robinson
2376683128 Move reverb to the effects subdir 2013-05-23 19:48:24 -07:00
Chris Robinson
f667c028e6 Move the AL_EFFECT_NULL state into a separate file 2013-05-23 18:50:07 -07:00
Chris Robinson
be4a4d7468 Use fegetenv/fesetenv to backup and restore the FPU state 2013-05-22 23:05:26 -07:00
Chris Robinson
eb15b13ca1 Merge the fesetround FPU handler with the assembly one
The assembly is only needed for SSE since we can't access the intrinsics
without the -msse switch, which itself would cause SSE code to be generated
elsewhere automtically.
2013-05-22 22:21:00 -07:00
Chris Robinson
38a9e642df Check for SSE2 and set the denormals-are-zero bit for mixing if available 2013-05-22 17:04:37 -07:00
Chris Robinson
b80efeb87d Set the correct SSE bits for round-to-zero 2013-05-22 16:31:43 -07:00
Chris Robinson
52efb8d7f4 Use restrict instead of RESTRICT 2013-05-22 15:11:39 -07:00
Chris Robinson
a6fa4a8bc2 Recognize DSSPEAKER_5POINT1_SURROUND (and 7POINT1) with DSound 2013-05-22 14:25:33 -07:00
Chris Robinson
cdbb0722f6 Avoid using a temp buffer for al_print
It's now using two *printf calls, which unfortuantely means there could be a
race between the two and cause the message to break up if something else tries
to print to the same file. This shouldn't really be a big deal since al_print
isn't used that often, and it now allows for lines of practically unlimited
length.
2013-05-22 03:02:39 -07:00
Chris Robinson
2eb8a520d4 Add casts to silence MSVC 2013-05-22 00:07:23 -07:00
Chris Robinson
0a07ed14c2 Rename DELETE to DELETE_OBJ
Because Windows.
2013-05-21 23:42:40 -07:00
Chris Robinson
604726c639 Add a DELETE macro to help destroy objects 2013-05-21 13:27:27 -07:00
Chris Robinson
eaccaa5028 Rename the effect state's Destroy method to Destruct 2013-05-21 13:02:56 -07:00
Chris Robinson
a5d94f5d09 Use factories to create and destroy effect states 2013-05-21 12:47:18 -07:00
Chris Robinson
e4186f4903 Use a properly-defined history for the FILTER struct 2013-05-21 07:10:24 -07:00
Chris Robinson
3ee0f8feb9 Avoid storing the device frequency in the equalizer 2013-05-21 05:33:54 -07:00
Chris Robinson
5c8c40afef Auto-generate wrappers to upcast objects before calling user methods 2013-05-21 05:02:25 -07:00
Chris Robinson
5516d8df0b Use macros to help define vtables for effect states 2013-05-21 04:18:02 -07:00
Chris Robinson
fba9ac6db1 Avoid storing the device frequency in the distortion state 2013-05-21 02:43:59 -07:00
Chris Robinson
de387c853f The effect state being destroyed can't be NULL 2013-05-21 02:37:27 -07:00
Chris Robinson
44da54ec7f Rename some inheritance macros 2013-05-21 02:30:11 -07:00
Chris Robinson
b6da74b6e2 Pre-scale the chorus and flanger delays to be in samples 2013-05-21 01:59:44 -07:00
Chris Robinson
7e9960f7f1 Avoid storing some chorus and flanger properties in the effect state 2013-05-21 01:38:43 -07:00
Chris Robinson
c6872d4d86 Process 64 samples at a time for chorus and flanger effects 2013-05-20 04:41:03 -07:00
Chris Robinson
5b706f3bdc Process 64 samples at a time for some effects
This should help with the non-interleaved samples of the output, and
allow skipping channels that don't contribute to the output.
2013-05-20 04:16:48 -07:00
Chris Robinson
80459b13e4 Split flanger delay calculation into separate methods 2013-05-20 03:41:32 -07:00
Chris Robinson
012fbc36b9 Split chorus delay calculation into separate methods 2013-05-20 02:38:06 -07:00
Chris Robinson
4c436b106d Use some macros to help with deriving types 2013-05-20 01:32:02 -07:00
Chris Robinson
6aa722808e Clear all the old channel gains to 0 before setting them 2013-05-20 00:02:47 -07:00
Chris Robinson
c693e649e6 Fix a potential leak when mmdevapi fails to open 2013-05-19 03:19:19 -07:00
Chris Robinson
1976d64814 Avoid recalculating the same coefficient 2013-05-19 03:18:21 -07:00
Chris Robinson
78e7c1c27b Implement distortion and equalizer effects
Code provided by Mike Gorchak
2013-05-18 01:33:01 -07:00
Chris Robinson
a7ad6080f0 Modulator fixes
Modulator functions return 0..1 instead of -1..+1
Apply high-pass filter before modulation
Increase fractional precision to 24 bits from 16

Thanks to Mike Gorchak
2013-05-18 00:43:09 -07:00
Chris Robinson
563f16dc2a Fix overflow issues when converting float to int
32-bit floats can only reach between -16777215...+16777215 (25 bits) before it
starts losing whole-number accuracy. Some compiler optimizations may break
trying to multiply a float by 2147483647.0 when the result is given right to a
float parameter, causing it instead to multiply by the nearest representable
float value, 2147483648.0.
2013-04-22 00:52:50 -07:00
Chris Robinson
b313c881c0 Add a missing cast to silence MSVC 2013-03-22 11:21:21 -07:00
Chris Robinson
6bf8f01af5 Report the actual ALSA error if setting the buffer metrics fails 2013-03-18 05:21:41 -07:00
Chris Robinson
bf54de4984 Use less math to clamp floats to -1...+1
The previous code could have issues as precision lowers. This should hopefully
work better while only using one if check instead of two.
2013-03-17 09:07:55 -07:00
Chris Robinson
eb1080910e Use force_align_arg_pointer for QSA 2013-03-15 04:32:46 -07:00
Chris Robinson
d237410d1d Add a QSA backend for QNX 2013-03-14 01:29:20 -07:00
Chris Robinson
2486f13dae Remove unnecessary NULL checks 2013-03-13 23:36:45 -07:00
Chris Robinson
3fd0f23e48 Add Chorus and Flanger effects
Code provided by Mike Gorchak
2013-03-13 23:31:12 -07:00
Chris Robinson
991aba286f Move the effect-specific get/set methods to where the effect is implemented 2013-03-13 21:53:42 -07:00
Chris Robinson
f1b0f67553 Build an appropriate channel map for PulseAudio 2013-02-08 18:59:48 -08:00
Chris Robinson
e358882f14 Destroy the ring buffer when closing down a portaudio device 2013-02-01 18:38:44 -08:00
Chris Robinson
564a182259 Avoid an underflow in the SSE mixers if BufferSize is less than 4 2012-12-24 05:49:44 -08:00
Chris Robinson
9cd086a707 Filter unneeded thread messages with MMDevApi 2012-12-24 05:37:53 -08:00
Chris Robinson
be25e6802d Add support for OpenSL ES 1.0.1 on Android 2012-12-12 14:36:58 -08:00
Chris Robinson
e51574c764 Trace the list of supported backends 2012-12-04 13:46:51 -08:00
Chris Robinson
893a1bedbc Use +/-90 degrees for stereo sources with non-HRTF stereo output. 2012-12-04 05:30:06 -08:00
Chris Robinson
4621a7b426 Add support for float32 output to CoreAudio 2012-12-03 11:50:02 -08:00
Chris Robinson
4808313e70 Use the correct multiplier for int32 output with CoreAudio 2012-12-03 10:44:02 -08:00