1 module pulse.extstreamrestore;
2 
3 version(linux):
4 
5 import pulse.channelmap;
6 import pulse.volume;
7 import pulse.context;
8 import pulse.operation;
9 import pulse.proplist;
10 
11 extern (C):
12 
13 /***
14   This file is part of PulseAudio.
15 
16   Copyright 2008 Lennart Poettering
17 
18   PulseAudio is free software; you can redistribute it and/or modify
19   it under the terms of the GNU Lesser General Public License as published
20   by the Free Software Foundation; either version 2.1 of the License,
21   or (at your option) any later version.
22 
23   PulseAudio is distributed in the hope that it will be useful, but
24   WITHOUT ANY WARRANTY; without even the implied warranty of
25   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26   General Public License for more details.
27 
28   You should have received a copy of the GNU Lesser General Public License
29   along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
30 ***/
31 
32 /** \file
33  *
34  * Routines for controlling module-stream-restore
35  */
36 
37 /** Stores information about one entry in the stream database that is
38  * maintained by module-stream-restore. \since 0.9.12 */
39 struct pa_ext_stream_restore_info
40 {
41     const(char)* name; /**< Identifier string of the stream. A string like "sink-input-by-role:" or similar followed by some arbitrary property value. */
42     pa_channel_map channel_map; /**< The channel map for the volume field, if applicable */
43     pa_cvolume volume; /**< The volume of the stream when it was seen last, if applicable and saved */
44     const(char)* device; /**< The sink/source of the stream when it was last seen, if applicable and saved */
45     int mute; /**< The boolean mute state of the stream when it was last seen, if applicable and saved */
46 }
47 
48 /** Callback prototype for pa_ext_stream_restore_test(). \since 0.9.12 */
49 alias pa_ext_stream_restore_test_cb_t = void function (
50     pa_context* c,
51     uint version_,
52     void* userdata);
53 
54 /** Test if this extension module is available in the server. \since 0.9.12 */
55 pa_operation* pa_ext_stream_restore_test (
56     pa_context* c,
57     pa_ext_stream_restore_test_cb_t cb,
58     void* userdata);
59 
60 /** Callback prototype for pa_ext_stream_restore_read(). \since 0.9.12 */
61 alias pa_ext_stream_restore_read_cb_t = void function (
62     pa_context* c,
63     const(pa_ext_stream_restore_info)* info,
64     int eol,
65     void* userdata);
66 
67 /** Read all entries from the stream database. \since 0.9.12 */
68 pa_operation* pa_ext_stream_restore_read (
69     pa_context* c,
70     pa_ext_stream_restore_read_cb_t cb,
71     void* userdata);
72 
73 /** Store entries in the stream database. \since 0.9.12 */
74 pa_operation* pa_ext_stream_restore_write (
75     pa_context* c,
76     pa_update_mode_t mode,
77     const(pa_ext_stream_restore_info)* data,
78     uint n,
79     int apply_immediately,
80     pa_context_success_cb_t cb,
81     void* userdata);
82 
83 /** Delete entries from the stream database. \since 0.9.12 */
84 pa_operation* pa_ext_stream_restore_delete (
85     pa_context* c,
86     const(char*)* s,
87     pa_context_success_cb_t cb,
88     void* userdata);
89 
90 /** Subscribe to changes in the stream database. \since 0.9.12 */
91 pa_operation* pa_ext_stream_restore_subscribe (
92     pa_context* c,
93     int enable,
94     pa_context_success_cb_t cb,
95     void* userdata);
96 
97 /** Callback prototype for pa_ext_stream_restore_set_subscribe_cb(). \since 0.9.12 */
98 alias pa_ext_stream_restore_subscribe_cb_t = void function (
99     pa_context* c,
100     void* userdata);
101 
102 /** Set the subscription callback that is called when
103  * pa_ext_stream_restore_subscribe() was called. \since 0.9.12 */
104 void pa_ext_stream_restore_set_subscribe_cb (
105     pa_context* c,
106     pa_ext_stream_restore_subscribe_cb_t cb,
107     void* userdata);
108