On 25 July 2010 20:56, David Earl <[email protected]> wrote:
> My two talks for State of the Map
>  * Tag Central - a schema for OpenStreetMap
>  * What I learned making a real map on real paper for real people and real
> money
> are now available online at http://www.frankieandshadow.com/sotm10/

Hi,
I was also called to post something I promised during the SOTM, if you
remember my lightning talk (one before the last talk in the session),
and here it is:

The JOSM patch to revolutionise the user experience and beat Potlatch
in statistics.

(I hardcoded it into JOSM at that time but actually promised a plugin.
 It later turned out that there's no "after-upload" hook for plugins
so I'm just attaching the patch.  You also need to run "wget
openstreetmap.pl/balrog/beep.wav -O ~/.josm/beep.wav")

Cheers
From c39182908789f38fd01e7a61d0b2333a6e474cad Mon Sep 17 00:00:00 2001
From: Andrzej Zaborowski <[email protected]>
Date: Wed, 4 Aug 2010 21:20:38 +0200
Subject: [PATCH] Change the JOSM user experience for ever!!

---
 .../josm/gui/io/UploadPrimitivesTask.java          |   21 ++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/core/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java b/core/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java
index bbed508..38ef82d 100644
--- a/core/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java
+++ b/core/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java
@@ -7,6 +7,7 @@ import static org.openstreetmap.josm.tools.I18n.tr;
 import static org.openstreetmap.josm.tools.I18n.trn;
 
 import java.io.IOException;
+import java.io.File;
 import java.lang.reflect.InvocationTargetException;
 import java.util.HashSet;
 import java.util.logging.Logger;
@@ -14,6 +15,11 @@ import java.util.logging.Logger;
 import javax.swing.JOptionPane;
 import javax.swing.SwingUtilities;
 
+import javax.sound.sampled.AudioInputStream;
+import javax.sound.sampled.AudioSystem;
+import javax.sound.sampled.Clip;
+import javax.sound.sampled.DataLine;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.APIDataSet;
 import org.openstreetmap.josm.data.osm.Changeset;
@@ -291,6 +297,7 @@ public class UploadPrimitivesTask extends  AbstractUploadTask {
         }
         if (uploadCancelled) return;
         cleanupAfterUpload();
+        beep();
     }
 
     @Override protected void finish() {
@@ -360,4 +367,19 @@ public class UploadPrimitivesTask extends  AbstractUploadTask {
             }
         }
     }
+
+    protected void beep() {
+        try {
+            AudioInputStream sound = AudioSystem.getAudioInputStream(
+                    new File(System.getProperty("user.home") +
+                        "/.josm/beep.wav"));
+            DataLine.Info info = new DataLine.Info(
+                    Clip.class, sound.getFormat());
+            Clip clip = (Clip) AudioSystem.getLine(info);
+            clip.open(sound);
+            clip.start();
+        } catch (Exception e) {
+            System.out.println("Beeping raised " + e.toString());
+        }
+    }
 }
-- 
1.5.3.4

_______________________________________________
talk mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/talk

Reply via email to