From: Rene S. <sa...@us...> - 2005-12-13 00:00:36
|
Update of /cvsroot/jake2/jake2/src/jake2/sound In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv962/src/jake2/sound Modified Files: S.java Log Message: lot of beatification and getDefaultSampleRate() added Index: S.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/S.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** S.java 4 Dec 2005 17:26:14 -0000 1.12 --- S.java 13 Dec 2005 00:00:25 -0000 1.13 *************** *** 43,47 **** static Vector drivers = new Vector(3); ! static { // dummy driver (no sound) --- 43,50 ---- static Vector drivers = new Vector(3); ! ! /** ! * Searches for and initializes all known sound drivers. ! */ static { // dummy driver (no sound) *************** *** 74,77 **** --- 77,83 ---- }; + /** + * Registers a new Sound Implementor. + */ public static void register(Sound driver) { if (driver == null) { *************** *** 83,86 **** --- 89,95 ---- } + /** + * Switches to the specific sound driver. + */ public static void useDriver(String driverName) { Sound driver = null; *************** *** 97,100 **** --- 106,112 ---- } + /** + * Initializes the sound module. + */ public static void Init() { *************** *** 133,216 **** } ! /* ! ===================== ! S_BeginRegistration ! ===================== ! */ public static void BeginRegistration() { impl.BeginRegistration(); } ! /* ! ===================== ! S_RegisterSound ! ===================== ! */ public static sfx_t RegisterSound(String sample) { return impl.RegisterSound(sample); } ! /* ! ===================== ! S_EndRegistration ! ===================== ! */ public static void EndRegistration() { impl.EndRegistration(); } ! /* ! ================== ! S_StartLocalSound ! ================== ! */ public static void StartLocalSound(String sound) { impl.StartLocalSound(sound); } ! /* ! ==================== ! S_StartSound ! ! Validates the parms and ques the sound up ! if pos is NULL, the sound will be dynamically sourced from the entity ! Entchannel 0 will never override a playing sound ! ==================== ! */ public static void StartSound(float[] origin, int entnum, int entchannel, sfx_t sfx, float fvol, float attenuation, float timeofs) { impl.StartSound(origin, entnum, entchannel, sfx, fvol, attenuation, timeofs); } ! /* ! ============ ! S_Update ! ! Called once each time through the main loop ! ============ ! */ public static void Update(float[] origin, float[] forward, float[] right, float[] up) { impl.Update(origin, forward, right, up); } ! /* ! ============ ! S_RawSamples ! ! Cinematic streaming and voice over network ! ============ ! */ public static void RawSamples(int samples, int rate, int width, int channels, ByteBuffer data) { impl.RawSamples(samples, rate, width, channels, data); } public static void disableStreaming() { impl.disableStreaming(); } ! /* ! ================== ! S_StopAllSounds ! ================== ! */ public static void StopAllSounds() { impl.StopAllSounds(); --- 145,210 ---- } ! /** ! * Called before the sounds are to be loaded and registered. ! */ public static void BeginRegistration() { impl.BeginRegistration(); } ! /** ! * Registers and loads a sound. ! */ public static sfx_t RegisterSound(String sample) { return impl.RegisterSound(sample); } ! /** ! * Called after all sounds are registered and loaded. ! */ public static void EndRegistration() { impl.EndRegistration(); } ! /** ! * Starts a local sound. ! */ public static void StartLocalSound(String sound) { impl.StartLocalSound(sound); } ! /** ! * StartSound - Validates the parms and ques the sound up ! * if pos is NULL, the sound will be dynamically sourced from the entity ! * Entchannel 0 will never override a playing sound ! */ public static void StartSound(float[] origin, int entnum, int entchannel, sfx_t sfx, float fvol, float attenuation, float timeofs) { impl.StartSound(origin, entnum, entchannel, sfx, fvol, attenuation, timeofs); } ! /** ! * Updates the sound renderer according to the changes in the environment, ! * called once each time through the main loop. ! */ public static void Update(float[] origin, float[] forward, float[] right, float[] up) { impl.Update(origin, forward, right, up); } ! /** ! * Cinematic streaming and voice over network. ! */ public static void RawSamples(int samples, int rate, int width, int channels, ByteBuffer data) { impl.RawSamples(samples, rate, width, channels, data); } + /** + * Switches off the sound streaming. + */ public static void disableStreaming() { impl.disableStreaming(); } ! /** ! * Stops all sounds. ! */ public static void StopAllSounds() { impl.StopAllSounds(); *************** *** 221,224 **** --- 215,221 ---- } + /** + * Returns a string array containing all sound driver names. + */ public static String[] getDriverNames() { String[] names = new String[drivers.size()]; *************** *** 228,230 **** --- 225,237 ---- return names; } + + /** + * This is used, when resampling to this default sampling rate is activated + * in the wavloader. It is placed here that sound implementors can override + * this one day. + */ + public static int getDefaultSampleRate() + { + return 44100; + } } \ No newline at end of file |