Implement ALC.getStringList()
Some checks failed
CI / flash-samples (push) Successful in 1m17s
CI / docs (push) Failing after 1m18s
CI / android (stable) (push) Failing after 3m26s
CI / android (r28c) (push) Failing after 3m54s
CI / linux (push) Failing after 7m19s
CI / air-samples (4.0.5) (push) Has been cancelled
CI / macos (push) Has been cancelled
CI / windows (push) Has been cancelled
CI / ios (push) Has been cancelled
CI / package-haxelib (push) Has been cancelled
CI / air-samples (4.1.5) (push) Has been cancelled
CI / air-samples (4.2.5) (push) Has been cancelled
CI / air-samples (4.3.6) (push) Has been cancelled
CI / hashlink-samples (macos-13) (push) Has been cancelled
CI / hashlink-samples (ubuntu-22.04) (push) Has been cancelled
CI / hashlink-samples (windows-latest) (push) Has been cancelled
CI / hashlinkc-samples (macos-13) (push) Has been cancelled
CI / hashlinkc-samples (ubuntu-22.04) (push) Has been cancelled
CI / hashlinkc-samples (windows-latest) (push) Has been cancelled
CI / html5-samples (3.4.7) (push) Has been cancelled
CI / html5-samples (4.0.5) (push) Has been cancelled
CI / html5-samples (4.1.5) (push) Has been cancelled
CI / html5-samples (4.2.5) (push) Has been cancelled
CI / html5-samples (4.3.6) (push) Has been cancelled
CI / neko-samples (3.4.7, macos-13) (push) Has been cancelled
CI / neko-samples (3.4.7, ubuntu-22.04) (push) Has been cancelled
CI / neko-samples (3.4.7, windows-latest) (push) Has been cancelled
CI / neko-samples (4.2.5, macos-13) (push) Has been cancelled
CI / neko-samples (4.2.5, ubuntu-22.04) (push) Has been cancelled
CI / neko-samples (4.2.5, windows-latest) (push) Has been cancelled
CI / notify (push) Has been cancelled
Some checks failed
CI / flash-samples (push) Successful in 1m17s
CI / docs (push) Failing after 1m18s
CI / android (stable) (push) Failing after 3m26s
CI / android (r28c) (push) Failing after 3m54s
CI / linux (push) Failing after 7m19s
CI / air-samples (4.0.5) (push) Has been cancelled
CI / macos (push) Has been cancelled
CI / windows (push) Has been cancelled
CI / ios (push) Has been cancelled
CI / package-haxelib (push) Has been cancelled
CI / air-samples (4.1.5) (push) Has been cancelled
CI / air-samples (4.2.5) (push) Has been cancelled
CI / air-samples (4.3.6) (push) Has been cancelled
CI / hashlink-samples (macos-13) (push) Has been cancelled
CI / hashlink-samples (ubuntu-22.04) (push) Has been cancelled
CI / hashlink-samples (windows-latest) (push) Has been cancelled
CI / hashlinkc-samples (macos-13) (push) Has been cancelled
CI / hashlinkc-samples (ubuntu-22.04) (push) Has been cancelled
CI / hashlinkc-samples (windows-latest) (push) Has been cancelled
CI / html5-samples (3.4.7) (push) Has been cancelled
CI / html5-samples (4.0.5) (push) Has been cancelled
CI / html5-samples (4.1.5) (push) Has been cancelled
CI / html5-samples (4.2.5) (push) Has been cancelled
CI / html5-samples (4.3.6) (push) Has been cancelled
CI / neko-samples (3.4.7, macos-13) (push) Has been cancelled
CI / neko-samples (3.4.7, ubuntu-22.04) (push) Has been cancelled
CI / neko-samples (3.4.7, windows-latest) (push) Has been cancelled
CI / neko-samples (4.2.5, macos-13) (push) Has been cancelled
CI / neko-samples (4.2.5, ubuntu-22.04) (push) Has been cancelled
CI / neko-samples (4.2.5, windows-latest) (push) Has been cancelled
CI / notify (push) Has been cancelled
This commit is contained in:
@@ -3399,6 +3399,72 @@ namespace lime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
value lime_alc_get_string_list (value device, int param) {
|
||||||
|
|
||||||
|
ALCdevice* alcDevice = (ALCdevice*)val_data (device);
|
||||||
|
const char* result = alcGetString (alcDevice, param);
|
||||||
|
|
||||||
|
if (!result || *result == '\0') {
|
||||||
|
|
||||||
|
return alloc_null ();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
value list = alloc_array (0);
|
||||||
|
|
||||||
|
while (*result != '\0') {
|
||||||
|
|
||||||
|
val_array_push (list, alloc_string (result));
|
||||||
|
result += strlen (result) + 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HL_PRIM varray* HL_NAME(hl_alc_get_string_list) (HL_CFFIPointer* device, int param) {
|
||||||
|
|
||||||
|
ALCdevice* alcDevice = device ? (ALCdevice*)device->ptr : 0;
|
||||||
|
const char* result = alcGetString(alcDevice, param);
|
||||||
|
|
||||||
|
if (!result || *result == '\0') {
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
const char* temp = result;
|
||||||
|
while (*temp != '\0') {
|
||||||
|
|
||||||
|
count++;
|
||||||
|
temp += strlen (temp) + 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
varray* list = hl_alloc_array (&hlt_bytes, count);
|
||||||
|
vbyte** listData = hl_aptr (list, vbyte*);
|
||||||
|
|
||||||
|
while (*result != '\0') {
|
||||||
|
|
||||||
|
int length = strlen (result) + 1;
|
||||||
|
char* _result = (char*)malloc (length);
|
||||||
|
strcpy (_result, result);
|
||||||
|
|
||||||
|
*listData = (vbyte*)_result;
|
||||||
|
listData++;
|
||||||
|
|
||||||
|
result += length;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool lime_alc_make_context_current (value context) {
|
bool lime_alc_make_context_current (value context) {
|
||||||
|
|
||||||
ALCcontext* alcContext = (ALCcontext*)val_data (context);
|
ALCcontext* alcContext = (ALCcontext*)val_data (context);
|
||||||
@@ -3718,6 +3784,7 @@ namespace lime {
|
|||||||
DEFINE_PRIME1 (lime_alc_get_error);
|
DEFINE_PRIME1 (lime_alc_get_error);
|
||||||
DEFINE_PRIME3 (lime_alc_get_integerv);
|
DEFINE_PRIME3 (lime_alc_get_integerv);
|
||||||
DEFINE_PRIME2 (lime_alc_get_string);
|
DEFINE_PRIME2 (lime_alc_get_string);
|
||||||
|
DEFINE_PRIME2 (lime_alc_get_string_list);
|
||||||
DEFINE_PRIME1 (lime_alc_make_context_current);
|
DEFINE_PRIME1 (lime_alc_make_context_current);
|
||||||
DEFINE_PRIME1 (lime_alc_open_device);
|
DEFINE_PRIME1 (lime_alc_open_device);
|
||||||
DEFINE_PRIME1v (lime_alc_pause_device);
|
DEFINE_PRIME1v (lime_alc_pause_device);
|
||||||
@@ -3847,6 +3914,7 @@ namespace lime {
|
|||||||
DEFINE_HL_PRIM (_I32, hl_alc_get_error, _TCFFIPOINTER);
|
DEFINE_HL_PRIM (_I32, hl_alc_get_error, _TCFFIPOINTER);
|
||||||
DEFINE_HL_PRIM (_ARR, hl_alc_get_integerv, _TCFFIPOINTER _I32 _I32);
|
DEFINE_HL_PRIM (_ARR, hl_alc_get_integerv, _TCFFIPOINTER _I32 _I32);
|
||||||
DEFINE_HL_PRIM (_BYTES, hl_alc_get_string, _TCFFIPOINTER _I32);
|
DEFINE_HL_PRIM (_BYTES, hl_alc_get_string, _TCFFIPOINTER _I32);
|
||||||
|
DEFINE_HL_PRIM (_ARR, hl_alc_get_string_list, _TCFFIPOINTER _I32);
|
||||||
DEFINE_HL_PRIM (_BOOL, hl_alc_make_context_current, _TCFFIPOINTER);
|
DEFINE_HL_PRIM (_BOOL, hl_alc_make_context_current, _TCFFIPOINTER);
|
||||||
DEFINE_HL_PRIM (_TCFFIPOINTER, hl_alc_open_device, _STRING);
|
DEFINE_HL_PRIM (_TCFFIPOINTER, hl_alc_open_device, _STRING);
|
||||||
DEFINE_HL_PRIM (_VOID, hl_alc_pause_device, _TCFFIPOINTER);
|
DEFINE_HL_PRIM (_VOID, hl_alc_pause_device, _TCFFIPOINTER);
|
||||||
|
|||||||
@@ -1656,6 +1656,8 @@ class NativeCFFI
|
|||||||
|
|
||||||
@:cffi private static function lime_alc_get_string(device:CFFIPointer, param:Int):Dynamic;
|
@:cffi private static function lime_alc_get_string(device:CFFIPointer, param:Int):Dynamic;
|
||||||
|
|
||||||
|
@:cffi private static function lime_alc_get_string_list(device:CFFIPointer, param:Int):Array<Dynamic>;
|
||||||
|
|
||||||
@:cffi private static function lime_alc_make_context_current(context:CFFIPointer):Bool;
|
@:cffi private static function lime_alc_make_context_current(context:CFFIPointer):Bool;
|
||||||
|
|
||||||
@:cffi private static function lime_alc_open_device(devicename:String):CFFIPointer;
|
@:cffi private static function lime_alc_open_device(devicename:String):CFFIPointer;
|
||||||
@@ -1836,6 +1838,7 @@ class NativeCFFI
|
|||||||
private static var lime_alc_get_integerv = new cpp.Callable<cpp.Object->Int->Int->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_alc_get_integerv",
|
private static var lime_alc_get_integerv = new cpp.Callable<cpp.Object->Int->Int->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_alc_get_integerv",
|
||||||
"oiio", false));
|
"oiio", false));
|
||||||
private static var lime_alc_get_string = new cpp.Callable<cpp.Object->Int->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_alc_get_string", "oio", false));
|
private static var lime_alc_get_string = new cpp.Callable<cpp.Object->Int->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_alc_get_string", "oio", false));
|
||||||
|
private static var lime_alc_get_string_list = new cpp.Callable<cpp.Object->Int->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_alc_get_string_list", "oio", false));
|
||||||
private static var lime_alc_make_context_current = new cpp.Callable<cpp.Object->Bool>(cpp.Prime._loadPrime("lime", "lime_alc_make_context_current", "ob",
|
private static var lime_alc_make_context_current = new cpp.Callable<cpp.Object->Bool>(cpp.Prime._loadPrime("lime", "lime_alc_make_context_current", "ob",
|
||||||
false));
|
false));
|
||||||
private static var lime_alc_open_device = new cpp.Callable<String->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_alc_open_device", "so", false));
|
private static var lime_alc_open_device = new cpp.Callable<String->cpp.Object>(cpp.Prime._loadPrime("lime", "lime_alc_open_device", "so", false));
|
||||||
@@ -1969,6 +1972,7 @@ class NativeCFFI
|
|||||||
private static var lime_alc_get_error = CFFI.load("lime", "lime_alc_get_error", 1);
|
private static var lime_alc_get_error = CFFI.load("lime", "lime_alc_get_error", 1);
|
||||||
private static var lime_alc_get_integerv = CFFI.load("lime", "lime_alc_get_integerv", 3);
|
private static var lime_alc_get_integerv = CFFI.load("lime", "lime_alc_get_integerv", 3);
|
||||||
private static var lime_alc_get_string = CFFI.load("lime", "lime_alc_get_string", 2);
|
private static var lime_alc_get_string = CFFI.load("lime", "lime_alc_get_string", 2);
|
||||||
|
private static var lime_alc_get_string_list = CFFI.load("lime", "lime_alc_get_string_list", 2);
|
||||||
private static var lime_alc_make_context_current = CFFI.load("lime", "lime_alc_make_context_current", 1);
|
private static var lime_alc_make_context_current = CFFI.load("lime", "lime_alc_make_context_current", 1);
|
||||||
private static var lime_alc_open_device = CFFI.load("lime", "lime_alc_open_device", 1);
|
private static var lime_alc_open_device = CFFI.load("lime", "lime_alc_open_device", 1);
|
||||||
private static var lime_alc_pause_device = CFFI.load("lime", "lime_alc_pause_device", 1);
|
private static var lime_alc_pause_device = CFFI.load("lime", "lime_alc_pause_device", 1);
|
||||||
@@ -2318,6 +2322,11 @@ class NativeCFFI
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@:hlNative("lime", "hl_alc_get_string_list") private static function lime_alc_get_string_list(device:CFFIPointer, param:Int):hl.NativeArray<hl.Bytes>
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@:hlNative("lime", "hl_alc_make_context_current") private static function lime_alc_make_context_current(context:ALContext):Bool
|
@:hlNative("lime", "hl_alc_make_context_current") private static function lime_alc_make_context_current(context:ALContext):Bool
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -414,6 +414,11 @@ class OpenALAudioContext
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getStringList(device:ALDevice, param:Int):Array<String>
|
||||||
|
{
|
||||||
|
return ALC.getStringList(device, param);
|
||||||
|
}
|
||||||
|
|
||||||
public function isBuffer(buffer:ALBuffer):Bool
|
public function isBuffer(buffer:ALBuffer):Bool
|
||||||
{
|
{
|
||||||
return AL.isBuffer(buffer);
|
return AL.isBuffer(buffer);
|
||||||
|
|||||||
@@ -156,6 +156,31 @@ class ALC
|
|||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getStringList(device:ALDevice, param:Int):Array<String>
|
||||||
|
{
|
||||||
|
#if (lime_cffi && lime_openal && !macro)
|
||||||
|
if (param == DEVICE_SPECIFIER ||
|
||||||
|
param == ALL_DEVICES_SPECIFIER)
|
||||||
|
{
|
||||||
|
var result = NativeCFFI.lime_alc_get_string_list(device, param);
|
||||||
|
#if hl
|
||||||
|
if (result == null) return [];
|
||||||
|
var _result = [];
|
||||||
|
for (i in 0...result.length)
|
||||||
|
_result[i] = CFFI.stringValue(result[i]);
|
||||||
|
return _result;
|
||||||
|
#else
|
||||||
|
return result;
|
||||||
|
#end
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return [getString(device, param)];
|
||||||
|
#else
|
||||||
|
return null;
|
||||||
|
#end
|
||||||
|
}
|
||||||
|
|
||||||
public static function makeContextCurrent(context:ALContext):Bool
|
public static function makeContextCurrent(context:ALContext):Bool
|
||||||
{
|
{
|
||||||
#if (lime_cffi && lime_openal && !macro)
|
#if (lime_cffi && lime_openal && !macro)
|
||||||
|
|||||||
Reference in New Issue
Block a user