839 Commits

Author SHA1 Message Date
Chris Robinson
7c93308771 Remove checks for functions that always exist
They're part of C++11 and available on the testing systems. If some system has
trouble, switching to proper C++ calls should fix it.
2018-11-15 17:53:05 -08:00
Chris Robinson
245b7ff0b4 Remove the unused al_string API 2018-11-15 06:32:01 -08:00
Chris Robinson
7b3a2085aa Use a regular char* for the device's name 2018-11-15 06:23:01 -08:00
Chris Robinson
46301a087c Use C++ a bit more with alc.cpp 2018-11-14 06:17:47 -08:00
Chris Robinson
a5f68c2121 Avoid using ATOMIC_FLAG
Although it cant potentially be better than a regular atomic, it presents
compatibility issues when non-C11 atomics are mixed with C++
2018-11-13 20:26:32 -08:00
Chris Robinson
a6d780574d Make the enumerated HRTF entry name a char*
Would ideally be a std::string with the HRTF name itself, but they're still
seen in C code.
2018-11-12 22:26:12 -08:00
Chris Robinson
d4d0b1fdd4 Use a regular char* for the HRTF string name 2018-11-12 19:02:38 -08:00
Chris Robinson
51ed335833 Use C++ more with helpers.cpp 2018-11-11 19:17:40 -08:00
Chris Robinson
1e8c6df7b9 Add a C++ ContextRef helper to manage a ALCcontext reference 2018-10-31 10:05:15 -07:00
Chris Robinson
f3f94e478b Don't limit output for ALC_DONT_CARE_SOFT and float samples 2018-10-03 13:48:04 -07:00
Chris Robinson
79314c4461 Include the limiter's lookAhead delay in the device latency 2018-09-25 23:05:27 -07:00
Chris Robinson
b6d0ff02c2 Use an internal event to more timely release old effect states 2018-09-21 04:14:15 -07:00
Chris Robinson
f21e2df4cf Remove an unnecessary mutex 2018-09-20 22:53:16 -07:00
Chris Robinson
ebbbeb0d66 Put user events in a union structure 2018-09-20 21:59:38 -07:00
Chris Robinson
cb8545346d Always start the event thread with the context 2018-09-20 19:58:01 -07:00
Chris Robinson
ea95a8adef Combine nearly-duplicate structures 2018-09-19 21:31:46 -07:00
Chris Robinson
46cfedb117 Pass the device name list to the backend probe method 2018-09-07 22:02:37 -07:00
Jan Niklas Hasse
a80ab01227 Correctly check byte order for newer Android compiler, fix #203 2018-06-20 21:36:33 +02:00
Chris Robinson
720ec2beea Use the __BYTE_ORDER__ macro when available 2018-05-21 17:51:57 -07:00
Chris Robinson
197e88cdcc Avoid using unsigned values for signed 2018-05-15 01:20:39 -07:00
Chris Robinson
4ac4889912 Avoid unnecessary function-like macros 2018-05-15 00:53:12 -07:00
Chris Robinson
1e04c4c689 Make a faster float2int method for x87 targets 2018-05-12 22:34:15 -07:00
Chris Robinson
5c0673049c Fix MSVC 2018-05-12 03:31:58 -07:00
Chris Robinson
f240952bcc Fix non-SEE (32-bit) GCC builds 2018-05-12 00:58:27 -07:00
Chris Robinson
e787a241c0 Add and use a method for fast float rounding
Unlike fastf2i, this keeps the result as a float instead of converting to
integer.
2018-05-12 00:52:09 -07:00
Chris Robinson
1fb6428ffa Another fix attempt for 32-bit MSVC 2018-05-04 04:02:57 -07:00
Chris Robinson
b31a54e972 Try to fix 32-bit MSVC builds 2018-05-04 02:56:01 -07:00
Chris Robinson
75e2cb97f7 Don't assume round-to-zero for fastf2i 2018-05-04 02:09:32 -07:00
Chris Robinson
ac8dbd7a56 Add a specific function for truncating float-to-int conversions 2018-05-03 22:02:32 -07:00
Chris Robinson
ace8e64850 Only use fast float-to-int workarounds for x87
At least SSE and ARM have opcodes that handle float-to-int conversions well
enough. Also, Clang doesn't inline lrintf, incurring function call overhead for
what should be a single opcode.
2018-04-21 21:07:20 -07:00
Chris Robinson
a55c93e1f5 Improve ASSUME for Clang
For some reason, the { if(!x)__builtin_unreachable(); } construct does not
provide the same optimization opportunity for Clang (even though the condition
being false would trigger undefined behavior by reaching unreachable code, it
still performs checks and such for the condition potentially being false).
Using __builtin_assume seems to work better.
2018-04-21 01:54:43 -07:00
Chris Robinson
150586d7fe Add an ASSUME macro that requires a true condition 2018-04-17 22:50:50 -07:00
Chris Robinson
30821e978b Add extern "C" to some headers 2018-03-09 17:24:03 -08:00
Chris Robinson
4e6c758daf Use a plain mutex for the property lock 2018-03-03 13:42:37 -08:00
Chris Robinson
bd32a682f7 Use atomic variables instead of volatile 2018-03-02 19:16:55 -08:00
Chris Robinson
d25398d2c7 Avoid using static inline in headers 2018-02-25 13:14:14 -08:00
Chris Robinson
5b11129eaa Use a function pointer for applying the dry mix post-process 2018-02-10 15:50:05 -08:00
Chris Robinson
9b878c64f9 Make the Connected state atomic
Also don't send the Disconnected event more than once.
2018-02-04 00:01:12 -08:00
Chris Robinson
40bda4d93f Add a disconnected event type 2018-02-03 01:07:06 -08:00
Chris Robinson
e240351d81 Use a semaphore to signal the event handler
Semaphores allow for semi-persistent signals, compared to a condition variable
which requires a mutex for proper detection. A semaphore can be 'post'ed after
writing some data on one thread, and another thread will be able to recognize
it quickly even if the post occured in between checking for data and waiting.

This more correctly fixes a race condition with events since the mixer
shouldn't be using mutexes, and arbitrary wake-ups just to make sure an event
wasn't missed was quite inefficient.
2018-02-01 18:20:14 -08:00
Chris Robinson
7256bc92fa Add a thread to marshal events from the mixer
To avoid having unknown user code running in the mixer thread that could
significantly delay the mixed output, a lockless ringbuffer is used for the
mixer to provide events that a secondary thread will pop off and process.
2018-01-31 20:21:54 -08:00
Chris Robinson
0394d5a44f Rename EventLock to make it more clear it's protecting the callback 2018-01-30 12:34:25 -08:00
Chris Robinson
c2710ffe87 Make EnabledEvts atomic 2018-01-28 16:58:41 -08:00
Chris Robinson
f16ece6048 Move some inline functions into a header instead of copying them
Unfortunately does not include the Lookup* functions, which need the full type
declaration to offset the pointer.
2018-01-27 21:16:24 -08:00
Chris Robinson
cb9fb31214 Store filters in an array of lists 2018-01-27 19:40:47 -08:00
Chris Robinson
e8c268ef09 Store effects in an array of lists 2018-01-27 19:04:32 -08:00
Chris Robinson
6a839600b9 Use a vector to store the effect slot pointers
And make the ID a simple index into it (1-base, to avoid ID 0).
2018-01-27 19:04:32 -08:00
Chris Robinson
031cf24880 Use an array lookup for source IDs
This is now similar to buffers, being stored in groups of 64 in a vector with
the ID providing the array indices.
2018-01-27 14:34:05 -08:00
Chris Robinson
f76ab02bd4 Add a ctz64 fallback using _BitScanForward when available 2018-01-27 14:34:05 -08:00
Chris Robinson
9718502e5d Check for _BitScanForward64 before using it 2018-01-27 11:11:39 -08:00