add PortAudio backend - PLEASE READ

PLEASE DO:

```
git submodule update --init --recursive
```

AFTER PULLING THIS COMMIT.
This commit is contained in:
tildearrow 2023-08-30 17:32:51 -05:00
parent 7d605c9d76
commit 68787a4d8b
9 changed files with 340 additions and 4 deletions

View file

@ -32,6 +32,9 @@
#ifdef HAVE_JACK
#include "../audio/jack.h"
#endif
#ifdef HAVE_PA
#include "../audio/pa.h"
#endif
#include <math.h>
#include <float.h>
#include <fmt/printf.h>
@ -3279,6 +3282,8 @@ bool DivEngine::initAudioBackend() {
if (audioEngine==DIV_AUDIO_NULL) {
if (getConfString("audioEngine","SDL")=="JACK") {
audioEngine=DIV_AUDIO_JACK;
} else if (getConfString("audioEngine","SDL")=="PortAudio") {
audioEngine=DIV_AUDIO_PORTAUDIO;
} else {
audioEngine=DIV_AUDIO_SDL;
}
@ -3322,6 +3327,21 @@ bool DivEngine::initAudioBackend() {
#endif
#else
output=new TAAudioJACK;
#endif
break;
case DIV_AUDIO_PORTAUDIO:
#ifndef HAVE_PA
logE("Furnace was not compiled with PortAudio!");
setConf("audioEngine","SDL");
saveConf();
#ifdef HAVE_SDL2
output=new TAAudioSDL;
#else
logE("Furnace was not compiled with SDL support either!");
output=new TAAudio;
#endif
#else
output=new TAAudioPA;
#endif
break;
case DIV_AUDIO_SDL:

View file

@ -73,6 +73,7 @@ enum DivStatusView {
enum DivAudioEngines {
DIV_AUDIO_JACK=0,
DIV_AUDIO_SDL=1,
DIV_AUDIO_PORTAUDIO=2,
DIV_AUDIO_NULL=126,
DIV_AUDIO_DUMMY=127