Hi David,
Thanks for sending the patch.
Apparently your (or my) email client has messed up your patch (inserted some
enters). This is probably because the email was sent as HTML. Please resubmit
the patch through SourceForge:FreeCol:Patches (this is the preferred method)
or alternatively email the patch as true attachment (not pasted in the email
body).
Thanks again,
Lars
On Saturday 12 February 2005 03:26, David Eagen wrote:
> I'm starting small with my changes..
>
>
>
> This patch adds logging to SoundPlayer.java that was listed as TODO's.
>
>
>
>
>
>
>
>
>
> Index: SoundPlayer.java
>
> ===================================================================
>
> RCS file:
> /cvsroot/freecol/freecol/src/net/sf/freecol/client/gui/sound/SoundPlayer.ja
>v a,v
>
> retrieving revision 1.3
>
> diff -u -r1.3 SoundPlayer.java
>
> --- SoundPlayer.java 26 Sep 2004 10:27:00 -0000 1.3
>
> +++ SoundPlayer.java 11 Feb 2005 23:09:19 -0000
>
> @@ -5,6 +5,7 @@
>
> import java.io.BufferedInputStream;
>
> import java.io.File;
>
> import java.io.FileInputStream;
>
> +import java.util.logging.Logger;
>
>
>
> import javax.sound.midi.InvalidMidiDataException;
>
> import javax.sound.midi.MetaEventListener;
>
> @@ -28,7 +29,7 @@
>
> */
>
> public class SoundPlayer {
>
>
>
> -
>
> + private static final Logger logger =
> Logger.getLogger(SoundPlayer.class.getName());
>
> public static final String COPYRIGHT = "Copyright (C) 2003-2004 The
> FreeCol Team";
>
> public static final String LICENSE =
> "http://www.gnu.org/licenses/gpl.html";
>
> public static final String REVISION = "$Revision: 1.3 $";
>
> @@ -272,7 +273,7 @@
>
> FileInputStream fileInputStream = new
> FileInputStream(file);
>
> currentSound = new
> BufferedInputStream(fileInputStream, 1024);
>
> } catch (Exception e3) {
>
> - // TODO: Log the exception: "Error while loading audio
> file."
>
> + logger.warning("Error while loading audio file: " +
> e3.getMessage());
>
> currentSound = null;
>
> return false;
>
> }
>
> @@ -308,7 +309,7 @@
>
> clip.open(stream);
>
> currentSound = clip;
>
> } catch (Exception ex) {
>
> - // TODO: Log the exception: "Error while reading
> audio-stream."
>
> + logger.warning("Error while reading audio-stream: "
> + ex.getMessage());
>
> currentSound = null;
>
> return false;
>
> }
>
> @@ -323,16 +324,16 @@
>
> }
>
>
>
> } catch (InvalidMidiDataException imde) {
>
> - // TODO: Log the exception: "Unsupported audio
> file."
>
> + logger.warning("Unsupported audio file: " +
> imde.getMessage());
>
> currentSound = null;
>
> return false;
>
> } catch (Exception ex) {
>
> - // TODO: Log the exception: "Error while loading
> MIDI-file."
>
> + logger.warning("Error while loading MIDI-file: " +
> ex.getMessage());
>
> currentSound = null;
>
> return false;
>
> }
>
> } else {
>
> - // TODO: Log: "Could not load MIDI-file, because it
> has been disabled."
>
> + logger.info("Could not load MIDI-file, because it
> has been disabled.");
>
> currentSound = null;
>
> return false;
>
> }
|