Chris Robinson
b89cc3417b
Avoid locking the mixer when unqueueing buffers
2014-05-11 03:52:22 -07:00
Chris Robinson
9f8615c670
Avoid accessing the source's buffer queue head multiple times
2014-05-11 03:11:35 -07:00
Chris Robinson
851a917b03
Use a struct to store the source's direct gain/gainhf properties
2014-05-11 01:40:44 -07:00
Chris Robinson
ddd1550a8b
Avoid locking the mixer while queueing buffers onto a source.
2014-05-10 08:55:28 -07:00
Chris Robinson
e9297d9744
Mark the buffer queue pointers volatile
2014-05-10 08:03:53 -07:00
Chris Robinson
3e28fb33a3
Add a missing pointer init
2014-05-10 07:57:35 -07:00
Chris Robinson
9642bf637d
Explicit init the source queue and current_buffer pointers
2014-05-10 06:32:39 -07:00
Chris Robinson
a455704148
Use a RWLock to help protect the source's buffer queue
...
In some instances this allows to to remove the device/mixer lock, or reduce how
long it's held.
2014-05-10 05:07:13 -07:00
Chris Robinson
eebde08e65
Don't explicitly store the BuffersInQueue
2014-05-10 03:33:41 -07:00
Chris Robinson
c4383b65e2
Store the current buffer queue item, rather than played buffer count
2014-05-10 03:21:40 -07:00
Chris Robinson
1c01e94237
Move the static_assert definition to its own header
2014-05-07 02:28:25 -07:00
Chris Robinson
0ea979a262
Move some headers to include/
...
Note, these are not installed. Only headers in include/AL/ are installed.
2014-05-06 18:29:53 -07:00
Chris Robinson
d066c7b124
Better pack HRTF mixing properties
2014-05-03 18:59:26 -07:00
Chris Robinson
b2e533fbfc
Clamp the current and target gain lower bound to epsilon
...
Should give a bit more wiggle room for the gain stepping to get lower than the
silence threshold.
2014-05-03 17:51:06 -07:00
Chris Robinson
149df6d4db
Convert the mmdevapi backend to the new backend API
2014-04-25 09:26:53 -07:00
Chris Robinson
32a2f95885
Convert the DSound backend to the new API
2014-04-19 22:54:21 -07:00
Chris Robinson
bb969c3ccc
Add a SZFMT macro for a size_t string formatter
2014-04-19 09:42:03 -07:00
Chris Robinson
1d266aa834
Add a GCC-specific STATIC_UPCAST macro that checks the object type
...
The check is compile time, and is functionally identical to the old/alternate
version.
2014-04-19 03:11:23 -07:00
Chris Robinson
59fc9aac0e
Use C11 alignas when available
2014-04-19 02:11:04 -07:00
Chris Robinson
c041a99f72
Simplify some error checking
2014-04-18 06:54:18 -07:00
Chris Robinson
b8d56190d1
Check pthread_mutex_unlock for errors
2014-04-18 06:39:46 -07:00
Chris Robinson
1353cb0d88
Rename AL_ONCE_INIT to AL_ONCE_FLAG_INIT
2014-04-18 02:21:58 -07:00
Chris Robinson
579e7c10c2
Check TlsSetValue for error
2014-04-17 22:57:16 -07:00
Chris Robinson
6c8bf9ec42
Rename althread_once to be more C11-like
2014-04-17 21:39:51 -07:00
Chris Robinson
5abefaed0a
Use the thread ID for althrd_t on Windows
2014-04-17 21:01:54 -07:00
Chris Robinson
36df67f546
Rename SetThreadName to althrd_setname
2014-04-17 20:41:32 -07:00
Chris Robinson
4b5e8b8c40
Don't inline al_nssleep
2014-04-17 09:14:03 -07:00
Chris Robinson
d1f1a1d056
Make and use a C11-like altimespec_get wrapper function
2014-04-17 09:03:57 -07:00
Chris Robinson
c3b1c31d9b
Rename althread_key_ wrappers to altss_ and move it to threads.h/c
2014-04-17 00:11:12 -07:00
Chris Robinson
8cc3d05949
Fix some almtx_ return values
2014-04-16 08:21:45 -07:00
Chris Robinson
2149ccd985
Remove almtx_normal and almtx_errorcheck
2014-04-16 08:00:54 -07:00
Chris Robinson
959d75edc8
Fix althrd_sleep return value
2014-04-16 07:18:28 -07:00
Chris Robinson
b020dd13fd
Avoid using a Sleep() wrapper
2014-04-16 06:59:44 -07:00
Chris Robinson
d124aee4d7
Remove the old thread wrappers for the new ones
2014-04-16 06:11:40 -07:00
Chris Robinson
18ab9cbbdd
Implement a C11-like thread wrapper and use it in mmdevapi and pulseaudio
2014-04-16 05:19:34 -07:00
Chris Robinson
29cb5058c0
Use a C11-like mutex wrapper instead of CRITICAL_SECTIONs
2014-04-16 01:39:11 -07:00
Chris Robinson
9c70ca9da6
Avoid memory leak if preset ID lookup fails
2014-04-14 01:33:31 -07:00
Chris Robinson
e76bc53d37
Insert all new effect slots into the active effect slots at once
2014-04-10 20:49:01 -07:00
Chris Robinson
c6821e5dd1
Use C11's static_assert when available
2014-04-07 11:48:28 -07:00
Chris Robinson
5e0fc84f49
Make HRTF stepping values per-channel
2014-04-05 10:24:13 -07:00
Chris Robinson
7b93e10f7a
Use an al_string for the device name
2014-03-28 22:11:34 -07:00
Chris Robinson
045959e9c0
Use C99 VLA instead of alloca when available
2014-03-25 18:16:03 -07:00
Chris Robinson
03fd2b8266
Remove setState from the MidiSynth vtable
2014-03-23 18:34:49 -07:00
Chris Robinson
de5c54db09
Remove an unused method
2014-03-23 17:47:58 -07:00
Chris Robinson
e2cb41dc61
Remove the last bits of the predictive sample processing
2014-03-23 17:33:57 -07:00
Chris Robinson
72986882f5
Remove the click removal buffers for auxiliary effect slots
2014-03-23 16:28:55 -07:00
Chris Robinson
52deb557d5
Add gain stepping to the send mixers
2014-03-23 16:11:21 -07:00
Chris Robinson
55f851093f
Remove the now-unneeded click removal buffers for the device
...
They are still there for auxiliary sends. However, they should go away soon
enough too, and then we won't have to mess around with calculating extra
"predictive" samples in the mixer.
2014-03-23 07:31:33 -07:00
Chris Robinson
81e049bd47
Step mixing gains per-sample for non-HRTF mixing
...
This fades the dry mixing gains using a logarithmic curve, which should produce
a smoother transition than a linear one. It functions similarly to a linear
fade except that
step = (target - current) / numsteps;
...
gain += step;
becomes
step = powf(target / current, 1.0f / numsteps);
...
gain *= step;
where 'target' and 'current' are clamped to a lower bound that is greater than
0 (which makes no sense on a logarithmic scale).
Consequently, the non-HRTF direct mixers do not do not feed into the click
removal and pending click buffers, as this per-sample fading would do an
adequate job of stopping clicks and pops caused by extreme gain changes. These
buffers should be removed shortly.
2014-03-23 06:57:00 -07:00
Chris Robinson
0ce0a88fd6
Move the step counter and moving flag to DirectParams
2014-03-23 03:03:03 -07:00
Chris Robinson
b0d511a860
Store the HrtfState directly in the DirectParams
2014-03-23 02:45:50 -07:00
Chris Robinson
9959972c7e
Add a stub 'soft' MIDI synth handler
...
Eventually this one will be used to handle MIDI internally, using our own
mixers and resamplers.
2014-03-22 21:53:00 -07:00
Chris Robinson
842aeb888b
Move some HRTF and mixer structs to alu.h
2014-03-22 02:39:57 -07:00
Chris Robinson
0a030c2bd9
Use a void* for the effect state Delete method param
2014-03-21 23:56:18 -07:00
Chris Robinson
8c33b4d742
Increase the vector reserve as needed when pushing in new items
2014-03-21 16:35:38 -07:00
Chris Robinson
ff63188cc2
Add a generic vector interface and use it for the active effect slots
2014-03-21 01:23:01 -07:00
Chris Robinson
e6e3937fa9
Use flexible array members to pad the device and context structs
...
This helps avoid the convoluted math otherwise required to ensure the default
slot and listener, respectively, are aligned.
2014-03-20 14:49:46 -07:00
Chris Robinson
168149ce9d
Keep track of the mix count
...
The purpose of this is to provide a safe way to be able to "swap" resources
used by the mixer from other threads without the need to block the mixer, as
well as a way to track when mixes have occurred. The idea is two-fold:
It provides a way to safely swap resources. If the mixer were to (atomically)
get a reference to an object to access it from, another thread would be able
allocate and prepare a new object then swap the reference to it with the stored
one. The other thread would then be able to wait until (count&1) is clear,
indicating the mixer is not running, before safely freeing the old object for
the mixer to use the new one.
It also provides a way to tell if the mixer has run. With this, a thread would
be able to read multiple values, which could be altered by the mixer, without
requiring a mixer lock. Comparing the before and after counts for inequality
would signify if the mixer has (started to) run, indicating the values may be
out of sync and should try getting them again. Of course, it will still need
something like a RWLock to ensure another (non-mixer) thread doesn't try to
write to the values at the same time.
Note that because of the possibility of overflow, the counter is not reliable
as an absolute count.
2014-03-19 19:00:54 -07:00
Chris Robinson
0c5cbafcd8
Use a union to combine HRTF and non-HRTF mixer params
2014-03-19 17:55:09 -07:00
Chris Robinson
6ee54fb1f3
Store some source mixing parameters in the active source struct
2014-03-19 13:14:11 -07:00
Chris Robinson
d6f7aac1bb
Use a separate struct for tracking active sources
2014-03-18 19:56:25 -07:00
Chris Robinson
dc74473025
Store the old-style backend funcs in the wrapper
2014-03-17 10:54:27 -07:00
Chris Robinson
bb787ba8ee
Avoid GCC's macro arg concat extension with IDE parsing
2014-03-17 09:16:33 -07:00
Chris Robinson
cde2f825d5
Use the correct array size
2014-03-08 22:48:36 -08:00
Chris Robinson
14a04020ff
Improve int-to-float and uint-to-float conversions
2014-03-08 22:34:07 -08:00
Chris Robinson
2e279684d7
Only require MSADPCM block alignment to be a multiple of 2
2014-03-06 21:42:03 -08:00
Chris Robinson
7657fbb296
Only sign-expand the nibble when needed
2014-03-06 19:14:19 -08:00
Chris Robinson
143f786d1a
Move the sample conversion routines to a separate file
2014-03-05 16:38:02 -08:00
Chris Robinson
bf4ddfef6d
Implement a simplistic MSADPCM encoder
...
It's not particularly good, but it's better than silence.
2014-03-05 07:27:22 -08:00
Chris Robinson
61569e09ed
Allocate enough temp space for the ADPCM decoders and encoders
2014-03-05 06:18:55 -08:00
Chris Robinson
a4126b66d4
Use specialized methods for converting ALshort to IMA4 and MSADPCM
...
As before, to avoid unnecessary direct copies
2014-03-05 06:13:00 -08:00
Chris Robinson
f82f3f10ab
Use specialized methods for converting IMA4 and MSADPCM to ALshort
...
Since the decoder methods already convert to ALshort, there's no need to use a
temp buffer that's just going to copy directly to the destination.
2014-03-05 04:59:24 -08:00
Chris Robinson
15b68fe694
Use maxi to clamp an int to a lower-bound
2014-03-05 04:37:55 -08:00
Chris Robinson
fb1f9aad6e
Expand the sign bit on the initial MSADPCM delta value
2014-03-05 00:30:23 -08:00
Chris Robinson
a1c440bd09
Add an extension to support MSADPCM buffer formats
2014-03-04 22:44:30 -08:00
Chris Robinson
f3a87d72b2
Add an extension to alter the block alignment for buffer unpack/pack ops
...
This is for unpacking (reading, e.g. alBufferData) and packing (writing, e.g.
alGetBufferSamplesSOFT) operations. The alignments are specified in sample
frames, with 0 meaning the default (65 for IMA4, 1 otherwise). IMA4 alignment
must be a multiple of 8, plus 1 (e.g. alignment = n*8 + 1), otherwise an error
will occur during (un)packing. Chenging the block alignment does not affect
already-loaded sample data, only future unpack/pack operations... so for
example, this is perfectly valid:
// Load mono IMA4 data with a block alignment of 1024 bytes, or 2041 sample
// frames.
alBufferi(buffer, AL_UNPACK_BLOCK_ALIGNMENT_SOFT, 2041);
alBufferData(buffer, AL_FORMAT_MONO_IMA4, data, data_len, srate);
alBufferi(buffer, AL_UNPACK_BLOCK_ALIGNMENT_SOFT, 0);
2014-03-04 05:53:35 -08:00
Chris Robinson
b0a6b6427c
Parameterize the block alignment
2014-03-04 04:29:35 -08:00
Chris Robinson
a6eb38ea7f
Use alloca for temp space decoding/encoding IMA4 blocks
2014-03-03 20:02:15 -08:00
Chris Robinson
a2d9133ffc
Reduce explicit template declarations and ignore IMA4-to-IMA4 conversions
...
Since we never store IMA4 data in buffers, we should only ever convert from
(user input) or to (user output) IMA4. Once we allow user-specified pack/unpack
block alignment, this wouldn't be a simple memcpy anyway.
2014-03-03 17:25:46 -08:00
Chris Robinson
c442c93a93
Store the original frame size alignment in the buffer
2014-03-03 17:05:08 -08:00
Chris Robinson
ea8a85b19c
Move PATH_MAX fallback definitions to alMain.h
2014-02-27 18:17:20 -08:00
Chris Robinson
6e7c0e15eb
Use OpenDataFile to load soundfonts relative to data directories
2014-02-27 02:20:51 -08:00
Chris Robinson
a8249c3469
Move OpenDataFile to helpers.c so other sources can use it
2014-02-27 01:49:23 -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
9f43de62ab
Add a return value to FindHrtfFormat
2014-02-23 20:14:07 -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
65a5311449
Rename aftertouch to keypressure
2014-01-17 04:18:49 -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
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
56899716d6
Add an extension to pause audio processing
2014-01-15 16:27:17 -08:00
Chris Robinson
0c80f62de7
Add a method to get soundfont samples
2014-01-13 00:20:14 -08:00
Chris Robinson
6f3dac6f58
Allow getting preset properties even when referenced
2014-01-12 23:57:44 -08:00
Chris Robinson
e252a100f7
Minor non-functional cleanup
2014-01-12 16:27:21 -08:00
Chris Robinson
a5bfc1e30b
Add a method to get the current MIDI state
2014-01-12 12:27:46 -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
bb54743425
Allow querying default soundfont properties
...
Any attempts to modify it or its held objects will result in an
AL_INVALID_OPERATION error.
2014-01-04 04:49:10 -08:00
Chris Robinson
355b8db915
Don't allow min key/vel ranges to exceed max range
2014-01-03 23:19:14 -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
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
f790d0e91f
Use a uint map for modulators
2014-01-02 14:43:44 -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
5f85a1dcf0
Move some error macros to alError.h
2014-01-02 10:42:00 -08:00
Chris Robinson
01f547b93e
Move some preset alloc/dealloc code to separate functions
2014-01-02 10:39:21 -08:00
Chris Robinson
e74e3e2b23
Move alLoadSoundfontSOFT to alSoundfont.c
2014-01-02 09:06:28 -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
7640c658ee
Remove explicit locking from alMidiSoundfontvSOFT.
...
The MIDI backend can lock as it needs.
2013-12-29 05:48:30 -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
06dd9f9b8c
Lock the device while selecting soundfonts
2013-12-29 05:36:05 -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
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
09665715ed
Add support for the fontsound loop mode
2013-12-29 00:34:58 -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
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
2b772a5607
Allow specifying all 4 sample types
...
ROM-based types will be specified with a separate property
2013-12-27 01:08:48 -08:00
Chris Robinson
307ac564ca
Allow specifying some fontsound sample properties
2013-12-26 23:37:22 -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
cb3f82a4bf
Do not allow deleting preset or instrument ID 0
2013-12-24 21:23:51 -08:00
Chris Robinson
f7556b827a
Allow querying the soundfont sample length and format type
2013-12-24 02:55:11 -08:00
Chris Robinson
b0878fe609
Do not accept preset or instrument ID 0 as valid
2013-12-23 23:42:21 -08:00
Chris Robinson
c911ca89a3
Unlock the soundfont earlier after switching preset lists
2013-12-23 23:31:47 -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
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
1bd828603e
Add functions to set a soundfont's sample data
2013-12-19 04:19:03 -08:00
Chris Robinson
99933fac49
Allow creating instrument objects
2013-12-19 00:57:07 -08:00
Chris Robinson
57491bf14c
Call the right delete method when generating presets fails
2013-12-19 00:56:12 -08:00
Chris Robinson
666acb314b
Rename some ALsoundfont fields
2013-12-19 00:37:56 -08:00
Chris Robinson
4288d3cd01
Move the soundfont and preset extension functions to separate sources
2013-12-19 00:27:11 -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
73fc4592ab
Make alIsSoundfontSOFT check soundfont IDs
2013-12-18 23:12:44 -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
ef0341c180
Make MidiSynth's methods non-static
2013-12-17 21:56:28 -08:00
Chris Robinson
189d73dd87
Render some MIDI samples even when stopped
...
Because stopping MIDI playback puts any playing notes into release phase, they
should be rendered. Ideally it could stop rendering once output goes silent.
2013-12-15 21:03:23 -08:00
Chris Robinson
f244ef6f82
Use macros for MIDI controller values
2013-12-15 20:15:30 -08:00
Chris Robinson
bcc2b9a490
Don't explicitly set reverb or chorus
2013-12-13 16:14:50 -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
a343d78724
Update behavior for alMidiStopSOFT
...
alMidiStopSOFT now has the following behavior:
* All pending MIDI events up to the current time are processed first, before
the queue is flushed.
* All channels then receive an All Notes Off event so that notes go through
their release phase. Controllers are *NOT* reset.
* Clock time is reset to 0, like before.
2013-12-13 13:40:53 -08:00
Chris Robinson
57eef756c3
Fix retrieving source properties
2013-12-09 13:04:16 -08:00
Chris Robinson
5349b90a48
Fix leak if inserting a sysex event fails
2013-12-08 06:20:44 -08:00
Chris Robinson
3f5914e094
Simplify dummy synth processing loop
2013-12-01 01:03:55 -08:00
Chris Robinson
517be463ae
Minor comment update
2013-12-01 00:31:39 -08:00
Chris Robinson
dc13ce7a0a
Use a method to get the default soundfont filename
2013-12-01 00:22:20 -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
e0babed29b
Add a workaround for allowing GM2 bank selection with a GM2 On SysEx
2013-11-29 23:57:32 -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
82d4e69da1
Don't force MMA bank selection mode
2013-11-29 00:42:27 -08:00
Chris Robinson
f4cf84e72d
Combine duplicate soundfont loading code
2013-11-28 05:30:48 -08:00
Chris Robinson
8615a109ce
Remove an unneeded MidiSynth field
2013-11-28 05:06:40 -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
29a4ac329a
Move MidiSynth locking out of the setState method
2013-11-28 04:29:38 -08:00
Chris Robinson
5dad1688d4
Fix building without FluidSynth
2013-11-28 04:21:39 -08:00
Chris Robinson
98b0a3187e
Add a config option for specifying the default MIDI soundfont
2013-11-28 04:16:46 -08:00
Chris Robinson
7794e53667
Be a bit safer with MIDI state changes
2013-11-28 03:57:45 -08:00
Chris Robinson
bb0207d784
Add a method to load a soundfont
2013-11-28 03:38:17 -08:00
Chris Robinson
a3c76c3274
Add an option for FLuidSynth to handle MIDI
2013-11-28 03:08:28 -08:00
Chris Robinson
a48f362d28
Start a MIDI interface extension
2013-11-28 01:53:05 -08:00
Chris Robinson
489723723c
Cleanups for MidiSynth
...
Remove an unneeded field, make MidiSynth_getTime public, and properly return a
64-bit time from it.
2013-11-27 19:41:52 -08:00
Chris Robinson
5554b8cfc9
Add a MidiSynth interface for devices
2013-11-27 18:45:02 -08:00
Chris Robinson
3a1613253b
Add a base MidiSynth struct
2013-11-27 05:12:11 -08:00
Chris Robinson
6a76f50fa3
Ensure UINT64_MAX is defined
2013-11-27 05:09: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
d339120145
Move ALfloatBUFFERSIZE to a common location
2013-11-27 00:16:30 -08:00
Chris Robinson
80ea801204
Add a macro for GCC to ensure stack alignment
2013-11-25 17:29:39 -08:00
Chris Robinson
801b7cb059
Include strings.h when available
2013-11-05 13:07:46 -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
5874e387a8
Move some inline methods to their appropriate headers
2013-11-04 13:51:19 -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
9760a592b2
Rename VCALL and VCALL0 to V and V0
2013-11-02 17:30:28 -07:00
Chris Robinson
a1a3f51be2
Convert the OSS backend to the new interface
2013-11-02 15:42:45 -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
426429279b
Use the existing ALint64SOFT/ALuint64SOFT types for ALint64/ALuint64
2013-11-01 16:49:05 -07:00
Chris Robinson
7460dd1b08
Prefer long as a 64-bit type instead of long long
2013-10-30 12:29:53 -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
0a6eff6a89
Add a GNU-specific AL_PRINT
...
This one makes use of the ', ## __VA_ARGS__' construct to avoid
splitting the output into two *printf calls.
2013-10-28 17:09:52 -07:00
Chris Robinson
21f1e54cb9
Create and use a backend wrapper for capture
2013-10-28 14:38:55 -07:00
Chris Robinson
8d9fb5109b
Move some stuff out of alMain.h
2013-10-28 12:48:13 -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
f065700ef9
Move the lock/unlock methods to the backend
2013-10-28 05:10:28 -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
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
959b768911
Use SET_VTABLE1 to set the ALeffect vtables
2013-10-08 18:58:44 -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
b3841653c6
Remove the last of the al_try code
2013-10-07 12:05:39 -07:00
Chris Robinson
32d3bde261
Use inline functions to lookup and remove objects
2013-10-07 11:39:32 -07:00
Chris Robinson
c787a9bf74
Remove al_try from alAuxEffectSlot.c
2013-10-07 11:30:11 -07:00
Chris Robinson
4f72da0005
Return only true or false from the source getters and setters
2013-10-07 11:10:49 -07:00
Chris Robinson
69d373db78
Remove al_try from alSource.c
2013-10-07 09:24:50 -07:00
Chris Robinson
0803f1b2f1
Remove al_try from alListener.c
2013-10-07 09:04:52 -07:00
Chris Robinson
c080dcae8d
Remove al_try from alState.c
2013-10-07 08:50:17 -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
44172f701c
Remove a duplicate and unused macro
2013-10-07 07:32:45 -07:00
Chris Robinson
e1d5be570e
Remove al_try usage from alBuffer.c
2013-10-07 07:06:01 -07:00
Chris Robinson
1461903e0d
Add a workaround for KDevelop not recognizing the ALIGN macro
2013-10-07 06:05:42 -07:00
Chris Robinson
8aa237ac23
Fix effect slot struct declarations so KDevelop doesn't barf on them
2013-10-07 05:41:41 -07:00
Chris Robinson
5d014ba85f
Start using a simpler method for error handling
...
This helps avoid the al_try/al_throwerr/al_endtry stuff.
2013-10-06 18:01:01 -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
69e64e1ed2
Add a workaround for KDevelop not recognizing 'restrict'
2013-10-06 03:53:20 -07:00
Chris Robinson
ba52ac9bcd
Finalize AL_SOFT_deferred_updates
2013-10-05 06:14:04 -07:00
Chris Robinson
41175ec84c
Implement the Compressor effect
2013-10-03 07:55:12 -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
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
393d0eb138
Limit lower filter gain to -100dB
2013-07-21 18:42:14 -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