OpenFL version compatibility fix (reopen) (#250)

* OpenFL version compatibility fix

Uses var alias "__source" on 9.2.2 or "__audioSource" on latest, in case of using latest libraries.

* Revert "OpenFL version compatibility fix"

This reverts commit aa83aee5a5.

* OpenFL Compatibility fix

Uses (compiles) "__source" or "__audioSource" variable depending of the OpenFL version, in order to not break FlxSound.

* Revert "OpenFL Compatibility fix"

This reverts commit 18a9aeddf9.

* OpenFL compatibility fix (get/set var)

(suggestion by @NeeEoo) uses an auxiliary "__audioSource" variable for usage on latest OpenFL versions, in order to not break FlxSound class.
This commit is contained in:
Jaime Humberto Macias Bustamante
2024-03-04 17:18:06 +01:00
committed by GitHub
parent 08b50ff98c
commit c574073523
+9
View File
@@ -64,6 +64,7 @@ import lime.media.AudioSource;
@:noCompletion private var __soundTransform:SoundTransform;
#if lime
@:noCompletion private var __source:AudioSource;
@:noCompletion private var __audioSource(get, set):AudioSource;
#end
#if openfljs
@@ -232,6 +233,14 @@ import lime.media.AudioSource;
__dispose();
dispatchEvent(new Event(Event.SOUND_COMPLETE));
}
function set___audioSource(value:AudioSource):AudioSource {
return __source = value;
}
function get___audioSource():AudioSource {
return __source;
}
}
#else
typedef SoundChannel = flash.media.SoundChannel;