EffectsTest enhancements
Fix the session edit boxes, and make the effects list more readable
by translating known effect type UUIDs
Change-Id: I67e78d8d2781c5a56fa35d994bc21911d15f8715
diff --git a/media/tests/EffectsTest/res/layout/bassboosttest.xml b/media/tests/EffectsTest/res/layout/bassboosttest.xml
index 0888e98..ac912c8 100755
--- a/media/tests/EffectsTest/res/layout/bassboosttest.xml
+++ b/media/tests/EffectsTest/res/layout/bassboosttest.xml
@@ -105,6 +105,8 @@
style="@android:style/TextAppearance.Medium" />
<EditText android:id="@+id/sessionEdit"
+ android:singleLine="true"
+ android:numeric="integer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
diff --git a/media/tests/EffectsTest/res/layout/equalizertest.xml b/media/tests/EffectsTest/res/layout/equalizertest.xml
index 2223c48..5ef035d 100755
--- a/media/tests/EffectsTest/res/layout/equalizertest.xml
+++ b/media/tests/EffectsTest/res/layout/equalizertest.xml
@@ -105,6 +105,8 @@
style="@android:style/TextAppearance.Medium" />
<EditText android:id="@+id/sessionEdit"
+ android:singleLine="true"
+ android:numeric="integer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
diff --git a/media/tests/EffectsTest/res/layout/presetreverbtest.xml b/media/tests/EffectsTest/res/layout/presetreverbtest.xml
index b648899..cd7fbd3a 100755
--- a/media/tests/EffectsTest/res/layout/presetreverbtest.xml
+++ b/media/tests/EffectsTest/res/layout/presetreverbtest.xml
@@ -105,6 +105,8 @@
style="@android:style/TextAppearance.Medium" />
<EditText android:id="@+id/sessionEdit"
+ android:singleLine="true"
+ android:numeric="integer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
diff --git a/media/tests/EffectsTest/res/layout/virtualizertest.xml b/media/tests/EffectsTest/res/layout/virtualizertest.xml
index c9203de..1fafeab 100755
--- a/media/tests/EffectsTest/res/layout/virtualizertest.xml
+++ b/media/tests/EffectsTest/res/layout/virtualizertest.xml
@@ -105,6 +105,8 @@
style="@android:style/TextAppearance.Medium" />
<EditText android:id="@+id/sessionEdit"
+ android:singleLine="true"
+ android:numeric="integer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
diff --git a/media/tests/EffectsTest/res/layout/visualizertest.xml b/media/tests/EffectsTest/res/layout/visualizertest.xml
index 8611e8c..50ac7bb 100755
--- a/media/tests/EffectsTest/res/layout/visualizertest.xml
+++ b/media/tests/EffectsTest/res/layout/visualizertest.xml
@@ -105,6 +105,8 @@
style="@android:style/TextAppearance.Medium" />
<EditText android:id="@+id/sessionEdit"
+ android:singleLine="true"
+ android:numeric="integer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.5"
diff --git a/media/tests/EffectsTest/src/com/android/effectstest/EffectsTest.java b/media/tests/EffectsTest/src/com/android/effectstest/EffectsTest.java
index 6612766..70202463 100755
--- a/media/tests/EffectsTest/src/com/android/effectstest/EffectsTest.java
+++ b/media/tests/EffectsTest/src/com/android/effectstest/EffectsTest.java
@@ -32,6 +32,7 @@
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.media.audiofx.AudioEffect;
+
import java.util.UUID;
public class EffectsTest extends Activity {
@@ -154,13 +155,35 @@
this.setOrientation(VERTICAL);
}
+ public String effectUuidToString(UUID effectType) {
+ if (effectType.equals(AudioEffect.EFFECT_TYPE_VIRTUALIZER)) {
+ return "Virtualizer";
+ } else if (effectType.equals(AudioEffect.EFFECT_TYPE_ENV_REVERB)){
+ return "Reverb";
+ } else if (effectType.equals(AudioEffect.EFFECT_TYPE_PRESET_REVERB)){
+ return "Preset Reverb";
+ } else if (effectType.equals(AudioEffect.EFFECT_TYPE_EQUALIZER)){
+ return "Equalizer";
+ } else if (effectType.equals(AudioEffect.EFFECT_TYPE_BASS_BOOST)){
+ return "Bass Boost";
+ } else if (effectType.equals(AudioEffect.EFFECT_TYPE_AGC)){
+ return "Automatic Gain Control";
+ } else if (effectType.equals(AudioEffect.EFFECT_TYPE_AEC)){
+ return "Acoustic Echo Canceler";
+ } else if (effectType.equals(AudioEffect.EFFECT_TYPE_NS)){
+ return "Noise Suppressor";
+ }
+
+ return effectType.toString();
+ }
+
public void set(int position) {
TextView tv = new TextView(mContext);
tv.setText("Effect "+ position);
addView(tv, new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
tv = new TextView(mContext);
- tv.setText(" type: "+ mDescriptors[position].type.toString());
+ tv.setText(" type: "+ effectUuidToString(mDescriptors[position].type));
addView(tv, new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
tv = new TextView(mContext);