BASS_Encode_SetNotify


Sets a callback function on an encoder (or all encoders on a channel) to receive notifications about its status.

BOOL BASS_Encode_SetNotify(
    DWORD handle,
    ENCODENOTIFYPROC *proc,
    void *user
);

Parameters

handleThe encoder or channel handle... a HENCODE, HSTREAM, HMUSIC, or HRECORD.
procCallback function to receive the notifications... NULL = no callback.
userUser instance data to pass to the callback function.

Return value

If successful, TRUE is returned, else FALSE is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_HANDLEhandle is not valid.

Remarks

When setting a notification callback on a channel, it only applies to the encoders that are currently set on the channel. Subsequent encoders will not automatically have the notification callback set on them, this function will have to be called again to set them up.

An encoder can only have one notification callback set. Subsequent calls of this function can be used to change the callback function, or disable notifications (proc = NULL).

The status of an encoder and its cast connection (if it has one) is checked when data is sent to the encoder or server, and by BASS_Encode_IsActive. That means an encoder's death will not be detected automatically, and so no notification given, while no data is being encoded.

If the encoder is already dead when setting up a notification callback, the callback will be triggered immediately.

See also

BASS_Encode_Start, ENCODENOTIFYPROC