From 64ab1e11ae5dc1bfaf2b969940a4677aae254b2e Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Tue, 10 Dec 2002 21:36:53 +0000 Subject: [PATCH] Got the sound manager test app mostly working again. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2051 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/media/sound/SoundTestApp.java | 23 ++++++++++++++----- .../threerings/media/sound/sounds.properties | 7 ++++++ 2 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 tests/src/java/com/threerings/media/sound/sounds.properties diff --git a/tests/src/java/com/threerings/media/sound/SoundTestApp.java b/tests/src/java/com/threerings/media/sound/SoundTestApp.java index 1d229518d..7867c62d8 100644 --- a/tests/src/java/com/threerings/media/sound/SoundTestApp.java +++ b/tests/src/java/com/threerings/media/sound/SoundTestApp.java @@ -1,5 +1,5 @@ // -// $Id: SoundTestApp.java,v 1.2 2002/11/12 22:55:59 shaper Exp $ +// $Id: SoundTestApp.java,v 1.3 2002/12/10 21:36:53 mdb Exp $ package com.threerings.media; @@ -13,20 +13,31 @@ public class SoundTestApp { if (args.length == 0) { Log.info("Usage: runjava com.threerings.media.SoundTestApp " + - " [ ...]"); + " [ ...]"); System.exit(0); } ResourceManager rmgr = new ResourceManager("rsrc"); _soundmgr = new SoundManager(rmgr); - _files = args; + _keys = args; } public void run () { - for (int ii = 0; ii < _files.length; ii++) { - _soundmgr.play(SoundManager.DEFAULT, _files[ii]); + for (int ii = 0; ii < _keys.length; ii++) { + System.out.println("Playing " + _keys[ii] + "."); + _soundmgr.play(SoundManager.DEFAULT, + "com/threerings/media/", _keys[ii]); } + _soundmgr.shutdown(); + + // the sound manager starts up threads that never seem to exit so + // we have to stick a fork in things after a short while + try { + Thread.sleep(5000L); + } catch (InterruptedException ie) { + } + System.exit(0); } public static void main (String[] args) @@ -35,6 +46,6 @@ public class SoundTestApp app.run(); } - protected String[] _files; + protected String[] _keys; protected SoundManager _soundmgr; } diff --git a/tests/src/java/com/threerings/media/sound/sounds.properties b/tests/src/java/com/threerings/media/sound/sounds.properties new file mode 100644 index 000000000..e029199bb --- /dev/null +++ b/tests/src/java/com/threerings/media/sound/sounds.properties @@ -0,0 +1,7 @@ +# +# $Id: sounds.properties,v 1.1 2002/12/10 21:36:53 mdb Exp $ +# +# Sound test app configuration file + +sound1 = media/test.wav +sound2 = foo/bar.wav