Chris Robinson
cae78e79e8
Convert the examples from SDL_sound to libsndfile
2020-03-24 15:46:47 -07:00
Chris Robinson
586bc94d51
Use libsndfile for the alplay example
2020-03-24 13:36:49 -07:00
Chris Robinson
c24d127229
Avoid non-namespace template specialization
2020-03-24 12:03:07 -07:00
Chris Robinson
cc27bbb680
Clear the WASAPI device list when enumerating
2020-03-24 11:48:25 -07:00
Chris Robinson
62f17d8763
Don't send close messages for unopened WASAPI devices
2020-03-24 11:40:34 -07:00
Chris Robinson
eed8407599
Remove some unused functions
2020-03-23 17:18:11 -07:00
Chris Robinson
7effad45c2
Clean up ALfilter some
...
Use inline methods instead of macros
Fix indentation
Add some consts
2020-03-23 16:31:08 -07:00
Chris Robinson
6a3b3b180b
Add a macro to disable class-specific new/delete
2020-03-23 16:00:50 -07:00
Chris Robinson
b53294e291
Use inline initialization more for sources
2020-03-23 15:04:26 -07:00
Chris Robinson
5d0f90fed0
Avoid ## in a macro
...
Cppcheck thinks it's an invalid use of it
2020-03-23 14:26:00 -07:00
Chris Robinson
41b4c06697
Simplify clamping the voice mix size
2020-03-23 11:35:08 -07:00
Chris Robinson
132a69c03d
Use more appropriate types for bitfields
2020-03-22 21:34:50 -07:00
Chris Robinson
46234171d1
Clean up some C++11-isms
2020-03-22 21:15:12 -07:00
Chris Robinson
dc8ccc06ce
More cleanup for the pitch shifter
2020-03-22 20:48:02 -07:00
Chris Robinson
813d4ed566
Use make_unique instead of new'ing into a unique_ptr
2020-03-22 18:48:33 -07:00
Chris Robinson
49b2d703e7
Properly define the new[] and delete[] operators
2020-03-22 13:28:45 -07:00
Chris Robinson
3c631149e3
Update AppVeyor to VS 2017 for 32-bit
2020-03-22 11:41:57 -07:00
Chris Robinson
be1584ab47
Avoid assigning in a conditional expression
2020-03-22 11:35:08 -07:00
Chris Robinson
ef663f13c0
Properly allocate voices
2020-03-22 11:34:37 -07:00
Chris Robinson
3d09898d40
Use the correct include for al::fstream
2020-03-22 11:09:19 -07:00
Chris Robinson
2acdcba8d1
Silence a potential type truncation warning
2020-03-22 10:41:23 -07:00
Chris Robinson
f3ff28fb2a
Some type cleanup
2020-03-22 10:41:02 -07:00
Chris Robinson
d30d9a2c9f
Clean up the pitch and frequency shifter some
2020-03-22 10:06:23 -07:00
Chris Robinson
002d0eb6a0
Fix the frequency shifter channel panning
2020-03-22 08:51:59 -07:00
Chris Robinson
9ce182228d
Avoid some pre-C++14 workarounds
2020-03-22 08:51:06 -07:00
Chris Robinson
040309b9f4
Add missing semicolon
2020-03-22 08:22:25 -07:00
Chris Robinson
f6a0b004e0
Update to C++14
2020-03-22 08:05:22 -07:00
Chris Robinson
adf28d87aa
Remove the check for stat()
...
It's POSIX-2001 standard
2020-03-21 08:39:45 -07:00
Chris Robinson
12775513ae
Cleanup some helper code
2020-03-20 15:48:27 -07:00
Chris Robinson
0d11de3e8d
Move CPUCapFlags and FillCPUCaps to their own source
2020-03-20 15:30:41 -07:00
Chris Robinson
f56ef433d8
Move the FPUCtl methods to its own source
2020-03-20 15:01:45 -07:00
Chris Robinson
ad98895876
Avoid a function call to get the channel count
2020-03-18 04:08:26 -07:00
Chris Robinson
7805179313
Rename a method to be clearer
2020-03-18 03:17:14 -07:00
Chris Robinson
54e2eafcc9
Make the pulseaudio enumeration functions class methods
2020-03-18 03:07:54 -07:00
Chris Robinson
9f077d5f41
Remove a couple unused methods
2020-03-18 02:35:31 -07:00
Chris Robinson
bf50f227b9
Use a busy-wait when synchronizing against the mixer
...
The mixer should have higher priority than any thread that can make AL calls,
so even on single-core systems, it shouldn't stall the mix. It will, however,
return back to the caller as soon as it can, while yielding will give up the
timeslice if there's any other thread waiting to process even if the mix is
almost done.
2020-03-16 01:05:14 -07:00
Chris Robinson
78251fd7e6
Fix voices being forced to update without valid properties
...
When starting a voice, the source ID was set before its first update struct was
provided, creating a small window where a listener or effect slot update could
force a voice to update without it having any valid properties to update with.
Supplying the update struct first would create a different race, where the
mixer could see a voice without a source but with an update struct, causing the
update struct to be 'freed' without being applied.
The fix here is to provide the update struct before setting the source ID, and
change the mixer to ignore update structs for voices without a source ID. This
can pseudo-orphan the updates that get set on a voice just as it stops, leaving
the struct unusable until the voice is used again, or the voice gets deleted
which will clear it. But it allows the update struct to stay in place and get
applied once the voice gets a source ID.
2020-03-04 23:18:05 -08:00
Chris Robinson
48b9b541ec
Avoid redundantly setting voice members
2020-03-04 13:40:21 -08:00
Chris Robinson
971862a80c
Don't change flags after InitVoice
2020-03-04 11:01:35 -08:00
Chris Robinson
e7405f7801
Use a new voice state to indicate a pending source offset change
2020-03-04 10:16:59 -08:00
Chris Robinson
08dc831e0e
Avoid unnecessarily reclearing some variables
2020-03-03 20:44:19 -08:00
Chris Robinson
accc1ec1c8
Add a helper to wait for the device mix
2020-03-03 20:32:44 -08:00
Chris Robinson
3e1a2c0f77
Use an intrusive_ptr for the device's HrtfStore
2020-03-01 17:16:09 -08:00
Chris Robinson
a01617904c
Simplify getting a voice for a new source offset
2020-02-28 20:07:43 -08:00
Chris Robinson
b42d241da5
Use real-time priority by default
2020-02-26 09:53:06 -08:00
Chris Robinson
eb49290dab
Remove unnecessary locks now that the mixer doesn't require one
2020-02-26 04:58:02 -08:00
Chris Robinson
4555b74bd7
Use a VoiceChange object to change the offset of a playing source
2020-02-26 03:52:40 -08:00
Chris Robinson
872096958b
Rename the voice's PendingStop to PendingChange
2020-02-26 01:48:59 -08:00
Chris Robinson
814f80ec59
Move voice initialization to a separate function
2020-02-26 01:39:30 -08:00
Chris Robinson
8618571866
Avoid storing the source offset when it's just read and reset
2020-02-26 01:03:23 -08:00