From: <rel...@us...> - 2009-07-06 15:53:10
|
Revision: 281 http://modplug.svn.sourceforge.net/modplug/?rev=281&view=rev Author: relabsoluness Date: 2009-07-06 15:27:09 +0000 (Mon, 06 Jul 2009) Log Message: ----------- (patches from Jojo, merged somewhat modified) [New] General: New default directories: plugins and plugin presets. Includes some related refactoring. (merge edit: some changes and fixes) [Fix] Internal: Fixed buffer overrun in tree view. (merged modified) Modified Paths: -------------- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moptions.cpp trunk/OpenMPT/mptrack/Moptions.h trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/resource.h Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.cpp =================================================================== --- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2009-07-05 21:01:58 UTC (rev 280) +++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2009-07-06 15:27:09 UTC (rev 281) @@ -115,8 +115,12 @@ CFileDialog dlg(TRUE, "fxp", NULL, OFN_HIDEREADONLY| OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST | OFN_ENABLESIZING | OFN_NOREADONLYRETURN, "VST Program (*.fxp)|*.fxp||", theApp.m_pMainWnd); + dlg.m_ofn.lpstrInitialDir = CMainFrame::GetWorkingDirectory(DIR_PLUGINPRESETS); + if (!(dlg.DoModal() == IDOK)) return; + CMainFrame::SetWorkingDirectory(dlg.GetFileName(), DIR_PLUGINPRESETS, true); + //TODO: exception handling to distinguish errors at this level. if (!(m_pVstPlugin->LoadProgram(dlg.GetFileName()))) ::AfxMessageBox("Error loading preset. Are you sure it is for this plugin?"); Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2009-07-05 21:01:58 UTC (rev 280) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2009-07-06 15:27:09 UTC (rev 281) @@ -1237,7 +1237,6 @@ BOOL CCtrlInstruments::OpenInstrument(LPCSTR lpszFileName) //-------------------------------------------------------- { - CHAR szName[_MAX_FNAME], szExt[_MAX_EXT]; CMappedFile f; BOOL bFirst, bOk; DWORD len; @@ -1287,10 +1286,9 @@ INSTRUMENTHEADER *penv = m_pSndFile->Headers[m_nInstrument]; if (penv) { - CHAR szPath[_MAX_PATH], szNewPath[_MAX_PATH]; - _splitpath(lpszFileName, szNewPath, szPath, szName, szExt); - strcat(szNewPath, szPath); - strcpy(CMainFrame::m_szCurInsDir, szNewPath); + TCHAR szName[_MAX_FNAME], szExt[_MAX_EXT]; + _tsplitpath(lpszFileName, nullptr, nullptr, szName, szExt); + CMainFrame::SetWorkingDirectory(lpszFileName, DIR_INSTRUMENTS, true); if (!penv->name[0]) { @@ -1528,10 +1526,11 @@ "Impulse Tracker Instruments (*.iti)|*.iti|" "All Files (*.*)|*.*||", this); - if (CMainFrame::m_szCurInsDir[0]) - { - dlg.m_ofn.lpstrInitialDir = CMainFrame::m_szCurInsDir; - } + + const LPCTSTR pszWdir = CMainFrame::GetWorkingDirectory(DIR_INSTRUMENTS); + if(pszWdir[0]) + dlg.m_ofn.lpstrInitialDir = pszWdir; + const size_t bufferSize = 2048; //Note: This is possibly the maximum buffer size. vector<char> filenameBuffer(bufferSize, 0); dlg.GetOFN().lpstrFile = &filenameBuffer[0]; @@ -1601,10 +1600,11 @@ this); // -! BUG_FIX#0019 - if (CMainFrame::m_szCurInsDir[0]) - { - dlg.m_ofn.lpstrInitialDir = CMainFrame::m_szCurInsDir; - } + + const LPCTSTR pszWdir = CMainFrame::GetWorkingDirectory(DIR_INSTRUMENTS); + if(pszWdir[0]) + dlg.m_ofn.lpstrInitialDir = pszWdir; + if (dlg.DoModal() != IDOK) return; BeginWaitCursor(); _splitpath(dlg.GetPathName(), drive, path, NULL, ext); @@ -1625,8 +1625,11 @@ EndWaitCursor(); if (!bOk) ErrorBox(IDS_ERR_SAVEINS, this); else { - strcpy(CMainFrame::m_szCurInsDir, drive); - strcat(CMainFrame::m_szCurInsDir, path); + strcpy(szFileName, drive); + strcat(szFileName, path); + + CMainFrame::SetWorkingDirectory(szFileName, DIR_INSTRUMENTS); + // -> CODE#0023 // -> DESC="IT project files (.itp)" // m_pModDoc->UpdateAllViews(NULL, (m_nInstrument << 24) | HINT_INSTRUMENT); Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2009-07-05 21:01:58 UTC (rev 280) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2009-07-06 15:27:09 UTC (rev 281) @@ -774,30 +774,30 @@ EndWaitCursor(); if (bOk) { - CHAR szPath[_MAX_PATH], szNewPath[_MAX_PATH]; MODINSTRUMENT *pins = &m_pSndFile->Ins[m_nSample]; - _splitpath(lpszFileName, szNewPath, szPath, szName, szExt); - strcat(szNewPath, szPath); - strcpy(CMainFrame::m_szCurSmpDir, szNewPath); + CMainFrame::SetWorkingDirectory(lpszFileName, DIR_SAMPLES, true); if (!pins->name[0]) { - memset(szPath, 0, 32); - strcpy(szPath, szName); + CHAR szFullFilename[_MAX_PATH]; + _splitpath(lpszFileName, 0, 0, szName, szExt); + + memset(szFullFilename, 0, 32); + strcpy(szFullFilename, szName); if (m_pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM)) { // MOD/XM - strcat(szPath, szExt); - szPath[31] = 0; - memcpy(m_pSndFile->m_szNames[m_nSample], szPath, 32); + strcat(szFullFilename, szExt); + szFullFilename[31] = 0; + memcpy(m_pSndFile->m_szNames[m_nSample], szFullFilename, 32); } else { // S3M/IT - szPath[31] = 0; - if (!m_pSndFile->m_szNames[m_nSample][0]) memcpy(m_pSndFile->m_szNames[m_nSample], szPath, 32); - if (strlen(szPath) < 9) strcat(szPath, szExt); + szFullFilename[31] = 0; + if (!m_pSndFile->m_szNames[m_nSample][0]) memcpy(m_pSndFile->m_szNames[m_nSample], szFullFilename, 32); + if (strlen(szFullFilename) < 9) strcat(szFullFilename, szExt); } - szPath[21] = 0; - memcpy(pins->name, szPath, 22); + szFullFilename[21] = 0; + memcpy(pins->name, szFullFilename, 22); } if ((m_pSndFile->m_nType & MOD_TYPE_XM) && (!(pins->uFlags & CHN_PANNING))) { @@ -925,10 +925,11 @@ "Raw Samples (*.raw,*.snd,*.pcm)|*.raw;*.snd;*.pcm|" "All Files (*.*)|*.*||", this); - if (CMainFrame::m_szCurSmpDir[0]) - { - dlg.m_ofn.lpstrInitialDir = CMainFrame::m_szCurSmpDir; - } + + const LPCTSTR pszWdir = CMainFrame::GetWorkingDirectory(DIR_SAMPLES); + if(pszWdir[0]) + dlg.m_ofn.lpstrInitialDir = pszWdir; + dlg.m_ofn.nFilterIndex = nLastIndex; const size_t bufferSize = 2048; //Note: This is possibly the maximum buffer size in MFC 7(this note was written November 2006). vector<char> filenameBuffer(bufferSize, 0); @@ -992,10 +993,11 @@ "Wave File (*.wav)|*.wav|" "RAW Audio (*.raw)|*.raw||", this); - if (CMainFrame::m_szCurSmpDir[0]) - { - dlg.m_ofn.lpstrInitialDir = CMainFrame::m_szCurSmpDir; - } + + const LPCTSTR pszWdir = CMainFrame::GetWorkingDirectory(DIR_SAMPLES); + if(pszWdir[0]) + dlg.m_ofn.lpstrInitialDir = pszWdir; + if (dlg.DoModal() != IDOK) return; BeginWaitCursor(); @@ -1011,10 +1013,7 @@ ErrorBox(IDS_ERR_SAVESMP, this); } else { - CHAR drive[_MAX_DRIVE], path[_MAX_PATH]; - _splitpath(dlg.GetPathName(), drive, path, NULL, NULL); - strcpy(CMainFrame::m_szCurSmpDir, drive); - strcat(CMainFrame::m_szCurSmpDir, path); + CMainFrame::SetWorkingDirectory(dlg.GetPathName(), DIR_SAMPLES, true); } SwitchToView(); } Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2009-07-05 21:01:58 UTC (rev 280) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2009-07-06 15:27:09 UTC (rev 281) @@ -257,16 +257,12 @@ 0x00FF00, 0x00FFFF, 0x0000FF, }; -// Arrays -CHAR CMainFrame::m_szModDir[_MAX_PATH] = ""; -CHAR CMainFrame::m_szSmpDir[_MAX_PATH] = ""; -CHAR CMainFrame::m_szInsDir[_MAX_PATH] = ""; -CHAR CMainFrame::m_szKbdFile[_MAX_PATH] = ""; //rewbs.customKeys -CHAR CMainFrame::m_szCurModDir[_MAX_PATH] = ""; -CHAR CMainFrame::m_szCurSmpDir[_MAX_PATH] = ""; -CHAR CMainFrame::m_szCurInsDir[_MAX_PATH] = ""; -//CHAR CMainFrame::m_szCurKbdFile[_MAX_PATH] = ""; //rewbs.customKeys +// Directory Arrays (Default + Last) +TCHAR CMainFrame::m_szDefaultDirectory[NUM_DIRS][_MAX_PATH] = {0}; +TCHAR CMainFrame::m_szWorkingDirectory[NUM_DIRS][_MAX_PATH] = {0}; +TCHAR CMainFrame::m_szKbdFile[_MAX_PATH] = ""; //rewbs.customKeys + CInputHandler *CMainFrame::m_InputHandler = NULL; //rewbs.customKeys CAutoSaver *CMainFrame::m_pAutoSaver = NULL; //rewbs.autosave CPerformanceCounter *CMainFrame::m_pPerfCounter = NULL; @@ -318,8 +314,13 @@ m_szUserText[0] = 0; m_szInfoText[0] = 0; m_szXInfoText[0]= 0; //rewbs.xinfo - m_szPluginsDir[0] = 0; - m_szExportDir[0] = 0; + + for(UINT i = 0; i < NUM_DIRS; i++) + { + m_szDefaultDirectory[i][0] = 0; + m_szWorkingDirectory[i][0] = 0; + } + m_dTotalCPU=0; memset(gpenVuMeter, 0, sizeof(gpenVuMeter)); @@ -442,10 +443,19 @@ CSoundFile::s_DefaultPlugVolumeHandling = static_cast<uint8>(GetPrivateProfileInt("Misc", "DefaultPlugVolumeHandling", PLUGIN_VOLUMEHANDLING_IGNORE, iniFile)); if(CSoundFile::s_DefaultPlugVolumeHandling > 2) CSoundFile::s_DefaultPlugVolumeHandling = PLUGIN_VOLUMEHANDLING_IGNORE; - GetPrivateProfileString("Paths", "Songs_Directory", m_szModDir, m_szModDir, INIBUFFERSIZE, iniFile); - GetPrivateProfileString("Paths", "Samples_Directory", m_szSmpDir, m_szSmpDir, INIBUFFERSIZE, iniFile); - GetPrivateProfileString("Paths", "Instruments_Directory", m_szInsDir, m_szInsDir, INIBUFFERSIZE, iniFile); - GetPrivateProfileString("Paths", "Plugins_Directory", m_szPluginsDir, m_szPluginsDir, INIBUFFERSIZE, iniFile); + TCHAR szPath[_MAX_PATH] = ""; + GetPrivateProfileString("Paths", "Songs_Directory", GetDefaultDirectory(DIR_MODS), szPath, INIBUFFERSIZE, iniFile); + SetDefaultDirectory(szPath, DIR_MODS); + GetPrivateProfileString("Paths", "Samples_Directory", GetDefaultDirectory(DIR_SAMPLES), szPath, INIBUFFERSIZE, iniFile); + SetDefaultDirectory(szPath, DIR_SAMPLES); + GetPrivateProfileString("Paths", "Instruments_Directory", GetDefaultDirectory(DIR_INSTRUMENTS), szPath, INIBUFFERSIZE, iniFile); + SetDefaultDirectory(szPath, DIR_INSTRUMENTS); + GetPrivateProfileString("Paths", "Plugins_Directory", GetDefaultDirectory(DIR_PLUGINS), szPath, INIBUFFERSIZE, iniFile); + SetDefaultDirectory(szPath, DIR_PLUGINS); + GetPrivateProfileString("Paths", "Plugin_Presets_Directory", GetDefaultDirectory(DIR_PLUGINPRESETS), szPath, INIBUFFERSIZE, iniFile); + SetDefaultDirectory(szPath, DIR_PLUGINPRESETS); + GetPrivateProfileString("Paths", "Export_Directory", GetDefaultDirectory(DIR_EXPORT), szPath, INIBUFFERSIZE, iniFile); + SetDefaultDirectory(szPath, DIR_EXPORT); GetPrivateProfileString("Paths", "Key_Config_File", m_szKbdFile, m_szKbdFile, INIBUFFERSIZE, iniFile); CSoundFile::m_nXBassDepth = GetPrivateProfileLong("Effects", "XBassDepth", 0, iniFile); @@ -479,7 +489,6 @@ DWORD dwREG_DWORD = REG_DWORD; DWORD dwREG_SZ = REG_SZ; DWORD dwDWORDSize = sizeof(UINT); - DWORD dwSZSIZE = sizeof(m_szModDir); DWORD dwCRSIZE = sizeof(COLORREF); @@ -524,15 +533,23 @@ RegQueryValueEx(key, "BufferLength", NULL, &dwREG_DWORD, (LPBYTE)&m_nBufferLength, &dwDWORDSize); if ((m_nBufferLength < 10) || (m_nBufferLength > 200)) m_nBufferLength = 100; RegQueryValueEx(key, "PreAmp", NULL, &dwREG_DWORD, (LPBYTE)&m_nPreAmp, &dwDWORDSize); - RegQueryValueEx(key, "Songs_Directory", NULL, &dwREG_SZ, (LPBYTE)m_szModDir, &dwSZSIZE); - dwSZSIZE = sizeof(m_szSmpDir); - RegQueryValueEx(key, "Samples_Directory", NULL, &dwREG_SZ, (LPBYTE)m_szSmpDir, &dwSZSIZE); - dwSZSIZE = sizeof(m_szInsDir); - RegQueryValueEx(key, "Instruments_Directory", NULL, &dwREG_SZ, (LPBYTE)m_szInsDir, &dwSZSIZE); - dwSZSIZE = sizeof(m_szPluginsDir); - RegQueryValueEx(key, "Plugins_Directory", NULL, &dwREG_SZ, (LPBYTE)m_szPluginsDir, &dwSZSIZE); + + CHAR sPath[_MAX_PATH] = ""; + DWORD dwSZSIZE = sizeof(sPath); + RegQueryValueEx(key, "Songs_Directory", NULL, &dwREG_SZ, (LPBYTE)sPath, &dwSZSIZE); + SetDefaultDirectory(sPath, DIR_MODS); + dwSZSIZE = sizeof(sPath); + RegQueryValueEx(key, "Samples_Directory", NULL, &dwREG_SZ, (LPBYTE)sPath, &dwSZSIZE); + SetDefaultDirectory(sPath, DIR_SAMPLES); + dwSZSIZE = sizeof(sPath); + RegQueryValueEx(key, "Instruments_Directory", NULL, &dwREG_SZ, (LPBYTE)sPath, &dwSZSIZE); + SetDefaultDirectory(sPath, DIR_INSTRUMENTS); + dwSZSIZE = sizeof(sPath); + RegQueryValueEx(key, "Plugins_Directory", NULL, &dwREG_SZ, (LPBYTE)sPath, &dwSZSIZE); + SetDefaultDirectory(sPath, DIR_PLUGINS); dwSZSIZE = sizeof(m_szKbdFile); RegQueryValueEx(key, "Key_Config_File", NULL, &dwREG_SZ, (LPBYTE)m_szKbdFile, &dwSZSIZE); + RegQueryValueEx(key, "XBassDepth", NULL, &dwREG_DWORD, (LPBYTE)&CSoundFile::m_nXBassDepth, &dwDWORDSize); RegQueryValueEx(key, "XBassRange", NULL, &dwREG_DWORD, (LPBYTE)&CSoundFile::m_nXBassRange, &dwDWORDSize); RegQueryValueEx(key, "ReverbDepth", NULL, &dwREG_DWORD, (LPBYTE)&CSoundFile::m_nReverbDepth, &dwDWORDSize); @@ -658,11 +675,12 @@ } } // Default directory location - strcpy(m_szCurModDir, m_szModDir); - strcpy(m_szCurSmpDir, m_szSmpDir); - strcpy(m_szCurInsDir, m_szInsDir); -// strcpy(m_szCurKbdFile, m_szKbdFile); //rewbs.customKeys - if (m_szModDir[0]) SetCurrentDirectory(m_szModDir); + for(UINT i = 0; i < NUM_DIRS; i++) + { + _tcscpy(m_szWorkingDirectory[i], m_szDefaultDirectory[i]); + } + if (m_szDefaultDirectory[DIR_MODS][0]) SetCurrentDirectory(m_szDefaultDirectory[DIR_MODS]); + // Create Audio Thread m_hAudioWakeUp = CreateEvent(NULL, FALSE, FALSE, NULL); m_hNotifyWakeUp = CreateEvent(NULL, FALSE, FALSE, NULL); @@ -948,10 +966,12 @@ WritePrivateProfileDWord("Pattern Editor", "Record", gbPatternRecord, iniFile); WritePrivateProfileDWord("Pattern Editor", "AutoChordWaitTime", gnAutoChordWaitTime, iniFile); - WritePrivateProfileString("Paths", "Songs_Directory", m_szModDir, iniFile); - WritePrivateProfileString("Paths", "Samples_Directory", m_szSmpDir, iniFile); - WritePrivateProfileString("Paths", "Instruments_Directory", m_szInsDir, iniFile); - WritePrivateProfileString("Paths", "Plugins_Directory", m_szPluginsDir, iniFile); + WritePrivateProfileString("Paths", "Songs_Directory", GetDefaultDirectory(DIR_MODS), iniFile); + WritePrivateProfileString("Paths", "Samples_Directory", GetDefaultDirectory(DIR_SAMPLES), iniFile); + WritePrivateProfileString("Paths", "Instruments_Directory", GetDefaultDirectory(DIR_INSTRUMENTS), iniFile); + WritePrivateProfileString("Paths", "Plugins_Directory", GetDefaultDirectory(DIR_PLUGINS), iniFile); + WritePrivateProfileString("Paths", "Plugin_Presets_Directory", GetDefaultDirectory(DIR_PLUGINPRESETS), iniFile); + WritePrivateProfileString("Paths", "Export_Directory", GetDefaultDirectory(DIR_EXPORT), iniFile); WritePrivateProfileString("Paths", "Key_Config_File", m_szKbdFile, iniFile); WritePrivateProfileLong("Effects", "XBassDepth", CSoundFile::m_nXBassDepth, iniFile); @@ -2179,15 +2199,16 @@ } -BOOL CMainFrame::SetupDirectories(LPCSTR songs, LPCSTR samples, LPCSTR instr) +BOOL CMainFrame::SetupDirectories(LPCTSTR szModDir, LPCTSTR szSampleDir, LPCTSTR szInstrDir, LPCTSTR szVstDir, LPCTSTR szPresetDir) //--------------------------------------------------------------------------- { - strcpy(m_szModDir, songs); - strcpy(m_szSmpDir, samples); - strcpy(m_szInsDir, instr); - if (songs[0]) strcpy(m_szCurModDir, songs); - if (samples[0]) strcpy(m_szCurSmpDir, samples); - if (instr[0]) strcpy(m_szCurInsDir, instr); + // will also set working directory + SetDefaultDirectory(szModDir, DIR_MODS); + SetDefaultDirectory(szSampleDir, DIR_SAMPLES); + SetDefaultDirectory(szInstrDir, DIR_INSTRUMENTS); + SetDefaultDirectory(szVstDir, DIR_PLUGINS); + SetDefaultDirectory(szPresetDir, DIR_PLUGINPRESETS); + // This shouldn't be here (misc options) m_wndToolBar.EnableFlatButtons(m_dwPatternSetup & PATTERN_FLATBUTTONS); UpdateAllViews(HINT_MPTOPTIONS, NULL); @@ -3003,3 +3024,56 @@ CBox.SetItemData(CBox.AddString(s), i); } } + + +// retrieve / set default directory from given string and store it our setup variables +// TODO: Let some magic happen to convert between absolute and relative paths. m_csExecutableDirectoryPath might be helpful + +void CMainFrame::SetDirectory(const LPCTSTR szFilenameFrom, Directory dir, TCHAR (&directories)[NUM_DIRS][_MAX_PATH], bool bStripFilename) +//---------------------------------------------------------------------------- +{ + TCHAR szPath[_MAX_PATH], szDir[_MAX_DIR]; + + if(bStripFilename) + { + _tsplitpath(szFilenameFrom, szPath, szDir, 0, 0); + _tcscat(szPath, szDir); + } + else + { + _tcscpy(szPath, szFilenameFrom); + } + + _tcscpy(directories[dir], szPath); + + // When updating default directory, also update the working directory. + if(szPath[0] && directories == m_szDefaultDirectory) + SetWorkingDirectory(szPath, dir); +} + +void CMainFrame::SetDefaultDirectory(const LPCTSTR szFilenameFrom, Directory dir, bool bStripFilename) +//---------------------------------------------------------------------------- +{ + SetDirectory(szFilenameFrom, dir, m_szDefaultDirectory, bStripFilename); +} + + +void CMainFrame::SetWorkingDirectory(const LPCTSTR szFilenameFrom, Directory dir, bool bStripFilename) +//---------------------------------------------------------------------------- +{ + SetDirectory(szFilenameFrom, dir, m_szWorkingDirectory, bStripFilename); +} + + +LPCTSTR CMainFrame::GetDefaultDirectory(Directory dir) +//---------------------------------------------------------------------------- +{ + return m_szDefaultDirectory[dir]; +} + + +LPCTSTR CMainFrame::GetWorkingDirectory(Directory dir) +//---------------------------------------------------------------------------- +{ + return m_szWorkingDirectory[dir]; +} Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2009-07-05 21:01:58 UTC (rev 280) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2009-07-06 15:27:09 UTC (rev 281) @@ -340,6 +340,22 @@ ///////////////////////////////////////////////////////////////////////// +// Default directories + +enum Directory +{ + DIR_MODS = 0, + DIR_SAMPLES, + DIR_INSTRUMENTS, + DIR_PLUGINS, + DIR_PLUGINPRESETS, + DIR_EXPORT, + NUM_DIRS +}; + + + +///////////////////////////////////////////////////////////////////////// // Misc. Macros @@ -400,9 +416,8 @@ static COLORREF rgbCustomColors[MAX_MODCOLORS]; static LPMODPLUGDIB bmpPatterns, bmpNotes, bmpVUMeters, bmpVisNode; static HPEN gpenVuMeter[NUM_VUMETER_PENS*2]; - // Arrays - static CHAR m_szModDir[_MAX_PATH], m_szSmpDir[_MAX_PATH], m_szInsDir[_MAX_PATH], m_szKbdFile[_MAX_PATH]; - static CHAR m_szCurModDir[_MAX_PATH], m_szCurSmpDir[_MAX_PATH], m_szCurInsDir[_MAX_PATH], m_szCurKbdDir[_MAX_PATH]; + // key config + static TCHAR m_szKbdFile[_MAX_PATH]; // Low-Level Audio public: @@ -452,8 +467,6 @@ // Notification Buffer MPTNOTIFICATION NotifyBuffer[MAX_UPDATE_HISTORY]; // Misc - CHAR m_szPluginsDir[_MAX_PATH]; - CHAR m_szExportDir[_MAX_PATH]; bool m_bOptionsLocked; //rewbs.customKeys double m_dTotalCPU; CModDoc* m_pJustModifiedDoc; @@ -480,10 +493,6 @@ BOOL dsoundFillBuffers(LPBYTE lpBuf, DWORD dwSize); BOOL DSoundDone(LPBYTE lpBuffer, DWORD dwBytes); BOOL DoNotification(DWORD dwSamplesRead, DWORD dwLatency); - LPCSTR GetPluginsDir() const { return m_szPluginsDir; } - VOID SetPluginsDir(LPCSTR pszDir) { lstrcpyn(m_szPluginsDir, pszDir, sizeof(m_szPluginsDir)); } - LPCSTR GetExportDir() const { return m_szExportDir; } - VOID SetExportDir(LPCSTR pszDir) { lstrcpyn(m_szExportDir, pszDir, sizeof(m_szExportDir)); } // Midi Input Functions public: @@ -517,7 +526,7 @@ static CString GetPrivateProfileCString(const CString section, const CString key, const CString defaultValue, const CString iniFile); -// Misc functions + // Misc functions public: VOID SetUserText(LPCSTR lpszText); VOID SetInfoText(LPCSTR lpszText); @@ -561,7 +570,7 @@ BOOL StopRenderer(CSoundFile*); //rewbs.VSTTimeInfo void SwitchToActiveView(); BOOL SetupSoundCard(DWORD q, DWORD rate, UINT nbits, UINT chns, UINT bufsize, LONG wd); - BOOL SetupDirectories(LPCSTR s, LPCSTR s2, LPCSTR s3); + BOOL SetupDirectories(LPCTSTR szModDir, LPCTSTR szSampleDir, LPCTSTR szInstrDir, LPCTSTR szVstDir, LPCTSTR szPresetDir); BOOL SetupPlayer(DWORD, DWORD, BOOL bForceUpdate=FALSE); BOOL SetupMidi(DWORD d, LONG n); void SetPreAmp(UINT n); @@ -570,6 +579,19 @@ BOOL ResetNotificationBuffer(HWND hwnd=NULL); +public: + // access to default + working directories + static void SetWorkingDirectory(const LPCTSTR szFilenameFrom, Directory dir, bool bStripFilename = false); + static LPCTSTR GetWorkingDirectory(Directory dir); + static void SetDefaultDirectory(const LPCTSTR szFilenameFrom, Directory dir, bool bStripFilename = false); + static LPCTSTR GetDefaultDirectory(Directory dir); +protected: + static void SetDirectory(const LPCTSTR szFilenameFrom, Directory dir, TCHAR (&pDirs)[NUM_DIRS][_MAX_PATH], bool bStripFilename); + // Directory Arrays (default dir + last dir) + static TCHAR m_szDefaultDirectory[NUM_DIRS][_MAX_PATH]; + static TCHAR m_szWorkingDirectory[NUM_DIRS][_MAX_PATH]; + + // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMainFrame) Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2009-07-05 21:01:58 UTC (rev 280) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2009-07-06 15:27:09 UTC (rev 281) @@ -550,15 +550,15 @@ OFN_HIDEREADONLY| OFN_ENABLESIZING | OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST | OFN_NOREADONLYRETURN, lpszFilter, theApp.m_pMainWnd); - if (CMainFrame::m_szCurModDir[0]) - { - dlg.m_ofn.lpstrInitialDir = CMainFrame::m_szCurModDir; - } + + const LPCTSTR pszWdir = CMainFrame::GetWorkingDirectory(DIR_MODS); + if(pszWdir[0]) + dlg.m_ofn.lpstrInitialDir = pszWdir; + if (dlg.DoModal() != IDOK) return FALSE; strcpy(s, dlg.GetPathName()); + CMainFrame::SetWorkingDirectory(s, DIR_MODS, true); _splitpath(s, drive, path, fname, fext); - strcpy(CMainFrame::m_szCurModDir, drive); - strcat(CMainFrame::m_szCurModDir, path); } else { _splitpath(lpszPathName, drive, path, fname, NULL); @@ -1374,15 +1374,15 @@ CFileDialog dlg(FALSE, "wav", s, OFN_HIDEREADONLY | OFN_ENABLESIZING | OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST | OFN_NOREADONLYRETURN, "Wave Files (*.wav)|*.wav||", pMainFrm); - dlg.m_ofn.lpstrInitialDir = pMainFrm->GetExportDir(); + dlg.m_ofn.lpstrInitialDir = CMainFrame::GetWorkingDirectory(DIR_EXPORT); CWaveConvert wsdlg(pMainFrm); if (wsdlg.DoModal() != IDOK) return; if (dlg.DoModal() != IDOK) return; //rewbs: made filename dialog appear after wav settings dialog - s[0] = 0; - _splitpath(dlg.GetPathName(), s, path, NULL, NULL); - strcat(s, path); - pMainFrm->SetExportDir(s); + + // will set default dir here because there's no setup option for export dir yet (feel free to add one...) + pMainFrm->SetDefaultDirectory(dlg.GetPathName(), DIR_EXPORT, true); + strcpy(s, dlg.GetPathName()); // Saving as wave file @@ -1505,16 +1505,17 @@ OFN_HIDEREADONLY | OFN_ENABLESIZING | OFN_OVERWRITEPROMPT | OFN_PATHMUSTEXIST | OFN_NOREADONLYRETURN, "MPEG Layer III Files (*.mp3)|*.mp3|Layer3 Wave Files (*.wav)|*.wav||", pMainFrm); dlg.m_ofn.nFilterIndex = 0; - dlg.m_ofn.lpstrInitialDir = pMainFrm->GetExportDir(); + + dlg.m_ofn.lpstrInitialDir = CMainFrame::GetWorkingDirectory(DIR_EXPORT); + if (dlg.DoModal() == IDOK) { MPEGLAYER3WAVEFORMAT wfx; HACMDRIVERID hadid; - s[0] = 0; - _splitpath(dlg.GetPathName(), s, path, NULL, NULL); - strcat(s, path); - pMainFrm->SetExportDir(s); + // will set default dir here because there's no setup option for export dir yet (feel free to add one...) + pMainFrm->SetDefaultDirectory(dlg.GetPathName(), DIR_EXPORT, true); + strcpy(s, dlg.GetPathName()); _splitpath(s, NULL, NULL, NULL, fext); if (strlen(fext) <= 1) Modified: trunk/OpenMPT/mptrack/Moptions.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moptions.cpp 2009-07-05 21:01:58 UTC (rev 280) +++ trunk/OpenMPT/mptrack/Moptions.cpp 2009-07-06 15:27:09 UTC (rev 281) @@ -556,14 +556,17 @@ // COptionsGeneral BEGIN_MESSAGE_MAP(COptionsGeneral, CPropertyPage) - ON_EN_CHANGE(IDC_EDIT1, OnSettingsChanged) - ON_EN_CHANGE(IDC_EDIT2, OnSettingsChanged) - ON_EN_CHANGE(IDC_EDIT3, OnSettingsChanged) - ON_LBN_SELCHANGE(IDC_LIST1, OnOptionSelChanged) - ON_COMMAND(IDC_BUTTON1, OnBrowseSongs) - ON_COMMAND(IDC_BUTTON2, OnBrowseSamples) - ON_COMMAND(IDC_BUTTON3, OnBrowseInstruments) - ON_CLBN_CHKCHANGE(IDC_LIST1, OnSettingsChanged) + ON_EN_CHANGE(IDC_OPTIONS_DIR_MODS, OnSettingsChanged) + ON_EN_CHANGE(IDC_OPTIONS_DIR_SAMPS, OnSettingsChanged) + ON_EN_CHANGE(IDC_OPTIONS_DIR_INSTS, OnSettingsChanged) + ON_EN_CHANGE(IDC_OPTIONS_DIR_VSTPRESETS, OnSettingsChanged) + ON_LBN_SELCHANGE(IDC_LIST1, OnOptionSelChanged) + ON_COMMAND(IDC_BUTTON_CHANGE_MODDIR, OnBrowseSongs) + ON_COMMAND(IDC_BUTTON_CHANGE_SAMPDIR, OnBrowseSamples) + ON_COMMAND(IDC_BUTTON_CHANGE_INSTRDIR, OnBrowseInstruments) + ON_COMMAND(IDC_BUTTON_CHANGE_VSTDIR, OnBrowsePlugins) + ON_COMMAND(IDC_BUTTON_CHANGE_VSTPRESETSDIR, OnBrowsePresets) + ON_CLBN_CHKCHANGE(IDC_LIST1, OnSettingsChanged) END_MESSAGE_MAP() typedef struct OPTGENDESC @@ -711,9 +714,13 @@ } m_CheckList.SetCurSel(0); OnOptionSelChanged(); - SetDlgItemText(IDC_EDIT1, CMainFrame::m_szModDir); - SetDlgItemText(IDC_EDIT2, CMainFrame::m_szSmpDir); - SetDlgItemText(IDC_EDIT3, CMainFrame::m_szInsDir); + + SetDlgItemText(IDC_OPTIONS_DIR_MODS, CMainFrame::GetDefaultDirectory(DIR_MODS)); + SetDlgItemText(IDC_OPTIONS_DIR_SAMPS, CMainFrame::GetDefaultDirectory(DIR_SAMPLES)); + SetDlgItemText(IDC_OPTIONS_DIR_INSTS, CMainFrame::GetDefaultDirectory(DIR_INSTRUMENTS)); + SetDlgItemText(IDC_OPTIONS_DIR_VSTS, CMainFrame::GetDefaultDirectory(DIR_PLUGINS)); + SetDlgItemText(IDC_OPTIONS_DIR_VSTPRESETS, CMainFrame::GetDefaultDirectory(DIR_PLUGINPRESETS)); + return TRUE; } @@ -721,12 +728,16 @@ void COptionsGeneral::OnOK() //-------------------------- { - CHAR szModDir[_MAX_DIR], szSmpDir[_MAX_PATH], szInsDir[_MAX_PATH]; - szModDir[0] = szInsDir[0] = szSmpDir[0] = 0; - GetDlgItemText(IDC_EDIT1, szModDir, _MAX_PATH); - GetDlgItemText(IDC_EDIT2, szSmpDir, _MAX_PATH); - GetDlgItemText(IDC_EDIT3, szInsDir, _MAX_PATH); - for (UINT i=0; i<OPTGEN_MAXOPTIONS; i++) + // Default paths + TCHAR szModDir[_MAX_PATH], szSmpDir[_MAX_PATH], szInsDir[_MAX_PATH], szVstDir[_MAX_PATH], szPresetDir[_MAX_PATH]; + szModDir[0] = szInsDir[0] = szSmpDir[0] = szVstDir[0] = szPresetDir[0] = 0; + GetDlgItemText(IDC_OPTIONS_DIR_MODS, szModDir, _MAX_PATH); + GetDlgItemText(IDC_OPTIONS_DIR_SAMPS, szSmpDir, _MAX_PATH); + GetDlgItemText(IDC_OPTIONS_DIR_INSTS, szInsDir, _MAX_PATH); + GetDlgItemText(IDC_OPTIONS_DIR_VSTS, szVstDir, _MAX_PATH); + GetDlgItemText(IDC_OPTIONS_DIR_VSTPRESETS, szPresetDir, _MAX_PATH); + + for (UINT i=0; i < OPTGEN_MAXOPTIONS; i++) { DWORD mask = 0; BOOL bCheck = m_CheckList.GetCheck(i); @@ -774,7 +785,7 @@ CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); if (pMainFrm) { - pMainFrm->SetupDirectories(szModDir, szSmpDir, szInsDir); + pMainFrm->SetupDirectories(szModDir, szSmpDir, szInsDir, szVstDir, szPresetDir); pMainFrm->UpdateTree(NULL, HINT_MPTOPTIONS); } CPropertyPage::OnOK(); Modified: trunk/OpenMPT/mptrack/Moptions.h =================================================================== --- trunk/OpenMPT/mptrack/Moptions.h 2009-07-05 21:01:58 UTC (rev 280) +++ trunk/OpenMPT/mptrack/Moptions.h 2009-07-06 15:27:09 UTC (rev 281) @@ -35,9 +35,11 @@ virtual void DoDataExchange(CDataExchange* pDX); afx_msg void OnOptionSelChanged(); afx_msg void OnSettingsChanged() { SetModified(TRUE); } - afx_msg void OnBrowseSongs() { BrowseForFolder(IDC_EDIT1); } - afx_msg void OnBrowseSamples() { BrowseForFolder(IDC_EDIT2); } - afx_msg void OnBrowseInstruments() { BrowseForFolder(IDC_EDIT3); } + afx_msg void OnBrowseSongs() { BrowseForFolder(IDC_OPTIONS_DIR_MODS); } + afx_msg void OnBrowseSamples() { BrowseForFolder(IDC_OPTIONS_DIR_SAMPS); } + afx_msg void OnBrowseInstruments() { BrowseForFolder(IDC_OPTIONS_DIR_INSTS); } + afx_msg void OnBrowsePlugins() { BrowseForFolder(IDC_OPTIONS_DIR_VSTS); } + afx_msg void OnBrowsePresets() { BrowseForFolder(IDC_OPTIONS_DIR_VSTPRESETS); } //rewbs.customkeys: COptionsKeyboard moved to separate file DECLARE_MESSAGE_MAP(); Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2009-07-05 21:01:58 UTC (rev 280) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2009-07-06 15:27:09 UTC (rev 281) @@ -1277,10 +1277,11 @@ "All Files (*.*)|*.*||", NULL); dlg.m_ofn.nFilterIndex = CMainFrame::m_nFilterIndex; - if (CMainFrame::m_szCurModDir[0]) - { - dlg.m_ofn.lpstrInitialDir = CMainFrame::m_szCurModDir; - } + + const LPCTSTR pszWdir = CMainFrame::GetWorkingDirectory(DIR_MODS); + if(pszWdir[0]) + dlg.m_ofn.lpstrInitialDir = pszWdir; + const size_t bufferSize = 2048; //Note: This is possibly the maximum buffer size in MFC 7(this note was written November 2006). vector<char> filenameBuffer(bufferSize, 0); dlg.GetOFN().lpstrFile = &filenameBuffer[0]; @@ -1290,11 +1291,8 @@ POSITION pos = dlg.GetStartPosition(); while(pos != NULL) { - CHAR szDrive[_MAX_PATH], szDir[_MAX_PATH]; CString pathName = dlg.GetNextPathName(pos); - _splitpath(pathName, szDrive, szDir, NULL, NULL); - strcpy(CMainFrame::m_szCurModDir, szDrive); - strcat(CMainFrame::m_szCurModDir, szDir); + CMainFrame::SetWorkingDirectory(pathName, DIR_MODS, true); CMainFrame::m_nFilterIndex = dlg.m_ofn.nFilterIndex; OpenDocumentFile(pathName); } Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2009-07-05 21:01:58 UTC (rev 280) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2009-07-06 15:27:09 UTC (rev 281) @@ -150,7 +150,7 @@ m_dwStatus |= TREESTATUS_SINGLEEXPAND; } ModifyStyle(dwRemove, dwAdd); - strcpy(m_szInstrLibPath, CMainFrame::m_szSmpDir); + strcpy(m_szInstrLibPath, CMainFrame::GetDefaultDirectory(DIR_SAMPLES)); SetImageList(CMainFrame::GetMainFrame()->GetImageList(), TVSIL_NORMAL); if (m_pDataTree) { @@ -1705,7 +1705,8 @@ if (!GetCurrentDirectory(sizeof(s), s)) s[0] = 0; if (!strcmp(lpszDir+1, ":\\")) { - strcpy(sdrive, lpszDir); + sdrive[0] = lpszDir[0]; + sdrive[1] = lpszDir[1]; sdrive[2] = 0; lpszDir = sdrive; } Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2009-07-05 21:01:58 UTC (rev 280) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2009-07-06 15:27:09 UTC (rev 281) @@ -1376,15 +1376,11 @@ OFN_FILEMUSTEXIST|OFN_ENABLESIZING |OFN_HIDEREADONLY|OFN_PATHMUSTEXIST|OFN_FORCESHOWHIDDEN|OFN_ALLOWMULTISELECT, "VST Plugins (*.dll)|*.dll||", this); - CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); - if (pMainFrm) - { - LPCSTR pszDir = pMainFrm->GetPluginsDir(); - if (pszDir[0]) - { - dlg.m_ofn.lpstrInitialDir = pszDir; - } - } + + const LPCTSTR pszWdir = CMainFrame::GetWorkingDirectory(DIR_PLUGINS); + if(pszWdir[0]) + dlg.m_ofn.lpstrInitialDir = pszWdir; + pszFileNames = new CHAR[MAX_FILEOPEN_BUFSIZE]; if (!pszFileNames) return; pszFileNames[0] = 0; @@ -1393,7 +1389,6 @@ dlg.m_ofn.nMaxFile = MAX_FILEOPEN_BUFSIZE; if (dlg.DoModal() == IDOK) { - CHAR s[_MAX_PATH], sdir[_MAX_PATH]; CVstPluginManager *pManager = theApp.GetPluginManager(); pszFileNames[MAX_FILEOPEN_BUFSIZE-1] = 0; POSITION pos = dlg.GetStartPosition(); @@ -1403,16 +1398,14 @@ PVSTPLUGINLIB plugLib = NULL; while (pos != NULL) { - CString str = dlg.GetNextPathName(pos); + CString sFilename = dlg.GetNextPathName(pos); if (!n) { - _splitpath(str, s, sdir, NULL, NULL); - strcat(s, sdir); - if (pMainFrm) pMainFrm->SetPluginsDir(s); + CMainFrame::SetWorkingDirectory(sFilename, DIR_PLUGINS, true); } n++; if (pManager) { - plugLib = pManager->AddPlugin(str, FALSE); + plugLib = pManager->AddPlugin(sFilename, FALSE); if (plugLib) { bOk = TRUE; } Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2009-07-05 21:01:58 UTC (rev 280) +++ trunk/OpenMPT/mptrack/mptrack.rc 2009-07-06 15:27:09 UTC (rev 281) @@ -762,7 +762,7 @@ CTEXT "Length: 000000 (16-bit)",IDC_TEXT5,175,6,90,13, SS_CENTERIMAGE,WS_EX_STATICEDGE CONTROL "Toolbar2",IDC_TOOLBAR2,"ToolbarWindow32",WS_GROUP | - 0x4d,268,4,195,17 + 0x4d,268,4,186,17 GROUPBOX "",IDC_STATIC,3,22,94,78 LTEXT "Default Volume",IDC_STATIC,8,32,49,8 LTEXT "Global Volume",IDC_STATIC,8,45,46,8 @@ -1416,21 +1416,35 @@ CAPTION "General" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - GROUPBOX "Directories",IDC_STATIC,5,5,261,67 - LTEXT "Songs:",IDC_STATIC,15,20,36,12,SS_CENTERIMAGE - EDITTEXT IDC_EDIT1,59,20,174,12,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_BUTTON1,240,20,12,11,NOT WS_TABSTOP - LTEXT "Samples:",IDC_STATIC,15,37,41,12,SS_CENTERIMAGE - EDITTEXT IDC_EDIT2,59,37,174,12,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_BUTTON2,240,36,12,11,NOT WS_TABSTOP - LTEXT "Instruments:",IDC_STATIC,15,53,40,12,SS_CENTERIMAGE - EDITTEXT IDC_EDIT3,59,53,174,12,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_BUTTON3,240,54,12,11,NOT WS_TABSTOP - GROUPBOX "Options",IDC_STATIC,4,75,261,200 - LTEXT "Description",IDC_TEXT1,144,86,111,175 - LISTBOX IDC_LIST1,9,86,129,181,LBS_OWNERDRAWFIXED | + GROUPBOX "Default Directories",IDC_STATIC,6,6,261,102 + RTEXT "Songs:",IDC_STATIC_MODDIR,12,18,48,12,SS_CENTERIMAGE + EDITTEXT IDC_OPTIONS_DIR_MODS,66,18,174,12,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_BUTTON_CHANGE_MODDIR,246,18,12,11,NOT + WS_TABSTOP + RTEXT "Samples:",IDC_STATIC_SAMPDIR,12,36,48,12,SS_CENTERIMAGE + EDITTEXT IDC_OPTIONS_DIR_SAMPS,66,36,174,12,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_BUTTON_CHANGE_SAMPDIR,246,36,12,11,NOT + WS_TABSTOP + RTEXT "Instruments:",IDC_STATIC_INSTRDIR,12,54,48,12, + SS_CENTERIMAGE + EDITTEXT IDC_OPTIONS_DIR_INSTS,66,54,174,12,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_BUTTON_CHANGE_INSTRDIR,246,54,12,11,NOT + WS_TABSTOP + GROUPBOX "Options",IDC_STATIC,4,114,261,161 + LTEXT "Description",IDC_TEXT1,144,126,111,138 + LISTBOX IDC_LIST1,9,126,129,141,LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP + RTEXT "VST Plugins:",IDC_STATIC_VSTDIR,12,72,48,12, + SS_CENTERIMAGE + EDITTEXT IDC_OPTIONS_DIR_VSTS,66,72,174,12,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_BUTTON_CHANGE_VSTDIR,246,72,12,11,NOT + WS_TABSTOP + RTEXT "VST Presets:",IDC_STATIC_VSTPRESETDIR,12,90,48,12, + SS_CENTERIMAGE + EDITTEXT IDC_OPTIONS_DIR_VSTPRESETS,66,90,174,12,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_BUTTON_CHANGE_VSTPRESETSDIR,246,90,12,11,NOT + WS_TABSTOP END IDD_OPTIONS_SOUNDCARD DIALOGEX 0, 0, 272, 276 @@ -1438,7 +1452,6 @@ CAPTION "Sound Card" FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - GROUPBOX "",IDC_STATIC,5,5,232,170 LTEXT "Sound Device:",IDC_STATIC,11,14,79,8 CONTROL "",IDC_COMBO1,"ComboBoxEx32",CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP,11,25,219,96 @@ -1472,6 +1485,7 @@ WS_TABSTOP,133,92,64,10 LTEXT "Note: The Pre-Amp and Soft Panning settings are ignored by songs with mix levels set to 1.17RC3 or later in Song Properties.", IDC_STATIC,17,152,204,18 + GROUPBOX "",IDC_STATIC,5,5,232,170 END IDD_MIDIMACRO DIALOGEX 0, 0, 349, 345 @@ -1930,24 +1944,24 @@ LTEXT "around current",IDC_STATIC,156,84,49,8 END -IDD_ADDSILENCE DIALOGEX 0, 0, 175, 63 +IDD_ADDSILENCE DIALOGEX 0, 0, 175, 71 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Insert Silence" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - DEFPUSHBUTTON "OK",IDOK,118,7,50,14 - PUSHBUTTON "Cancel",IDCANCEL,118,25,50,14 - GROUPBOX "",IDC_STATIC,7,3,106,55 - EDITTEXT IDC_EDIT1,25,14,40,14,ES_AUTOHSCROLL | ES_NUMBER + DEFPUSHBUTTON "OK",IDOK,120,12,50,14 + PUSHBUTTON "Cancel",IDCANCEL,120,30,50,14 + GROUPBOX "",IDC_STATIC,6,6,108,60 + EDITTEXT IDC_EDIT1,12,18,40,14,ES_AUTOHSCROLL | ES_NUMBER CONTROL "",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | - UDS_NOTHOUSANDS,57,15,11,14 - LTEXT "samples",IDC_STATIC,74,17,26,8 + UDS_NOTHOUSANDS,44,18,11,14 + LTEXT "samples",IDC_STATIC,59,21,35,8 CONTROL "At beginning of sample",IDC_RADIO1,"Button", - BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,11,32,89,10 + BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,12,36,97,10 CONTROL "At end of sample",IDC_RADIO2,"Button", - BS_AUTORADIOBUTTON | WS_TABSTOP,11,46,70,10 + BS_AUTORADIOBUTTON | WS_TABSTOP,12,48,97,10 END IDD_PATTERNRANDOMIZER_EFFECT DIALOGEX 0, 0, 235, 172 @@ -2239,7 +2253,7 @@ LEFTMARGIN, 7 RIGHTMARGIN, 168 TOPMARGIN, 7 - BOTTOMMARGIN, 56 + BOTTOMMARGIN, 64 END END Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2009-07-05 21:01:58 UTC (rev 280) +++ trunk/OpenMPT/mptrack/resource.h 2009-07-06 15:27:09 UTC (rev 281) @@ -830,6 +830,24 @@ #define IDC_DONTSHOWAGAIN 2341 #define IDC_MESSAGETEXT 2342 #define IDC_SAMPLE_DCOFFSET 2343 +#define IDC_OPTIONS_DIR_MODS 2344 +#define IDC_OPTIONS_DIR_SAMPS 2345 +#define IDC_OPTIONS_DIR_INSTS 2346 +#define IDC_OPTIONS_DIR_VSTS 2347 +#define IDC_STATIC_MODDIR 2348 +#define IDC_STATIC_SAMPDIR 2349 +#define IDC_STATIC_INSTRDIR 2350 +#define IDC_STATIC_VSTDIR 2351 +#define IDC_BUTTON_CHANGE_MODDIR 2352 +#define IDC_BUTTON_CHANGE_SAMPDIR 2353 +#define IDC_BUTTON_CHANGE_INSTRDIR 2354 +#define IDC_BUTTON_CHANGE_VSTDIR 2355 +#define IDC_STATIC_AUTOSAVE_OPTIONS 2356 +#define IDC_STATIC_AUTOSAVE_LOCATION 2357 +#define IDC_OPTIONS_DIR_VSTPRESETS 2357 +#define IDC_BUTTON_CHANGE_VSTDIR2 2358 +#define IDC_BUTTON_CHANGE_VSTPRESETSDIR 2358 +#define IDC_STATIC_VSTPRESETDIR 2359 #define ID_FILE_NEWMOD 32771 #define ID_FILE_NEWXM 32772 #define ID_FILE_NEWS3M 32773 @@ -1067,7 +1085,7 @@ #define _APS_3D_CONTROLS 1 #define _APS_NEXT_RESOURCE_VALUE 518 #define _APS_NEXT_COMMAND_VALUE 59226 -#define _APS_NEXT_CONTROL_VALUE 2344 +#define _APS_NEXT_CONTROL_VALUE 2360 #define _APS_NEXT_SYMED_VALUE 901 #endif #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |