Lines Matching refs:sample
36 pa_scache_entry *sample; member
146 idx = s->sample->index; in handle_get_index()
158 pa_dbus_send_basic_variant_reply(conn, msg, DBUS_TYPE_STRING, &s->sample->name); in handle_get_name()
169 if (!s->sample->memchunk.memblock) { in handle_get_sample_format()
171 … "Sample %s isn't loaded into memory yet, so its sample format is unknown.", s->sample->name); in handle_get_sample_format()
175 sample_format = s->sample->sample_spec.format; in handle_get_sample_format()
188 if (!s->sample->memchunk.memblock) { in handle_get_sample_rate()
190 … "Sample %s isn't loaded into memory yet, so its sample rate is unknown.", s->sample->name); in handle_get_sample_rate()
194 sample_rate = s->sample->sample_spec.rate; in handle_get_sample_rate()
208 if (!s->sample->memchunk.memblock) { in handle_get_channels()
210 … "Sample %s isn't loaded into memory yet, so its channel map is unknown.", s->sample->name); in handle_get_channels()
214 for (i = 0; i < s->sample->channel_map.channels; ++i) in handle_get_channels()
215 channels[i] = s->sample->channel_map.map[i]; in handle_get_channels()
217 …pa_dbus_send_basic_array_variant_reply(conn, msg, DBUS_TYPE_UINT32, channels, s->sample->channel_m… in handle_get_channels()
229 if (!s->sample->volume_is_set) { in handle_get_default_volume()
231 "Sample %s doesn't have default volume stored.", s->sample->name); in handle_get_default_volume()
235 for (i = 0; i < s->sample->volume.channels; ++i) in handle_get_default_volume()
236 default_volume[i] = s->sample->volume.values[i]; in handle_get_default_volume()
238 …pa_dbus_send_basic_array_variant_reply(conn, msg, DBUS_TYPE_UINT32, default_volume, s->sample->vol… in handle_get_default_volume()
249 if (!s->sample->memchunk.memblock) { in handle_get_duration()
251 … "Sample %s isn't loaded into memory yet, so its duration is unknown.", s->sample->name); in handle_get_duration()
255 duration = pa_bytes_to_usec(s->sample->memchunk.length, &s->sample->sample_spec); in handle_get_duration()
268 if (!s->sample->memchunk.memblock) { in handle_get_bytes()
270 … "Sample %s isn't loaded into memory yet, so its size is unknown.", s->sample->name); in handle_get_bytes()
274 bytes = s->sample->memchunk.length; in handle_get_bytes()
307 idx = s->sample->index; in handle_get_all()
308 if (s->sample->memchunk.memblock) { in handle_get_all()
309 sample_format = s->sample->sample_spec.format; in handle_get_all()
310 sample_rate = s->sample->sample_spec.rate; in handle_get_all()
311 for (i = 0; i < s->sample->channel_map.channels; ++i) in handle_get_all()
312 channels[i] = s->sample->channel_map.map[i]; in handle_get_all()
313 duration = pa_bytes_to_usec(s->sample->memchunk.length, &s->sample->sample_spec); in handle_get_all()
314 bytes = s->sample->memchunk.length; in handle_get_all()
316 if (s->sample->volume_is_set) { in handle_get_all()
317 for (i = 0; i < s->sample->volume.channels; ++i) in handle_get_all()
318 default_volume[i] = s->sample->volume.values[i]; in handle_get_all()
327 …_iter, property_handlers[PROPERTY_HANDLER_NAME].property_name, DBUS_TYPE_STRING, &s->sample->name); in handle_get_all()
329 if (s->sample->memchunk.memblock) { in handle_get_all()
332 …PROPERTY_HANDLER_CHANNELS].property_name, DBUS_TYPE_UINT32, channels, s->sample->channel_map.chann… in handle_get_all()
335 if (s->sample->volume_is_set) in handle_get_all()
336 …NDLER_DEFAULT_VOLUME].property_name, DBUS_TYPE_UINT32, default_volume, s->sample->volume.channels); in handle_get_all()
338 if (s->sample->memchunk.memblock) { in handle_get_all()
372 if (!s->sample->core->default_sink) { in handle_play()
374 … "Can't play sample %s, because there are no sinks available.", s->sample->name); in handle_play()
378 if (pa_scache_play_item(s->sample->core, in handle_play()
379 s->sample->name, in handle_play()
380 s->sample->core->default_sink, in handle_play()
384 … pa_dbus_send_error(conn, msg, DBUS_ERROR_FAILED, "Playing sample %s failed.", s->sample->name); in handle_play()
427 …if (pa_scache_play_item(s->sample->core, s->sample->name, sink, volume, property_list, NULL) < 0) { in handle_play_to_sink()
428 … pa_dbus_send_error(conn, msg, DBUS_ERROR_FAILED, "Playing sample %s failed.", s->sample->name); in handle_play_to_sink()
446 if (pa_scache_remove_item(s->sample->core, s->sample->name) < 0) { in handle_remove()
447 … pa_dbus_send_error(conn, msg, DBUS_ERROR_FAILED, "Removing sample %s failed.", s->sample->name); in handle_remove()
456 pa_scache_entry *sample = call_data; in sample_cache_changed_cb() local
459 pa_assert(sample); in sample_cache_changed_cb()
462 if (sample_iface->sample != sample) in sample_cache_changed_cb()
465 if (!pa_proplist_equal(sample_iface->proplist, sample_iface->sample->proplist)) { in sample_cache_changed_cb()
468 pa_proplist_update(sample_iface->proplist, PA_UPDATE_SET, sample_iface->sample->proplist); in sample_cache_changed_cb()
483 pa_dbusiface_sample *pa_dbusiface_sample_new(pa_dbusiface_core *core, pa_scache_entry *sample) { in pa_dbusiface_sample_new() argument
487 pa_assert(sample); in pa_dbusiface_sample_new()
491 s->sample = sample; in pa_dbusiface_sample_new()
492 s->path = pa_sprintf_malloc("%s/%s%u", PA_DBUS_CORE_OBJECT_PATH, OBJECT_NAME, sample->index); in pa_dbusiface_sample_new()
493 s->proplist = pa_proplist_copy(sample->proplist); in pa_dbusiface_sample_new()
494 s->dbus_protocol = pa_dbus_protocol_get(sample->core); in pa_dbusiface_sample_new()
495 …s->sample_cache_changed_slot = pa_hook_connect(&sample->core->hooks[PA_CORE_HOOK_SAMPLE_CACHE_CHAN… in pa_dbusiface_sample_new()