diff options
author | Sven Gothel <sgothel@jausoft.com> | 2014-07-03 16:21:36 +0200 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2014-07-03 16:21:36 +0200 |
commit | 556d92b63555a085b25e32b1cd55afce24edd07a (patch) | |
tree | 6be2b02c62a77d5aba81ffbe34c46960608be163 /src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.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/opengl/util/av/AudioSink.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java index 1d835dd33..6d875fcf5 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java +++ b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java @@ -61,7 +61,7 @@ public interface AudioSink { * @param planar true for planar data package (each channel in own data buffer), false for packed data channels interleaved in one buffer. * @param littleEndian true for little-endian, false for big endian */ - public AudioFormat(int sampleRate, int sampleSize, int channelCount, boolean signed, boolean fixedP, boolean planar, boolean littleEndian) { + public AudioFormat(final int sampleRate, final int sampleSize, final int channelCount, final boolean signed, final boolean fixedP, final boolean planar, final boolean littleEndian) { this.sampleRate = sampleRate; this.sampleSize = sampleSize; this.channelCount = channelCount; @@ -104,7 +104,7 @@ public interface AudioSink { * Time -> Byte Count * </p> */ - public final int getDurationsByteSize(int millisecs) { + public final int getDurationsByteSize(final int millisecs) { final int bytesPerSample = sampleSize >>> 3; // /8 return millisecs * ( channelCount * bytesPerSample * ( sampleRate / 1000 ) ); } @@ -116,7 +116,7 @@ public interface AudioSink { * Byte Count -> Time * </p> */ - public final int getBytesDuration(int byteCount) { + public final int getBytesDuration(final int byteCount) { final int bytesPerSample = sampleSize >>> 3; // /8 return byteCount / ( channelCount * bytesPerSample * ( sampleRate / 1000 ) ); } @@ -132,7 +132,7 @@ public interface AudioSink { * </p> * @param sampleCount sample count per frame and channel */ - public final float getSamplesDuration(int sampleCount) { + public final float getSamplesDuration(final int sampleCount) { return ( 1000f * sampleCount ) / sampleRate; } @@ -151,7 +151,7 @@ public interface AudioSink { * @param millisecs time in milliseconds * @param frameDuration duration per frame in milliseconds. */ - public final int getFrameCount(int millisecs, float frameDuration) { + public final int getFrameCount(final int millisecs, final float frameDuration) { return Math.max(1, (int) ( millisecs / frameDuration + 0.5f )); } @@ -170,7 +170,7 @@ public interface AudioSink { * </p> * @param sampleCount sample count */ - public final int getSamplesByteCount(int sampleCount) { + public final int getSamplesByteCount(final int sampleCount) { return sampleCount * ( sampleSize >>> 3 ); } @@ -189,7 +189,7 @@ public interface AudioSink { * </p> * @param byteCount number of bytes */ - public final int getBytesSampleCount(int byteCount) { + public final int getBytesSampleCount(final int byteCount) { return ( byteCount << 3 ) / sampleSize; } @@ -208,7 +208,7 @@ public interface AudioSink { public AudioFrame() { this.byteSize = 0; } - public AudioFrame(int pts, int duration, int byteCount) { + public AudioFrame(final int pts, final int duration, final int byteCount) { super(pts, duration); this.byteSize=byteCount; } @@ -216,7 +216,7 @@ public interface AudioSink { /** Get this frame's size in bytes. */ public final int getByteSize() { return byteSize; } /** Set this frame's size in bytes. */ - public final void setByteSize(int size) { this.byteSize=size; } + public final void setByteSize(final int size) { this.byteSize=size; } @Override public String toString() { @@ -226,7 +226,7 @@ public interface AudioSink { public static class AudioDataFrame extends AudioFrame { protected final ByteBuffer data; - public AudioDataFrame(int pts, int duration, ByteBuffer bytes, int byteCount) { + public AudioDataFrame(final int pts, final int duration, final ByteBuffer bytes, final int byteCount) { super(pts, duration, byteCount); if( byteCount > bytes.remaining() ) { throw new IllegalArgumentException("Give size "+byteCount+" exceeds remaining bytes in ls "+bytes+". "+this); |