*** pactl.c 2012-06-04 00:44:00.537934221 +0200 --- pactl2.c 2012-06-04 00:43:15.107932990 +0200 *************** *** 116,121 **** --- 116,123 ---- SET_SINK_INPUT_MUTE, SET_SOURCE_OUTPUT_MUTE, SET_SINK_FORMATS, + SET_DEFAULT_SINK, + SET_DEFAULT_SOURCE, SUBSCRIBE } action = NONE; *************** *** 1241,1246 **** --- 1243,1256 ---- set_sink_formats(c, sink_idx, formats); break; + case SET_DEFAULT_SINK: + pa_context_set_default_sink(c, sink_name, simple_callback, NULL); + break; + + case SET_DEFAULT_SOURCE: + pa_context_set_default_source(c, source_name, simple_callback, NULL); + break; + case SUBSCRIBE: pa_context_set_subscribe_callback(c, context_subscribe_callback, NULL); *************** *** 1355,1360 **** --- 1365,1371 ---- printf("%s %s %s %s\n", argv0, _("[options]"), "set-(sink|source)-mute", _("NAME|#N 1|0")); printf("%s %s %s %s\n", argv0, _("[options]"), "set-(sink-input|source-output)-mute", _("#N 1|0")); printf("%s %s %s %s\n", argv0, _("[options]"), "set-sink-formats", _("#N FORMATS")); + printf("%s %s %s %s\n", argv0, _("[options]"), "set-default-(sink|source)", _("NAME|#N")); printf("%s %s %s\n", argv0, _("[options]"), "subscribe"); printf(_("\n" *************** *** 1782,1788 **** action = SET_SINK_FORMATS; formats = pa_xstrdup(argv[optind+2]); ! } else if (pa_streq(argv[optind], "help")) { help(bn); ret = 0; goto quit; --- 1793,1819 ---- action = SET_SINK_FORMATS; formats = pa_xstrdup(argv[optind+2]); ! } else if (pa_streq(argv[optind], "set-default-sink")) { ! action = SET_DEFAULT_SINK; ! ! if (argc > optind+2 || optind+1 >= argc) { ! pa_log(_("You have to specify a sink name/index.")); ! goto quit; ! } ! ! sink_name = pa_xstrdup(argv[optind+1]); ! ! } else if (pa_streq(argv[optind], "set-default-source")) { ! action = SET_DEFAULT_SOURCE; ! ! if (argc > optind+2 || optind+1 >= argc) { ! pa_log(_("You have to specify a source name/index.")); ! goto quit; ! } ! ! source_name = pa_xstrdup(argv[optind+1]); ! ! } else if (pa_streq(argv[optind], "help")) { help(bn); ret = 0; goto quit;