mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Some internal code shuffling for Config dialogs. OSX seems to be picky about when StaticSizerBoxes are created, as described in Issue 2229.
Bit of cleanup/grouping, control creation is now a bit more separate from value setting and tooltip assignment which IMO cluttered the code as it was. Removed something from main.cpp that looked like a hack to me. Fixes Issue 2229 git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5021 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -20,10 +20,12 @@
|
||||
#include "DSPConfigDlgLLE.h"
|
||||
|
||||
BEGIN_EVENT_TABLE(DSPConfigDialogLLE, wxDialog)
|
||||
EVT_BUTTON(wxID_OK, DSPConfigDialogLLE::SettingsChanged)
|
||||
EVT_CHECKBOX(ID_ENABLE_DTK_MUSIC, DSPConfigDialogLLE::SettingsChanged)
|
||||
EVT_CHECKBOX(ID_ENABLE_THROTTLE, DSPConfigDialogLLE::SettingsChanged)
|
||||
EVT_COMMAND_SCROLL(ID_VOLUME, DSPConfigDialogLLE::VolumeChanged)
|
||||
EVT_BUTTON(wxID_OK, DSPConfigDialogLLE::SettingsChanged)
|
||||
EVT_CHECKBOX(ID_ENABLE_DTK_MUSIC, DSPConfigDialogLLE::SettingsChanged)
|
||||
EVT_CHECKBOX(ID_ENABLE_THROTTLE, DSPConfigDialogLLE::SettingsChanged)
|
||||
#ifdef _WIN32
|
||||
EVT_COMMAND_SCROLL(ID_VOLUME, DSPConfigDialogLLE::VolumeChanged)
|
||||
#endif
|
||||
END_EVENT_TABLE()
|
||||
|
||||
DSPConfigDialogLLE::DSPConfigDialogLLE(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
|
||||
@ -36,6 +38,12 @@ DSPConfigDialogLLE::DSPConfigDialogLLE(wxWindow *parent, wxWindowID id, const wx
|
||||
CenterOnParent();
|
||||
|
||||
m_OK = new wxButton(this, wxID_OK, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
|
||||
wxStaticBoxSizer *sbSettings = new wxStaticBoxSizer(wxVERTICAL, this, wxT("Sound Settings"));
|
||||
// Same as for HLE. Maybe this dialog could be moved into AudioCommon or the likes?
|
||||
#ifdef _WIN32
|
||||
wxStaticBoxSizer *sbSettingsV = new wxStaticBoxSizer(wxVERTICAL, this, wxT("Volume"));
|
||||
#endif
|
||||
|
||||
// Create items
|
||||
m_buttonEnableDTKMusic = new wxCheckBox(this, ID_ENABLE_DTK_MUSIC, wxT("Enable DTK Music"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator);
|
||||
@ -43,8 +51,10 @@ DSPConfigDialogLLE::DSPConfigDialogLLE(wxWindow *parent, wxWindowID id, const wx
|
||||
wxStaticText *BackendText = new wxStaticText(this, wxID_ANY, wxT("Audio Backend"), wxDefaultPosition, wxDefaultSize, 0);
|
||||
m_BackendSelection = new wxComboBox(this, ID_BACKEND, wxEmptyString, wxDefaultPosition, wxSize(90, 20), wxArrayBackends, wxCB_READONLY, wxDefaultValidator);
|
||||
|
||||
#ifdef _WIN32
|
||||
m_volumeSlider = new wxSlider(this, ID_VOLUME, ac_Config.m_Volume, 1, 100, wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL|wxSL_INVERSE);
|
||||
m_volumeText = new wxStaticText(this, wxID_ANY, wxString::Format(wxT("%d %%"), ac_Config.m_Volume), wxDefaultPosition, wxDefaultSize, 0);
|
||||
#endif
|
||||
|
||||
// Update values
|
||||
m_buttonEnableDTKMusic->SetValue(ac_Config.m_EnableDTKMusic ? true : false);
|
||||
@ -64,7 +74,6 @@ DSPConfigDialogLLE::DSPConfigDialogLLE(wxWindow *parent, wxWindowID id, const wx
|
||||
wxBoxSizer *sBackend = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer *sButtons = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
wxStaticBoxSizer *sbSettings = new wxStaticBoxSizer(wxVERTICAL, this, wxT("Sound Settings"));
|
||||
sbSettings->Add(m_buttonEnableDTKMusic, 0, wxALL, 5);
|
||||
sbSettings->Add(m_buttonEnableThrottle, 0, wxALL, 5);
|
||||
|
||||
@ -72,12 +81,13 @@ DSPConfigDialogLLE::DSPConfigDialogLLE(wxWindow *parent, wxWindowID id, const wx
|
||||
sBackend->Add(m_BackendSelection, 0, wxALL, 1);
|
||||
sbSettings->Add(sBackend, 0, wxALL, 2);
|
||||
|
||||
wxStaticBoxSizer *sbSettingsV = new wxStaticBoxSizer(wxVERTICAL, this, wxT("Volume"));
|
||||
sbSettingsV->Add(m_volumeSlider, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER, 6);
|
||||
sbSettingsV->Add(m_volumeText, 0, wxALL|wxALIGN_LEFT, 4);
|
||||
|
||||
sSettings->Add(sbSettings, 0, wxALL|wxEXPAND, 4);
|
||||
#ifdef _WIN32
|
||||
sbSettingsV->Add(m_volumeSlider, 0, wxLEFT|wxRIGHT|wxALIGN_CENTER, 6);
|
||||
sbSettingsV->Add(m_volumeText, 0, wxALL|wxALIGN_LEFT, 4);
|
||||
sSettings->Add(sbSettingsV, 0, wxALL|wxEXPAND, 4);
|
||||
#endif
|
||||
sMain->Add(sSettings, 0, wxALL|wxEXPAND, 4);
|
||||
|
||||
sButtons->AddStretchSpacer();
|
||||
@ -90,15 +100,9 @@ DSPConfigDialogLLE::DSPConfigDialogLLE(wxWindow *parent, wxWindowID id, const wx
|
||||
// Add audio output options
|
||||
void DSPConfigDialogLLE::AddBackend(const char* backend)
|
||||
{
|
||||
// Update value
|
||||
// Update value
|
||||
m_BackendSelection->Append(wxString::FromAscii(backend));
|
||||
|
||||
// Unfortunately, DSound is the only API having a volume setting...
|
||||
#ifndef _WIN32
|
||||
m_volumeSlider->Disable();
|
||||
m_volumeText->Disable();
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
m_BackendSelection->SetValue(wxString::FromAscii(ac_Config.sBackend));
|
||||
#else
|
||||
@ -115,6 +119,7 @@ DSPConfigDialogLLE::~DSPConfigDialogLLE()
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
void DSPConfigDialogLLE::VolumeChanged(wxScrollEvent& WXUNUSED(event))
|
||||
{
|
||||
ac_Config.m_Volume = m_volumeSlider->GetValue();
|
||||
@ -122,6 +127,7 @@ void DSPConfigDialogLLE::VolumeChanged(wxScrollEvent& WXUNUSED(event))
|
||||
|
||||
m_volumeText->SetLabel(wxString::Format(wxT("%d %%"), m_volumeSlider->GetValue()));
|
||||
}
|
||||
#endif
|
||||
|
||||
void DSPConfigDialogLLE::SettingsChanged(wxCommandEvent& event)
|
||||
{
|
||||
|
Reference in New Issue
Block a user