Is there a preferred way to loop a sound in UOS? The only method I know is "uos_EndProc", but I can't use it, due to a error: Incompatible type for arg no. 2: Got "<address of procedure;Register>", expected "<procedure variable type of procedure of object;Register>".
> Did you try the demo MorseTL ? It uses uos_EndProc.
Yeap, and it worked here. But I realized what's wrong, and it's not a UOS fault.
From what I understand, a procedure can be referenced with a "@" symbol only if that routine is inside a class. But I'm using UOS functions in a separate unit (with no classes), and it's impossible to point to any procedure there.
Solution? I had to create another procedure in the main form. And this routine calls back again another one, which has all code I need, including "uos_EndProc" calling the procedure on main form.
> if length(Memo1.text) > i then uos_EndProc(player, @CreateMorsePlayer);
It uses "@", as you see. And, because "uos_EndProc" is pointing a TForm1 procedure, it works. The problem is that FPC don't accept calls with "@" inside a unit without a object associed. And I don't why.