]> code.delx.au - pulseaudio/blob - src/pulse/ext-stream-restore.h
2038eb4a1776ae43c0d5b4c39859caa1eb28cd07
[pulseaudio] / src / pulse / ext-stream-restore.h
1 #ifndef foopulseextstreamrestorehfoo
2 #define foopulseextstreamrestorehfoo
3
4 /***
5 This file is part of PulseAudio.
6
7 Copyright 2008 Lennart Poettering
8
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.
13
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.
18
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
22 USA.
23 ***/
24
25 #include <pulse/context.h>
26
27 /** \file
28 *
29 * Routines for controlling module-stream-restore
30 */
31
32 PA_C_DECL_BEGIN
33
34 /** Stores information about one entry in the stream database that is
35 * maintained by module-stream-restore. \since 0.9.12 */
36 typedef struct pa_ext_stream_restore_info {
37 const char *name; /**< Identifier string of the stream. A string like "sink-input-by-role:" or similar followed by some arbitrary property value. */
38 pa_channel_map channel_map; /**< The channel map for the volume field */
39 pa_cvolume volume; /**< The volume of the stream when it was seen last, if applicable */
40 const char *device; /**< The sink/source of the stream when it was last seen */
41 int mute; /**< The boolean mute state of the stream when it was last seen, if applicable */
42 } pa_ext_stream_restore_info;
43
44 /** Callback prototype for pa_ext_stream_restore_test(). \since 0.9.12 */
45 typedef void (*pa_ext_stream_restore_test_cb_t)(
46 pa_context *c,
47 uint32_t version,
48 void *userdata);
49
50 /** Test if this extension module is available in the server. \since 0.9.12 */
51 pa_operation *pa_ext_stream_restore_test(
52 pa_context *c,
53 pa_ext_stream_restore_test_cb_t cb,
54 void *userdata);
55
56 /** Callback prototype for pa_ext_stream_restore_read(). \since 0.9.12 */
57 typedef void (*pa_ext_stream_restore_read_cb_t)(
58 pa_context *c,
59 const pa_ext_stream_restore_info *info,
60 int eol,
61 void *userdata);
62
63 /** Read all entries from the stream database. \since 0.9.12 */
64 pa_operation *pa_ext_stream_restore_read(
65 pa_context *c,
66 pa_ext_stream_restore_read_cb_t cb,
67 void *userdata);
68
69 /** Store entries in the stream database. \since 0.9.12 */
70 pa_operation *pa_ext_stream_restore_write(
71 pa_context *c,
72 pa_update_mode_t mode,
73 const pa_ext_stream_restore_info data[],
74 unsigned n,
75 int apply_immediately,
76 pa_context_success_cb_t cb,
77 void *userdata);
78
79 /** Delete entries from the stream database. \since 0.9.12 */
80 pa_operation *pa_ext_stream_restore_delete(
81 pa_context *c,
82 const char *const s[],
83 pa_context_success_cb_t cb,
84 void *userdata);
85
86 /** Subscribe to changes in the stream database. \since 0.9.12 */
87 pa_operation *pa_ext_stream_restore_subscribe(
88 pa_context *c,
89 int enable,
90 pa_context_success_cb_t cb,
91 void *userdata);
92
93 /** Callback prototype for pa_ext_stream_restore_set_subscribe_cb(). \since 0.9.12 */
94 typedef void (*pa_ext_stream_restore_subscribe_cb_t)(
95 pa_context *c,
96 void *userdata);
97
98 /** Set the subscription callback that is called when
99 * pa_ext_stream_restore_subscribe() was called. \since 0.9.12 */
100 void pa_ext_stream_restore_set_subscribe_cb(
101 pa_context *c,
102 pa_ext_stream_restore_subscribe_cb_t cb,
103 void *userdata);
104
105 PA_C_DECL_END
106
107 #endif