1 #ifndef foopulseextstreamrestorehfoo
2 #define foopulseextstreamrestorehfoo
5 This file is part of PulseAudio.
7 Copyright 2008 Lennart Poettering
9 PulseAudio is free software; you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published
11 by the Free Software Foundation; either version 2 of the License,
12 or (at your option) any later version.
14 PulseAudio is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public License
20 along with PulseAudio; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
25 #include <pulse/context.h>
26 #include <pulse/version.h>
30 * Routines for controlling module-stream-restore
35 /** Stores information about one entry in the stream database that is
36 * maintained by module-stream-restore. \since 0.9.12 */
37 typedef struct pa_ext_stream_restore_info
{
38 const char *name
; /**< Identifier string of the stream. A string like "sink-input-by-role:" or similar followed by some arbitrary property value. */
39 pa_channel_map channel_map
; /**< The channel map for the volume field */
40 pa_cvolume volume
; /**< The volume of the stream when it was seen last, if applicable */
41 const char *device
; /**< The sink/source of the stream when it was last seen */
42 int mute
; /**< The boolean mute state of the stream when it was last seen, if applicable */
43 } pa_ext_stream_restore_info
;
45 /** Callback prototype for pa_ext_stream_restore_test(). \since 0.9.12 */
46 typedef void (*pa_ext_stream_restore_test_cb_t
)(
51 /** Test if this extension module is available in the server. \since 0.9.12 */
52 pa_operation
*pa_ext_stream_restore_test(
54 pa_ext_stream_restore_test_cb_t cb
,
57 /** Callback prototype for pa_ext_stream_restore_read(). \since 0.9.12 */
58 typedef void (*pa_ext_stream_restore_read_cb_t
)(
60 const pa_ext_stream_restore_info
*info
,
64 /** Read all entries from the stream database. \since 0.9.12 */
65 pa_operation
*pa_ext_stream_restore_read(
67 pa_ext_stream_restore_read_cb_t cb
,
70 /** Store entries in the stream database. \since 0.9.12 */
71 pa_operation
*pa_ext_stream_restore_write(
73 pa_update_mode_t mode
,
74 const pa_ext_stream_restore_info data
[],
76 int apply_immediately
,
77 pa_context_success_cb_t cb
,
80 /** Delete entries from the stream database. \since 0.9.12 */
81 pa_operation
*pa_ext_stream_restore_delete(
83 const char *const s
[],
84 pa_context_success_cb_t cb
,
87 /** Subscribe to changes in the stream database. \since 0.9.12 */
88 pa_operation
*pa_ext_stream_restore_subscribe(
91 pa_context_success_cb_t cb
,
94 /** Callback prototype for pa_ext_stream_restore_set_subscribe_cb(). \since 0.9.12 */
95 typedef void (*pa_ext_stream_restore_subscribe_cb_t
)(
99 /** Set the subscription callback that is called when
100 * pa_ext_stream_restore_subscribe() was called. \since 0.9.12 */
101 void pa_ext_stream_restore_set_subscribe_cb(
103 pa_ext_stream_restore_subscribe_cb_t cb
,