153a5a1b3Sopenharmony_ci#ifndef foopulseextstreamrestorehfoo
253a5a1b3Sopenharmony_ci#define foopulseextstreamrestorehfoo
353a5a1b3Sopenharmony_ci
453a5a1b3Sopenharmony_ci/***
553a5a1b3Sopenharmony_ci  This file is part of PulseAudio.
653a5a1b3Sopenharmony_ci
753a5a1b3Sopenharmony_ci  Copyright 2008 Lennart Poettering
853a5a1b3Sopenharmony_ci
953a5a1b3Sopenharmony_ci  PulseAudio is free software; you can redistribute it and/or modify
1053a5a1b3Sopenharmony_ci  it under the terms of the GNU Lesser General Public License as published
1153a5a1b3Sopenharmony_ci  by the Free Software Foundation; either version 2.1 of the License,
1253a5a1b3Sopenharmony_ci  or (at your option) any later version.
1353a5a1b3Sopenharmony_ci
1453a5a1b3Sopenharmony_ci  PulseAudio is distributed in the hope that it will be useful, but
1553a5a1b3Sopenharmony_ci  WITHOUT ANY WARRANTY; without even the implied warranty of
1653a5a1b3Sopenharmony_ci  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1753a5a1b3Sopenharmony_ci  General Public License for more details.
1853a5a1b3Sopenharmony_ci
1953a5a1b3Sopenharmony_ci  You should have received a copy of the GNU Lesser General Public License
2053a5a1b3Sopenharmony_ci  along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
2153a5a1b3Sopenharmony_ci***/
2253a5a1b3Sopenharmony_ci
2353a5a1b3Sopenharmony_ci#include <pulse/cdecl.h>
2453a5a1b3Sopenharmony_ci#include <pulse/context.h>
2553a5a1b3Sopenharmony_ci#include <pulse/version.h>
2653a5a1b3Sopenharmony_ci#include <pulse/volume.h>
2753a5a1b3Sopenharmony_ci#include <pulse/channelmap.h>
2853a5a1b3Sopenharmony_ci
2953a5a1b3Sopenharmony_ci/** \file
3053a5a1b3Sopenharmony_ci *
3153a5a1b3Sopenharmony_ci * Routines for controlling module-stream-restore
3253a5a1b3Sopenharmony_ci */
3353a5a1b3Sopenharmony_ci
3453a5a1b3Sopenharmony_ciPA_C_DECL_BEGIN
3553a5a1b3Sopenharmony_ci
3653a5a1b3Sopenharmony_ci/** Stores information about one entry in the stream database that is
3753a5a1b3Sopenharmony_ci * maintained by module-stream-restore. \since 0.9.12 */
3853a5a1b3Sopenharmony_citypedef struct pa_ext_stream_restore_info {
3953a5a1b3Sopenharmony_ci    const char *name;            /**< Identifier string of the stream. A string like "sink-input-by-role:" or similar followed by some arbitrary property value. */
4053a5a1b3Sopenharmony_ci    pa_channel_map channel_map;  /**< The channel map for the volume field, if applicable */
4153a5a1b3Sopenharmony_ci    pa_cvolume volume;           /**< The volume of the stream when it was seen last, if applicable and saved */
4253a5a1b3Sopenharmony_ci    const char *device;          /**< The sink/source of the stream when it was last seen, if applicable and saved */
4353a5a1b3Sopenharmony_ci    int mute;                    /**< The boolean mute state of the stream when it was last seen, if applicable and saved */
4453a5a1b3Sopenharmony_ci} pa_ext_stream_restore_info;
4553a5a1b3Sopenharmony_ci
4653a5a1b3Sopenharmony_ci/** Callback prototype for pa_ext_stream_restore_test(). \since 0.9.12 */
4753a5a1b3Sopenharmony_citypedef void (*pa_ext_stream_restore_test_cb_t)(
4853a5a1b3Sopenharmony_ci        pa_context *c,
4953a5a1b3Sopenharmony_ci        uint32_t version,
5053a5a1b3Sopenharmony_ci        void *userdata);
5153a5a1b3Sopenharmony_ci
5253a5a1b3Sopenharmony_ci/** Test if this extension module is available in the server. \since 0.9.12 */
5353a5a1b3Sopenharmony_cipa_operation *pa_ext_stream_restore_test(
5453a5a1b3Sopenharmony_ci        pa_context *c,
5553a5a1b3Sopenharmony_ci        pa_ext_stream_restore_test_cb_t cb,
5653a5a1b3Sopenharmony_ci        void *userdata);
5753a5a1b3Sopenharmony_ci
5853a5a1b3Sopenharmony_ci/** Callback prototype for pa_ext_stream_restore_read(). \since 0.9.12 */
5953a5a1b3Sopenharmony_citypedef void (*pa_ext_stream_restore_read_cb_t)(
6053a5a1b3Sopenharmony_ci        pa_context *c,
6153a5a1b3Sopenharmony_ci        const pa_ext_stream_restore_info *info,
6253a5a1b3Sopenharmony_ci        int eol,
6353a5a1b3Sopenharmony_ci        void *userdata);
6453a5a1b3Sopenharmony_ci
6553a5a1b3Sopenharmony_ci/** Read all entries from the stream database. \since 0.9.12 */
6653a5a1b3Sopenharmony_cipa_operation *pa_ext_stream_restore_read(
6753a5a1b3Sopenharmony_ci        pa_context *c,
6853a5a1b3Sopenharmony_ci        pa_ext_stream_restore_read_cb_t cb,
6953a5a1b3Sopenharmony_ci        void *userdata);
7053a5a1b3Sopenharmony_ci
7153a5a1b3Sopenharmony_ci/** Store entries in the stream database. \since 0.9.12 */
7253a5a1b3Sopenharmony_cipa_operation *pa_ext_stream_restore_write(
7353a5a1b3Sopenharmony_ci        pa_context *c,
7453a5a1b3Sopenharmony_ci        pa_update_mode_t mode,
7553a5a1b3Sopenharmony_ci        const pa_ext_stream_restore_info data[],
7653a5a1b3Sopenharmony_ci        unsigned n,
7753a5a1b3Sopenharmony_ci        int apply_immediately,
7853a5a1b3Sopenharmony_ci        pa_context_success_cb_t cb,
7953a5a1b3Sopenharmony_ci        void *userdata);
8053a5a1b3Sopenharmony_ci
8153a5a1b3Sopenharmony_ci/** Delete entries from the stream database. \since 0.9.12 */
8253a5a1b3Sopenharmony_cipa_operation *pa_ext_stream_restore_delete(
8353a5a1b3Sopenharmony_ci        pa_context *c,
8453a5a1b3Sopenharmony_ci        const char *const s[],
8553a5a1b3Sopenharmony_ci        pa_context_success_cb_t cb,
8653a5a1b3Sopenharmony_ci        void *userdata);
8753a5a1b3Sopenharmony_ci
8853a5a1b3Sopenharmony_ci/** Subscribe to changes in the stream database. \since 0.9.12 */
8953a5a1b3Sopenharmony_cipa_operation *pa_ext_stream_restore_subscribe(
9053a5a1b3Sopenharmony_ci        pa_context *c,
9153a5a1b3Sopenharmony_ci        int enable,
9253a5a1b3Sopenharmony_ci        pa_context_success_cb_t cb,
9353a5a1b3Sopenharmony_ci        void *userdata);
9453a5a1b3Sopenharmony_ci
9553a5a1b3Sopenharmony_ci/** Callback prototype for pa_ext_stream_restore_set_subscribe_cb(). \since 0.9.12 */
9653a5a1b3Sopenharmony_citypedef void (*pa_ext_stream_restore_subscribe_cb_t)(
9753a5a1b3Sopenharmony_ci        pa_context *c,
9853a5a1b3Sopenharmony_ci        void *userdata);
9953a5a1b3Sopenharmony_ci
10053a5a1b3Sopenharmony_ci/** Set the subscription callback that is called when
10153a5a1b3Sopenharmony_ci * pa_ext_stream_restore_subscribe() was called. \since 0.9.12 */
10253a5a1b3Sopenharmony_civoid pa_ext_stream_restore_set_subscribe_cb(
10353a5a1b3Sopenharmony_ci        pa_context *c,
10453a5a1b3Sopenharmony_ci        pa_ext_stream_restore_subscribe_cb_t cb,
10553a5a1b3Sopenharmony_ci        void *userdata);
10653a5a1b3Sopenharmony_ci
10753a5a1b3Sopenharmony_ciPA_C_DECL_END
10853a5a1b3Sopenharmony_ci
10953a5a1b3Sopenharmony_ci#endif
110