Skip to content

Commit a962d74

Browse files
marconeAndroid (Google) Code Review
authored andcommitted
Merge "EffectsTest enhancements" into jb-mr1-dev
2 parents 0482791 + 80cd3fc commit a962d74

File tree

6 files changed

+34
-1
lines changed

6 files changed

+34
-1
lines changed

media/tests/EffectsTest/res/layout/bassboosttest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@
105105
style="@android:style/TextAppearance.Medium" />
106106

107107
<EditText android:id="@+id/sessionEdit"
108+
android:singleLine="true"
109+
android:numeric="integer"
108110
android:layout_width="fill_parent"
109111
android:layout_height="wrap_content"
110112
android:layout_weight="0.5"

media/tests/EffectsTest/res/layout/equalizertest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@
105105
style="@android:style/TextAppearance.Medium" />
106106

107107
<EditText android:id="@+id/sessionEdit"
108+
android:singleLine="true"
109+
android:numeric="integer"
108110
android:layout_width="fill_parent"
109111
android:layout_height="wrap_content"
110112
android:layout_weight="0.5"

media/tests/EffectsTest/res/layout/presetreverbtest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@
105105
style="@android:style/TextAppearance.Medium" />
106106

107107
<EditText android:id="@+id/sessionEdit"
108+
android:singleLine="true"
109+
android:numeric="integer"
108110
android:layout_width="fill_parent"
109111
android:layout_height="wrap_content"
110112
android:layout_weight="0.5"

media/tests/EffectsTest/res/layout/virtualizertest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@
105105
style="@android:style/TextAppearance.Medium" />
106106

107107
<EditText android:id="@+id/sessionEdit"
108+
android:singleLine="true"
109+
android:numeric="integer"
108110
android:layout_width="fill_parent"
109111
android:layout_height="wrap_content"
110112
android:layout_weight="0.5"

media/tests/EffectsTest/res/layout/visualizertest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@
105105
style="@android:style/TextAppearance.Medium" />
106106

107107
<EditText android:id="@+id/sessionEdit"
108+
android:singleLine="true"
109+
android:numeric="integer"
108110
android:layout_width="fill_parent"
109111
android:layout_height="wrap_content"
110112
android:layout_weight="0.5"

media/tests/EffectsTest/src/com/android/effectstest/EffectsTest.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import android.widget.BaseAdapter;
3333
import android.widget.LinearLayout;
3434
import android.media.audiofx.AudioEffect;
35+
3536
import java.util.UUID;
3637

3738
public class EffectsTest extends Activity {
@@ -154,13 +155,35 @@ public EffectView(Context context, AudioEffect.Descriptor[] descriptors) {
154155
this.setOrientation(VERTICAL);
155156
}
156157

158+
public String effectUuidToString(UUID effectType) {
159+
if (effectType.equals(AudioEffect.EFFECT_TYPE_VIRTUALIZER)) {
160+
return "Virtualizer";
161+
} else if (effectType.equals(AudioEffect.EFFECT_TYPE_ENV_REVERB)){
162+
return "Reverb";
163+
} else if (effectType.equals(AudioEffect.EFFECT_TYPE_PRESET_REVERB)){
164+
return "Preset Reverb";
165+
} else if (effectType.equals(AudioEffect.EFFECT_TYPE_EQUALIZER)){
166+
return "Equalizer";
167+
} else if (effectType.equals(AudioEffect.EFFECT_TYPE_BASS_BOOST)){
168+
return "Bass Boost";
169+
} else if (effectType.equals(AudioEffect.EFFECT_TYPE_AGC)){
170+
return "Automatic Gain Control";
171+
} else if (effectType.equals(AudioEffect.EFFECT_TYPE_AEC)){
172+
return "Acoustic Echo Canceler";
173+
} else if (effectType.equals(AudioEffect.EFFECT_TYPE_NS)){
174+
return "Noise Suppressor";
175+
}
176+
177+
return effectType.toString();
178+
}
179+
157180
public void set(int position) {
158181
TextView tv = new TextView(mContext);
159182
tv.setText("Effect "+ position);
160183
addView(tv, new LinearLayout.LayoutParams(
161184
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
162185
tv = new TextView(mContext);
163-
tv.setText(" type: "+ mDescriptors[position].type.toString());
186+
tv.setText(" type: "+ effectUuidToString(mDescriptors[position].type));
164187
addView(tv, new LinearLayout.LayoutParams(
165188
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
166189
tv = new TextView(mContext);

0 commit comments

Comments
 (0)