kopia lustrzana https://github.com/sh123/codec2_talkie
Title fixes
rodzic
e88a94e9be
commit
cac9a17885
|
@ -457,8 +457,6 @@ public class MainActivity extends AppCompatActivity implements ServiceConnection
|
|||
}
|
||||
|
||||
private void updateStatusText(ProtocolFactory.ProtocolType protocolType) {
|
||||
String codec2ModeName = _sharedPreferences.getString(PreferenceKeys.CODEC2_MODE, getResources().getStringArray(R.array.codec2_modes)[0]);
|
||||
|
||||
// protocol
|
||||
String status = "";
|
||||
|
||||
|
@ -518,7 +516,7 @@ public class MainActivity extends AppCompatActivity implements ServiceConnection
|
|||
|
||||
status = status.length() == 0 ? protocolType.toString() : protocolType.toString() + " " + status;
|
||||
|
||||
String statusLine = AudioTools.getSpeedStatusText(codec2ModeName, _sharedPreferences) + ", " + status;
|
||||
String statusLine = AudioTools.getSpeedStatusText(_sharedPreferences, getResources()) + ", " + status;
|
||||
_textCodecMode.setText(statusLine);
|
||||
}
|
||||
|
||||
|
|
|
@ -451,10 +451,14 @@ public class AppWorker extends Thread {
|
|||
|
||||
private void cleanup() {
|
||||
Log.i(TAG, "cleanup() started");
|
||||
_systemAudioRecorder.stop();
|
||||
try {
|
||||
_systemAudioRecorder.stop();
|
||||
} catch (IllegalStateException ignored) {}
|
||||
_systemAudioRecorder.release();
|
||||
|
||||
_systemAudioPlayer.stop();
|
||||
try {
|
||||
_systemAudioPlayer.stop();
|
||||
} catch (IllegalStateException ignored) {}
|
||||
_systemAudioPlayer.release();
|
||||
|
||||
try {
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
package com.radio.codec2talkie.tools;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Color;
|
||||
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import com.radio.codec2talkie.R;
|
||||
import com.radio.codec2talkie.app.AppWorker;
|
||||
import com.radio.codec2talkie.settings.PreferenceKeys;
|
||||
import com.radio.codec2talkie.settings.SettingsWrapper;
|
||||
|
@ -81,7 +83,7 @@ public class AudioTools {
|
|||
return modulation == RadioTools.ModulationTypeLora ? "LoRa" : "FSK";
|
||||
}
|
||||
|
||||
public static String getSpeedStatusText(String codec2ModeName, SharedPreferences sharedPreferences) {
|
||||
public static String getSpeedStatusText(SharedPreferences sharedPreferences, Resources resources) {
|
||||
|
||||
// use freedv mode text instead if it is active
|
||||
String freedvModeLabel = getFreedvModeAsText(sharedPreferences);
|
||||
|
@ -89,7 +91,8 @@ public class AudioTools {
|
|||
|
||||
// codec2 speed
|
||||
String speedModeInfo;
|
||||
if (SettingsWrapper.isCodec2Enabled()) {
|
||||
if (SettingsWrapper.isCodec2Enabled(sharedPreferences)) {
|
||||
String codec2ModeName = sharedPreferences.getString(PreferenceKeys.CODEC2_MODE, resources.getStringArray(R.array.codec2_modes)[0]);
|
||||
speedModeInfo = "C2: " + AudioTools.extractCodec2Speed(codec2ModeName);
|
||||
} else {
|
||||
int speed = Integer.parseInt(sharedPreferences.getString(PreferenceKeys.OPUS_BIT_RATE, "3200"));
|
||||
|
|
Ładowanie…
Reference in New Issue