diff --git a/ant/build.xml b/ant/build.xml
index 9aaa37c..6f8f021 100644
--- a/ant/build.xml
+++ b/ant/build.xml
@@ -13,6 +13,7 @@
Logiciel de plan de feu
+
@@ -39,6 +40,7 @@
+
@@ -253,6 +255,14 @@
+
+
+
+
+
+
+
+
@@ -280,6 +290,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -314,18 +334,16 @@
-
+
-
-
-
+
diff --git a/data/config/AdecWatt.xml b/data/config/AdecWatt.xml
index 0734fe7..554c1b8 100644
--- a/data/config/AdecWatt.xml
+++ b/data/config/AdecWatt.xml
@@ -1,76 +1,78 @@
-
+
-This file is automaticaly generated by AdecWatt application at 3:42 PM on Jun 20, 2018.
-
-North
-Day
-false
-5
-0
-false
+This file is automaticaly generated by AdecWatt application at 5:39 PM on Apr 15, 2019.
+true
+true
+false
4
-true
-20180620
+false
+data/log/
+true
+true
+true
+true
+false
+/home/felix/perso/adecWatt56/data/export/CendresLampionsChapelleBleue.lpz
+false
+North
+true
+true
+0
+0
+true
+false
1
-false
-true
-false
-false
-false
-North
-true
true
-[x=166,y=26]
-North
-[x=0,y=26]
-[x=0,y=26]
-
-
-3
-false
-data/log/
-[x=0,y=26]
-true
+3128
+false
FR
-true
+5
+North
+[x=0,y=26]
+false
true
+[x=738,y=247]
+North
+false
+Day
false
-data/images/adecWatt.png
-true
+[x=0,y=26]
+[x=0,y=26]
+true
+false
+2
+North
+false
+true
+false
+false
+
+false
+true
true
-false
-/home/felix/perso/adecWatt56/data/export/CendresLampionsChapelleBleue.lpz
-North
-false
-false
-false
-false
-true
-false
+data/images/adecWatt.png
+false
fr
-2
-true
-false
false
-true
-true
+North
+false
+webmestre
+false
+false
+false
+20190415
+false
+false
false
-true
-false
-false
-true
-true
-true
-true
-North
-[x=0,y=26]
-North
-true
-false
-1
-true
-false
-true
-3128
+true
+3
+false
+false
+false
+[x=0,y=26]
+false
+false
+North
+
diff --git a/soft/Misc.jar b/soft/Misc.jar
index 04db1d1..5ad198a 100644
Binary files a/soft/Misc.jar and b/soft/Misc.jar differ
diff --git a/src/java/misc/Util.java b/src/java/misc/Util.java
index f4e8848..073b5ba 100644
--- a/src/java/misc/Util.java
+++ b/src/java/misc/Util.java
@@ -9,8 +9,6 @@
// ================================================================================
package misc;
-import java.applet.Applet;
-import java.applet.AudioClip;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
@@ -42,6 +40,14 @@ import java.util.Collection;
import java.util.Hashtable;
import java.util.List;
import java.util.Set;
+import javax.sound.sampled.AudioFormat;
+import javax.sound.sampled.AudioInputStream;
+import javax.sound.sampled.AudioSystem;
+import javax.sound.sampled.Clip;
+import javax.sound.sampled.DataLine;
+import javax.sound.sampled.LineEvent;
+import javax.sound.sampled.LineListener;
+import javax.sound.sampled.LineUnavailableException;
import javax.swing.AbstractButton;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
@@ -610,9 +616,41 @@ public class Util implements SwingConstants {
}
// ========================================
- static public final AudioClip loadAudio (String... names) {
+ static public final AudioInputStream loadAudio (String... names) {
URL url = Config.getDataUrl (names);
- return (url != null) ? Applet.newAudioClip (url) : null;
+ try {
+ return AudioSystem.getAudioInputStream (url);
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ static public final void play (AudioInputStream stream) {
+ if (stream == null)
+ return;
+ try {
+ AudioFormat format = stream.getFormat ();
+ DataLine.Info info = new DataLine.Info (Clip.class, format);
+ Clip clip = (Clip) AudioSystem.getLine (info);
+ clip.open (stream);
+ clip.addLineListener (new LineListener () {
+ public void update (LineEvent event) {
+ LineEvent.Type type = event.getType();
+ if (type == LineEvent.Type.START) {
+ // System.err.println ("Playback started.");
+ } else if (type == LineEvent.Type.STOP) {
+ // System.er.println ("Playback completed.");
+ clip.close ();
+ }
+ }
+ });
+ clip.start ();
+ } catch (LineUnavailableException e) {
+ Log.keepLastException ("Audio line for playing back is unavailable", e);
+ } catch (IOException e) {
+ Log.keepLastException ("Error playing the audio file", e);
+ }
+
}
// ========================================