When using the ASYNC API under Windows, the call to player_new() will spawn a separate thread for the decoding. Message exchange between the controlling application and the player is done though the standard Windows Message Queues.
The caller can specifiy if it wants messages sent back from the player to be delivered to a window's message handler or to the thread's message queue. If the argument to player_new() is NULL, then messages will be posted back to the calling thread's message queue. If the parameter is a pointer to an HWND variable that contains the Window Handle of a window that has been created, then messages will be posted to that window's message handler.Example:
player_new((void**)&Player.dthread, (void*)&m_hWnd);
To use the Delphi Interface, you need to install the component. Use the 'install component' menu. This will prompt you for the filename of the component, and which package to install it into. Typically, you can install it into the "user" package found under Borland\Delphi\Lib\Dclusr30.dpl (Delphi 3.0). The component file is XaudioPlayer.pas found under lib\delphi in the SDK distribution. Once you have installed the component, it will appear on your component panel, int a category named 'Xaudio'. A small icon with a ref X over a black circle will show the component.
When using the ASYNC API under Unix, the call to player_new() will fork a separate process for the decoding. Message exchange between the controlling application and the player is done though a pipe. If the controlling application wants to install a notifier function that is called when messages are being sent back from the player (Typically an X Windows application will want to do that, so that the main X loop will call the notification function when data arrives on the message queue), it can read the file descriptior of the pipe.
For that, it will need to include the file control_pipe.h and cast the player pointer to an XA_PipeControl structure, which contains the file descriptor of the pipe.Example:
input_id = XtAppAddInput(app_context, player->command_read_pipe, (XtPointer) XtInputReadMask, PipeInputCB, NULL);