[pulseaudio-commits] r1185 - /trunk/src/utils/pactl.c
svnmailer-noreply at 0pointer.de
svnmailer-noreply at 0pointer.de
Thu Aug 3 15:33:54 PDT 2006
Author: lennart
Date: Fri Aug 4 00:33:54 2006
New Revision: 1185
URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1185&root=pulseaudio&view=rev
Log:
implement "pactl move-source-output"
Modified:
trunk/src/utils/pactl.c
Modified: trunk/src/utils/pactl.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/utils/pactl.c?rev=1185&root=pulseaudio&r1=1184&r2=1185&view=diff
==============================================================================
--- trunk/src/utils/pactl.c (original)
+++ trunk/src/utils/pactl.c Fri Aug 4 00:33:54 2006
@@ -46,8 +46,8 @@
static pa_context *context = NULL;
static pa_mainloop_api *mainloop_api = NULL;
-static char *device = NULL, *sample_name = NULL, *sink_name = NULL;
-static uint32_t sink_input_idx = PA_INVALID_INDEX;
+static char *device = NULL, *sample_name = NULL, *sink_name = NULL, *source_name = NULL;
+static uint32_t sink_input_idx = PA_INVALID_INDEX, source_output_idx = PA_INVALID_INDEX;
static SNDFILE *sndfile = NULL;
static pa_stream *sample_stream = NULL;
@@ -66,7 +66,8 @@
PLAY_SAMPLE,
REMOVE_SAMPLE,
LIST,
- MOVE_SINK_INPUT
+ MOVE_SINK_INPUT,
+ MOVE_SOURCE_OUTPUT
} action = NONE;
static void quit(int ret) {
@@ -587,6 +588,10 @@
pa_operation_unref(pa_context_move_sink_input_by_name(c, sink_input_idx, sink_name, simple_callback, NULL));
break;
+ case MOVE_SOURCE_OUTPUT:
+ pa_operation_unref(pa_context_move_source_output_by_name(c, source_output_idx, source_name, simple_callback, NULL));
+ break;
+
default:
assert(0);
}
@@ -615,7 +620,8 @@
"%s [options] exit\n"
"%s [options] upload-sample FILENAME [NAME]\n"
"%s [options] play-sample NAME [SINK]\n"
- "%s [options] move-sink-input NAME [SINK]\n"
+ "%s [options] move-sink-input ID SINK\n"
+ "%s [options] move-source-output ID SOURCE\n"
"%s [options] remove-sample NAME\n\n"
" -h, --help Show this help\n"
" --version Show version\n\n"
@@ -747,6 +753,15 @@
sink_input_idx = atoi(argv[optind+1]);
sink_name = pa_xstrdup(argv[optind+2]);
+ } else if (!strcmp(argv[optind], "move-source-output")) {
+ action = MOVE_SOURCE_OUTPUT;
+ if (optind+2 >= argc) {
+ fprintf(stderr, "You have to specify a source output index and a source\n");
+ goto quit;
+ }
+
+ source_output_idx = atoi(argv[optind+1]);
+ source_name = pa_xstrdup(argv[optind+2]);
}
}
@@ -801,6 +816,7 @@
pa_xfree(device);
pa_xfree(sample_name);
pa_xfree(sink_name);
+ pa_xfree(source_name);
return ret;
}
More information about the pulseaudio-commits
mailing list