[pulseaudio-discuss] [PATCH 3/4] pactl: Separate stat and info actions

Colin Guthrie gmane at colin.guthr.ie
Thu Aug 4 09:21:28 PDT 2011


'Twas brillig, and David Henningsson at 04/08/11 10:40 did gyre and gimble:
> Sorry for the four months late reply, but now as I'm testing the new
> PulseAudio builds I realize I have scripts depending on "pactl stat"
> returning e g the default sink (and just yesterday I told somebody else
> to do the same!). Also, "pactl info" is not documented in the man page
> for pactl.
> 
> For me the best thing would be to let backwards compatibility win this
> time and revert this patch. What do other people think?

In retrospect, yes, that makes sense. Backwards compat is probably key here.

I think David suggested adding an "info" and a "mem" command and let
"stat" stay the same? Is that sensible?

Col



> 2011-03-26 17:15, Maarten Bosmans skrev:
>> ---
>>  src/utils/pactl.c |   11 +++++++++--
>>  1 files changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/utils/pactl.c b/src/utils/pactl.c
>> index e3c2aa2..cfa96fe 100644
>> --- a/src/utils/pactl.c
>> +++ b/src/utils/pactl.c
>> @@ -90,6 +90,7 @@ static enum {
>>      NONE,
>>      EXIT,
>>      STAT,
>> +    INFO,
>>      UPLOAD_SAMPLE,
>>      PLAY_SAMPLE,
>>      REMOVE_SAMPLE,
>> @@ -882,8 +883,10 @@ static void context_state_callback(pa_context *c, void *userdata) {
>>          case PA_CONTEXT_READY:
>>              switch (action) {
>>                  case STAT:
>> -                    actions = 2;
>>                      pa_operation_unref(pa_context_stat(c, stat_callback, NULL));
>> +                    break;
>> +
>> +                case INFO:
>>                      pa_operation_unref(pa_context_get_server_info(c, get_server_info_callback, NULL));
>>                      break;
>>  
>> @@ -1122,6 +1125,7 @@ static int parse_volume(const char *vol_spec, pa_volume_t *vol, enum volume_flag
>>  static void help(const char *argv0) {
>>  
>>      printf(_("%s [options] stat\n"
>> +             "%s [options] info\n"
>>               "%s [options] list [TYPE]\n"
>>               "%s [options] exit\n"
>>               "%s [options] upload-sample FILENAME [NAME]\n"
>> @@ -1151,7 +1155,7 @@ static void help(const char *argv0) {
>>             argv0, argv0, argv0, argv0, argv0,
>>             argv0, argv0, argv0, argv0, argv0,
>>             argv0, argv0, argv0, argv0, argv0,
>> -           argv0, argv0);
>> +           argv0, argv0, argv0);
>>  }
>>  
>>  enum {
>> @@ -1224,6 +1228,9 @@ int main(int argc, char *argv[]) {
>>          if (pa_streq(argv[optind], "stat"))
>>              action = STAT;
>>  
>> +        else if (pa_streq(argv[optind], "info"))
>> +            action = INFO;
>> +
>>          else if (pa_streq(argv[optind], "exit"))
>>              action = EXIT;
>>  
> 
> 
> 


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]



More information about the pulseaudio-discuss mailing list