153a5a1b3Sopenharmony_ci#ifndef foopulseextdevicerestorehfoo 253a5a1b3Sopenharmony_ci#define foopulseextdevicerestorehfoo 353a5a1b3Sopenharmony_ci 453a5a1b3Sopenharmony_ci/*** 553a5a1b3Sopenharmony_ci This file is part of PulseAudio. 653a5a1b3Sopenharmony_ci 753a5a1b3Sopenharmony_ci Copyright 2008 Lennart Poettering 853a5a1b3Sopenharmony_ci Copyright 2011 Colin Guthrie 953a5a1b3Sopenharmony_ci 1053a5a1b3Sopenharmony_ci PulseAudio is free software; you can redistribute it and/or modify 1153a5a1b3Sopenharmony_ci it under the terms of the GNU Lesser General Public License as published 1253a5a1b3Sopenharmony_ci by the Free Software Foundation; either version 2.1 of the License, 1353a5a1b3Sopenharmony_ci or (at your option) any later version. 1453a5a1b3Sopenharmony_ci 1553a5a1b3Sopenharmony_ci PulseAudio is distributed in the hope that it will be useful, but 1653a5a1b3Sopenharmony_ci WITHOUT ANY WARRANTY; without even the implied warranty of 1753a5a1b3Sopenharmony_ci MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1853a5a1b3Sopenharmony_ci General Public License for more details. 1953a5a1b3Sopenharmony_ci 2053a5a1b3Sopenharmony_ci You should have received a copy of the GNU Lesser General Public License 2153a5a1b3Sopenharmony_ci along with PulseAudio; if not, see <http://www.gnu.org/licenses/>. 2253a5a1b3Sopenharmony_ci***/ 2353a5a1b3Sopenharmony_ci 2453a5a1b3Sopenharmony_ci#include <pulse/context.h> 2553a5a1b3Sopenharmony_ci#include <pulse/format.h> 2653a5a1b3Sopenharmony_ci#include <pulse/version.h> 2753a5a1b3Sopenharmony_ci 2853a5a1b3Sopenharmony_ci/** \file 2953a5a1b3Sopenharmony_ci * 3053a5a1b3Sopenharmony_ci * Routines for controlling module-device-restore 3153a5a1b3Sopenharmony_ci */ 3253a5a1b3Sopenharmony_ci 3353a5a1b3Sopenharmony_ciPA_C_DECL_BEGIN 3453a5a1b3Sopenharmony_ci 3553a5a1b3Sopenharmony_ci/** Stores information about one device in the device database that is 3653a5a1b3Sopenharmony_ci * maintained by module-device-manager. \since 1.0 */ 3753a5a1b3Sopenharmony_citypedef struct pa_ext_device_restore_info { 3853a5a1b3Sopenharmony_ci pa_device_type_t type; /**< Device type sink or source? */ 3953a5a1b3Sopenharmony_ci uint32_t index; /**< The device index */ 4053a5a1b3Sopenharmony_ci uint8_t n_formats; /**< How many formats do we have? */ 4153a5a1b3Sopenharmony_ci pa_format_info **formats; /**< An array of formats (may be NULL if n_formats == 0) */ 4253a5a1b3Sopenharmony_ci} pa_ext_device_restore_info; 4353a5a1b3Sopenharmony_ci 4453a5a1b3Sopenharmony_ci/** Callback prototype for pa_ext_device_restore_test(). \since 1.0 */ 4553a5a1b3Sopenharmony_citypedef void (*pa_ext_device_restore_test_cb_t)( 4653a5a1b3Sopenharmony_ci pa_context *c, 4753a5a1b3Sopenharmony_ci uint32_t version, 4853a5a1b3Sopenharmony_ci void *userdata); 4953a5a1b3Sopenharmony_ci 5053a5a1b3Sopenharmony_ci/** Test if this extension module is available in the server. \since 1.0 */ 5153a5a1b3Sopenharmony_cipa_operation *pa_ext_device_restore_test( 5253a5a1b3Sopenharmony_ci pa_context *c, 5353a5a1b3Sopenharmony_ci pa_ext_device_restore_test_cb_t cb, 5453a5a1b3Sopenharmony_ci void *userdata); 5553a5a1b3Sopenharmony_ci 5653a5a1b3Sopenharmony_ci/** Subscribe to changes in the device database. \since 1.0 */ 5753a5a1b3Sopenharmony_cipa_operation *pa_ext_device_restore_subscribe( 5853a5a1b3Sopenharmony_ci pa_context *c, 5953a5a1b3Sopenharmony_ci int enable, 6053a5a1b3Sopenharmony_ci pa_context_success_cb_t cb, 6153a5a1b3Sopenharmony_ci void *userdata); 6253a5a1b3Sopenharmony_ci 6353a5a1b3Sopenharmony_ci/** Callback prototype for pa_ext_device_restore_set_subscribe_cb(). \since 1.0 */ 6453a5a1b3Sopenharmony_citypedef void (*pa_ext_device_restore_subscribe_cb_t)( 6553a5a1b3Sopenharmony_ci pa_context *c, 6653a5a1b3Sopenharmony_ci pa_device_type_t type, 6753a5a1b3Sopenharmony_ci uint32_t idx, 6853a5a1b3Sopenharmony_ci void *userdata); 6953a5a1b3Sopenharmony_ci 7053a5a1b3Sopenharmony_ci/** Set the subscription callback that is called when 7153a5a1b3Sopenharmony_ci * pa_ext_device_restore_subscribe() was called. \since 1.0 */ 7253a5a1b3Sopenharmony_civoid pa_ext_device_restore_set_subscribe_cb( 7353a5a1b3Sopenharmony_ci pa_context *c, 7453a5a1b3Sopenharmony_ci pa_ext_device_restore_subscribe_cb_t cb, 7553a5a1b3Sopenharmony_ci void *userdata); 7653a5a1b3Sopenharmony_ci 7753a5a1b3Sopenharmony_ci/** Callback prototype for pa_ext_device_restore_read_formats(). \since 1.0 */ 7853a5a1b3Sopenharmony_citypedef void (*pa_ext_device_restore_read_device_formats_cb_t)( 7953a5a1b3Sopenharmony_ci pa_context *c, 8053a5a1b3Sopenharmony_ci const pa_ext_device_restore_info *info, 8153a5a1b3Sopenharmony_ci int eol, 8253a5a1b3Sopenharmony_ci void *userdata); 8353a5a1b3Sopenharmony_ci 8453a5a1b3Sopenharmony_ci/** Read the formats for all present devices from the device database. \since 1.0 */ 8553a5a1b3Sopenharmony_cipa_operation *pa_ext_device_restore_read_formats_all( 8653a5a1b3Sopenharmony_ci pa_context *c, 8753a5a1b3Sopenharmony_ci pa_ext_device_restore_read_device_formats_cb_t cb, 8853a5a1b3Sopenharmony_ci void *userdata); 8953a5a1b3Sopenharmony_ci 9053a5a1b3Sopenharmony_ci/** Read an entry from the device database. \since 1.0 */ 9153a5a1b3Sopenharmony_cipa_operation *pa_ext_device_restore_read_formats( 9253a5a1b3Sopenharmony_ci pa_context *c, 9353a5a1b3Sopenharmony_ci pa_device_type_t type, 9453a5a1b3Sopenharmony_ci uint32_t idx, 9553a5a1b3Sopenharmony_ci pa_ext_device_restore_read_device_formats_cb_t cb, 9653a5a1b3Sopenharmony_ci void *userdata); 9753a5a1b3Sopenharmony_ci 9853a5a1b3Sopenharmony_ci/** Read an entry from the device database. \since 1.0 */ 9953a5a1b3Sopenharmony_cipa_operation *pa_ext_device_restore_save_formats( 10053a5a1b3Sopenharmony_ci pa_context *c, 10153a5a1b3Sopenharmony_ci pa_device_type_t type, 10253a5a1b3Sopenharmony_ci uint32_t idx, 10353a5a1b3Sopenharmony_ci uint8_t n_formats, 10453a5a1b3Sopenharmony_ci pa_format_info **formats, 10553a5a1b3Sopenharmony_ci pa_context_success_cb_t cb, 10653a5a1b3Sopenharmony_ci void *userdata); 10753a5a1b3Sopenharmony_ci 10853a5a1b3Sopenharmony_ciPA_C_DECL_END 10953a5a1b3Sopenharmony_ci 11053a5a1b3Sopenharmony_ci#endif 111