mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Added dtk sound mixing to audiocommon (should work with LLE now)
And also moved all common setting to audiocommonconfig git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2796 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -18,6 +18,7 @@
|
||||
#include "Common.h"
|
||||
#include "IniFile.h"
|
||||
#include "Config.h"
|
||||
#include "AudioCommon.h"
|
||||
|
||||
CConfig g_Config;
|
||||
|
||||
@ -34,13 +35,7 @@ void CConfig::Load()
|
||||
IniFile file;
|
||||
file.Load(FULL_CONFIG_DIR "DSP.ini");
|
||||
file.Get("Config", "EnableHLEAudio", &m_EnableHLEAudio, true); // Sound Settings
|
||||
file.Get("Config", "EnableDTKMusic", &m_EnableDTKMusic, true);
|
||||
file.Get("Config", "EnableThrottle", &m_EnableThrottle, true);
|
||||
#ifdef _WIN32
|
||||
file.Get("Config", "Backend", &sBackend, "DSound");
|
||||
#else
|
||||
file.Get("Config", "Backend", &sBackend, "AOSound");
|
||||
#endif
|
||||
ac_Config.Load(file);
|
||||
}
|
||||
|
||||
void CConfig::Save()
|
||||
@ -48,9 +43,7 @@ void CConfig::Save()
|
||||
IniFile file;
|
||||
file.Load(FULL_CONFIG_DIR "DSP.ini");
|
||||
file.Set("Config", "EnableHLEAudio", m_EnableHLEAudio); // Sound Settings
|
||||
file.Set("Config", "EnableDTKMusic", m_EnableDTKMusic);
|
||||
file.Set("Config", "EnableThrottle", m_EnableThrottle);
|
||||
file.Set("Config", "Backend", sBackend.c_str());
|
||||
|
||||
ac_Config.Set(file);
|
||||
|
||||
file.Save(FULL_CONFIG_DIR "DSP.ini");
|
||||
}
|
||||
|
@ -23,10 +23,7 @@
|
||||
struct CConfig
|
||||
{
|
||||
bool m_EnableHLEAudio;
|
||||
bool m_EnableDTKMusic;
|
||||
bool m_EnableThrottle;
|
||||
std::string sBackend;
|
||||
|
||||
|
||||
CConfig();
|
||||
|
||||
void Load();
|
||||
|
@ -46,8 +46,8 @@ ConfigDialog::ConfigDialog(wxWindow *parent, wxWindowID id, const wxString &titl
|
||||
|
||||
// Update values
|
||||
m_buttonEnableHLEAudio->SetValue(g_Config.m_EnableHLEAudio ? true : false);
|
||||
m_buttonEnableDTKMusic->SetValue(g_Config.m_EnableDTKMusic ? true : false);
|
||||
m_buttonEnableThrottle->SetValue(g_Config.m_EnableThrottle ? true : false);
|
||||
m_buttonEnableDTKMusic->SetValue(ac_Config.m_EnableDTKMusic ? true : false);
|
||||
m_buttonEnableThrottle->SetValue(ac_Config.m_EnableThrottle ? true : false);
|
||||
|
||||
// Add tooltips
|
||||
m_buttonEnableHLEAudio->SetToolTip(wxT("This is the most common sound type"));
|
||||
@ -81,7 +81,7 @@ void ConfigDialog::AddBackend(const char* backend)
|
||||
{
|
||||
m_BackendSelection->Append(wxString::FromAscii(backend));
|
||||
// Update value
|
||||
m_BackendSelection->SetValue(wxString::FromAscii(g_Config.sBackend.c_str()));
|
||||
m_BackendSelection->SetValue(wxString::FromAscii(ac_Config.sBackend.c_str()));
|
||||
}
|
||||
|
||||
ConfigDialog::~ConfigDialog()
|
||||
@ -91,9 +91,9 @@ ConfigDialog::~ConfigDialog()
|
||||
void ConfigDialog::SettingsChanged(wxCommandEvent& event)
|
||||
{
|
||||
g_Config.m_EnableHLEAudio = m_buttonEnableHLEAudio->GetValue();
|
||||
g_Config.m_EnableDTKMusic = m_buttonEnableDTKMusic->GetValue();
|
||||
g_Config.m_EnableThrottle = m_buttonEnableThrottle->GetValue();
|
||||
g_Config.sBackend = m_BackendSelection->GetValue().mb_str();
|
||||
ac_Config.m_EnableDTKMusic = m_buttonEnableDTKMusic->GetValue();
|
||||
ac_Config.m_EnableThrottle = m_buttonEnableThrottle->GetValue();
|
||||
ac_Config.sBackend = m_BackendSelection->GetValue().mb_str();
|
||||
g_Config.Save();
|
||||
|
||||
if (event.GetId() == wxID_OK)
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/statbox.h>
|
||||
#include "AudioCommon.h"
|
||||
|
||||
class ConfigDialog : public wxDialog
|
||||
{
|
||||
|
@ -15,9 +15,9 @@ void HLEMixer::MixUCode(short *samples, int numSamples) {
|
||||
void HLEMixer::Premix(short *samples, int numSamples) {
|
||||
|
||||
// first get the DTK Music
|
||||
if (g_Config.m_EnableDTKMusic) {
|
||||
g_dspInitialize.pGetAudioStreaming(samples, numSamples);
|
||||
}
|
||||
// if (g_Config.m_EnableDTKMusic) {
|
||||
// g_dspInitialize.pGetAudioStreaming(samples, numSamples);
|
||||
// }
|
||||
|
||||
MixUCode(samples, numSamples);
|
||||
}
|
||||
|
@ -194,16 +194,8 @@ void Initialize(void *init)
|
||||
|
||||
CDSPHandler::CreateInstance();
|
||||
|
||||
soundStream = AudioCommon::InitSoundStream(g_Config.sBackend,
|
||||
new HLEMixer());
|
||||
soundStream->GetMixer()->SetThrottle(g_Config.m_EnableThrottle);
|
||||
soundStream = AudioCommon::InitSoundStream(new HLEMixer());
|
||||
|
||||
// Start the sound recording
|
||||
/*
|
||||
if (g_Config.record) {
|
||||
soundStream->StartLogAudio(FULL_DUMP_DIR g_Config.recordFile);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
void DSP_StopSoundStream()
|
||||
|
Reference in New Issue
Block a user