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