[Android] EqualizerBar: Round equalizer band frequencies instead of truncating them

Ronald Wright git at videolan.org
Sun Aug 18 20:16:05 CEST 2013


vlc-ports/android | branch: master | Ronald Wright <logiconcepts819 at gmail.com> | Sun Aug 18 11:17:03 2013 -0500| [81a12c638fac8a6ba6d6b5888127525b2ff5e111] | committer: Edward Wang

EqualizerBar: Round equalizer band frequencies instead of truncating them

Currently, the Android app truncates the equalizer frequencies to the nearest
whole. The Qt GUI in the desktop VLC app depicts rounded frequencies, so the
same scheme should be used in the Android app.

Signed-off-by: Sébastien Toque <xilasz at gmail.com>
Signed-off-by: Edward Wang <edward.c.wang at compdigitec.com>

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=81a12c638fac8a6ba6d6b5888127525b2ff5e111
---

 vlc-android/src/org/videolan/vlc/widget/EqualizerBar.java |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/widget/EqualizerBar.java b/vlc-android/src/org/videolan/vlc/widget/EqualizerBar.java
index 5ed0919..444d4e9 100644
--- a/vlc-android/src/org/videolan/vlc/widget/EqualizerBar.java
+++ b/vlc-android/src/org/videolan/vlc/widget/EqualizerBar.java
@@ -59,9 +59,9 @@ public class EqualizerBar extends LinearLayout {
         mSeek.setProgress(RANGE);
         mSeek.setOnSeekBarChangeListener(mSeekListener);
         mBand = (TextView) findViewById(R.id.equalizer_band);
-        mBand.setText(band < 1000
-                ? (int) band + " Hz"
-                : (int) (band / 1000) + " kHz");
+        mBand.setText(band < 999.5f
+                ? (int) (band + 0.5f) + " Hz"
+                : (int) (band / 1000.0f + 0.5f) + " kHz");
         mValue = (TextView) findViewById(R.id.equalizer_value);
     }
 



More information about the Android mailing list