[pulseaudio-commits] r1586 - /branches/lennart/src/pulsecore/cli-command.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Tue Aug 7 03:47:02 PDT 2007
Author: lennart
Date: Tue Aug 7 12:47:00 2007
New Revision: 1586
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1586&root=3Dpulseaudio&vi=
ew=3Drev
Log:
add global suspend command to cli
Modified:
branches/lennart/src/pulsecore/cli-command.c
Modified: branches/lennart/src/pulsecore/cli-command.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
cli-command.c?rev=3D1586&root=3Dpulseaudio&r1=3D1585&r2=3D1586&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/cli-command.c (original)
+++ branches/lennart/src/pulsecore/cli-command.c Tue Aug 7 12:47:00 2007
@@ -117,6 +117,7 @@
static int pa_cli_command_vacuum(pa_core *c, pa_tokenizer *t, pa_strbuf *b=
uf, int *fail);
static int pa_cli_command_suspend_sink(pa_core *c, pa_tokenizer *t, pa_str=
buf *buf, int *fail);
static int pa_cli_command_suspend_source(pa_core *c, pa_tokenizer *t, pa_s=
trbuf *buf, int *fail);
+static int pa_cli_command_suspend(pa_core *c, pa_tokenizer *t, pa_strbuf *=
buf, int *fail);
=
/* A method table for all available commands */
=
@@ -165,6 +166,7 @@
{ "vacuum", pa_cli_command_vacuum, NULL, =
1},
{ "suspend-sink", pa_cli_command_suspend_sink, "Suspe=
nd sink (args: index|name, bool)", 3},
{ "suspend-source", pa_cli_command_suspend_source, "Suspe=
nd source (args: index|name, bool)", 3},
+ { "suspend", pa_cli_command_suspend, "Suspe=
nd all sinks and all sources (args: bool)", 2},
{ NULL, NULL, NULL, 0 }
};
=
@@ -958,6 +960,32 @@
}
=
pa_source_suspend(source, suspend);
+ return 0;
+}
+
+static int pa_cli_command_suspend(pa_core *c, pa_tokenizer *t, pa_strbuf *=
buf, int *fail) {
+ const char *m;
+ pa_sink *sink;
+ pa_source *source;
+ int suspend;
+ uint32_t idx;
+
+ if (!(m =3D pa_tokenizer_get(t, 1))) {
+ pa_strbuf_puts(buf, "You need to specify a suspend switch setting =
(0/1).\n");
+ return -1;
+ }
+
+ if (pa_atoi(m, &suspend) < 0) {
+ pa_strbuf_puts(buf, "Failed to parse suspend switch.\n");
+ return -1;
+ }
+
+ for (sink =3D pa_idxset_first(c->sinks, &idx); sink; sink =3D pa_idxse=
t_next(c->sinks, &idx))
+ pa_sink_suspend(sink, suspend);
+
+ for (source =3D pa_idxset_first(c->sources, &idx); source; source =3D =
pa_idxset_next(c->sources, &idx))
+ pa_source_suspend(source, suspend);
+ =
return 0;
}
=
@@ -982,7 +1010,6 @@
#else
pa_strbuf_printf(buf, "### Configuration dump generated at %s\n", ctim=
e(&now));
#endif
-
=
for (m =3D pa_idxset_first(c->modules, &idx); m; m =3D pa_idxset_next(=
c->modules, &idx)) {
if (m->auto_unload)
More information about the pulseaudio-commits
mailing list