diff options
author | Sven Gothel <[email protected]> | 2014-07-03 16:21:36 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-07-03 16:21:36 +0200 |
commit | 556d92b63555a085b25e32b1cd55afce24edd07a (patch) | |
tree | 6be2b02c62a77d5aba81ffbe34c46960608be163 /src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java | |
parent | a90f4a51dffec3247278e3c683ed4462b1dd9ab5 (diff) |
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Add final modifier to private fields
- Add final modifier to method parameters
- Add final modifier to local variables
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Remove trailing white spaces on all lines
Diffstat (limited to 'src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java index 98a787478..5e55786ac 100644 --- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java +++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java @@ -56,7 +56,7 @@ public class Track { // If we're playing the file, this is its input stream private InputStream input; // Keep around the file name - private File file; + private final File file; // Whether we're playing this sound private boolean playing; // Whether we're looping this sound @@ -64,7 +64,7 @@ public class Track { // The position of this sound; defaults to being at the origin private volatile Vec3f position = new Vec3f(); - Track(File file) throws IOException { + Track(final File file) throws IOException { if (!file.getName().endsWith(".rawsound")) { throw new IOException("Unsupported file format (currently supports only raw sounds)"); } @@ -96,7 +96,7 @@ public class Track { openInput(); // Fill it immediately fill(); - } catch (IOException e) { + } catch (final IOException e) { e.printStackTrace(); return; } @@ -109,7 +109,7 @@ public class Track { return playing; } - public synchronized void setLooping(boolean looping) { + public synchronized void setLooping(final boolean looping) { this.looping = looping; } @@ -117,7 +117,7 @@ public class Track { return looping; } - public void setPosition(float x, float y, float z) { + public void setPosition(final float x, final float y, final float z) { position = new Vec3f(x, y, z); } @@ -125,7 +125,7 @@ public class Track { if (input == null) { return; } - SoundBuffer curBuffer = fillingBuffer; + final SoundBuffer curBuffer = fillingBuffer; if (!curBuffer.empty()) { return; } @@ -152,7 +152,7 @@ public class Track { private float leftGain; private float rightGain; - void setLeftGain(float leftGain) { + void setLeftGain(final float leftGain) { this.leftGain = leftGain; } @@ -160,7 +160,7 @@ public class Track { return leftGain; } - void setRightGain(float rightGain) { + void setRightGain(final float rightGain) { this.rightGain = rightGain; } @@ -180,7 +180,7 @@ public class Track { // This is called by the mixer and must be extremely fast float nextSample() { - float res = activeBuffer.getSample(samplePosition++); + final float res = activeBuffer.getSample(samplePosition++); ++samplesRead; if (!hasNextSample()) { swapBuffers(); @@ -193,7 +193,7 @@ public class Track { } synchronized void swapBuffers() { - SoundBuffer tmp = activeBuffer; + final SoundBuffer tmp = activeBuffer; activeBuffer = fillingBuffer; fillingBuffer = tmp; fillingBuffer.empty(true); |