2009-07-28 21:32:10 +00:00
// Copyright (C) 2003 Dolphin Project.
2008-12-08 05:30:24 +00:00
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
2009-01-04 21:53:41 +00:00
# include <string> // System
2008-12-08 05:30:24 +00:00
# include <vector>
2010-07-20 03:23:25 +00:00
# include "Common.h"
# include "CommonPaths.h"
2009-01-04 21:53:41 +00:00
# include "Core.h" // Core
2009-02-28 21:30:43 +00:00
# include "HW/EXI.h"
2009-03-02 04:02:09 +00:00
# include "HW/SI.h"
2008-12-08 05:30:24 +00:00
2009-01-04 21:53:41 +00:00
# include "Globals.h" // Local
2008-12-08 05:30:24 +00:00
# include "ConfigMain.h"
# include "PluginManager.h"
2009-01-17 23:41:21 +00:00
# include "ConfigManager.h"
2009-09-14 06:26:49 +00:00
# include "SysConf.h"
2008-12-09 05:37:15 +00:00
# include "Frame.h"
2010-04-12 01:33:10 +00:00
# include "HotkeyDlg.h"
2008-12-09 05:37:15 +00:00
2010-06-22 15:10:25 +00:00
# include "../../Common/Src/OpenCL.h"
2010-06-22 13:17:01 +00:00
2010-06-03 01:24:26 +00:00
# ifdef __APPLE__
2010-04-23 19:15:44 +00:00
# include <Cocoa/Cocoa.h>
# endif
2008-12-09 05:37:15 +00:00
extern CFrame * main_frame ;
2008-12-08 05:30:24 +00:00
2009-10-19 15:14:48 +00:00
// Strings for Device Selections
# define DEV_NONE_STR "<Nothing>"
# define DEV_DUMMY_STR "Dummy"
# define SIDEV_STDCONT_STR "Standard Controller"
# define SIDEV_GBA_STR "GBA"
# define SIDEV_AM_BB_STR "AM-Baseboard"
# define EXIDEV_MEMCARD_STR "Memory Card"
# define EXIDEV_MIC_STR "Mic"
# define EXIDEV_BBA_STR "BBA"
# define EXIDEV_AM_BB_STR "AM-Baseboard"
2008-12-08 05:30:24 +00:00
BEGIN_EVENT_TABLE ( CConfigMain , wxDialog )
EVT_CLOSE ( CConfigMain : : OnClose )
2010-06-05 01:38:22 +00:00
EVT_BUTTON ( wxID_OK , CConfigMain : : OnOk )
2009-01-04 21:29:23 +00:00
2009-01-22 07:42:17 +00:00
2009-10-23 15:26:35 +00:00
EVT_CHECKBOX ( ID_CPUTHREAD , CConfigMain : : CoreSettingsChanged )
2008-12-08 05:30:24 +00:00
EVT_CHECKBOX ( ID_IDLESKIP , CConfigMain : : CoreSettingsChanged )
EVT_CHECKBOX ( ID_ENABLECHEATS , CConfigMain : : CoreSettingsChanged )
2009-06-18 11:23:37 +00:00
EVT_CHOICE ( ID_FRAMELIMIT , CConfigMain : : CoreSettingsChanged )
2010-06-05 01:38:22 +00:00
EVT_CHECKBOX ( ID_FRAMELIMIT_USEFPSFORLIMITING , CConfigMain : : CoreSettingsChanged )
EVT_CHECKBOX ( ID_ALWAYS_HLE_BS2 , CConfigMain : : CoreSettingsChanged )
2010-06-23 12:57:59 +00:00
# if defined(HAVE_OPENCL) && HAVE_OPENCL
2010-06-22 13:17:01 +00:00
EVT_CHECKBOX ( ID_ENABLE_OPENCL , CConfigMain : : CoreSettingsChanged )
2010-06-23 12:57:59 +00:00
# endif
2010-06-05 01:38:22 +00:00
EVT_RADIOBOX ( ID_CPUENGINE , CConfigMain : : CoreSettingsChanged )
EVT_CHECKBOX ( ID_LOCKTHREADS , CConfigMain : : CoreSettingsChanged )
EVT_CHECKBOX ( ID_DSPTHREAD , CConfigMain : : CoreSettingsChanged )
EVT_CHOICE ( ID_DISPLAY_FULLSCREENRES , CConfigMain : : DisplaySettingsChanged )
EVT_TEXT ( ID_DISPLAY_WINDOWWIDTH , CConfigMain : : DisplaySettingsChanged )
EVT_TEXT ( ID_DISPLAY_WINDOWHEIGHT , CConfigMain : : DisplaySettingsChanged )
EVT_CHECKBOX ( ID_DISPLAY_FULLSCREEN , CConfigMain : : DisplaySettingsChanged )
EVT_CHECKBOX ( ID_DISPLAY_HIDECURSOR , CConfigMain : : DisplaySettingsChanged )
EVT_CHECKBOX ( ID_DISPLAY_RENDERTOMAIN , CConfigMain : : DisplaySettingsChanged )
EVT_CHECKBOX ( ID_INTERFACE_CONFIRMSTOP , CConfigMain : : DisplaySettingsChanged )
EVT_CHECKBOX ( ID_INTERFACE_USEPANICHANDLERS , CConfigMain : : DisplaySettingsChanged )
EVT_RADIOBOX ( ID_INTERFACE_THEME , CConfigMain : : DisplaySettingsChanged )
EVT_CHOICE ( ID_INTERFACE_LANG , CConfigMain : : DisplaySettingsChanged )
EVT_BUTTON ( ID_HOTKEY_CONFIG , CConfigMain : : DisplaySettingsChanged )
2009-01-14 16:36:43 +00:00
2009-01-04 21:29:23 +00:00
EVT_CHOICE ( ID_GC_SRAM_LNG , CConfigMain : : GCSettingsChanged )
2010-06-05 01:38:22 +00:00
2009-02-02 22:29:33 +00:00
EVT_CHOICE ( ID_GC_EXIDEVICE_SLOTA , CConfigMain : : GCSettingsChanged )
EVT_BUTTON ( ID_GC_EXIDEVICE_SLOTA_PATH , CConfigMain : : GCSettingsChanged )
EVT_CHOICE ( ID_GC_EXIDEVICE_SLOTB , CConfigMain : : GCSettingsChanged )
EVT_BUTTON ( ID_GC_EXIDEVICE_SLOTB_PATH , CConfigMain : : GCSettingsChanged )
EVT_CHOICE ( ID_GC_EXIDEVICE_SP1 , CConfigMain : : GCSettingsChanged )
EVT_CHOICE ( ID_GC_SIDEVICE0 , CConfigMain : : GCSettingsChanged )
EVT_CHOICE ( ID_GC_SIDEVICE1 , CConfigMain : : GCSettingsChanged )
EVT_CHOICE ( ID_GC_SIDEVICE2 , CConfigMain : : GCSettingsChanged )
EVT_CHOICE ( ID_GC_SIDEVICE3 , CConfigMain : : GCSettingsChanged )
2009-01-04 21:29:23 +00:00
2010-06-05 01:38:22 +00:00
2008-12-08 05:30:24 +00:00
EVT_CHOICE ( ID_WII_BT_BAR , CConfigMain : : WiiSettingsChanged )
2010-06-05 01:38:22 +00:00
2008-12-08 05:30:24 +00:00
EVT_CHECKBOX ( ID_WII_IPL_SSV , CConfigMain : : WiiSettingsChanged )
EVT_CHECKBOX ( ID_WII_IPL_PGS , CConfigMain : : WiiSettingsChanged )
EVT_CHECKBOX ( ID_WII_IPL_E60 , CConfigMain : : WiiSettingsChanged )
EVT_CHOICE ( ID_WII_IPL_AR , CConfigMain : : WiiSettingsChanged )
EVT_CHOICE ( ID_WII_IPL_LNG , CConfigMain : : WiiSettingsChanged )
2010-06-05 01:38:22 +00:00
2010-01-11 11:56:17 +00:00
EVT_CHECKBOX ( ID_WII_SD_CARD , CConfigMain : : WiiSettingsChanged )
EVT_CHECKBOX ( ID_WII_KEYBOARD , CConfigMain : : WiiSettingsChanged )
2008-12-09 05:37:15 +00:00
2010-06-05 01:38:22 +00:00
2008-12-08 05:30:24 +00:00
EVT_LISTBOX ( ID_ISOPATHS , CConfigMain : : ISOPathsSelectionChanged )
2010-06-05 01:38:22 +00:00
EVT_CHECKBOX ( ID_RECURSIVEISOPATH , CConfigMain : : RecursiveDirectoryChanged )
2008-12-08 05:30:24 +00:00
EVT_BUTTON ( ID_ADDISOPATH , CConfigMain : : AddRemoveISOPaths )
EVT_BUTTON ( ID_REMOVEISOPATH , CConfigMain : : AddRemoveISOPaths )
2010-06-05 01:38:22 +00:00
2008-12-08 05:30:24 +00:00
EVT_FILEPICKER_CHANGED ( ID_DEFAULTISO , CConfigMain : : DefaultISOChanged )
EVT_DIRPICKER_CHANGED ( ID_DVDROOT , CConfigMain : : DVDRootChanged )
2009-12-10 09:16:10 +00:00
EVT_FILEPICKER_CHANGED ( ID_APPLOADERPATH , CConfigMain : : ApploaderPathChanged )
2009-01-14 16:36:43 +00:00
2010-06-05 01:38:22 +00:00
2008-12-08 05:30:24 +00:00
EVT_CHOICE ( ID_GRAPHIC_CB , CConfigMain : : OnSelectionChanged )
EVT_BUTTON ( ID_GRAPHIC_CONFIG , CConfigMain : : OnConfig )
2010-06-05 01:38:22 +00:00
2008-12-08 05:30:24 +00:00
EVT_CHOICE ( ID_DSP_CB , CConfigMain : : OnSelectionChanged )
EVT_BUTTON ( ID_DSP_CONFIG , CConfigMain : : OnConfig )
2010-06-05 01:38:22 +00:00
2008-12-08 05:30:24 +00:00
EVT_CHOICE ( ID_WIIMOTE_CB , CConfigMain : : OnSelectionChanged )
EVT_BUTTON ( ID_WIIMOTE_CONFIG , CConfigMain : : OnConfig )
END_EVENT_TABLE ( )
2009-01-04 21:53:41 +00:00
2008-12-08 05:30:24 +00:00
CConfigMain : : CConfigMain ( wxWindow * parent , wxWindowID id , const wxString & title , const wxPoint & position , const wxSize & size , long style )
: wxDialog ( parent , id , title , position , size , style )
{
2009-01-04 21:53:41 +00:00
// Control refreshing of the ISOs list
2008-12-08 05:30:24 +00:00
bRefreshList = false ;
2009-02-03 15:03:34 +00:00
2010-04-22 04:28:34 +00:00
AddResolutions ( ) ;
2008-12-08 05:30:24 +00:00
CreateGUIControls ( ) ;
2009-01-04 21:53:41 +00:00
// Update selected ISO paths
2008-12-08 05:30:24 +00:00
for ( u32 i = 0 ; i < SConfig : : GetInstance ( ) . m_ISOFolder . size ( ) ; i + + )
{
2009-12-29 17:34:14 +00:00
ISOPaths - > Append ( wxString ( SConfig : : GetInstance ( ) . m_ISOFolder [ i ] . c_str ( ) , * wxConvCurrent ) ) ;
2008-12-08 05:30:24 +00:00
}
}
CConfigMain : : ~ CConfigMain ( )
{
}
2009-01-04 21:53:41 +00:00
2009-02-02 22:29:33 +00:00
// Used to restrict changing of some options while emulator is running
2009-01-04 21:53:41 +00:00
void CConfigMain : : UpdateGUI ( )
{
if ( Core : : GetState ( ) ! = Core : : CORE_UNINITIALIZED )
{
2009-01-15 06:48:15 +00:00
// Disable the Core stuff on GeneralPage
2009-10-23 15:26:35 +00:00
CPUThread - > Disable ( ) ;
2009-01-15 06:48:15 +00:00
SkipIdle - > Disable ( ) ;
EnableCheats - > Disable ( ) ;
2010-06-05 01:38:22 +00:00
AlwaysHLE_BS2 - > Disable ( ) ;
2010-06-23 12:57:59 +00:00
# if defined(HAVE_OPENCL) && HAVE_OPENCL
2010-06-22 13:17:01 +00:00
EnableOpenCL - > Disable ( ) ;
2010-06-23 12:57:59 +00:00
# endif
2010-06-05 01:38:22 +00:00
CPUEngine - > Disable ( ) ;
LockThreads - > Disable ( ) ;
DSPThread - > Disable ( ) ;
// Disable stuff on DisplayPage
2010-04-22 04:28:34 +00:00
FullscreenResolution - > Disable ( ) ;
2010-06-05 01:38:22 +00:00
RenderToMain - > Disable ( ) ;
2009-04-16 05:29:45 +00:00
2010-06-05 01:38:22 +00:00
// Disable stuff on GamecubePage
2009-02-02 22:29:33 +00:00
GCSystemLang - > Disable ( ) ;
2009-04-16 05:29:45 +00:00
2010-06-05 01:38:22 +00:00
// Disable stuff on WiiPage
2010-01-11 11:56:17 +00:00
WiiSensBarPos - > Disable ( ) ;
WiiScreenSaver - > Disable ( ) ;
WiiProgressiveScan - > Disable ( ) ;
WiiEuRGB60 - > Disable ( ) ;
WiiAspectRatio - > Disable ( ) ;
WiiSystemLang - > Disable ( ) ;
2009-04-16 05:29:45 +00:00
2010-06-05 01:38:22 +00:00
// Disable stuff on PathsPage
2009-01-04 21:53:41 +00:00
PathsPage - > Disable ( ) ;
2009-04-16 05:29:45 +00:00
2010-06-05 01:38:22 +00:00
// Disable stuff on PluginsPage
2009-04-16 05:29:45 +00:00
GraphicSelection - > Disable ( ) ;
DSPSelection - > Disable ( ) ;
WiimoteSelection - > Disable ( ) ;
2009-01-04 21:53:41 +00:00
}
}
2008-12-08 05:30:24 +00:00
2010-02-06 16:20:54 +00:00
void CConfigMain : : InitializeGUILists ( )
2008-12-08 05:30:24 +00:00
{
2010-06-05 01:38:22 +00:00
// General page
2009-06-09 21:27:45 +00:00
// Framelimit
2010-01-08 21:57:31 +00:00
arrayStringFor_Framelimit . Add ( wxT ( " Off " ) ) ;
arrayStringFor_Framelimit . Add ( wxT ( " Auto " ) ) ;
2010-04-22 02:51:07 +00:00
for ( int i = 10 ; i < = 120 ; i + = 5 ) // from 10 to 120
2010-01-08 21:57:31 +00:00
arrayStringFor_Framelimit . Add ( wxString : : Format ( wxT ( " %i " ) , i ) ) ;
2010-02-06 16:20:54 +00:00
2010-06-05 01:38:22 +00:00
// Emulator Engine
arrayStringFor_CPUEngine . Add ( wxT ( " Interpreter (VERY slow) " ) ) ;
arrayStringFor_CPUEngine . Add ( wxT ( " JIT Recompiler (recommended) " ) ) ;
arrayStringFor_CPUEngine . Add ( wxT ( " JITIL experimental recompiler " ) ) ;
// Display page
// Resolutions
if ( arrayStringFor_FullscreenResolution . empty ( ) )
arrayStringFor_FullscreenResolution . Add ( wxT ( " <No resolutions found> " ) ) ;
2010-02-06 16:20:54 +00:00
// Themes
arrayStringFor_Themes . Add ( wxT ( " Boomy " ) ) ;
arrayStringFor_Themes . Add ( wxT ( " Vista " ) ) ;
arrayStringFor_Themes . Add ( wxT ( " X-Plastik " ) ) ;
arrayStringFor_Themes . Add ( wxT ( " KDE " ) ) ;
2010-06-05 01:38:22 +00:00
// GUI language arrayStrings
arrayStringFor_InterfaceLang . Add ( wxT ( " English " ) ) ;
arrayStringFor_InterfaceLang . Add ( wxT ( " German " ) ) ;
arrayStringFor_InterfaceLang . Add ( wxT ( " French " ) ) ;
arrayStringFor_InterfaceLang . Add ( wxT ( " Spanish " ) ) ;
arrayStringFor_InterfaceLang . Add ( wxT ( " Italian " ) ) ;
arrayStringFor_InterfaceLang . Add ( wxT ( " Dutch " ) ) ;
// Gamecube page
// GC Language arrayStrings
arrayStringFor_GCSystemLang = arrayStringFor_InterfaceLang ;
// Wii page
2010-02-06 16:20:54 +00:00
// Sensorbar Position
arrayStringFor_WiiSensBarPos . Add ( wxT ( " Bottom " ) ) ;
arrayStringFor_WiiSensBarPos . Add ( wxT ( " Top " ) ) ;
2010-06-05 01:38:22 +00:00
2010-02-06 16:20:54 +00:00
// Aspect ratio
2010-06-09 20:03:37 +00:00
arrayStringFor_WiiAspectRatio . Add ( wxT ( " 4:3 " ) ) ;
2010-02-06 16:20:54 +00:00
arrayStringFor_WiiAspectRatio . Add ( wxT ( " 16:9 " ) ) ;
2010-06-05 01:38:22 +00:00
// Wii Language arrayStrings
arrayStringFor_WiiSystemLang = arrayStringFor_InterfaceLang ;
arrayStringFor_WiiSystemLang . Insert ( wxT ( " Japanese " ) , 0 ) ;
arrayStringFor_WiiSystemLang . Add ( wxT ( " Simplified Chinese " ) ) ;
arrayStringFor_WiiSystemLang . Add ( wxT ( " Traditional Chinese " ) ) ;
arrayStringFor_WiiSystemLang . Add ( wxT ( " Korean " ) ) ;
2010-02-06 16:20:54 +00:00
}
2010-06-05 01:38:22 +00:00
2010-02-06 16:20:54 +00:00
void CConfigMain : : InitializeGUIValues ( )
{
// General - Basic
CPUThread - > SetValue ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bCPUThread ) ;
SkipIdle - > SetValue ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bSkipIdle ) ;
EnableCheats - > SetValue ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bEnableCheats ) ;
Framelimit - > SetSelection ( SConfig : : GetInstance ( ) . m_Framelimit ) ;
2010-04-22 02:51:07 +00:00
UseFPSForLimiting - > SetValue ( SConfig : : GetInstance ( ) . b_UseFPS ) ;
2010-02-06 16:20:54 +00:00
// General - Advanced
AlwaysHLE_BS2 - > SetValue ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bHLE_BS2 ) ;
2010-06-23 12:57:59 +00:00
# if defined(HAVE_OPENCL) && HAVE_OPENCL
2010-06-22 13:17:01 +00:00
EnableOpenCL - > SetValue ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bEnableOpenCL ) ;
2010-06-23 12:57:59 +00:00
# endif
2010-06-05 01:38:22 +00:00
CPUEngine - > SetSelection ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . iCPUCore ) ;
2010-02-06 16:20:54 +00:00
LockThreads - > SetValue ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bLockThreads ) ;
DSPThread - > SetValue ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bDSPThread ) ;
2010-06-05 01:38:22 +00:00
// Display - Display
FullscreenResolution - > SetStringSelection ( wxString : : FromAscii ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . strFullscreenResolution . c_str ( ) ) ) ;
2010-04-22 04:28:34 +00:00
WindowWidth - > SetValue ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . iRenderWindowWidth ) ;
WindowHeight - > SetValue ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . iRenderWindowHeight ) ;
2010-04-12 01:33:10 +00:00
Fullscreen - > SetValue ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bFullscreen ) ;
HideCursor - > SetValue ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bHideCursor ) ;
RenderToMain - > SetValue ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bRenderToMain ) ;
2010-06-05 01:38:22 +00:00
// Display - Interface
ConfirmStop - > SetValue ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bConfirmStop ) ;
UsePanicHandlers - > SetValue ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bUsePanicHandlers ) ;
Theme - > SetSelection ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . iTheme ) ;
// need redesign
InterfaceLang - > SetSelection ( SConfig : : GetInstance ( ) . m_InterfaceLanguage ) ;
2010-02-06 16:20:54 +00:00
// Gamecube - IPL
GCSystemLang - > SetSelection ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . SelectedLanguage ) ;
// Gamecube - Devices
// Not here. They use some locals over in CreateGUIControls for initialization,
// which is why they are still there.
2010-06-05 01:38:22 +00:00
// Wii - Wiimote
2010-02-06 16:20:54 +00:00
WiiSensBarPos - > SetSelection ( SConfig : : GetInstance ( ) . m_SYSCONF - > GetData < u8 > ( " BT.BAR " ) ) ;
2010-06-05 01:38:22 +00:00
// Wii - Misc
2010-02-06 16:20:54 +00:00
WiiScreenSaver - > SetValue ( ! ! SConfig : : GetInstance ( ) . m_SYSCONF - > GetData < u8 > ( " IPL.SSV " ) ) ;
WiiProgressiveScan - > SetValue ( ! ! SConfig : : GetInstance ( ) . m_SYSCONF - > GetData < u8 > ( " IPL.PGS " ) ) ;
WiiEuRGB60 - > SetValue ( ! ! SConfig : : GetInstance ( ) . m_SYSCONF - > GetData < u8 > ( " IPL.E60 " ) ) ;
WiiAspectRatio - > SetSelection ( SConfig : : GetInstance ( ) . m_SYSCONF - > GetData < u8 > ( " IPL.AR " ) ) ;
WiiSystemLang - > SetSelection ( SConfig : : GetInstance ( ) . m_SYSCONF - > GetData < u8 > ( " IPL.LNG " ) ) ;
2010-06-05 01:38:22 +00:00
// Wii - Devices
2010-02-06 16:20:54 +00:00
WiiSDCard - > SetValue ( SConfig : : GetInstance ( ) . m_WiiSDCard ) ;
WiiKeyboard - > SetValue ( SConfig : : GetInstance ( ) . m_WiiKeyboard ) ;
2010-06-05 01:38:22 +00:00
2010-02-06 16:20:54 +00:00
// Paths
2010-06-05 01:38:22 +00:00
RecursiveISOPath - > SetValue ( SConfig : : GetInstance ( ) . m_RecursiveISOFolder ) ;
2010-02-06 16:20:54 +00:00
DefaultISO - > SetPath ( wxString ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . m_strDefaultGCM . c_str ( ) , * wxConvCurrent ) ) ;
DVDRoot - > SetPath ( wxString ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . m_strDVDRoot . c_str ( ) , * wxConvCurrent ) ) ;
ApploaderPath - > SetPath ( wxString ( SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . m_strApploader . c_str ( ) , * wxConvCurrent ) ) ;
2010-06-05 01:38:22 +00:00
2010-02-06 16:20:54 +00:00
// Plugins
FillChoiceBox ( GraphicSelection , PLUGIN_TYPE_VIDEO , SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . m_strVideoPlugin ) ;
FillChoiceBox ( DSPSelection , PLUGIN_TYPE_DSP , SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . m_strDSPPlugin ) ;
2010-06-12 20:13:58 +00:00
FillChoiceBox ( WiimoteSelection , PLUGIN_TYPE_WIIMOTE , SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . m_strWiimotePlugin ) ;
2010-02-06 16:20:54 +00:00
}
2010-06-05 01:38:22 +00:00
2010-02-06 16:20:54 +00:00
void CConfigMain : : InitializeGUITooltips ( )
{
// General - Basic
CPUThread - > SetToolTip ( wxT ( " This splits the Video and CPU threads, so they can be run on separate cores. " )
wxT ( " \n Causes major speed improvements on PCs with more than one core, " )
wxT ( " \n but can also cause occasional crashes/glitches. " ) ) ;
Framelimit - > SetToolTip ( wxT ( " If you set Framelimit higher than game full speed (NTSC:60, PAL:50), \n you also have to disable Audio Throttle in DSP to make it effective. " ) ) ;
// General - Advanced
DSPThread - > SetToolTip ( wxT ( " Run DSPLLE on a dedicated thread (not recommended). " ) ) ;
2010-06-23 12:57:59 +00:00
# if defined(HAVE_OPENCL) && HAVE_OPENCL
2010-06-22 13:17:01 +00:00
EnableOpenCL - > SetToolTip ( wxT ( " Allow videocard to accelerate texture decoding. " ) ) ;
2010-06-23 12:57:59 +00:00
# endif
2010-06-05 01:38:22 +00:00
// Display - Display
FullscreenResolution - > SetToolTip ( wxT ( " Select resolution for fullscreen mode " ) ) ;
WindowWidth - > SetToolTip ( wxT ( " Window width for windowed mode " ) ) ;
WindowHeight - > SetToolTip ( wxT ( " Window height for windowed mode " ) ) ;
Fullscreen - > SetToolTip ( wxT ( " Start the rendering window in fullscreen mode. " ) ) ;
HideCursor - > SetToolTip ( wxT ( " Hide the cursor when it is over the rendering window " )
wxT ( " \n and the rendering window has focus. " ) ) ;
RenderToMain - > SetToolTip ( wxT ( " Render to main window. " ) ) ;
// Display - Interface
2010-02-06 16:20:54 +00:00
ConfirmStop - > SetToolTip ( wxT ( " Show a confirmation box before stopping a game. " ) ) ;
UsePanicHandlers - > SetToolTip ( wxT ( " Show a message box when a potentially serious error has occured. " )
wxT ( " Disabling this may avoid annoying and non-fatal messages, but it may also mean that Dolphin " )
wxT ( " suddenly crashes without any explanation at all. " ) ) ;
2010-04-12 01:33:10 +00:00
2010-06-05 01:38:22 +00:00
// Display - Themes: Copyright notice
2010-02-06 16:20:54 +00:00
Theme - > SetItemToolTip ( 0 , wxT ( " Created by Milosz Wlazlo [miloszwl@miloszwl.com, miloszwl.deviantart.com] " ) ) ;
Theme - > SetItemToolTip ( 1 , wxT ( " Created by VistaIcons.com " ) ) ;
Theme - > SetItemToolTip ( 2 , wxT ( " Created by black_rider and published on ForumW.org > Web Developments " ) ) ;
Theme - > SetItemToolTip ( 3 , wxT ( " Created by KDE-Look.org " ) ) ;
2010-06-05 01:38:22 +00:00
InterfaceLang - > SetToolTip ( wxT ( " For the time being this will only change the text shown in " )
wxT ( " \n the game list of PAL GC games. " ) ) ;
2010-04-12 01:33:10 +00:00
2010-06-05 01:38:22 +00:00
// Gamecube - Devices
GCEXIDevice [ 2 ] - > SetToolTip ( wxT ( " Serial Port 1 - This is the port which devices such as the net adapter use " ) ) ;
// Wii - Devices
2010-02-06 16:20:54 +00:00
WiiKeyboard - > SetToolTip ( wxT ( " This could cause slow down in Wii Menu and some games. " ) ) ;
}
2010-04-22 04:28:34 +00:00
2010-02-06 16:20:54 +00:00
void CConfigMain : : CreateGUIControls ( )
{
InitializeGUILists ( ) ;
2010-06-16 10:12:57 +00:00
2009-01-22 07:42:17 +00:00
// Create the notebook and pages
2008-12-08 05:30:24 +00:00
Notebook = new wxNotebook ( this , ID_NOTEBOOK , wxDefaultPosition , wxDefaultSize ) ;
2009-01-04 21:53:41 +00:00
GeneralPage = new wxPanel ( Notebook , ID_GENERALPAGE , wxDefaultPosition , wxDefaultSize ) ;
2010-05-30 08:22:04 +00:00
DisplayPage = new wxPanel ( Notebook , ID_DISPLAYPAGE , wxDefaultPosition , wxDefaultSize ) ;
2008-12-08 05:30:24 +00:00
GamecubePage = new wxPanel ( Notebook , ID_GAMECUBEPAGE , wxDefaultPosition , wxDefaultSize ) ;
WiiPage = new wxPanel ( Notebook , ID_WIIPAGE , wxDefaultPosition , wxDefaultSize ) ;
PathsPage = new wxPanel ( Notebook , ID_PATHSPAGE , wxDefaultPosition , wxDefaultSize ) ;
2010-06-05 01:38:22 +00:00
PluginsPage = new wxPanel ( Notebook , ID_PLUGINPAGE , wxDefaultPosition , wxDefaultSize ) ;
2008-12-25 07:28:41 +00:00
2009-01-04 21:53:41 +00:00
Notebook - > AddPage ( GeneralPage , wxT ( " General " ) ) ;
2010-05-30 08:22:04 +00:00
Notebook - > AddPage ( DisplayPage , wxT ( " Display " ) ) ;
2008-12-25 07:28:41 +00:00
Notebook - > AddPage ( GamecubePage , wxT ( " Gamecube " ) ) ;
Notebook - > AddPage ( WiiPage , wxT ( " Wii " ) ) ;
Notebook - > AddPage ( PathsPage , wxT ( " Paths " ) ) ;
2010-06-05 01:38:22 +00:00
Notebook - > AddPage ( PluginsPage , wxT ( " Plugins " ) ) ;
2009-01-15 06:48:15 +00:00
2009-01-04 21:53:41 +00:00
// General page
2009-02-02 22:29:33 +00:00
// Core Settings - Basic
2010-06-05 01:38:22 +00:00
sbBasic = new wxStaticBoxSizer ( wxVERTICAL , GeneralPage , wxT ( " Basic Settings " ) ) ;
2009-10-23 15:26:35 +00:00
CPUThread = new wxCheckBox ( GeneralPage , ID_CPUTHREAD , wxT ( " Enable Dual Core (speedup) " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-10-13 04:45:11 +00:00
SkipIdle = new wxCheckBox ( GeneralPage , ID_IDLESKIP , wxT ( " Enable Idle Skipping (speedup) " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-01-14 16:36:43 +00:00
EnableCheats = new wxCheckBox ( GeneralPage , ID_ENABLECHEATS , wxT ( " Enable Cheats " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-08-03 18:35:25 +00:00
// Framelimit
2010-06-05 01:38:22 +00:00
wxStaticText * FramelimitText = new wxStaticText ( GeneralPage , ID_FRAMELIMIT_TEXT , wxT ( " Framelimit : " ) , wxDefaultPosition , wxDefaultSize ) ;
2009-08-03 18:35:25 +00:00
Framelimit = new wxChoice ( GeneralPage , ID_FRAMELIMIT , wxDefaultPosition , wxDefaultSize , arrayStringFor_Framelimit , 0 , wxDefaultValidator ) ;
2010-04-22 02:51:07 +00:00
UseFPSForLimiting = new wxCheckBox ( GeneralPage , ID_FRAMELIMIT_USEFPSFORLIMITING , wxT ( " Use FPS For Limiting " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-08-03 18:35:25 +00:00
2009-02-02 22:29:33 +00:00
// Core Settings - Advanced
2010-06-05 01:38:22 +00:00
sbAdvanced = new wxStaticBoxSizer ( wxVERTICAL , GeneralPage , wxT ( " Advanced Settings " ) ) ;
2010-01-16 19:00:09 +00:00
AlwaysHLE_BS2 = new wxCheckBox ( GeneralPage , ID_ALWAYS_HLE_BS2 , wxT ( " HLE the IPL (recommended) " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2010-06-23 12:57:59 +00:00
# if defined(HAVE_OPENCL) && HAVE_OPENCL
2010-06-22 13:17:01 +00:00
EnableOpenCL = new wxCheckBox ( GeneralPage , ID_ENABLE_OPENCL , wxT ( " Enable OpenCL " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
# endif
2010-06-05 02:03:16 +00:00
CPUEngine = new wxRadioBox ( GeneralPage , ID_CPUENGINE , wxT ( " CPU Emulator Engine " ) , wxDefaultPosition , wxDefaultSize , arrayStringFor_CPUEngine , 0 , wxRA_SPECIFY_ROWS ) ;
2009-01-14 16:36:43 +00:00
LockThreads = new wxCheckBox ( GeneralPage , ID_LOCKTHREADS , wxT ( " Lock threads to cores " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2010-01-21 14:30:52 +00:00
DSPThread = new wxCheckBox ( GeneralPage , ID_DSPTHREAD , wxT ( " DSPLLE on thread " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-01-14 16:36:43 +00:00
// Populate the settings
2009-10-23 15:26:35 +00:00
sbBasic - > Add ( CPUThread , 0 , wxALL , 5 ) ;
2009-01-04 21:53:41 +00:00
sbBasic - > Add ( SkipIdle , 0 , wxALL , 5 ) ;
sbBasic - > Add ( EnableCheats , 0 , wxALL , 5 ) ;
2010-06-05 01:38:22 +00:00
wxBoxSizer * sFramelimit = new wxBoxSizer ( wxHORIZONTAL ) ;
sFramelimit - > Add ( FramelimitText , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
2009-08-03 18:35:25 +00:00
sFramelimit - > Add ( Framelimit , 0 , wxALL | wxEXPAND , 5 ) ;
2010-04-22 02:51:07 +00:00
sFramelimit - > Add ( UseFPSForLimiting , 0 , wxALL | wxEXPAND , 5 ) ;
2009-08-03 18:35:25 +00:00
sbBasic - > Add ( sFramelimit , 0 , wxALL | wxEXPAND , 5 ) ;
2009-10-11 16:16:18 +00:00
sbAdvanced - > Add ( AlwaysHLE_BS2 , 0 , wxALL , 5 ) ;
2010-06-23 12:57:59 +00:00
# if defined(HAVE_OPENCL) && HAVE_OPENCL
2010-06-22 13:17:01 +00:00
sbAdvanced - > Add ( EnableOpenCL , 0 , wxALL , 5 ) ;
2010-06-23 12:57:59 +00:00
# endif
2010-06-05 01:38:22 +00:00
sbAdvanced - > Add ( CPUEngine , 0 , wxALL , 5 ) ;
2009-01-04 21:53:41 +00:00
sbAdvanced - > Add ( LockThreads , 0 , wxALL , 5 ) ;
2009-04-21 15:19:07 +00:00
sbAdvanced - > Add ( DSPThread , 0 , wxALL , 5 ) ;
2009-01-14 16:36:43 +00:00
2010-06-05 01:38:22 +00:00
// Populate the General page
2010-05-30 08:22:04 +00:00
sGeneralPage = new wxBoxSizer ( wxVERTICAL ) ;
sGeneralPage - > Add ( sbBasic , 0 , wxEXPAND | wxALL , 5 ) ;
sGeneralPage - > Add ( sbAdvanced , 0 , wxEXPAND | wxALL , 5 ) ;
GeneralPage - > SetSizer ( sGeneralPage ) ;
sGeneralPage - > Layout ( ) ;
2010-06-05 01:38:22 +00:00
2010-05-30 08:22:04 +00:00
// Display page
// General display settings
2010-06-05 01:38:22 +00:00
sbDisplay = new wxStaticBoxSizer ( wxVERTICAL , DisplayPage , wxT ( " Emulator Display Settings " ) ) ;
wxStaticText * FullscreenResolutionText = new wxStaticText ( DisplayPage , wxID_ANY , wxT ( " Fullscreen Display Resolution: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2010-05-30 08:22:04 +00:00
FullscreenResolution = new wxChoice ( DisplayPage , ID_DISPLAY_FULLSCREENRES , wxDefaultPosition , wxDefaultSize , arrayStringFor_FullscreenResolution , 0 , wxDefaultValidator , arrayStringFor_FullscreenResolution [ 0 ] ) ;
wxStaticText * WindowSizeText = new wxStaticText ( DisplayPage , wxID_ANY , wxT ( " Window Size: " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2010-06-09 20:03:37 +00:00
WindowWidth = new wxSpinCtrl ( DisplayPage , ID_DISPLAY_WINDOWWIDTH , wxEmptyString , wxDefaultPosition , wxSize ( 70 , - 1 ) ) ;
2010-05-30 08:22:04 +00:00
WindowWidth - > SetRange ( 0 , 3280 ) ;
2010-06-05 01:38:22 +00:00
wxStaticText * WindowXText = new wxStaticText ( DisplayPage , wxID_ANY , wxT ( " x " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
2010-06-09 20:03:37 +00:00
WindowHeight = new wxSpinCtrl ( DisplayPage , ID_DISPLAY_WINDOWHEIGHT , wxEmptyString , wxDefaultPosition , wxSize ( 70 , - 1 ) ) ;
2010-05-30 08:22:04 +00:00
WindowHeight - > SetRange ( 0 , 2048 ) ;
Fullscreen = new wxCheckBox ( DisplayPage , ID_DISPLAY_FULLSCREEN , wxT ( " Start Renderer in Fullscreen " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
HideCursor = new wxCheckBox ( DisplayPage , ID_DISPLAY_HIDECURSOR , wxT ( " Hide Mouse Cursor " ) ) ;
RenderToMain = new wxCheckBox ( DisplayPage , ID_DISPLAY_RENDERTOMAIN , wxT ( " Render to Main Window " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2010-04-12 01:33:10 +00:00
2010-05-30 08:22:04 +00:00
// Interface settings
2010-06-05 01:38:22 +00:00
sbInterface = new wxStaticBoxSizer ( wxVERTICAL , DisplayPage , wxT ( " Interface Settings " ) ) ;
2010-05-30 08:22:04 +00:00
ConfirmStop = new wxCheckBox ( DisplayPage , ID_INTERFACE_CONFIRMSTOP , wxT ( " Confirm On Stop " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
UsePanicHandlers = new wxCheckBox ( DisplayPage , ID_INTERFACE_USEPANICHANDLERS , wxT ( " Use Panic Handlers " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2010-06-05 01:38:22 +00:00
// Themes - this should really be a wxChoice...
Theme = new wxRadioBox ( DisplayPage , ID_INTERFACE_THEME , wxT ( " Theme " ) , wxDefaultPosition , wxDefaultSize , arrayStringFor_Themes , 1 , wxRA_SPECIFY_ROWS ) ;
2010-05-30 08:22:04 +00:00
// Interface Language
// At the moment this only changes the language displayed in m_gamelistctrl
// If someone wants to control the whole GUI's language, it should be set here too
2010-06-05 01:38:22 +00:00
wxStaticText * InterfaceLangText = new wxStaticText ( DisplayPage , ID_INTERFACE_LANG_TEXT , wxT ( " Game List Language: " ) , wxDefaultPosition , wxDefaultSize ) ;
2010-05-30 08:22:04 +00:00
InterfaceLang = new wxChoice ( DisplayPage , ID_INTERFACE_LANG , wxDefaultPosition , wxDefaultSize , arrayStringFor_InterfaceLang , 0 , wxDefaultValidator ) ;
2009-01-14 16:36:43 +00:00
2010-05-30 08:22:04 +00:00
// Hotkey configuration
HotkeyConfig = new wxButton ( DisplayPage , ID_HOTKEY_CONFIG , wxT ( " Hotkeys " ) , wxDefaultPosition , wxDefaultSize , wxBU_EXACTFIT , wxDefaultValidator ) ;
2009-01-04 21:53:41 +00:00
2010-06-05 01:38:22 +00:00
// Populate the settings
wxBoxSizer * sDisplayRes = new wxBoxSizer ( wxHORIZONTAL ) ;
sDisplayRes - > Add ( FullscreenResolutionText , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sDisplayRes - > Add ( FullscreenResolution , 0 , wxEXPAND | wxALL , 5 ) ;
sbDisplay - > Add ( sDisplayRes , 0 , wxALL , 5 ) ;
wxBoxSizer * sDisplaySize = new wxBoxSizer ( wxHORIZONTAL ) ;
sDisplaySize - > Add ( WindowSizeText , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sDisplaySize - > Add ( WindowWidth , 0 , wxEXPAND | wxALL , 5 ) ;
sDisplaySize - > Add ( WindowXText , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sDisplaySize - > Add ( WindowHeight , 0 , wxEXPAND | wxALL , 5 ) ;
sbDisplay - > Add ( sDisplaySize , 0 , wxALL , 5 ) ;
sbDisplay - > Add ( Fullscreen , 0 , wxEXPAND | wxALL , 5 ) ;
sbDisplay - > Add ( HideCursor , 0 , wxALL , 5 ) ;
sbDisplay - > Add ( RenderToMain , 0 , wxEXPAND | wxALL , 5 ) ;
2010-05-30 08:22:04 +00:00
sbInterface - > Add ( ConfirmStop , 0 , wxALL , 5 ) ;
sbInterface - > Add ( UsePanicHandlers , 0 , wxALL , 5 ) ;
sbInterface - > Add ( Theme , 0 , wxEXPAND | wxALL , 5 ) ;
2010-06-05 01:38:22 +00:00
wxBoxSizer * sInterface = new wxBoxSizer ( wxHORIZONTAL ) ;
2010-05-30 08:22:04 +00:00
sInterface - > Add ( InterfaceLangText , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sInterface - > Add ( InterfaceLang , 0 , wxEXPAND | wxALL , 5 ) ;
sInterface - > AddStretchSpacer ( ) ;
sInterface - > Add ( HotkeyConfig , 0 , wxALIGN_RIGHT | wxALL , 5 ) ;
sbInterface - > Add ( sInterface , 0 , wxEXPAND | wxALL , 5 ) ;
2010-06-05 01:38:22 +00:00
// Populate the Display page
2010-05-30 08:22:04 +00:00
sDisplayPage = new wxBoxSizer ( wxVERTICAL ) ;
sDisplayPage - > Add ( sbDisplay , 0 , wxEXPAND | wxALL , 5 ) ;
sDisplayPage - > Add ( sbInterface , 0 , wxEXPAND | wxALL , 5 ) ;
DisplayPage - > SetSizer ( sDisplayPage ) ;
sDisplayPage - > Layout ( ) ;
2009-01-04 21:53:41 +00:00
2010-06-05 01:38:22 +00:00
2009-01-04 21:53:41 +00:00
// Gamecube page
2010-02-06 16:20:54 +00:00
// IPL settings
2010-06-05 01:38:22 +00:00
sbGamecubeIPLSettings = new wxStaticBoxSizer ( wxVERTICAL , GamecubePage , wxT ( " IPL Settings " ) ) ;
wxStaticText * GCSystemLangText = new wxStaticText ( GamecubePage , ID_GC_SRAM_LNG_TEXT , wxT ( " System Language: " ) , wxDefaultPosition , wxDefaultSize ) ;
2009-01-04 21:53:41 +00:00
GCSystemLang = new wxChoice ( GamecubePage , ID_GC_SRAM_LNG , wxDefaultPosition , wxDefaultSize , arrayStringFor_GCSystemLang , 0 , wxDefaultValidator ) ;
2010-06-05 01:38:22 +00:00
// Device settings
2009-02-02 22:29:33 +00:00
// EXI Devices
2010-06-05 01:38:22 +00:00
wxStaticBoxSizer * sbGamecubeDeviceSettings = new wxStaticBoxSizer ( wxVERTICAL , GamecubePage , wxT ( " Device Settings " ) ) ;
wxStaticText * GCEXIDeviceText [ 3 ] ;
2009-02-02 22:29:33 +00:00
GCEXIDeviceText [ 0 ] = new wxStaticText ( GamecubePage , ID_GC_EXIDEVICE_SLOTA_TEXT , wxT ( " Slot A " ) , wxDefaultPosition , wxDefaultSize ) ;
GCEXIDeviceText [ 1 ] = new wxStaticText ( GamecubePage , ID_GC_EXIDEVICE_SLOTB_TEXT , wxT ( " Slot B " ) , wxDefaultPosition , wxDefaultSize ) ;
GCEXIDeviceText [ 2 ] = new wxStaticText ( GamecubePage , ID_GC_EXIDEVICE_SP1_TEXT , wxT ( " SP1 " ) , wxDefaultPosition , wxDefaultSize ) ;
2010-06-05 01:38:22 +00:00
const wxString SlotDevices [ ] = { wxT ( DEV_NONE_STR ) , wxT ( DEV_DUMMY_STR ) , wxT ( EXIDEV_MEMCARD_STR )
2010-04-04 19:25:49 +00:00
# if HAVE_PORTAUDIO
, wxT ( EXIDEV_MIC_STR )
# endif
} ;
2009-02-06 18:18:20 +00:00
static const int numSlotDevices = sizeof ( SlotDevices ) / sizeof ( wxString ) ;
2010-06-05 01:38:22 +00:00
const wxString SP1Devices [ ] = { wxT ( DEV_NONE_STR ) , wxT ( DEV_DUMMY_STR ) , wxT ( EXIDEV_BBA_STR ) , wxT ( EXIDEV_AM_BB_STR ) } ;
2009-02-06 18:18:20 +00:00
static const int numSP1Devices = sizeof ( SP1Devices ) / sizeof ( wxString ) ;
GCEXIDevice [ 0 ] = new wxChoice ( GamecubePage , ID_GC_EXIDEVICE_SLOTA , wxDefaultPosition , wxDefaultSize , numSlotDevices , SlotDevices , 0 , wxDefaultValidator ) ;
GCEXIDevice [ 1 ] = new wxChoice ( GamecubePage , ID_GC_EXIDEVICE_SLOTB , wxDefaultPosition , wxDefaultSize , numSlotDevices , SlotDevices , 0 , wxDefaultValidator ) ;
GCEXIDevice [ 2 ] = new wxChoice ( GamecubePage , ID_GC_EXIDEVICE_SP1 , wxDefaultPosition , wxDefaultSize , numSP1Devices , SP1Devices , 0 , wxDefaultValidator ) ;
2009-02-02 22:29:33 +00:00
GCMemcardPath [ 0 ] = new wxButton ( GamecubePage , ID_GC_EXIDEVICE_SLOTA_PATH , wxT ( " ... " ) , wxDefaultPosition , wxDefaultSize , wxBU_EXACTFIT , wxDefaultValidator ) ;
GCMemcardPath [ 1 ] = new wxButton ( GamecubePage , ID_GC_EXIDEVICE_SLOTB_PATH , wxT ( " ... " ) , wxDefaultPosition , wxDefaultSize , wxBU_EXACTFIT , wxDefaultValidator ) ;
2010-02-06 16:20:54 +00:00
// Can't move this one without making the 4 const's etc. above class members/fields,
2009-02-02 22:29:33 +00:00
for ( int i = 0 ; i < 3 ; + + i )
{
bool isMemcard = false ;
2009-10-19 15:14:48 +00:00
switch ( SConfig : : GetInstance ( ) . m_EXIDevice [ i ] )
{
case EXIDEVICE_NONE :
GCEXIDevice [ i ] - > SetStringSelection ( SlotDevices [ 0 ] ) ;
break ;
case EXIDEVICE_MEMORYCARD_A :
case EXIDEVICE_MEMORYCARD_B :
isMemcard = GCEXIDevice [ i ] - > SetStringSelection ( SlotDevices [ 2 ] ) ;
break ;
case EXIDEVICE_MIC :
GCEXIDevice [ i ] - > SetStringSelection ( SlotDevices [ 3 ] ) ;
break ;
case EXIDEVICE_ETH :
GCEXIDevice [ i ] - > SetStringSelection ( SP1Devices [ 2 ] ) ;
break ;
case EXIDEVICE_AM_BASEBOARD :
GCEXIDevice [ i ] - > SetStringSelection ( SP1Devices [ 3 ] ) ;
break ;
case EXIDEVICE_DUMMY :
default :
GCEXIDevice [ i ] - > SetStringSelection ( SlotDevices [ 1 ] ) ;
break ;
}
2009-02-02 22:29:33 +00:00
if ( ! isMemcard & & i < 2 )
GCMemcardPath [ i ] - > Disable ( ) ;
}
//SI Devices
2010-06-05 01:38:22 +00:00
wxStaticText * GCSIDeviceText [ 4 ] ;
2009-02-02 22:29:33 +00:00
GCSIDeviceText [ 0 ] = new wxStaticText ( GamecubePage , ID_GC_SIDEVICE_TEXT , wxT ( " Port 1 " ) , wxDefaultPosition , wxDefaultSize ) ;
GCSIDeviceText [ 1 ] = new wxStaticText ( GamecubePage , ID_GC_SIDEVICE_TEXT , wxT ( " Port 2 " ) , wxDefaultPosition , wxDefaultSize ) ;
GCSIDeviceText [ 2 ] = new wxStaticText ( GamecubePage , ID_GC_SIDEVICE_TEXT , wxT ( " Port 3 " ) , wxDefaultPosition , wxDefaultSize ) ;
GCSIDeviceText [ 3 ] = new wxStaticText ( GamecubePage , ID_GC_SIDEVICE_TEXT , wxT ( " Port 4 " ) , wxDefaultPosition , wxDefaultSize ) ;
2010-04-04 19:25:49 +00:00
const wxString SIPort1Devices [ ] = { wxT ( DEV_NONE_STR ) , wxT ( SIDEV_STDCONT_STR ) , wxT ( SIDEV_GBA_STR ) , wxT ( SIDEV_AM_BB_STR ) } ;
static const int numSIPort1Devices = sizeof ( SIPort1Devices ) / sizeof ( wxString ) ;
const wxString SIDevices [ ] = { wxT ( DEV_NONE_STR ) , wxT ( SIDEV_STDCONT_STR ) , wxT ( SIDEV_GBA_STR ) } ;
2009-02-06 18:18:20 +00:00
static const int numSIDevices = sizeof ( SIDevices ) / sizeof ( wxString ) ;
2010-04-04 19:25:49 +00:00
GCSIDevice [ 0 ] = new wxChoice ( GamecubePage , ID_GC_SIDEVICE0 , wxDefaultPosition , wxDefaultSize , numSIPort1Devices , SIPort1Devices , 0 , wxDefaultValidator ) ;
2009-02-06 18:18:20 +00:00
GCSIDevice [ 1 ] = new wxChoice ( GamecubePage , ID_GC_SIDEVICE1 , wxDefaultPosition , wxDefaultSize , numSIDevices , SIDevices , 0 , wxDefaultValidator ) ;
GCSIDevice [ 2 ] = new wxChoice ( GamecubePage , ID_GC_SIDEVICE2 , wxDefaultPosition , wxDefaultSize , numSIDevices , SIDevices , 0 , wxDefaultValidator ) ;
GCSIDevice [ 3 ] = new wxChoice ( GamecubePage , ID_GC_SIDEVICE3 , wxDefaultPosition , wxDefaultSize , numSIDevices , SIDevices , 0 , wxDefaultValidator ) ;
2010-02-06 16:20:54 +00:00
// Can't move this one without making the 2 const's etc. above class members/fields.
2009-02-02 22:29:33 +00:00
for ( int i = 0 ; i < 4 ; + + i )
{
2009-10-19 15:14:48 +00:00
switch ( SConfig : : GetInstance ( ) . m_SIDevice [ i ] )
{
case SI_GC_CONTROLLER :
2009-02-02 22:29:33 +00:00
GCSIDevice [ i ] - > SetStringSelection ( SIDevices [ 1 ] ) ;
2009-10-19 15:14:48 +00:00
break ;
case SI_GBA :
2009-02-06 18:18:20 +00:00
GCSIDevice [ i ] - > SetStringSelection ( SIDevices [ 2 ] ) ;
2009-10-19 15:14:48 +00:00
break ;
case SI_AM_BASEBOARD :
GCSIDevice [ i ] - > SetStringSelection ( SIDevices [ 3 ] ) ;
break ;
default :
2009-02-02 22:29:33 +00:00
GCSIDevice [ i ] - > SetStringSelection ( SIDevices [ 0 ] ) ;
2009-10-19 15:14:48 +00:00
break ;
}
2009-02-02 22:29:33 +00:00
}
2010-06-05 01:38:22 +00:00
// Populate the settings
sGamecubeIPLSettings = new wxGridBagSizer ( ) ;
sGamecubeIPLSettings - > Add ( GCSystemLangText , wxGBPosition ( 0 , 0 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sGamecubeIPLSettings - > Add ( GCSystemLang , wxGBPosition ( 0 , 1 ) , wxDefaultSpan , wxALL , 5 ) ;
2009-01-04 21:53:41 +00:00
sbGamecubeIPLSettings - > Add ( sGamecubeIPLSettings ) ;
2010-06-05 01:38:22 +00:00
wxBoxSizer * sEXIDevices [ 4 ] , * sSIDevices [ 4 ] ;
2009-02-02 22:29:33 +00:00
for ( int i = 0 ; i < 3 ; + + i )
{
sEXIDevices [ i ] = new wxBoxSizer ( wxHORIZONTAL ) ;
sEXIDevices [ i ] - > Add ( GCEXIDeviceText [ i ] , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sEXIDevices [ i ] - > Add ( GCEXIDevice [ i ] , 0 , wxALL , 5 ) ;
if ( i < 2 )
sEXIDevices [ i ] - > Add ( GCMemcardPath [ i ] , 0 , wxALL , 5 ) ;
sbGamecubeDeviceSettings - > Add ( sEXIDevices [ i ] ) ;
}
for ( int i = 0 ; i < 4 ; + + i )
{
sSIDevices [ i ] = new wxBoxSizer ( wxHORIZONTAL ) ;
sSIDevices [ i ] - > Add ( GCSIDeviceText [ i ] , 0 , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sSIDevices [ i ] - > Add ( GCSIDevice [ i ] , 0 , wxALL , 5 ) ;
sbGamecubeDeviceSettings - > Add ( sSIDevices [ i ] ) ;
}
2010-06-05 01:38:22 +00:00
// Populate the Gamecube page
sGamecubePage = new wxBoxSizer ( wxVERTICAL ) ;
sGamecubePage - > Add ( sbGamecubeIPLSettings , 0 , wxEXPAND | wxALL , 5 ) ;
sGamecubePage - > Add ( sbGamecubeDeviceSettings , 0 , wxEXPAND | wxALL , 5 ) ;
GamecubePage - > SetSizer ( sGamecubePage ) ;
sGamecubePage - > Layout ( ) ;
2009-01-04 21:53:41 +00:00
// Wii page
2010-06-05 01:38:22 +00:00
// Wiimote Settings
sbWiimoteSettings = new wxStaticBoxSizer ( wxHORIZONTAL , WiiPage , wxT ( " Wiimote Settings " ) ) ;
wxStaticText * WiiSensBarPosText = new wxStaticText ( WiiPage , ID_WII_BT_BAR_TEXT , wxT ( " Sensor Bar Position: " ) , wxDefaultPosition , wxDefaultSize ) ;
2009-01-04 21:53:41 +00:00
WiiSensBarPos = new wxChoice ( WiiPage , ID_WII_BT_BAR , wxDefaultPosition , wxDefaultSize , arrayStringFor_WiiSensBarPos , 0 , wxDefaultValidator ) ;
2010-06-05 01:38:22 +00:00
// Misc Settings
2009-09-14 06:26:49 +00:00
sbWiiIPLSettings = new wxStaticBoxSizer ( wxVERTICAL , WiiPage , wxT ( " Misc Settings " ) ) ;
2009-01-04 21:53:41 +00:00
WiiScreenSaver = new wxCheckBox ( WiiPage , ID_WII_IPL_SSV , wxT ( " Enable Screen Saver (burn-in reduction) " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
WiiProgressiveScan = new wxCheckBox ( WiiPage , ID_WII_IPL_PGS , wxT ( " Enable Progressive Scan " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-12-30 16:20:41 +00:00
WiiEuRGB60 = new wxCheckBox ( WiiPage , ID_WII_IPL_E60 , wxT ( " Use EuRGB60 Mode (PAL60) " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2010-06-05 01:38:22 +00:00
wxStaticText * WiiAspectRatioText = new wxStaticText ( WiiPage , ID_WII_IPL_AR_TEXT , wxT ( " Aspect Ratio: " ) , wxDefaultPosition , wxDefaultSize ) ;
2009-01-04 21:53:41 +00:00
WiiAspectRatio = new wxChoice ( WiiPage , ID_WII_IPL_AR , wxDefaultPosition , wxDefaultSize , arrayStringFor_WiiAspectRatio , 0 , wxDefaultValidator ) ;
2010-06-05 01:38:22 +00:00
wxStaticText * WiiSystemLangText = new wxStaticText ( WiiPage , ID_WII_IPL_LNG_TEXT , wxT ( " System Language: " ) , wxDefaultPosition , wxDefaultSize ) ;
2009-01-04 21:53:41 +00:00
WiiSystemLang = new wxChoice ( WiiPage , ID_WII_IPL_LNG , wxDefaultPosition , wxDefaultSize , arrayStringFor_WiiSystemLang , 0 , wxDefaultValidator ) ;
2010-06-05 01:38:22 +00:00
// Device Settings
2010-01-11 11:56:17 +00:00
sbWiiDeviceSettings = new wxStaticBoxSizer ( wxVERTICAL , WiiPage , wxT ( " Device Settings " ) ) ;
WiiSDCard = new wxCheckBox ( WiiPage , ID_WII_SD_CARD , wxT ( " Insert SD Card " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
WiiKeyboard = new wxCheckBox ( WiiPage , ID_WII_KEYBOARD , wxT ( " Connect USB Keyboard " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2010-06-05 01:38:22 +00:00
// Populate the settings
sWiimoteSettings = new wxGridBagSizer ( ) ;
sWiimoteSettings - > Add ( WiiSensBarPosText , wxGBPosition ( 0 , 0 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sWiimoteSettings - > Add ( WiiSensBarPos , wxGBPosition ( 0 , 1 ) , wxDefaultSpan , wxALL , 5 ) ;
2009-01-04 21:53:41 +00:00
sbWiimoteSettings - > Add ( sWiimoteSettings ) ;
2010-06-05 01:38:22 +00:00
sWiiIPLSettings = new wxGridBagSizer ( ) ;
2009-01-04 21:53:41 +00:00
sWiiIPLSettings - > Add ( WiiScreenSaver , wxGBPosition ( 0 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
sWiiIPLSettings - > Add ( WiiProgressiveScan , wxGBPosition ( 1 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
sWiiIPLSettings - > Add ( WiiEuRGB60 , wxGBPosition ( 2 , 0 ) , wxGBSpan ( 1 , 2 ) , wxALL , 5 ) ;
2010-06-05 01:38:22 +00:00
sWiiIPLSettings - > Add ( WiiAspectRatioText , wxGBPosition ( 3 , 0 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sWiiIPLSettings - > Add ( WiiAspectRatio , wxGBPosition ( 3 , 1 ) , wxDefaultSpan , wxALL , 5 ) ;
sWiiIPLSettings - > Add ( WiiSystemLangText , wxGBPosition ( 4 , 0 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sWiiIPLSettings - > Add ( WiiSystemLang , wxGBPosition ( 4 , 1 ) , wxDefaultSpan , wxALL , 5 ) ;
2009-01-04 21:53:41 +00:00
sbWiiIPLSettings - > Add ( sWiiIPLSettings ) ;
2010-01-11 11:56:17 +00:00
sbWiiDeviceSettings - > Add ( WiiSDCard , 0 , wxALL , 5 ) ;
sbWiiDeviceSettings - > Add ( WiiKeyboard , 0 , wxALL , 5 ) ;
2010-06-05 01:38:22 +00:00
// Populate the Wii page
sWiiPage = new wxBoxSizer ( wxVERTICAL ) ;
sWiiPage - > Add ( sbWiimoteSettings , 0 , wxEXPAND | wxALL , 5 ) ;
sWiiPage - > Add ( sbWiiIPLSettings , 0 , wxEXPAND | wxALL , 5 ) ;
sWiiPage - > Add ( sbWiiDeviceSettings , 0 , wxEXPAND | wxALL , 5 ) ;
WiiPage - > SetSizer ( sWiiPage ) ;
sWiiPage - > Layout ( ) ;
2009-01-04 21:53:41 +00:00
2009-09-02 21:00:45 +00:00
2009-01-04 21:53:41 +00:00
// Paths page
sbISOPaths = new wxStaticBoxSizer ( wxVERTICAL , PathsPage , wxT ( " ISO Directories " ) ) ;
ISOPaths = new wxListBox ( PathsPage , ID_ISOPATHS , wxDefaultPosition , wxDefaultSize , arrayStringFor_ISOPaths , wxLB_SINGLE , wxDefaultValidator ) ;
2010-06-05 01:38:22 +00:00
RecursiveISOPath = new wxCheckBox ( PathsPage , ID_RECURSIVEISOPATH , wxT ( " Search Subfolders " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-01-04 21:53:41 +00:00
AddISOPath = new wxButton ( PathsPage , ID_ADDISOPATH , wxT ( " Add... " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
RemoveISOPath = new wxButton ( PathsPage , ID_REMOVEISOPATH , wxT ( " Remove " ) , wxDefaultPosition , wxDefaultSize , 0 ) ;
RemoveISOPath - > Enable ( false ) ;
2010-06-05 01:38:22 +00:00
wxStaticText * DefaultISOText = new wxStaticText ( PathsPage , ID_DEFAULTISO_TEXT , wxT ( " Default ISO: " ) , wxDefaultPosition , wxDefaultSize ) ;
2009-01-04 21:53:41 +00:00
DefaultISO = new wxFilePickerCtrl ( PathsPage , ID_DEFAULTISO , wxEmptyString , wxT ( " Choose a default ISO: " ) ,
wxString : : Format ( wxT ( " All GC/Wii images (gcm, iso, gcz)|*.gcm;*.iso;*.gcz|All files (%s)|%s " ) , wxFileSelectorDefaultWildcardStr , wxFileSelectorDefaultWildcardStr ) ,
2009-02-28 08:37:12 +00:00
wxDefaultPosition , wxDefaultSize , wxFLP_USE_TEXTCTRL | wxFLP_OPEN ) ;
2010-06-05 01:38:22 +00:00
wxStaticText * DVDRootText = new wxStaticText ( PathsPage , ID_DVDROOT_TEXT , wxT ( " DVD Root: " ) , wxDefaultPosition , wxDefaultSize ) ;
2009-01-04 21:53:41 +00:00
DVDRoot = new wxDirPickerCtrl ( PathsPage , ID_DVDROOT , wxEmptyString , wxT ( " Choose a DVD root directory: " ) , wxDefaultPosition , wxDefaultSize , wxDIRP_USE_TEXTCTRL ) ;
2010-06-05 01:38:22 +00:00
wxStaticText * ApploaderPathText = new wxStaticText ( PathsPage , ID_APPLOADERPATH_TEXT , wxT ( " Apploader: " ) , wxDefaultPosition , wxDefaultSize ) ;
2009-12-10 09:16:10 +00:00
ApploaderPath = new wxFilePickerCtrl ( PathsPage , ID_APPLOADERPATH , wxEmptyString , wxT ( " Choose file to use as apploader: (applies to discs constructed from directories only) " ) ,
wxString : : Format ( wxT ( " apploader (.img)|*.img|All files (%s)|%s " ) , wxFileSelectorDefaultWildcardStr , wxFileSelectorDefaultWildcardStr ) ,
wxDefaultPosition , wxDefaultSize , wxFLP_USE_TEXTCTRL | wxFLP_OPEN ) ;
2009-01-04 21:53:41 +00:00
2010-06-05 01:38:22 +00:00
// Populate the settings
2009-01-04 21:53:41 +00:00
sbISOPaths - > Add ( ISOPaths , 1 , wxEXPAND | wxALL , 0 ) ;
2010-06-05 01:38:22 +00:00
wxBoxSizer * sISOButtons = new wxBoxSizer ( wxHORIZONTAL ) ;
sISOButtons - > Add ( RecursiveISOPath , 0 , wxALL | wxALIGN_CENTER , 0 ) ;
sISOButtons - > AddStretchSpacer ( ) ;
2009-01-04 21:53:41 +00:00
sISOButtons - > Add ( AddISOPath , 0 , wxALL , 0 ) ;
sISOButtons - > Add ( RemoveISOPath , 0 , wxALL , 0 ) ;
sbISOPaths - > Add ( sISOButtons , 0 , wxEXPAND | wxALL , 5 ) ;
2010-06-05 01:38:22 +00:00
sOtherPaths = new wxGridBagSizer ( ) ;
sOtherPaths - > Add ( DefaultISOText , wxGBPosition ( 0 , 0 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sOtherPaths - > Add ( DefaultISO , wxGBPosition ( 0 , 1 ) , wxDefaultSpan , wxEXPAND | wxALL , 5 ) ;
sOtherPaths - > Add ( DVDRootText , wxGBPosition ( 1 , 0 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sOtherPaths - > Add ( DVDRoot , wxGBPosition ( 1 , 1 ) , wxDefaultSpan , wxEXPAND | wxALL , 5 ) ;
sOtherPaths - > Add ( ApploaderPathText , wxGBPosition ( 2 , 0 ) , wxDefaultSpan , wxALIGN_CENTER_VERTICAL | wxALL , 5 ) ;
sOtherPaths - > Add ( ApploaderPath , wxGBPosition ( 2 , 1 ) , wxDefaultSpan , wxEXPAND | wxALL , 5 ) ;
2010-04-20 13:19:36 +00:00
sOtherPaths - > AddGrowableCol ( 1 ) ;
2010-06-05 01:38:22 +00:00
// Populate the Paths page
sPathsPage = new wxBoxSizer ( wxVERTICAL ) ;
sPathsPage - > Add ( sbISOPaths , 1 , wxEXPAND | wxALL , 5 ) ;
sPathsPage - > Add ( sOtherPaths , 0 , wxEXPAND | wxALL , 5 ) ;
PathsPage - > SetSizer ( sPathsPage ) ;
sPathsPage - > Layout ( ) ;
2009-01-04 21:53:41 +00:00
2009-09-02 21:00:45 +00:00
2009-01-04 21:53:41 +00:00
// Plugins page
2010-06-05 01:38:22 +00:00
sbGraphicsPlugin = new wxStaticBoxSizer ( wxHORIZONTAL , PluginsPage , wxT ( " Graphics " ) ) ;
2010-06-27 17:52:02 +00:00
GraphicSelection = new wxChoice ( PluginsPage , ID_GRAPHIC_CB , wxDefaultPosition , wxDefaultSize , 0 , NULL , 0 , wxDefaultValidator ) ;
2010-06-05 01:38:22 +00:00
GraphicConfig = new wxButton ( PluginsPage , ID_GRAPHIC_CONFIG , wxT ( " Config... " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-01-04 21:53:41 +00:00
2010-06-05 01:38:22 +00:00
sbDSPPlugin = new wxStaticBoxSizer ( wxHORIZONTAL , PluginsPage , wxT ( " DSP " ) ) ;
2010-06-27 17:52:02 +00:00
DSPSelection = new wxChoice ( PluginsPage , ID_DSP_CB , wxDefaultPosition , wxDefaultSize , 0 , NULL , 0 , wxDefaultValidator ) ;
2010-06-05 01:38:22 +00:00
DSPConfig = new wxButton ( PluginsPage , ID_DSP_CONFIG , wxT ( " Config... " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2010-06-03 18:05:08 +00:00
2010-06-05 01:38:22 +00:00
sbWiimotePlugin = new wxStaticBoxSizer ( wxHORIZONTAL , PluginsPage , wxT ( " Wiimote " ) ) ;
2010-06-27 17:52:02 +00:00
WiimoteSelection = new wxChoice ( PluginsPage , ID_WIIMOTE_CB , wxDefaultPosition , wxDefaultSize , 0 , NULL , 0 , wxDefaultValidator ) ;
2010-06-05 01:38:22 +00:00
WiimoteConfig = new wxButton ( PluginsPage , ID_WIIMOTE_CONFIG , wxT ( " Config... " ) , wxDefaultPosition , wxDefaultSize , 0 , wxDefaultValidator ) ;
2009-01-04 21:53:41 +00:00
2010-06-05 01:38:22 +00:00
// Populate the settings
2009-01-04 21:53:41 +00:00
sbGraphicsPlugin - > Add ( GraphicSelection , 1 , wxEXPAND | wxALL , 5 ) ;
sbGraphicsPlugin - > Add ( GraphicConfig , 0 , wxALL , 5 ) ;
sbDSPPlugin - > Add ( DSPSelection , 1 , wxEXPAND | wxALL , 5 ) ;
sbDSPPlugin - > Add ( DSPConfig , 0 , wxALL , 5 ) ;
sbWiimotePlugin - > Add ( WiimoteSelection , 1 , wxEXPAND | wxALL , 5 ) ;
sbWiimotePlugin - > Add ( WiimoteConfig , 0 , wxALL , 5 ) ;
2010-06-05 01:38:22 +00:00
// Populate the Plugins page
sPluginsPage = new wxBoxSizer ( wxVERTICAL ) ;
sPluginsPage - > Add ( sbGraphicsPlugin , 0 , wxEXPAND | wxALL , 5 ) ;
sPluginsPage - > Add ( sbDSPPlugin , 0 , wxEXPAND | wxALL , 5 ) ;
sPluginsPage - > Add ( sbWiimotePlugin , 0 , wxEXPAND | wxALL , 5 ) ;
PluginsPage - > SetSizer ( sPluginsPage ) ;
sPluginsPage - > Layout ( ) ;
2009-01-04 21:53:41 +00:00
2010-06-05 01:38:22 +00:00
m_Ok = new wxButton ( this , wxID_OK ) ;
2008-12-08 05:30:24 +00:00
2008-12-25 07:28:41 +00:00
wxBoxSizer * sButtons = new wxBoxSizer ( wxHORIZONTAL ) ;
2008-12-08 05:30:24 +00:00
sButtons - > Add ( 0 , 0 , 1 , wxEXPAND , 5 ) ;
2010-06-05 01:38:22 +00:00
sButtons - > Add ( m_Ok , 0 , wxALL , 5 ) ;
2009-01-15 06:48:15 +00:00
2008-12-25 07:28:41 +00:00
wxBoxSizer * sMain = new wxBoxSizer ( wxVERTICAL ) ;
2008-12-08 05:30:24 +00:00
sMain - > Add ( Notebook , 1 , wxEXPAND | wxALL , 5 ) ;
sMain - > Add ( sButtons , 0 , wxEXPAND , 5 ) ;
2009-01-15 06:48:15 +00:00
2010-02-06 16:20:54 +00:00
InitializeGUIValues ( ) ;
InitializeGUITooltips ( ) ;
2009-01-04 21:53:41 +00:00
UpdateGUI ( ) ;
2010-06-05 01:38:22 +00:00
SetSizer ( sMain ) ;
Layout ( ) ;
2008-12-08 05:30:24 +00:00
Fit ( ) ;
Center ( ) ;
}
void CConfigMain : : OnClose ( wxCloseEvent & WXUNUSED ( event ) )
{
2009-02-03 15:03:34 +00:00
EndModal ( ( bRefreshList ) ? wxID_OK : wxID_CLOSE ) ;
2010-06-05 01:38:22 +00:00
}
2008-12-08 05:30:24 +00:00
2010-06-05 01:38:22 +00:00
void CConfigMain : : OnOk ( wxCommandEvent & WXUNUSED ( event ) )
{
Close ( ) ;
2009-09-14 06:26:49 +00:00
// Sysconf saves when it gets deleted
//delete SConfig::GetInstance().m_SYSCONF;
2008-12-08 05:30:24 +00:00
2008-12-23 11:24:11 +00:00
// Save the config. Dolphin crashes to often to save the settings on closing only
2008-12-08 05:30:24 +00:00
SConfig : : GetInstance ( ) . SaveSettings ( ) ;
}
2010-06-05 01:38:22 +00:00
// Core settings
2008-12-08 05:30:24 +00:00
void CConfigMain : : CoreSettingsChanged ( wxCommandEvent & event )
{
switch ( event . GetId ( ) )
{
2010-06-05 01:38:22 +00:00
// Core - Basic
case ID_CPUTHREAD :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bCPUThread = CPUThread - > IsChecked ( ) ;
2009-01-04 21:53:41 +00:00
break ;
2010-06-05 01:38:22 +00:00
case ID_IDLESKIP :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bSkipIdle = SkipIdle - > IsChecked ( ) ;
2009-02-02 22:29:33 +00:00
break ;
2010-06-05 01:38:22 +00:00
case ID_ENABLECHEATS :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bEnableCheats = EnableCheats - > IsChecked ( ) ;
2010-04-12 01:33:10 +00:00
break ;
2009-06-18 11:23:37 +00:00
case ID_FRAMELIMIT :
2010-06-05 01:38:22 +00:00
SConfig : : GetInstance ( ) . m_Framelimit = Framelimit - > GetSelection ( ) ;
2009-06-09 21:27:45 +00:00
break ;
2010-06-05 01:38:22 +00:00
case ID_FRAMELIMIT_USEFPSFORLIMITING :
SConfig : : GetInstance ( ) . b_UseFPS = UseFPSForLimiting - > IsChecked ( ) ;
2009-10-13 04:45:11 +00:00
break ;
2010-06-05 01:38:22 +00:00
// Core - Advanced
case ID_ALWAYS_HLE_BS2 :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bHLE_BS2 = AlwaysHLE_BS2 - > IsChecked ( ) ;
2008-12-08 05:30:24 +00:00
break ;
2010-06-23 12:57:59 +00:00
# if defined(HAVE_OPENCL) && HAVE_OPENCL
2010-06-22 13:17:01 +00:00
case ID_ENABLE_OPENCL :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bEnableOpenCL = EnableOpenCL - > IsChecked ( ) ;
break ;
2010-06-23 12:57:59 +00:00
# endif
2010-06-05 01:38:22 +00:00
case ID_CPUENGINE :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . iCPUCore = CPUEngine - > GetSelection ( ) ;
if ( main_frame - > g_pCodeWindow )
2010-06-09 20:03:37 +00:00
main_frame - > g_pCodeWindow - > GetMenuBar ( ) - > Check ( IDM_INTERPRETER ,
2010-06-05 01:38:22 +00:00
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . iCPUCore ? false : true ) ;
2008-12-08 05:30:24 +00:00
break ;
2009-04-08 20:26:33 +00:00
case ID_DSPTHREAD :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bDSPThread = DSPThread - > IsChecked ( ) ;
break ;
2008-12-08 05:30:24 +00:00
case ID_LOCKTHREADS :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bLockThreads = LockThreads - > IsChecked ( ) ;
break ;
2010-06-05 01:38:22 +00:00
}
}
// Display and Interface settings
void CConfigMain : : DisplaySettingsChanged ( wxCommandEvent & event )
{
switch ( event . GetId ( ) )
{
// Display - Display
2010-04-22 04:28:34 +00:00
case ID_DISPLAY_FULLSCREENRES :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . strFullscreenResolution =
FullscreenResolution - > GetStringSelection ( ) . mb_str ( ) ;
# if defined(HAVE_XRANDR) && HAVE_XRANDR
main_frame - > m_XRRConfig - > Update ( ) ;
# endif
break ;
case ID_DISPLAY_WINDOWWIDTH :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . iRenderWindowWidth = WindowWidth - > GetValue ( ) ;
break ;
case ID_DISPLAY_WINDOWHEIGHT :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . iRenderWindowHeight = WindowHeight - > GetValue ( ) ;
break ;
2010-06-05 01:38:22 +00:00
case ID_DISPLAY_FULLSCREEN :
2010-04-12 01:33:10 +00:00
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bFullscreen = Fullscreen - > IsChecked ( ) ;
break ;
case ID_DISPLAY_HIDECURSOR :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bHideCursor = HideCursor - > IsChecked ( ) ;
break ;
case ID_DISPLAY_RENDERTOMAIN :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bRenderToMain = RenderToMain - > IsChecked ( ) ;
break ;
2010-06-05 01:38:22 +00:00
// Display - Interface
case ID_INTERFACE_CONFIRMSTOP :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bConfirmStop = ConfirmStop - > IsChecked ( ) ;
break ;
case ID_INTERFACE_USEPANICHANDLERS :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . bUsePanicHandlers = UsePanicHandlers - > IsChecked ( ) ;
SetEnableAlert ( UsePanicHandlers - > IsChecked ( ) ) ;
break ;
case ID_INTERFACE_THEME :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . iTheme = Theme - > GetSelection ( ) ;
main_frame - > InitBitmaps ( ) ;
break ;
case ID_INTERFACE_LANG :
SConfig : : GetInstance ( ) . m_InterfaceLanguage = ( INTERFACE_LANGUAGE ) InterfaceLang - > GetSelection ( ) ;
bRefreshList = true ;
break ;
case ID_HOTKEY_CONFIG :
{
HotkeyConfigDialog * m_HotkeyDialog = new HotkeyConfigDialog ( this ) ;
m_HotkeyDialog - > ShowModal ( ) ;
m_HotkeyDialog - > Destroy ( ) ;
// Update the GUI in case menu accelerators were changed
main_frame - > UpdateGUI ( ) ;
}
break ;
2008-12-08 05:30:24 +00:00
}
}
2009-09-02 21:00:45 +00:00
2009-02-02 22:29:33 +00:00
// GC settings
2009-02-23 09:34:28 +00:00
// -----------------------
2008-12-08 05:30:24 +00:00
void CConfigMain : : GCSettingsChanged ( wxCommandEvent & event )
{
2009-02-02 22:29:33 +00:00
int sidevice = 0 ;
2009-02-28 21:30:43 +00:00
int exidevice = 0 ;
2008-12-08 05:30:24 +00:00
switch ( event . GetId ( ) )
{
2010-06-05 01:38:22 +00:00
// Gamecube - IPL
2008-12-08 05:30:24 +00:00
case ID_GC_SRAM_LNG :
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . SelectedLanguage = GCSystemLang - > GetSelection ( ) ;
break ;
2010-06-05 01:38:22 +00:00
// Gamecube - Devices
2009-10-19 15:14:48 +00:00
case ID_GC_EXIDEVICE_SP1 :
2009-02-28 21:30:43 +00:00
exidevice + + ;
case ID_GC_EXIDEVICE_SLOTB :
exidevice + + ;
2010-06-05 01:38:22 +00:00
case ID_GC_EXIDEVICE_SLOTA :
2009-02-28 21:30:43 +00:00
ChooseEXIDevice ( std : : string ( event . GetString ( ) . mb_str ( ) ) , exidevice ) ;
2010-06-05 01:38:22 +00:00
break ;
2009-02-02 22:29:33 +00:00
case ID_GC_EXIDEVICE_SLOTA_PATH :
ChooseMemcardPath ( SConfig : : GetInstance ( ) . m_strMemoryCardA , true ) ;
break ;
case ID_GC_EXIDEVICE_SLOTB_PATH :
ChooseMemcardPath ( SConfig : : GetInstance ( ) . m_strMemoryCardB , false ) ;
break ;
2010-06-05 01:38:22 +00:00
case ID_GC_SIDEVICE3 :
sidevice + + ;
case ID_GC_SIDEVICE2 :
2009-02-02 22:29:33 +00:00
sidevice + + ;
2010-06-05 01:38:22 +00:00
case ID_GC_SIDEVICE1 :
2009-02-02 22:29:33 +00:00
sidevice + + ;
2010-06-05 01:38:22 +00:00
case ID_GC_SIDEVICE0 :
2009-02-02 22:29:33 +00:00
ChooseSIDevice ( std : : string ( event . GetString ( ) . mb_str ( ) ) , sidevice ) ;
2010-06-05 01:38:22 +00:00
break ;
2008-12-08 05:30:24 +00:00
}
}
2008-12-23 11:11:02 +00:00
2009-02-02 22:29:33 +00:00
void CConfigMain : : ChooseMemcardPath ( std : : string & strMemcard , bool isSlotA )
{
2009-02-28 21:30:43 +00:00
std : : string filename = std : : string ( wxFileSelector (
wxT ( " Choose a file to open " ) ,
2010-06-11 08:39:03 +00:00
wxString : : From8BitData ( File : : GetUserPath ( D_GCUSER_IDX ) ) ,
2010-06-09 20:03:37 +00:00
isSlotA ? wxT ( GC_MEMCARDA ) : wxT ( GC_MEMCARDB ) ,
2009-02-28 21:30:43 +00:00
wxEmptyString ,
2009-02-02 22:29:33 +00:00
wxT ( " Gamecube Memory Cards (*.raw,*.gcp)|*.raw;*.gcp " ) ) . mb_str ( ) ) ;
2009-02-28 21:30:43 +00:00
2009-02-02 22:29:33 +00:00
if ( ! filename . empty ( ) )
2009-02-28 21:46:04 +00:00
{
2009-02-28 22:01:58 +00:00
// also check that the path isn't used for the other memcard...
if ( filename . compare ( isSlotA ? SConfig : : GetInstance ( ) . m_strMemoryCardB
: SConfig : : GetInstance ( ) . m_strMemoryCardA ) ! = 0 )
{
strMemcard = filename ;
if ( Core : : GetState ( ) ! = Core : : CORE_UNINITIALIZED )
{
// Change memcard to the new file
ExpansionInterface : : ChangeDevice (
isSlotA ? 0 : 1 , // SlotA: channel 0, SlotB channel 1
isSlotA ? EXIDEVICE_MEMORYCARD_A : EXIDEVICE_MEMORYCARD_B ,
0 ) ; // SP1 is device 2, slots are device 0
}
}
else
2009-02-28 21:46:04 +00:00
{
2009-02-28 22:01:58 +00:00
PanicAlert ( " Cannot use that file as a memory card. \n "
" Are you trying to use the same file in both slots? " ) ;
2009-02-28 21:46:04 +00:00
}
}
2009-02-02 22:29:33 +00:00
}
2008-12-08 05:30:24 +00:00
2009-02-02 22:29:33 +00:00
void CConfigMain : : ChooseSIDevice ( std : : string deviceName , int deviceNum )
{
TSIDevices tempType ;
2009-10-19 15:14:48 +00:00
if ( ! deviceName . compare ( SIDEV_STDCONT_STR ) )
2009-02-02 22:29:33 +00:00
tempType = SI_GC_CONTROLLER ;
2009-10-19 15:14:48 +00:00
else if ( ! deviceName . compare ( SIDEV_GBA_STR ) )
2009-02-06 18:18:20 +00:00
tempType = SI_GBA ;
2009-10-19 15:14:48 +00:00
else if ( ! deviceName . compare ( SIDEV_AM_BB_STR ) )
tempType = SI_AM_BASEBOARD ;
2009-02-02 22:29:33 +00:00
else
2009-12-21 07:39:57 +00:00
tempType = SI_NONE ;
2008-12-23 11:11:02 +00:00
2009-02-02 22:29:33 +00:00
SConfig : : GetInstance ( ) . m_SIDevice [ deviceNum ] = tempType ;
2009-03-02 04:02:09 +00:00
if ( Core : : GetState ( ) ! = Core : : CORE_UNINITIALIZED )
{
// Change plugged device! :D
SerialInterface : : ChangeDevice ( tempType , deviceNum ) ;
}
2009-02-02 22:29:33 +00:00
}
2009-02-28 21:30:43 +00:00
void CConfigMain : : ChooseEXIDevice ( std : : string deviceName , int deviceNum )
{
TEXIDevices tempType ;
2009-10-19 15:14:48 +00:00
if ( ! deviceName . compare ( EXIDEV_MEMCARD_STR ) )
2009-02-28 21:30:43 +00:00
tempType = deviceNum ? EXIDEVICE_MEMORYCARD_B : EXIDEVICE_MEMORYCARD_A ;
2009-10-19 15:14:48 +00:00
else if ( ! deviceName . compare ( EXIDEV_MIC_STR ) )
2009-02-28 21:30:43 +00:00
tempType = EXIDEVICE_MIC ;
2009-10-19 15:14:48 +00:00
else if ( ! deviceName . compare ( EXIDEV_BBA_STR ) )
2009-02-28 21:30:43 +00:00
tempType = EXIDEVICE_ETH ;
2009-10-19 15:14:48 +00:00
else if ( ! deviceName . compare ( EXIDEV_AM_BB_STR ) )
tempType = EXIDEVICE_AM_BASEBOARD ;
else if ( ! deviceName . compare ( DEV_NONE_STR ) )
tempType = EXIDEVICE_NONE ;
2009-02-28 21:30:43 +00:00
else
tempType = EXIDEVICE_DUMMY ;
// Gray out the memcard path button if we're not on a memcard
if ( tempType = = EXIDEVICE_MEMORYCARD_A | | tempType = = EXIDEVICE_MEMORYCARD_B )
GCMemcardPath [ deviceNum ] - > Enable ( ) ;
else if ( deviceNum = = 0 | | deviceNum = = 1 )
GCMemcardPath [ deviceNum ] - > Disable ( ) ;
SConfig : : GetInstance ( ) . m_EXIDevice [ deviceNum ] = tempType ;
if ( Core : : GetState ( ) ! = Core : : CORE_UNINITIALIZED )
{
// Change plugged device! :D
ExpansionInterface : : ChangeDevice (
( deviceNum = = 1 ) ? 1 : 0 , // SlotB is on channel 1, slotA and SP1 are on 0
tempType , // The device enum to change to
( deviceNum = = 2 ) ? 2 : 0 ) ; // SP1 is device 2, slots are device 0
}
}
2009-02-02 22:29:33 +00:00
2009-02-23 09:34:28 +00:00
2009-09-02 21:00:45 +00:00
2008-12-23 11:11:02 +00:00
// Wii settings
2009-02-23 09:34:28 +00:00
// -------------------
2008-12-08 05:30:24 +00:00
void CConfigMain : : WiiSettingsChanged ( wxCommandEvent & event )
{
switch ( event . GetId ( ) )
{
2010-06-05 01:38:22 +00:00
// Wii - Wiimote settings
case ID_WII_BT_BAR :
2009-09-14 06:26:49 +00:00
SConfig : : GetInstance ( ) . m_SYSCONF - > SetData ( " BT.BAR " , WiiSensBarPos - > GetSelection ( ) ) ;
2008-12-08 05:30:24 +00:00
break ;
2010-06-05 01:38:22 +00:00
// SYSCONF settings
2008-12-08 05:30:24 +00:00
case ID_WII_IPL_SSV :
2009-09-14 06:26:49 +00:00
SConfig : : GetInstance ( ) . m_SYSCONF - > SetData ( " IPL.SSV " , WiiScreenSaver - > IsChecked ( ) ) ;
2008-12-08 05:30:24 +00:00
break ;
case ID_WII_IPL_PGS :
2009-09-14 06:26:49 +00:00
SConfig : : GetInstance ( ) . m_SYSCONF - > SetData ( " IPL.PGS " , WiiProgressiveScan - > IsChecked ( ) ) ;
2008-12-08 05:30:24 +00:00
break ;
case ID_WII_IPL_E60 :
2009-09-14 06:26:49 +00:00
SConfig : : GetInstance ( ) . m_SYSCONF - > SetData ( " IPL.E60 " , WiiEuRGB60 - > IsChecked ( ) ) ;
2008-12-08 05:30:24 +00:00
break ;
2010-06-05 01:38:22 +00:00
case ID_WII_IPL_AR :
SConfig : : GetInstance ( ) . m_SYSCONF - > SetData ( " IPL.AR " , WiiAspectRatio - > GetSelection ( ) ) ;
break ;
case ID_WII_IPL_LNG :
SConfig : : GetInstance ( ) . m_SYSCONF - > SetData ( " IPL.LNG " , WiiSystemLang - > GetSelection ( ) ) ;
break ;
// Wii - Devices
2010-01-11 11:56:17 +00:00
case ID_WII_SD_CARD :
SConfig : : GetInstance ( ) . m_WiiSDCard = WiiSDCard - > IsChecked ( ) ;
break ;
case ID_WII_KEYBOARD :
SConfig : : GetInstance ( ) . m_WiiKeyboard = WiiKeyboard - > IsChecked ( ) ;
break ;
2008-12-08 05:30:24 +00:00
}
}
2009-02-23 09:34:28 +00:00
2008-12-23 11:11:02 +00:00
2009-09-02 21:00:45 +00:00
2008-12-23 11:11:02 +00:00
// Paths settings
2009-02-23 09:34:28 +00:00
// -------------------
2008-12-08 05:30:24 +00:00
void CConfigMain : : ISOPathsSelectionChanged ( wxCommandEvent & WXUNUSED ( event ) )
{
if ( ! ISOPaths - > GetStringSelection ( ) . empty ( ) )
{
RemoveISOPath - > Enable ( true ) ;
}
else
{
RemoveISOPath - > Enable ( false ) ;
}
}
void CConfigMain : : AddRemoveISOPaths ( wxCommandEvent & event )
{
if ( event . GetId ( ) = = ID_ADDISOPATH )
{
wxString dirHome ;
wxGetHomeDir ( & dirHome ) ;
wxDirDialog dialog ( this , _T ( " Choose a directory to add " ) , dirHome , wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST ) ;
if ( dialog . ShowModal ( ) = = wxID_OK )
{
if ( ISOPaths - > FindString ( dialog . GetPath ( ) ) ! = - 1 )
{
wxMessageBox ( _ ( " The chosen directory is already in the list " ) , _ ( " Error " ) , wxOK ) ;
}
else
{
bRefreshList = true ;
ISOPaths - > Append ( dialog . GetPath ( ) ) ;
}
}
}
else
{
bRefreshList = true ;
ISOPaths - > Delete ( ISOPaths - > GetSelection ( ) ) ;
}
// Save changes right away
SConfig : : GetInstance ( ) . m_ISOFolder . clear ( ) ;
for ( unsigned int i = 0 ; i < ISOPaths - > GetCount ( ) ; i + + )
2009-08-02 05:59:55 +00:00
SConfig : : GetInstance ( ) . m_ISOFolder . push_back ( std : : string ( ISOPaths - > GetStrings ( ) [ i ] . mb_str ( ) ) ) ;
2008-12-08 05:30:24 +00:00
}
2009-04-05 06:46:18 +00:00
void CConfigMain : : RecursiveDirectoryChanged ( wxCommandEvent & WXUNUSED ( event ) )
{
2010-06-05 01:38:22 +00:00
SConfig : : GetInstance ( ) . m_RecursiveISOFolder = RecursiveISOPath - > IsChecked ( ) ;
2009-04-05 06:46:18 +00:00
bRefreshList = true ;
}
2008-12-08 05:30:24 +00:00
void CConfigMain : : DefaultISOChanged ( wxFileDirPickerEvent & WXUNUSED ( event ) )
{
2009-08-02 05:59:55 +00:00
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . m_strDefaultGCM = DefaultISO - > GetPath ( ) . mb_str ( ) ;
2008-12-08 05:30:24 +00:00
}
void CConfigMain : : DVDRootChanged ( wxFileDirPickerEvent & WXUNUSED ( event ) )
{
2009-08-02 05:59:55 +00:00
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . m_strDVDRoot = DVDRoot - > GetPath ( ) . mb_str ( ) ;
2008-12-08 05:30:24 +00:00
}
2009-12-10 09:16:10 +00:00
void CConfigMain : : ApploaderPathChanged ( wxFileDirPickerEvent & WXUNUSED ( event ) )
{
SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . m_strApploader = ApploaderPath - > GetPath ( ) . mb_str ( ) ;
}
2009-09-02 21:00:45 +00:00
2009-02-02 22:29:33 +00:00
// Plugin settings
2008-12-08 05:30:24 +00:00
void CConfigMain : : OnSelectionChanged ( wxCommandEvent & WXUNUSED ( event ) )
{
2009-02-02 22:29:33 +00:00
// Update plugin filenames
2008-12-08 05:30:24 +00:00
GetFilename ( GraphicSelection , SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . m_strVideoPlugin ) ;
2010-06-03 18:05:08 +00:00
GetFilename ( DSPSelection , SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . m_strDSPPlugin ) ;
2010-06-12 20:13:58 +00:00
GetFilename ( WiimoteSelection , SConfig : : GetInstance ( ) . m_LocalCoreStartupParameter . m_strWiimotePlugin ) ;
2008-12-08 05:30:24 +00:00
}
void CConfigMain : : OnConfig ( wxCommandEvent & event )
{
switch ( event . GetId ( ) )
{
2010-06-05 01:38:22 +00:00
case ID_GRAPHIC_CONFIG :
CallConfig ( GraphicSelection ) ;
break ;
2008-12-08 05:30:24 +00:00
case ID_DSP_CONFIG :
2010-06-05 01:38:22 +00:00
CallConfig ( DSPSelection ) ;
break ;
2008-12-08 05:30:24 +00:00
case ID_WIIMOTE_CONFIG :
2010-06-05 01:38:22 +00:00
CallConfig ( WiimoteSelection ) ;
break ;
2008-12-08 05:30:24 +00:00
}
}
2008-12-23 11:11:02 +00:00
2009-01-24 12:09:30 +00:00
void CConfigMain : : CallConfig ( wxChoice * _pChoice )
{
int Index = _pChoice - > GetSelection ( ) ;
2009-03-18 17:17:58 +00:00
INFO_LOG ( CONSOLE , " CallConfig: %i \n " , Index ) ;
2009-01-24 12:09:30 +00:00
if ( Index > = 0 )
{
const CPluginInfo * pInfo = static_cast < CPluginInfo * > ( _pChoice - > GetClientData ( Index ) ) ;
if ( pInfo ! = NULL )
2009-01-31 21:49:06 +00:00
CPluginManager : : GetInstance ( ) . OpenConfig ( ( HWND ) this - > GetHandle ( ) , pInfo - > GetFilename ( ) . c_str ( ) , pInfo - > GetPluginInfo ( ) . Type ) ;
2009-01-24 12:09:30 +00:00
}
}
2008-12-23 11:11:02 +00:00
2008-12-08 05:30:24 +00:00
void CConfigMain : : FillChoiceBox ( wxChoice * _pChoice , int _PluginType , const std : : string & _SelectFilename )
{
_pChoice - > Clear ( ) ;
int Index = - 1 ;
const CPluginInfos & rInfos = CPluginManager : : GetInstance ( ) . GetPluginInfos ( ) ;
for ( size_t i = 0 ; i < rInfos . size ( ) ; i + + )
{
const PLUGIN_INFO & rPluginInfo = rInfos [ i ] . GetPluginInfo ( ) ;
if ( rPluginInfo . Type = = _PluginType )
{
wxString temp ;
temp = wxString : : FromAscii ( rInfos [ i ] . GetPluginInfo ( ) . Name ) ;
int NewIndex = _pChoice - > Append ( temp , ( void * ) & rInfos [ i ] ) ;
2009-01-31 21:49:06 +00:00
if ( rInfos [ i ] . GetFilename ( ) = = _SelectFilename )
2008-12-08 05:30:24 +00:00
{
Index = NewIndex ;
}
}
}
_pChoice - > Select ( Index ) ;
}
bool CConfigMain : : GetFilename ( wxChoice * _pChoice , std : : string & _rFilename )
2009-01-24 12:09:30 +00:00
{
2008-12-08 05:30:24 +00:00
_rFilename . clear ( ) ;
int Index = _pChoice - > GetSelection ( ) ;
if ( Index > = 0 )
{
const CPluginInfo * pInfo = static_cast < CPluginInfo * > ( _pChoice - > GetClientData ( Index ) ) ;
2009-01-31 21:49:06 +00:00
_rFilename = pInfo - > GetFilename ( ) ;
2009-03-18 17:17:58 +00:00
INFO_LOG ( CONSOLE , " GetFilename: %i %s \n " , Index , _rFilename . c_str ( ) ) ;
2008-12-08 05:30:24 +00:00
return ( true ) ;
}
return ( false ) ;
}
2010-04-22 04:28:34 +00:00
// Search for avaliable resolutions
void CConfigMain : : AddResolutions ( )
{
# ifdef _WIN32
DWORD iModeNum = 0 ;
DEVMODE dmi ;
ZeroMemory ( & dmi , sizeof ( dmi ) ) ;
dmi . dmSize = sizeof ( dmi ) ;
std : : vector < std : : string > resos ;
while ( EnumDisplaySettings ( NULL , iModeNum + + , & dmi ) ! = 0 )
{
char res [ 100 ] ;
sprintf ( res , " %dx%d " , dmi . dmPelsWidth , dmi . dmPelsHeight ) ;
std : : string strRes ( res ) ;
// Only add unique resolutions
if ( std : : find ( resos . begin ( ) , resos . end ( ) , strRes ) = = resos . end ( ) )
{
resos . push_back ( strRes ) ;
arrayStringFor_FullscreenResolution . Add ( wxString : : FromAscii ( res ) ) ;
}
ZeroMemory ( & dmi , sizeof ( dmi ) ) ;
}
# elif defined(HAVE_XRANDR) && HAVE_XRANDR
main_frame - > m_XRRConfig - > AddResolutions ( arrayStringFor_FullscreenResolution ) ;
2010-06-03 01:24:26 +00:00
# elif defined(__APPLE__)
2010-06-09 20:03:37 +00:00
CFDictionaryRef mode ;
CFArrayRef array ;
CFIndex n , i ;
int w , h ;
2010-04-22 04:28:34 +00:00
std : : vector < std : : string > resos ;
2010-06-09 20:03:37 +00:00
array = CGDisplayAvailableModes ( CGMainDisplayID ( ) ) ;
n = CFArrayGetCount ( array ) ;
2010-04-22 04:28:34 +00:00
for ( i = 0 ; i < n ; i + + )
{
2010-06-09 20:03:37 +00:00
mode = ( CFDictionaryRef ) CFArrayGetValueAtIndex ( array , i ) ;
CFNumberRef anWidth = ( CFNumberRef ) CFDictionaryGetValue ( mode ,
kCGDisplayWidth ) ;
if ( NULL = = anWidth | |
! CFNumberGetValue ( anWidth , kCFNumberIntType , & w ) )
continue ;
CFNumberRef anHeight =
( CFNumberRef ) CFDictionaryGetValue ( mode ,
kCGDisplayHeight ) ;
if ( NULL = = anHeight | |
! CFNumberGetValue ( anHeight , kCFNumberIntType , & h ) )
continue ;
2010-04-22 04:28:34 +00:00
char res [ 32 ] ;
sprintf ( res , " %dx%d " , w , h ) ;
std : : string strRes ( res ) ;
2010-06-09 20:03:37 +00:00
2010-04-22 04:28:34 +00:00
// Only add unique resolutions
2010-06-09 20:03:37 +00:00
if ( std : : find ( resos . begin ( ) , resos . end ( ) , strRes ) = =
resos . end ( ) )
2010-04-22 04:28:34 +00:00
{
resos . push_back ( strRes ) ;
2010-06-09 20:03:37 +00:00
arrayStringFor_FullscreenResolution . Add ( strRes ) ;
2010-04-22 04:28:34 +00:00
}
}
# endif
}