summaryrefslogtreecommitdiffstats
path: root/src/pulse
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-01-27 03:05:40 +0100
committerLennart Poettering <lennart@poettering.net>2009-01-27 03:05:40 +0100
commit1be39e4fa5b8f6a2d995593a4c1fd66eeafd6328 (patch)
tree7ad3a99b5f5649a933f7d217fa07888e59635495 /src/pulse
parent5449d793ae7800ad236f027f6c6893a1d2db3929 (diff)
allow samples to be played with 'default' (i.e. unspecified) volume.
Diffstat (limited to 'src/pulse')
-rw-r--r--src/pulse/scache.c8
-rw-r--r--src/pulse/scache.h4
2 files changed, 10 insertions, 2 deletions
diff --git a/src/pulse/scache.c b/src/pulse/scache.c
index fd3b9876..c96c42ad 100644
--- a/src/pulse/scache.c
+++ b/src/pulse/scache.c
@@ -188,6 +188,10 @@ pa_operation *pa_context_play_sample(pa_context *c, const char *name, const char
t = pa_tagstruct_command(c, PA_COMMAND_PLAY_SAMPLE, &tag);
pa_tagstruct_putu32(t, PA_INVALID_INDEX);
pa_tagstruct_puts(t, dev);
+
+ if (volume == (pa_volume_t) -1 && c->version < 15)
+ volume = PA_VOLUME_NORM;
+
pa_tagstruct_putu32(t, volume);
pa_tagstruct_puts(t, name);
@@ -225,6 +229,10 @@ pa_operation *pa_context_play_sample_with_proplist(pa_context *c, const char *na
t = pa_tagstruct_command(c, PA_COMMAND_PLAY_SAMPLE, &tag);
pa_tagstruct_putu32(t, PA_INVALID_INDEX);
pa_tagstruct_puts(t, dev);
+
+ if (volume == (pa_volume_t) -1 && c->version < 15)
+ volume = PA_VOLUME_NORM;
+
pa_tagstruct_putu32(t, volume);
pa_tagstruct_puts(t, name);
pa_tagstruct_put_proplist(t, p);
diff --git a/src/pulse/scache.h b/src/pulse/scache.h
index 69e813c6..79fcfbc5 100644
--- a/src/pulse/scache.h
+++ b/src/pulse/scache.h
@@ -101,7 +101,7 @@ pa_operation* pa_context_play_sample(
pa_context *c /**< Context */,
const char *name /**< Name of the sample to play */,
const char *dev /**< Sink to play this sample on */,
- pa_volume_t volume /**< Volume to play this sample with */ ,
+ pa_volume_t volume /**< Volume to play this sample with. Starting with 0.9.15 you may pass here (pa_volume_t) -1 which will leave the decision about the volume to the server side which is a good idea. */ ,
pa_context_success_cb_t cb /**< Call this function after successfully starting playback, or NULL */,
void *userdata /**< Userdata to pass to the callback */);
@@ -113,7 +113,7 @@ pa_operation* pa_context_play_sample_with_proplist(
pa_context *c /**< Context */,
const char *name /**< Name of the sample to play */,
const char *dev /**< Sink to play this sample on */,
- pa_volume_t volume /**< Volume to play this sample with */ ,
+ pa_volume_t volume /**< Volume to play this sample with. Starting with 0.9.15 you may pass here (pa_volume_t) -1 which will leave the decision about the volume to the server side which is a good idea. */ ,
pa_proplist *proplist /**< Property list for this sound. The property list of the cached entry will be merged into this property list */,
pa_context_play_sample_cb_t cb /**< Call this function after successfully starting playback, or NULL */,
void *userdata /**< Userdata to pass to the callback */);