summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc-André Lureau <marc-andre.lureau@nokia.com>2009-04-17 21:03:07 +0300
committerMarc-André Lureau <marc-andre.lureau@nokia.com>2009-04-18 00:08:18 +0300
commit296b99ea15a5f840fe962558f4f2dfb9636c4905 (patch)
tree979616093ba75eeb82f63013fda27448832df80c
parentc7083f59e01b383ed9fe5e0b3e4cce1e7c665e68 (diff)
canberra-gtk-play: add -V option for volume
-rw-r--r--src/canberra-gtk-play.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/canberra-gtk-play.c b/src/canberra-gtk-play.c
index 689a8f6..8445b72 100644
--- a/src/canberra-gtk-play.c
+++ b/src/canberra-gtk-play.c
@@ -80,7 +80,7 @@ static void callback(ca_context *c, uint32_t id, int error, void *userdata) {
int main (int argc, char *argv[]) {
GOptionContext *oc;
- static gchar *event_id = NULL, *filename = NULL, *event_description = NULL, *cache_control = NULL;
+ static gchar *event_id = NULL, *filename = NULL, *event_description = NULL, *cache_control = NULL, *volume = NULL;
int r;
static gboolean version = FALSE;
@@ -90,6 +90,7 @@ int main (int argc, char *argv[]) {
{ "description", 'd', 0, G_OPTION_ARG_STRING, &event_description, "Event sound description", "STRING" },
{ "cache-control", 'c', 0, G_OPTION_ARG_STRING, &cache_control, "Cache control (permanent, volatile, never)", "STRING" },
{ "loop", 'l', 0, G_OPTION_ARG_INT, &n_loops, "Loop how many times (detault: 1)", "INTEGER" },
+ { "volume", 'V', 0, G_OPTION_ARG_STRING, &volume, "A floating point dB value for the sample volume (ex: 0.0)", "STRING" },
{ "version", 'v', 0, G_OPTION_ARG_NONE, &version, "Display version number and quit", NULL },
{ NULL, 0, 0, 0, NULL, NULL, NULL }
};
@@ -135,6 +136,9 @@ int main (int argc, char *argv[]) {
if (event_description)
ca_proplist_sets(proplist, CA_PROP_EVENT_DESCRIPTION, event_description);
+ if (volume)
+ ca_proplist_sets(proplist, CA_PROP_CANBERRA_VOLUME, volume);
+
r = ca_context_play_full(ca_gtk_context_get(), 1, proplist, callback, NULL);
if (r < 0) {