Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,9 @@ public domain. For details, see [project/lib/lzma/](project/lzma).
This product bundles mbedTLS 2.6.0, which is available under an
"Apache 2.0" license. For details, see [project/lib/mbedtls/](project/lib).

This product bundles OpenAL-Soft 1.19.0, which is available under an
This product bundles OpenAL-Soft 1.25.1, which is available under an
"LGPLv2" license. For details, see [project/lib/openal/](project/lib).

_OpenAL-Soft is only included in dynamically-linked builds, it is excluded
from Lime static builds in order to preserve Lime's permissive nature._

This product bundles pixman 0.32.8, which is available under an
"MIT" license. For details, see [project/lib/pixman/](project/lib).

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
#ifdef NATIVE_TOOLKIT_HAVE_SDL

#define HAVE_OPENSL 0

#else

#define HAVE_OPENSL 1

#endif

#define HAVE_ALSA 0

#define HAVE_OSS 0
Expand All @@ -22,6 +32,4 @@

#define HAVE_COREAUDIO 0

#define HAVE_OPENSL 1

#define HAVE_OBOE 0
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
#ifdef NATIVE_TOOLKIT_HAVE_SDL

#define HAVE_COREAUDIO 0

#else

#define HAVE_COREAUDIO 1

#endif

#define HAVE_ALSA 0

#define HAVE_OSS 0
Expand All @@ -20,8 +30,6 @@

#define HAVE_JACK 0

#define HAVE_COREAUDIO 1

#define HAVE_OPENSL 0

#define HAVE_OBOE 0
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
#define HAVE_ALSA 1
#ifdef NATIVE_TOOLKIT_HAVE_SDL

#define HAVE_OSS 0
#define HAVE_ALSA 0

#define HAVE_PIPEWIRE 0

#define HAVE_PULSEAUDIO 0

#else

#define HAVE_ALSA 1

#define HAVE_PIPEWIRE 1

#define HAVE_PULSEAUDIO 1

#endif

#define HAVE_OSS 0

#define HAVE_SOLARIS 0

#define HAVE_SNDIO 0
Expand All @@ -16,8 +30,6 @@

#define HAVE_PORTAUDIO 0

#define HAVE_PULSEAUDIO 1

#define HAVE_JACK 0

#define HAVE_COREAUDIO 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
#ifdef NATIVE_TOOLKIT_HAVE_SDL

#define HAVE_WASAPI 0

#define HAVE_DSOUND 0

#else

#define HAVE_WASAPI 1

#define HAVE_DSOUND 1

#endif

#define HAVE_ALSA 0

#define HAVE_OSS 0
Expand All @@ -8,10 +22,6 @@

#define HAVE_SNDIO 0

#define HAVE_WASAPI 1

#define HAVE_DSOUND 1

#define HAVE_WINMM 0

#define HAVE_PORTAUDIO 0
Expand Down
2 changes: 1 addition & 1 deletion project/lib/custom/openal/include/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
#define ALSOFT_GIT_BRANCH "master"

/* Define the hash of the head commit */
#define ALSOFT_GIT_COMMIT_HASH "1d52120"
#define ALSOFT_GIT_COMMIT_HASH "0887e589"
15 changes: 8 additions & 7 deletions project/lib/openal-files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,15 @@

<section>

<section>
<file name="${NATIVE_TOOLKIT_PATH}/openal/alc/backends/null.cpp" />
<file name="${NATIVE_TOOLKIT_PATH}/openal/alc/backends/base.cpp" />
<file name="${NATIVE_TOOLKIT_PATH}/openal/alc/backends/loopback.cpp" />

<file name="${NATIVE_TOOLKIT_PATH}/openal/alc/backends/base.cpp" />
<file name="${NATIVE_TOOLKIT_PATH}/openal/alc/backends/loopback.cpp" />
<file name="${NATIVE_TOOLKIT_PATH}/openal/alc/backends/null.cpp" />
</section>

</section>
<file name="${NATIVE_TOOLKIT_PATH}/openal/alc/backends/sdl3.cpp" if="NATIVE_TOOLKIT_HAVE_SDL" />

<section unless="NATIVE_TOOLKIT_HAVE_SDL" >

<file name="${NATIVE_TOOLKIT_PATH}/openal/alc/backends/opensl.cpp" if="android" />

Expand All @@ -158,8 +160,6 @@

</section>

<file name="${NATIVE_TOOLKIT_PATH}/openal/alc/backends/sdl3.cpp" if="NATIVE_TOOLKIT_HAVE_SDL" />

</section>

<section>
Expand Down Expand Up @@ -201,6 +201,7 @@
<file name="${NATIVE_TOOLKIT_PATH}/openal/common/almalloc.cpp" />
<file name="${NATIVE_TOOLKIT_PATH}/openal/common/alstring.cpp" />
<file name="${NATIVE_TOOLKIT_PATH}/openal/common/althrd_setname.cpp" />
<file name="${NATIVE_TOOLKIT_PATH}/openal/common/altypes.cpp" />
<file name="${NATIVE_TOOLKIT_PATH}/openal/common/dynload.cpp" />
<file name="${NATIVE_TOOLKIT_PATH}/openal/common/filesystem.cpp" />
<file name="${NATIVE_TOOLKIT_PATH}/openal/common/pffft.cpp" />
Expand Down
44 changes: 3 additions & 41 deletions src/lime/media/AudioManager.hx
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,10 @@ class AudioManager
alc.makeContextCurrent(ctx);
alc.processContext(ctx);

#if (lime_openalsoft && !mobile)
if (alc.isExtensionPresent('ALC_SOFT_system_events', device) && alc.isExtensionPresent('ALC_SOFT_reopen_device', device))
#if (lime_openalsoft)
if (alc.isExtensionPresent('AL_SOFT_hold_on_disconnect'))
{
if (alc.isExtensionPresent('AL_SOFT_hold_on_disconnect'))
alc.disable(AL.STOP_SOURCES_ON_DISCONNECT_SOFT);

alc.eventControlSOFT([ALC.EVENT_TYPE_DEFAULT_DEVICE_CHANGED_SOFT, ALC.EVENT_TYPE_DEVICE_ADDED_SOFT, ALC.EVENT_TYPE_DEVICE_REMOVED_SOFT], true);

alc.eventCallbackSOFT(deviceEventCallback);
alc.disable(AL.STOP_SOURCES_ON_DISCONNECT_SOFT);
}
#end
}
Expand Down Expand Up @@ -139,39 +134,6 @@ class AudioManager
#end
}

#if lime_openalsoft
@:noCompletion
private static function deviceEventCallback(eventType:Int, deviceType:Int, handle:CFFIPointer, message:#if hl hl.Bytes #else String #end):Void
{
#if !lime_doc_gen
if (eventType == ALC.EVENT_TYPE_DEFAULT_DEVICE_CHANGED_SOFT && deviceType == ALC.PLAYBACK_DEVICE_SOFT)
{
var device = new ALDevice(handle);

MainLoop.runInMainThread(function():Void
{
var alc = context.openal;

if (device == null)
{
var currentContext = alc.getCurrentContext();

var device = alc.getContextsDevice(currentContext);

if (device != null)
alc.reopenDeviceSOFT(device, null, null);
}
else
{
alc.reopenDeviceSOFT(device, null, null);
}

});
}
#end
}
#end

@:noCompletion
private static function setupConfig():Void
{
Expand Down