(get-available-source) ( sources source# stop-source# -- next-source# al-source/f )


Vocabulary
audio.engine.private

Inputs
sourcesan object
source#an object
stop-source#an object


Outputs
next-source#an object
al-source/fan object


Definition


:: (get-available-source)
( sources source# stop-source# -- next-source# al-source/f )
source# sources nth :> al-source source# 1 +
sources length mod :> next-source# al-source {
[ AL_BUFFERS_PROCESSED get-source-param 0 = ]
[ AL_BUFFERS_QUEUED get-source-param 0 = ]
[
AL_SOURCE_STATE get-source-param
{ 4113 4116 } member?
]
} 1&&
[ next-source# al-source ] [
next-source# stop-source# =
[ next-source# f ] [
sources next-source# stop-source#
(get-available-source)
] if
] if ;