summaryrefslogtreecommitdiffstats
path: root/src/pulse
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-10-29 00:46:22 +0100
committerLennart Poettering <lennart@poettering.net>2009-10-29 00:46:22 +0100
commitf27a50691c8fe45bac7dd6b21fac91a359def3a1 (patch)
tree740c6bd459931f7c894e038c57926b9d4d1ad6a4 /src/pulse
parent546bcf3f2f9711f0d08c21c3b775994844e7e2a2 (diff)
libpulse: introduce PA_STREAM_RELATIVE_VOLUME
Diffstat (limited to 'src/pulse')
-rw-r--r--src/pulse/def.h10
-rw-r--r--src/pulse/stream.c10
2 files changed, 18 insertions, 2 deletions
diff --git a/src/pulse/def.h b/src/pulse/def.h
index 5d0a0b4b..30a076d5 100644
--- a/src/pulse/def.h
+++ b/src/pulse/def.h
@@ -276,11 +276,18 @@ typedef enum pa_stream_flags {
* whether to create the stream in muted or in unmuted
* state. \since 0.9.15 */
- PA_STREAM_FAIL_ON_SUSPEND = 0x20000U
+ PA_STREAM_FAIL_ON_SUSPEND = 0x20000U,
/**< If the sink/source this stream is connected to is suspended
* during the creation of this stream, cause it to fail. If the
* sink/source is being suspended during creation of this stream,
* make sure this stream is terminated. \since 0.9.15 */
+
+ PA_STREAM_RELATIVE_VOLUME = 0x40000U,
+ /**< If a volume is passed when this stream is created, consider
+ * it relative to the sink's current volume, never as absolute
+ * device volume. If this is not specified the volume will be
+ * consider absolute when the sink is in flat volume mode,
+ * relative otherwise. \since 0.9.20 */
} pa_stream_flags_t;
/** \cond fulldocs */
@@ -307,6 +314,7 @@ typedef enum pa_stream_flags {
#define PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND
#define PA_STREAM_START_UNMUTED PA_STREAM_START_UNMUTED
#define PA_STREAM_FAIL_ON_SUSPEND PA_STREAM_FAIL_ON_SUSPEND
+#define PA_STREAM_RELATIVE_VOLUME PA_STREAM_RELATIVE_VOLUME
/** \endcond */
diff --git a/src/pulse/stream.c b/src/pulse/stream.c
index 2bc2b1e4..29979625 100644
--- a/src/pulse/stream.c
+++ b/src/pulse/stream.c
@@ -1025,7 +1025,8 @@ static int create_stream(
PA_STREAM_EARLY_REQUESTS|
PA_STREAM_DONT_INHIBIT_AUTO_SUSPEND|
PA_STREAM_START_UNMUTED|
- PA_STREAM_FAIL_ON_SUSPEND)), PA_ERR_INVALID);
+ PA_STREAM_FAIL_ON_SUSPEND|
+ PA_STREAM_RELATIVE_VOLUME)), PA_ERR_INVALID);
PA_CHECK_VALIDITY(s->context, s->context->version >= 12 || !(flags & PA_STREAM_VARIABLE_RATE), PA_ERR_NOTSUPPORTED);
PA_CHECK_VALIDITY(s->context, s->context->version >= 13 || !(flags & PA_STREAM_PEAK_DETECT), PA_ERR_NOTSUPPORTED);
@@ -1158,6 +1159,13 @@ static int create_stream(
pa_tagstruct_put_boolean(t, flags & PA_STREAM_FAIL_ON_SUSPEND);
}
+ if (s->context->version >= 17) {
+
+ if (s->direction == PA_STREAM_PLAYBACK)
+ pa_tagstruct_put_boolean(t, flags & PA_STREAM_RELATIVE_VOLUME);
+
+ }
+
pa_pstream_send_tagstruct(s->context->pstream, t);
pa_pdispatch_register_reply(s->context->pdispatch, tag, DEFAULT_TIMEOUT, pa_create_stream_callback, s, NULL);