Remove the 'Default' gender option as this does not make sense.

This commit is contained in:
Reece H. Dunn
2013-05-03 15:32:28 +01:00
parent 1b9df87976
commit b2785ce823
50 changed files with 22 additions and 64 deletions
@@ -35,6 +35,27 @@ public class TtsSettingsActivity extends PreferenceActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Migrate old eyes-free settings to the new settings:
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(TtsSettingsActivity.this);
final SharedPreferences.Editor editor = prefs.edit();
String pitch = prefs.getString("espeak_pitch", null);
if (pitch == null) {
// Try the old eyes-free setting:
pitch = prefs.getString("default_pitch", "100");
int pitchValue = Integer.parseInt(pitch) / 2;
editor.putString("espeak_pitch", Integer.toString(pitchValue));
}
String gender = prefs.getString("default_gender", "0");
if (gender.equals("0")) {
// Convert the "Default" value to "Male":
editor.putString("default_gender", "1");
}
editor.commit();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
{
getFragmentManager().beginTransaction().replace(
@@ -122,21 +143,6 @@ public class TtsSettingsActivity extends PreferenceActivity {
return;
}
// Migrate old eyes-free settings to the new settings:
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
final SharedPreferences.Editor editor = prefs.edit();
String pitch = prefs.getString("espeak_pitch", null);
if (pitch == null) {
// Try the old eyes-free setting:
pitch = prefs.getString("default_pitch", "100");
int pitchValue = Integer.parseInt(pitch) / 2;
editor.putString("espeak_pitch", Integer.toString(pitchValue));
}
editor.commit();
// Bind eSpeak parameters to preference settings:
SpeechSynthesis engine = new SpeechSynthesis(context, null);