in normal case a long procedure returns a long-limited number (that is what I want):
Code: Select all
Procedure.l test()
ProcedureReturn $FFFFFFFF ; = 4294967295
EndProcedure
Debug test() ; returns -1
https://www.videolan.org/developers/vlc ... 19203302a30 if the volume was set, -1 if it was out of range
Code: Select all
CompilerSelect #PB_Compiler_OS
CompilerCase #PB_OS_Windows
SetEnvironmentVariable("VLC_PLUGIN_PATH", GetEnvironmentVariable("ProgramFiles") + "\VideoLAN\VLC\plugins\")
SetEnvironmentVariable("VLC_LIBRARY_PATH", GetEnvironmentVariable("ProgramFiles") + "\VideoLAN\VLC\libvlc.dll")
SetEnvironmentVariable("PATH", GetEnvironmentVariable("PATH") + ";" + GetPathPart(GetEnvironmentVariable("VLC_LIBRARY_PATH")))
CompilerCase #PB_OS_MacOS
SetEnvironmentVariable("VLC_PLUGIN_PATH", "/Applications/VLC.app/Contents/MacOS/plugins/")
SetEnvironmentVariable("VLC_LIBRARY_PATH", "/Applications/VLC.app/Contents/MacOS/lib/libvlc.dylib")
CompilerCase #PB_OS_Linux
SetEnvironmentVariable("VLC_PLUGIN_PATH", "/usr/lib/vlc/codecs/")
SetEnvironmentVariable("VLC_LIBRARY_PATH", "/usr/lib/libvlc.so")
CompilerEndSelect
Global libvlc_main = OpenLibrary(#PB_Any, GetEnvironmentVariable("VLC_LIBRARY_PATH"))
PrototypeC.i p_libvlc_new(argc.i, *argv)
Global libvlc_new.p_libvlc_new = GetFunction(libvlc_main, "libvlc_new")
PrototypeC.i p_libvlc_media_player_new(*p_instance)
Global libvlc_media_player_new.p_libvlc_media_player_new = GetFunction(libvlc_main, "libvlc_media_player_new")
PrototypeC.l p_libvlc_audio_set_volume(*p_ml, i_volume.i) ; should return a long!
Global libvlc_audio_set_volume.p_libvlc_audio_set_volume = GetFunction(libvlc_main, "libvlc_audio_set_volume")
*vlc_inst = libvlc_new(0, 0)
Debug *vlc_inst
*vlc_player = libvlc_media_player_new(*vlc_inst)
Debug *vlc_player
Debug libvlc_audio_set_volume(*vlc_player, -4545) ; enter an invalid volume, get an error 4294967295 (should be -1)