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/opengl/util/av | |
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')
4 files changed, 17 insertions, 17 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); diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java index 386b1e085..a2b29b4eb 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java @@ -50,7 +50,7 @@ public class AudioSinkFactory { return new NullAudioSink(); } - public static AudioSink create(final ClassLoader cl, String implName) { + public static AudioSink create(final ClassLoader cl, final String implName) { final AudioSink audioSink; if(ReflectionUtil.isClassAvailable(implName, cl)){ try { @@ -58,7 +58,7 @@ public class AudioSinkFactory { if( audioSink.isInitialized() ) { return audioSink; } - } catch (Throwable t) { + } catch (final Throwable t) { if(AudioSink.DEBUG) { System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage()); t.printStackTrace(); } } } diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java index 215275951..4fffd9fab 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java +++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java @@ -246,10 +246,10 @@ public interface GLMediaPlayer extends TextureSequence { */ @SuppressWarnings("serial") public static class StreamException extends Exception { - public StreamException(Throwable cause) { + public StreamException(final Throwable cause) { super(cause); } - public StreamException(String message, Throwable cause) { + public StreamException(final String message, final Throwable cause) { super(message, cause); } } @@ -318,7 +318,7 @@ public interface GLMediaPlayer extends TextureSequence { public final int id; - State(int id){ + State(final int id){ this.id = id; } } diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java index 558d59630..9378cec91 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java +++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java @@ -55,12 +55,12 @@ public class GLMediaPlayerFactory { return new NullGLMediaPlayer(); } - public static GLMediaPlayer create(final ClassLoader cl, String implName) { + public static GLMediaPlayer create(final ClassLoader cl, final String implName) { try { if(((Boolean)ReflectionUtil.callStaticMethod(implName, isAvailableMethodName, null, null, cl)).booleanValue()) { return (GLMediaPlayer) ReflectionUtil.createInstance(implName, cl); } - } catch (Throwable t) { if(GLMediaPlayer.DEBUG) { System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage()); t.printStackTrace(); } } + } catch (final Throwable t) { if(GLMediaPlayer.DEBUG) { System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage()); t.printStackTrace(); } } return null; } } |