]> code.delx.au - pulseaudio/blobdiff - src/utils/pax11publish.c
s/POLYP/PULSE/g
[pulseaudio] / src / utils / pax11publish.c
index 908a35072c331cba50c4a289d40ad502c4436456..2a0d21d68b4af9813ffd17bc21273392fb9cca64 100644 (file)
@@ -1,20 +1,20 @@
 /* $Id$ */
 
 /***
-  This file is part of polypaudio.
+  This file is part of PulseAudio.
  
-  polypaudio is free software; you can redistribute it and/or modify
+  PulseAudio is free software; you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as published
   by the Free Software Foundation; either version 2 of the License,
   or (at your option) any later version.
  
-  polypaudio is distributed in the hope that it will be useful, but
+  PulseAudio is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   General Public License for more details.
  
   You should have received a copy of the GNU Lesser General Public License
-  along with polypaudio; if not, write to the Free Software
+  along with PulseAudio; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
   USA.
 ***/
 #include <X11/Xlib.h>
 #include <X11/Xatom.h>
 
-#include <polypcore/util.h>
-#include <polypcore/log.h>
-#include <polypcore/authkey.h>
-#include <polypcore/native-common.h>
-#include <polypcore/x11prop.h>
-#include <polyp/client-conf.h>
+#include <pulse/util.h>
+
+#include <pulsecore/core-util.h>
+#include <pulsecore/log.h>
+#include <pulsecore/authkey.h>
+#include <pulsecore/native-common.h>
+#include <pulsecore/x11prop.h>
+
+#include "../pulse/client-conf.h"
 
 int main(int argc, char *argv[]) {
     const char *dname = NULL, *sink = NULL, *source = NULL, *server = NULL, *cookie_file = PA_NATIVE_COOKIE_FILE;
@@ -51,10 +54,10 @@ int main(int argc, char *argv[]) {
                 break;
             case 'h':
                 printf("%s [-D display] [-S server] [-O sink] [-I source] [-c file]  [-d|-e|-i|-r]\n\n"
-                       " -d    Show current Polypaudio data attached to X11 display (default)\n"
-                       " -e    Export local Polypaudio data to X11 display\n"
-                       " -i    Import Polypaudio data from X11 display to local environment variables and cookie file.\n"
-                       " -r    Remove Polypaudio data from X11 display\n",
+                       " -d    Show current PulseAudio data attached to X11 display (default)\n"
+                       " -e    Export local PulseAudio data to X11 display\n"
+                       " -i    Import PulseAudio data from X11 display to local environment variables and cookie file.\n"
+                       " -r    Remove PulseAudio data from X11 display\n",
                        pa_path_get_filename(argv[0]));
                 ret = 0;
                 goto finish;
@@ -89,20 +92,20 @@ int main(int argc, char *argv[]) {
     }
 
     if (!(d = XOpenDisplay(dname))) {
-        pa_log(__FILE__": XOpenDisplay() failed\n");
+        pa_log(__FILE__": XOpenDisplay() failed");
         goto finish;
     }
 
     switch (mode) {
         case DUMP: {
             char t[1024];
-            if (pa_x11_get_prop(d, "POLYP_SERVER", t, sizeof(t))) 
+            if (pa_x11_get_prop(d, "PULSE_SERVER", t, sizeof(t))) 
                 printf("Server: %s\n", t);
-            if (pa_x11_get_prop(d, "POLYP_SOURCE", t, sizeof(t)))
+            if (pa_x11_get_prop(d, "PULSE_SOURCE", t, sizeof(t)))
                 printf("Source: %s\n", t);
-            if (pa_x11_get_prop(d, "POLYP_SINK", t, sizeof(t)))
+            if (pa_x11_get_prop(d, "PULSE_SINK", t, sizeof(t)))
                 printf("Sink: %s\n", t);
-            if (pa_x11_get_prop(d, "POLYP_COOKIE", t, sizeof(t)))
+            if (pa_x11_get_prop(d, "PULSE_COOKIE", t, sizeof(t)))
                 printf("Cookie: %s\n", t);
 
             break;
@@ -110,14 +113,14 @@ int main(int argc, char *argv[]) {
             
         case IMPORT: {
             char t[1024];
-            if (pa_x11_get_prop(d, "POLYP_SERVER", t, sizeof(t))) 
-                printf("POLYP_SERVER='%s'\nexport POLYP_SERVER\n", t);
-            if (pa_x11_get_prop(d, "POLYP_SOURCE", t, sizeof(t)))
-                printf("POLYP_SOURCE='%s'\nexport POLYP_SOURCE\n", t);
-            if (pa_x11_get_prop(d, "POLYP_SINK", t, sizeof(t)))
-                printf("POLYP_SINK='%s'\nexport POLYP_SINK\n", t);
-
-            if (pa_x11_get_prop(d, "POLYP_COOKIE", t, sizeof(t))) {
+            if (pa_x11_get_prop(d, "PULSE_SERVER", t, sizeof(t))) 
+                printf("PULSE_SERVER='%s'\nexport PULSE_SERVER\n", t);
+            if (pa_x11_get_prop(d, "PULSE_SOURCE", t, sizeof(t)))
+                printf("PULSE_SOURCE='%s'\nexport PULSE_SOURCE\n", t);
+            if (pa_x11_get_prop(d, "PULSE_SINK", t, sizeof(t)))
+                printf("PULSE_SINK='%s'\nexport PULSE_SINK\n", t);
+
+            if (pa_x11_get_prop(d, "PULSE_COOKIE", t, sizeof(t))) {
                 uint8_t cookie[PA_NATIVE_COOKIE_LENGTH];
                 size_t l;
                 if ((l = pa_parsehex(t, cookie, sizeof(cookie))) != sizeof(cookie)) {
@@ -150,16 +153,16 @@ int main(int argc, char *argv[]) {
                 goto finish;
             }
 
-            pa_x11_del_prop(d, "POLYP_SERVER");
-            pa_x11_del_prop(d, "POLYP_SINK");
-            pa_x11_del_prop(d, "POLYP_SOURCE");
-            pa_x11_del_prop(d, "POLYP_ID");
-            pa_x11_del_prop(d, "POLYP_COOKIE");
+            pa_x11_del_prop(d, "PULSE_SERVER");
+            pa_x11_del_prop(d, "PULSE_SINK");
+            pa_x11_del_prop(d, "PULSE_SOURCE");
+            pa_x11_del_prop(d, "PULSE_ID");
+            pa_x11_del_prop(d, "PULSE_COOKIE");
             
             if (server)
-                pa_x11_set_prop(d, "POLYP_SERVER", server);
+                pa_x11_set_prop(d, "PULSE_SERVER", server);
             else if (conf->default_server)
-                pa_x11_set_prop(d, "POLYP_SERVER", conf->default_server);
+                pa_x11_set_prop(d, "PULSE_SERVER", conf->default_server);
             else {
                 char hn[256];
                 if (!pa_get_fqdn(hn, sizeof(hn))) {
@@ -167,18 +170,18 @@ int main(int argc, char *argv[]) {
                     goto finish;
                 }
                     
-                pa_x11_set_prop(d, "POLYP_SERVER", hn);
+                pa_x11_set_prop(d, "PULSE_SERVER", hn);
             }
 
             if (sink)
-                pa_x11_set_prop(d, "POLYP_SINK", sink);
+                pa_x11_set_prop(d, "PULSE_SINK", sink);
             else if (conf->default_sink)
-                pa_x11_set_prop(d, "POLYP_SINK", conf->default_sink);
+                pa_x11_set_prop(d, "PULSE_SINK", conf->default_sink);
 
             if (source)
-                pa_x11_set_prop(d, "POLYP_SOURCE", source);
+                pa_x11_set_prop(d, "PULSE_SOURCE", source);
             if (conf->default_source)
-                pa_x11_set_prop(d, "POLYP_SOURCE", conf->default_source);
+                pa_x11_set_prop(d, "PULSE_SOURCE", conf->default_source);
 
             pa_client_conf_free(conf);
             
@@ -187,16 +190,16 @@ int main(int argc, char *argv[]) {
                 goto finish;
             }
 
-            pa_x11_set_prop(d, "POLYP_COOKIE", pa_hexstr(cookie, sizeof(cookie), hx, sizeof(hx)));
+            pa_x11_set_prop(d, "PULSE_COOKIE", pa_hexstr(cookie, sizeof(cookie), hx, sizeof(hx)));
             break;
         }
 
         case REMOVE:
-            pa_x11_del_prop(d, "POLYP_SERVER");
-            pa_x11_del_prop(d, "POLYP_SINK");
-            pa_x11_del_prop(d, "POLYP_SOURCE");
-            pa_x11_del_prop(d, "POLYP_ID");
-            pa_x11_del_prop(d, "POLYP_COOKIE");
+            pa_x11_del_prop(d, "PULSE_SERVER");
+            pa_x11_del_prop(d, "PULSE_SINK");
+            pa_x11_del_prop(d, "PULSE_SOURCE");
+            pa_x11_del_prop(d, "PULSE_ID");
+            pa_x11_del_prop(d, "PULSE_COOKIE");
             break;
             
         default: