]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/sink-input.h
introduce pa_sink_input_get_relative_volume()
[pulseaudio] / src / pulsecore / sink-input.h
index 20e2cfa4079119861e5633ec3c701c14bb45ba7c..0bcb9d567eab21287e30a4f6a4d015244591424d 100644 (file)
@@ -9,7 +9,7 @@
 
   PulseAudio is free software; you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as published
-  by the Free Software Foundation; either version 2 of the License,
+  by the Free Software Foundation; either version 2.1 of the License,
   or (at your option) any later version.
 
   PulseAudio is distributed in the hope that it will be useful, but
@@ -171,6 +171,10 @@ struct pa_sink_input {
      * be allowed */
     pa_bool_t (*may_move_to) (pa_sink_input *i, pa_sink *s); /* may be NULL */
 
+    /* If non-NULL this function is used to dispatch asynchronous
+     * control events. */
+    void (*send_event)(pa_sink_input *i, const char *event, pa_proplist* data);
+
     struct {
         pa_sink_input_state_t state;
         pa_atomic_t drained;
@@ -217,6 +221,12 @@ enum {
     PA_SINK_INPUT_MESSAGE_MAX
 };
 
+typedef struct pa_sink_input_send_event_hook_data {
+    pa_sink_input *sink_input;
+    const char *event;
+    pa_proplist *data;
+} pa_sink_input_send_event_hook_data;
+
 typedef struct pa_sink_input_new_data {
     pa_proplist *proplist;
 
@@ -292,12 +302,15 @@ pa_usec_t pa_sink_input_get_latency(pa_sink_input *i, pa_usec_t *sink_latency);
 
 void pa_sink_input_set_volume(pa_sink_input *i, const pa_cvolume *volume, pa_bool_t save);
 const pa_cvolume *pa_sink_input_get_volume(pa_sink_input *i);
+pa_cvolume *pa_sink_input_get_relative_volume(pa_sink_input *i, pa_cvolume *v);
 void pa_sink_input_set_mute(pa_sink_input *i, pa_bool_t mute, pa_bool_t save);
 pa_bool_t pa_sink_input_get_mute(pa_sink_input *i);
 void pa_sink_input_update_proplist(pa_sink_input *i, pa_update_mode_t mode, pa_proplist *p);
 
 pa_resample_method_t pa_sink_input_get_resample_method(pa_sink_input *i);
 
+void pa_sink_input_send_event(pa_sink_input *i, const char *name, pa_proplist *data);
+
 int pa_sink_input_move_to(pa_sink_input *i, pa_sink *dest, pa_bool_t save);
 pa_bool_t pa_sink_input_may_move(pa_sink_input *i); /* may this sink input move at all? */
 pa_bool_t pa_sink_input_may_move_to(pa_sink_input *i, pa_sink *dest); /* may this sink input move to this sink? */