From 81c5760863f26de90d8258e72d931244597df3bc Mon Sep 17 00:00:00 2001 From: Eric Woroshow Date: Mon, 7 Apr 2008 18:57:41 +0000 Subject: [PATCH] Added an AL context. Provide a method in the sound manager to preload sound data. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@459 ed5b42cb-e716-0410-a449-f6a68f950b19 --- .../com/threerings/openal/SoundManager.java | 11 ++++++++- .../com/threerings/openal/util/AlContext.java | 23 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/java/com/threerings/openal/util/AlContext.java diff --git a/src/java/com/threerings/openal/SoundManager.java b/src/java/com/threerings/openal/SoundManager.java index 945f0da3..4145dde4 100644 --- a/src/java/com/threerings/openal/SoundManager.java +++ b/src/java/com/threerings/openal/SoundManager.java @@ -135,6 +135,15 @@ public class SoundManager } } + /** + * Loads a clip buffer for the sound clip loaded via the specified provider with the + * specified path. The loaded clip is placed in the cache. + */ + public void loadClip (ClipProvider provider, String path) + { + getClip(provider, path); + } + /** * Creates a sound manager and initializes the OpenAL sound subsystem. */ @@ -182,7 +191,7 @@ public class SoundManager /** * Creates a clip buffer for the sound clip loaded via the specified provider with the - * specified path. The clip buffer may come from teh cache, and it will immediately be queued + * specified path. The clip buffer may come from the cache, and it will immediately be queued * for loading if it is not already loaded. */ protected ClipBuffer getClip (ClipProvider provider, String path) diff --git a/src/java/com/threerings/openal/util/AlContext.java b/src/java/com/threerings/openal/util/AlContext.java new file mode 100644 index 00000000..c2b19931 --- /dev/null +++ b/src/java/com/threerings/openal/util/AlContext.java @@ -0,0 +1,23 @@ +// +// $Id$ + +package com.threerings.openal.util; + +import com.threerings.openal.ClipProvider; +import com.threerings.openal.SoundManager; + +/** + * Provides access to the various components of the OpenAL sound system. + */ +public interface AlContext +{ + /** + * Returns a reference to the sound manager. + */ + public SoundManager getSoundManager (); + + /** + * Returns a reference to the clip provider. + */ + public ClipProvider getClipProvider (); +}