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