[Android] Add Audio logging settings
This commit is contained in:
parent
33df507b4c
commit
8352d1bd61
|
@ -129,7 +129,9 @@
|
||||||
<string name="GenerateLogFiles_summary">Log recompiler code</string>
|
<string name="GenerateLogFiles_summary">Log recompiler code</string>
|
||||||
<string name="logging">Logging</string>
|
<string name="logging">Logging</string>
|
||||||
<string name="project64core">Project64 Core</string>
|
<string name="project64core">Project64 Core</string>
|
||||||
|
<string name="AudioPlugin">Audio Plugin</string>
|
||||||
<string name="logging_project64core">Logging - Project64 Core</string>
|
<string name="logging_project64core">Logging - Project64 Core</string>
|
||||||
|
<string name="logging_Audio">Logging - Audio</string>
|
||||||
<string name="TraceError">Error</string>
|
<string name="TraceError">Error</string>
|
||||||
<string name="TraceWarning">Warning</string>
|
<string name="TraceWarning">Warning</string>
|
||||||
<string name="TraceNotice">Notice</string>
|
<string name="TraceNotice">Notice</string>
|
||||||
|
@ -158,6 +160,8 @@
|
||||||
<string name="TraceUserInterface">User Interface</string>
|
<string name="TraceUserInterface">User Interface</string>
|
||||||
<string name="TraceRomList">Rom List</string>
|
<string name="TraceRomList">Rom List</string>
|
||||||
<string name="TraceExceptionHandler">Exception Handler</string>
|
<string name="TraceExceptionHandler">Exception Handler</string>
|
||||||
|
<string name="TraceAudioInitShutdown">Init/Shutdown</string>
|
||||||
|
<string name="TraceAudioAudioInterface">Interface</string>
|
||||||
<string name="CpuType">CPU core style</string>
|
<string name="CpuType">CPU core style</string>
|
||||||
<string name="Interpreter">Interpreter</string>
|
<string name="Interpreter">Interpreter</string>
|
||||||
<string name="Recompiler">Recompiler</string>
|
<string name="Recompiler">Recompiler</string>
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
android:entries="@array/trace_severity_list"
|
||||||
|
android:entryValues="@array/trace_severity_values"
|
||||||
|
android:key="Debugger_TraceAudioInitShutdown"
|
||||||
|
android:title="@string/TraceAudioInitShutdown" />
|
||||||
|
<ListPreference
|
||||||
|
android:entries="@array/trace_severity_list"
|
||||||
|
android:entryValues="@array/trace_severity_values"
|
||||||
|
android:key="Debugger_TraceAudioAudioInterface"
|
||||||
|
android:title="@string/TraceAudioAudioInterface" />
|
||||||
|
</PreferenceScreen>
|
|
@ -34,5 +34,8 @@
|
||||||
<Preference
|
<Preference
|
||||||
android:title="@string/project64core"
|
android:title="@string/project64core"
|
||||||
android:key="logging_core" />
|
android:key="logging_core" />
|
||||||
|
<Preference
|
||||||
|
android:title="@string/AudioPlugin"
|
||||||
|
android:key="logging_audio" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
/****************************************************************************
|
||||||
|
* *
|
||||||
|
* Project 64 - A Nintendo 64 emulator. *
|
||||||
|
* http://www.pj64-emu.com/ *
|
||||||
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
||||||
|
* *
|
||||||
|
* License: *
|
||||||
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
||||||
|
* *
|
||||||
|
****************************************************************************/
|
||||||
|
package emu.project64.jni;
|
||||||
|
|
||||||
|
public enum AudioSettingID
|
||||||
|
{
|
||||||
|
Output_SwapChannels,
|
||||||
|
Output_DefaultFrequency,
|
||||||
|
Buffer_PrimarySize,
|
||||||
|
Buffer_SecondarySize,
|
||||||
|
Buffer_SecondaryNbr,
|
||||||
|
Logging_LogAudioInitShutdown,
|
||||||
|
Logging_LogAudioInterface,
|
||||||
|
;
|
||||||
|
|
||||||
|
private int value;
|
||||||
|
|
||||||
|
public int getValue()
|
||||||
|
{
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
private static final class StaticFields
|
||||||
|
{
|
||||||
|
public static int Counter = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private AudioSettingID()
|
||||||
|
{
|
||||||
|
this.value = StaticFields.Counter;
|
||||||
|
StaticFields.Counter += 1;
|
||||||
|
}
|
||||||
|
}
|
|
@ -129,6 +129,10 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat
|
||||||
{
|
{
|
||||||
loadFragment(new LoggingProject64Core());
|
loadFragment(new LoggingProject64Core());
|
||||||
}
|
}
|
||||||
|
else if (preference.getKey().equals("logging_audio"))
|
||||||
|
{
|
||||||
|
loadFragment(new LoggingAudio());
|
||||||
|
}
|
||||||
else if (preference.getKey().equals("settings_reset"))
|
else if (preference.getKey().equals("settings_reset"))
|
||||||
{
|
{
|
||||||
DialogInterface.OnClickListener internalListener = new DialogInterface.OnClickListener()
|
DialogInterface.OnClickListener internalListener = new DialogInterface.OnClickListener()
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
/****************************************************************************
|
||||||
|
* *
|
||||||
|
* Project64 - A Nintendo 64 emulator. *
|
||||||
|
* http://www.pj64-emu.com/ *
|
||||||
|
* Copyright (C) 2012 Project64. All rights reserved. *
|
||||||
|
* *
|
||||||
|
* License: *
|
||||||
|
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
|
||||||
|
* *
|
||||||
|
****************************************************************************/
|
||||||
|
package emu.project64.settings;
|
||||||
|
|
||||||
|
import emu.project64.R;
|
||||||
|
|
||||||
|
public class LoggingAudio extends BaseSettingsFragment
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
protected int getXml()
|
||||||
|
{
|
||||||
|
return R.xml.logging_audio;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getTitleId()
|
||||||
|
{
|
||||||
|
return R.string.logging_Audio;
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,6 +12,7 @@ package emu.project64.settings;
|
||||||
|
|
||||||
import emu.project64.AndroidDevice;
|
import emu.project64.AndroidDevice;
|
||||||
import emu.project64.R;
|
import emu.project64.R;
|
||||||
|
import emu.project64.jni.AudioSettingID;
|
||||||
import emu.project64.jni.NativeExports;
|
import emu.project64.jni.NativeExports;
|
||||||
import emu.project64.jni.SettingsID;
|
import emu.project64.jni.SettingsID;
|
||||||
import emu.project64.jni.SystemEvent;
|
import emu.project64.jni.SystemEvent;
|
||||||
|
@ -85,6 +86,8 @@ public class SettingsActivity extends AppCompatActivity implements SharedPrefere
|
||||||
.putString("Debugger_TraceUserInterface",String.valueOf(NativeExports.SettingsLoadDword(SettingsID.Debugger_TraceUserInterface.getValue())))
|
.putString("Debugger_TraceUserInterface",String.valueOf(NativeExports.SettingsLoadDword(SettingsID.Debugger_TraceUserInterface.getValue())))
|
||||||
.putString("Debugger_TraceRomList",String.valueOf(NativeExports.SettingsLoadDword(SettingsID.Debugger_TraceRomList.getValue())))
|
.putString("Debugger_TraceRomList",String.valueOf(NativeExports.SettingsLoadDword(SettingsID.Debugger_TraceRomList.getValue())))
|
||||||
.putString("Debugger_TraceExceptionHandler",String.valueOf(NativeExports.SettingsLoadDword(SettingsID.Debugger_TraceExceptionHandler.getValue())))
|
.putString("Debugger_TraceExceptionHandler",String.valueOf(NativeExports.SettingsLoadDword(SettingsID.Debugger_TraceExceptionHandler.getValue())))
|
||||||
|
.putString("Debugger_TraceAudioInitShutdown",String.valueOf(NativeExports.SettingsLoadDword(SettingsID.FirstAudioSettings.getValue() + AudioSettingID.Logging_LogAudioInitShutdown.getValue())))
|
||||||
|
.putString("Debugger_TraceAudioAudioInterface",String.valueOf(NativeExports.SettingsLoadDword(SettingsID.FirstAudioSettings.getValue() + AudioSettingID.Logging_LogAudioInterface.getValue())))
|
||||||
.putInt("MaxRomsRemembered",NativeExports.UISettingsLoadDword(UISettingID.File_RecentGameFileCount.getValue()))
|
.putInt("MaxRomsRemembered",NativeExports.UISettingsLoadDword(UISettingID.File_RecentGameFileCount.getValue()))
|
||||||
.apply();
|
.apply();
|
||||||
|
|
||||||
|
@ -188,22 +191,12 @@ public class SettingsActivity extends AppCompatActivity implements SharedPrefere
|
||||||
{
|
{
|
||||||
NativeExports.SettingsSaveDword(SettingsID.Debugger_TraceTLB.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1")));
|
NativeExports.SettingsSaveDword(SettingsID.Debugger_TraceTLB.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1")));
|
||||||
}
|
}
|
||||||
else if (key.equals("Debugger_TraceProtectedMEM"))
|
else if (key.equals("Debugger_TraceProtectedMEM")) { NativeExports.SettingsSaveDword(SettingsID.Debugger_TraceProtectedMEM.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1"))); }
|
||||||
{
|
else if (key.equals("Debugger_TraceUserInterface")) { NativeExports.SettingsSaveDword(SettingsID.Debugger_TraceUserInterface.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1"))); }
|
||||||
NativeExports.SettingsSaveDword(SettingsID.Debugger_TraceProtectedMEM.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1")));
|
else if (key.equals("Debugger_TraceRomList")) { NativeExports.SettingsSaveDword(SettingsID.Debugger_TraceRomList.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1"))); }
|
||||||
}
|
else if (key.equals("Debugger_TraceExceptionHandler")) { NativeExports.SettingsSaveDword(SettingsID.Debugger_TraceExceptionHandler.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1"))); }
|
||||||
else if (key.equals("Debugger_TraceUserInterface"))
|
else if (key.equals("Debugger_TraceAudioInitShutdown")) { NativeExports.SettingsSaveDword(SettingsID.FirstAudioSettings.getValue() + AudioSettingID.Logging_LogAudioInitShutdown.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1"))); }
|
||||||
{
|
else if (key.equals("Debugger_TraceAudioAudioInterface")) { NativeExports.SettingsSaveDword(SettingsID.FirstAudioSettings.getValue() + AudioSettingID.Logging_LogAudioInterface.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1"))); }
|
||||||
NativeExports.SettingsSaveDword(SettingsID.Debugger_TraceUserInterface.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1")));
|
|
||||||
}
|
|
||||||
else if (key.equals("Debugger_TraceRomList"))
|
|
||||||
{
|
|
||||||
NativeExports.SettingsSaveDword(SettingsID.Debugger_TraceRomList.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1")));
|
|
||||||
}
|
|
||||||
else if (key.equals("Debugger_TraceExceptionHandler"))
|
|
||||||
{
|
|
||||||
NativeExports.SettingsSaveDword(SettingsID.Debugger_TraceExceptionHandler.getValue(), Integer.valueOf(sharedPreferences.getString(key, "1")));
|
|
||||||
}
|
|
||||||
else if (key.equals("MaxRomsRemembered")) { NativeExports.UISettingsSaveDword(UISettingID.File_RecentGameFileCount.getValue(), sharedPreferences.getInt(key, 10)); }
|
else if (key.equals("MaxRomsRemembered")) { NativeExports.UISettingsSaveDword(UISettingID.File_RecentGameFileCount.getValue(), sharedPreferences.getInt(key, 10)); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue