PulseAudio  16.0
scache.h File Reference

All sample cache related routines. More...

Go to the source code of this file.

Typedefs

typedef void(* pa_context_play_sample_cb_t) (pa_context *c, uint32_t idx, void *userdata)
 Callback prototype for pa_context_play_sample_with_proplist(). More...
 

Functions

int pa_stream_connect_upload (pa_stream *s, size_t length)
 Make this stream a sample upload stream. More...
 
int pa_stream_finish_upload (pa_stream *s)
 Finish the sample upload, the stream name will become the sample name. More...
 
pa_operationpa_context_remove_sample (pa_context *c, const char *name, pa_context_success_cb_t cb, void *userdata)
 Remove a sample from the sample cache. More...
 
pa_operationpa_context_play_sample (pa_context *c, const char *name, const char *dev, pa_volume_t volume, pa_context_success_cb_t cb, void *userdata)
 Play a sample from the sample cache to the specified device. More...
 
pa_operationpa_context_play_sample_with_proplist (pa_context *c, const char *name, const char *dev, pa_volume_t volume, const pa_proplist *proplist, pa_context_play_sample_cb_t cb, void *userdata)
 Play a sample from the sample cache to the specified device, allowing specification of a property list for the playback stream. More...
 

Detailed Description

All sample cache related routines.

See also Sample Cache

Typedef Documentation

◆ pa_context_play_sample_cb_t

typedef void(* pa_context_play_sample_cb_t) (pa_context *c, uint32_t idx, void *userdata)

Callback prototype for pa_context_play_sample_with_proplist().

The idx value is the index of the sink input object, or PA_INVALID_INDEX on failure.

Since
0.9.11

Function Documentation

◆ pa_context_play_sample()

pa_operation* pa_context_play_sample ( pa_context c,
const char *  name,
const char *  dev,
pa_volume_t  volume,
pa_context_success_cb_t  cb,
void *  userdata 
)

Play a sample from the sample cache to the specified device.

If the latter is NULL use the default sink. Returns an operation object

Parameters
cContext
nameName of the sample to play
devSink to play this sample on
volumeVolume to play this sample with. Starting with 0.9.15 you may pass here PA_VOLUME_INVALID which will leave the decision about the volume to the server side, which is a good idea.
cbCall this function after successfully starting playback, or NULL
userdataUserdata to pass to the callback

◆ pa_context_play_sample_with_proplist()

pa_operation* pa_context_play_sample_with_proplist ( pa_context c,
const char *  name,
const char *  dev,
pa_volume_t  volume,
const pa_proplist proplist,
pa_context_play_sample_cb_t  cb,
void *  userdata 
)

Play a sample from the sample cache to the specified device, allowing specification of a property list for the playback stream.

If the latter is NULL use the default sink. Returns an operation object.

Since
0.9.11
Parameters
cContext
nameName of the sample to play
devSink to play this sample on
volumeVolume to play this sample with. Starting with 0.9.15 you may pass here PA_VOLUME_INVALID which will leave the decision about the volume to the server side, which is a good idea.
proplistProperty list for this sound. The property list of the cached entry will have this merged into it.
cbCall this function after successfully starting playback, or NULL
userdataUserdata to pass to the callback

◆ pa_context_remove_sample()

pa_operation* pa_context_remove_sample ( pa_context c,
const char *  name,
pa_context_success_cb_t  cb,
void *  userdata 
)

Remove a sample from the sample cache.

Returns an operation object which may be used to cancel the operation while it is running.

◆ pa_stream_connect_upload()

int pa_stream_connect_upload ( pa_stream s,
size_t  length 
)

Make this stream a sample upload stream.

Returns zero on success.

◆ pa_stream_finish_upload()

int pa_stream_finish_upload ( pa_stream s)

Finish the sample upload, the stream name will become the sample name.

You cancel a sample upload by issuing pa_stream_disconnect(). Returns zero on success.