aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ponymix.113
-rw-r--r--ponymix.cc14
2 files changed, 22 insertions, 5 deletions
diff --git a/ponymix.1 b/ponymix.1
index 470f294..b222440 100644
--- a/ponymix.1
+++ b/ponymix.1
@@ -68,12 +68,17 @@ Mute, unmute, or toggle the mute status of a device.
.IP "\fBis-muted\fR"
Check if a device is muted. ponymix will exit zero if muted, and non-zero
otherwise.
+.SS Application Commands
+These commands are specific to devices which refer to streams of applications.
+For these commands, \fIsink\fR and \fIsource\fR are synonymous with \fIsink-input\fR
+and \fIsource-output\fR, respectively.
.IP "\fBmove\fR \fIDEVICE\fR"
-Move a device's stream to the given device, specified using the \fI--devtype\fR
-and \fI--device\fR flags. Note that a source output can only be moved to
-another source, and a sink input can only be moved to another sink.
+Move a device's stream to the given device, specified using the \fB--devtype\fR
+and \fB--device\fR flags. Note that a source output can only be moved to
+another source, and a sink input can only be moved to another sink. The type of
+the target device will be inferred using this logic.
.IP "\fBkill\fR
-Kill a device's stream, specified using the \fI--device\fR and \fI--devtype\fR
+Kill a device's stream, specified using the \fB--device\fR and \fB--devtype\fR
flags. This only applies to sink-inputs and source-outputs.
.SS Card Commands
These commands are specific to cards.
diff --git a/ponymix.cc b/ponymix.cc
index 2f76905..31765fa 100644
--- a/ponymix.cc
+++ b/ponymix.cc
@@ -430,6 +430,17 @@ static int Move(PulseClient& ponymix, int, char* argv[]) {
}
static int Kill(PulseClient& ponymix, int, char*[]) {
+ switch (opt_devtype) {
+ case DEVTYPE_SOURCE:
+ opt_devtype = DEVTYPE_SOURCE_OUTPUT;
+ break;
+ case DEVTYPE_SINK:
+ opt_devtype = DEVTYPE_SINK_INPUT;
+ break;
+ default:
+ break;
+ }
+
auto device = string_to_device_or_die(ponymix, opt_device, opt_devtype);
return !ponymix.Kill(*device);
@@ -503,7 +514,8 @@ static void usage() {
" mute mute device\n"
" unmute unmute device\n"
" toggle toggle mute\n"
- " is-muted check if muted\n"
+ " is-muted check if muted\n", stdout);
+ fputs("\nApplication Commands:\n"
" move DEVICE move target device to DEVICE\n"
" kill DEVICE kill target DEVICE\n", stdout);