From: <sag...@us...> - 2011-09-18 20:27:11
|
Revision: 1041 http://modplug.svn.sourceforge.net/modplug/?rev=1041&view=rev Author: saga-games Date: 2011-09-18 20:27:04 +0000 (Sun, 18 Sep 2011) Log Message: ----------- [Imp] Buttons in the Plugin Manager have mnemonic shortcuts now (http://bugs.openmpt.org/view.php?id=186). [Imp] Treeview: If available, drum keys use key names provided by the sounddfont instead of pre-defined drum key names (experimental) [Fix] Comments tab: C5 frequency should be displayed correctly in all cases now. [Ref] Smaller refactoring here and there. [Mod] OpenMPT: Version is now 1.20.00.23 Modified Paths: -------------- trunk/OpenMPT/mptrack/CloseMainDialog.cpp trunk/OpenMPT/mptrack/CloseMainDialog.h trunk/OpenMPT/mptrack/SelectPluginDialog.cpp trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/View_ins.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/Vstplug.h trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/mptrack/view_com.cpp Modified: trunk/OpenMPT/mptrack/CloseMainDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/CloseMainDialog.cpp 2011-09-18 20:11:32 UTC (rev 1040) +++ trunk/OpenMPT/mptrack/CloseMainDialog.cpp 2011-09-18 20:27:04 UTC (rev 1041) @@ -46,8 +46,6 @@ { CDialog::OnInitDialog(); - CMainFrame::GetInputHandler()->Bypass(true); - // Create list of unsaved documents m_List.ResetContent(); @@ -104,8 +102,6 @@ } CDialog::OnOK(); - CMainFrame::GetInputHandler()->Bypass(false); - } @@ -113,7 +109,6 @@ //------------------------------ { CDialog::OnCancel(); - CMainFrame::GetInputHandler()->Bypass(false); } Modified: trunk/OpenMPT/mptrack/CloseMainDialog.h =================================================================== --- trunk/OpenMPT/mptrack/CloseMainDialog.h 2011-09-18 20:11:32 UTC (rev 1040) +++ trunk/OpenMPT/mptrack/CloseMainDialog.h 2011-09-18 20:27:04 UTC (rev 1041) @@ -21,9 +21,9 @@ CString FormatTitle(const CModDoc *pModDoc, bool fullPath); public: - CloseMainDialog() : CDialog(IDD_CLOSEDOCUMENTS) { }; + CloseMainDialog() : CDialog(IDD_CLOSEDOCUMENTS) { CMainFrame::GetInputHandler()->Bypass(true); }; + ~CloseMainDialog() { CMainFrame::GetInputHandler()->Bypass(false); }; - protected: virtual void DoDataExchange(CDataExchange* pDX); virtual BOOL OnInitDialog(); Modified: trunk/OpenMPT/mptrack/SelectPluginDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2011-09-18 20:11:32 UTC (rev 1040) +++ trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2011-09-18 20:27:04 UTC (rev 1041) @@ -68,12 +68,14 @@ m_treePlugins.ModifyStyle(dwRemove, dwAdd); m_treePlugins.SetImageList(CMainFrame::GetMainFrame()->GetImageList(), TVSIL_NORMAL); - if (m_pPlugin) { + if (m_pPlugin) + { CString targetSlot; - targetSlot.Format("Put in FX%02d", m_nPlugSlot+1); + targetSlot.Format("&Put in FX%02d", m_nPlugSlot + 1); SetDlgItemText(IDOK, targetSlot); ::EnableWindow(::GetDlgItem(m_hWnd, IDOK), TRUE); - } else { + } else + { ::EnableWindow(::GetDlgItem(m_hWnd, IDOK), FALSE); } Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2011-09-18 20:11:32 UTC (rev 1040) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2011-09-18 20:27:04 UTC (rev 1041) @@ -513,9 +513,9 @@ RegQueryValueEx(key, "MDIGraphHeight", NULL, &dwREG_DWORD, (LPBYTE)&glGraphWindowHeight, &dwDWORDSize); //rewbs.graph RegQueryValueEx(key, "MDITreeRatio", NULL, &dwREG_DWORD, (LPBYTE)&glTreeSplitRatio, &dwDWORDSize); // Colors - for (int ncol=0; ncol<MAX_MODCOLORS; ncol++) + for (int ncol = 0; ncol < MAX_MODCOLORS; ncol++) { - CHAR s[64]; + CHAR s[16]; wsprintf(s, "Color%02d", ncol); RegQueryValueEx(key, s, NULL, &dwREG_DWORD, (LPBYTE)&rgbCustomColors[ncol], &dwCRSIZE); } @@ -752,7 +752,7 @@ } // Obsolete, since we always write to Keybindings.mkb now. // Older versions of OpenMPT 1.18+ will look for this file if this entry is missing, so removing this entry after having read it is kind of backwards compatible. - WritePrivateProfileString("Paths", "Key_Config_File", NULL, iniFile); + WritePrivateProfileString("Paths", "Key_Config_File", nullptr, iniFile); CMainFrame::WritePrivateProfileLong("Effects", "XBassDepth", CSoundFile::m_nXBassDepth, iniFile); CMainFrame::WritePrivateProfileLong("Effects", "XBassRange", CSoundFile::m_nXBassRange, iniFile); @@ -822,7 +822,7 @@ _tcscpy(szPath, szFilenameFrom); } - TCHAR szOldDir[sizeof(directories[dir])]; // for comparison + TCHAR szOldDir[CountOf(directories[dir])]; // for comparison _tcscpy(szOldDir, directories[dir]); _tcscpy(directories[dir], szPath); Modified: trunk/OpenMPT/mptrack/View_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_ins.cpp 2011-09-18 20:11:32 UTC (rev 1040) +++ trunk/OpenMPT/mptrack/View_ins.cpp 2011-09-18 20:27:04 UTC (rev 1041) @@ -113,10 +113,10 @@ m_rcClient.bottom = 2; m_dwStatus = 0; m_nBtnMouseOver = 0xFFFF; - memset(m_dwNotifyPos, 0, sizeof(m_dwNotifyPos)); - memset(m_NcButtonState, 0, sizeof(m_NcButtonState)); + MemsetZero(m_dwNotifyPos); + MemsetZero(m_NcButtonState); m_bmpEnvBar.Create(IDB_ENVTOOLBAR, 20, 0, RGB(192,192,192)); - memset(m_baPlayingNote, 0, sizeof(bool)*NOTE_MAX); //rewbs.customKeys + MemsetZero(m_baPlayingNote); //rewbs.customKeys m_nPlayingChannel = CHANNELINDEX_INVALID; //rewbs.customKeys //rewbs.envRowGrid m_bGrid=true; Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2011-09-18 20:11:32 UTC (rev 1040) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2011-09-18 20:27:04 UTC (rev 1041) @@ -469,8 +469,8 @@ // Memorize Banks WORD wBanks[16]; HTREEITEM hBanks[16]; - memset(wBanks, 0, sizeof(wBanks)); - memset(hBanks, 0, sizeof(hBanks)); + MemsetZero(wBanks); + MemsetZero(hBanks); UINT nBanks = 0; // Add Drum Kits folder HTREEITEM hDrums = InsertItem(TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE, @@ -492,16 +492,25 @@ { UINT keymin = pDlsIns->Regions[iRgn].uKeyMin; UINT keymax = pDlsIns->Regions[iRgn].uKeyMax; + + const CHAR *regionName = pDlsBank->GetRegionName(iIns, iRgn); + if(regionName == nullptr && (keymin >= 24) && (keymin <= 84)) + { + regionName = szMidiPercussionNames[keymin - 24]; + } else + { + regionName = ""; + } + if (keymin >= keymax) { - wsprintf(szName, "%s%d: %s", szNoteNames[keymin%12], keymin/12, - ((keymin >= 24) && (keymin <= 84)) ? szMidiPercussionNames[keymin-24] : ""); + wsprintf(szName, "%s%d: %s", szNoteNames[keymin % 12], keymin / 12, regionName); } else { wsprintf(szName, "%s%d-%s%d: %s", - szNoteNames[keymin%12], keymin/12, - szNoteNames[keymax%12], keymax/12, - ((keymin >= 24) && (keymin <= 84)) ? szMidiPercussionNames[keymin-24] : ""); + szNoteNames[keymin % 12], keymin / 12, + szNoteNames[keymax % 12], keymax / 12, + regionName); } LPARAM lParam = 0x80000000|(iDls<<24)|(iRgn<<16)|iIns; InsertItem(TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM, Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2011-09-18 20:11:32 UTC (rev 1040) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2011-09-18 20:27:04 UTC (rev 1041) @@ -67,7 +67,7 @@ BOOL CVstPluginManager::CreateMixPluginProc(PSNDMIXPLUGIN pMixPlugin, CSoundFile* pSndFile) -//------------------------------------------------------------------------------------- +//----------------------------------------------------------------------------------------- { CVstPluginManager *that = theApp.GetPluginManager(); if (that) @@ -1554,9 +1554,11 @@ { if (!(--m_nRefCount)) { - try { + try + { delete this; - } catch (...) { + } catch (...) + { CVstPluginManager::ReportPlugException("Exception while destroying plugin!\n"); } @@ -2916,8 +2918,10 @@ else m_pMixStruct->Info.dwInputRouting &= ~MIXPLUG_INPUTF_BYPASS; +#ifdef MODPLUG_TRACKER if (m_pModDoc) m_pModDoc->UpdateAllViews(NULL, HINT_MIXPLUGINS, NULL); +#endif // MODPLUG_TRACKER return bypass; } @@ -2956,7 +2960,7 @@ void CVstPlugin::NotifySongPlaying(bool playing) //---------------------------------------------- { - m_bSongPlaying=playing; + m_bSongPlaying = playing; } @@ -2966,7 +2970,7 @@ UINT slot = 0; if (m_pSndFile) { - while ((m_pMixStruct != &(m_pSndFile->m_MixPlugins[slot])) && slot<MAX_MIXPLUGINS - 1) + while ((m_pMixStruct != &(m_pSndFile->m_MixPlugins[slot])) && slot < MAX_MIXPLUGINS - 1) { slot++; } @@ -3008,12 +3012,6 @@ return (CVstPlugin::Dispatch(effCanDo, 0, 0, (char*)(LPCTSTR)s, 0)) ? true : false; } -bool CVstPlugin::KeysRequired() -//----------------------------- -{ - return (CVstPlugin::Dispatch(effKeysRequired, 0, 0, NULL, 0) != 0); -} - void CVstPlugin::GetOutputPlugList(CArray<CVstPlugin*, CVstPlugin*> &list) //------------------------------------------------------------------------ { Modified: trunk/OpenMPT/mptrack/Vstplug.h =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.h 2011-09-18 20:11:32 UTC (rev 1040) +++ trunk/OpenMPT/mptrack/Vstplug.h 2011-09-18 20:27:04 UTC (rev 1041) @@ -158,7 +158,6 @@ bool isInstrument(); // ericus 18/02/2005 bool CanRecieveMidiEvents(); - bool KeysRequired(); void GetOutputPlugList(CArray<CVstPlugin*,CVstPlugin*> &list); void GetInputPlugList(CArray<CVstPlugin*,CVstPlugin*> &list); Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2011-09-18 20:11:32 UTC (rev 1040) +++ trunk/OpenMPT/mptrack/mptrack.rc 2011-09-18 20:27:04 UTC (rev 1041) @@ -1372,9 +1372,9 @@ EDITTEXT IDC_NAMEFILTER,30,6,150,14,ES_AUTOHSCROLL CONTROL "Tree1",IDC_TREE1,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_SHOWSELALWAYS | WS_HSCROLL | WS_TABSTOP,6,24,174,180,WS_EX_CLIENTEDGE DEFPUSHBUTTON "Add to Song",IDOK,187,6,53,14 - PUSHBUTTON "New plugin...",IDC_BUTTON1,188,23,52,14,BS_MULTILINE - PUSHBUTTON "Remove",IDC_BUTTON2,188,40,52,14 - PUSHBUTTON "Cancel",IDCANCEL,186,189,54,14 + PUSHBUTTON "&New plugin...",IDC_BUTTON1,188,23,52,14,BS_MULTILINE + PUSHBUTTON "&Remove",IDC_BUTTON2,188,40,52,14 + PUSHBUTTON "&Cancel",IDCANCEL,186,189,54,14 LTEXT "IDC_TEXT_CURRENT_VSTPLUG",IDC_TEXT_CURRENT_VSTPLUG,6,208,234,8 END Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-09-18 20:11:32 UTC (rev 1040) +++ trunk/OpenMPT/mptrack/version.h 2011-09-18 20:27:04 UTC (rev 1041) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 20 #define VER_MINOR 00 -#define VER_MINORMINOR 22 +#define VER_MINORMINOR 23 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/mptrack/view_com.cpp =================================================================== --- trunk/OpenMPT/mptrack/view_com.cpp 2011-09-18 20:11:32 UTC (rev 1040) +++ trunk/OpenMPT/mptrack/view_com.cpp 2011-09-18 20:27:04 UTC (rev 1041) @@ -202,7 +202,7 @@ UINT nCol = 0; for (UINT iSmp=0; iSmp<SMPLIST_COLUMNS; iSmp++) { - memset(&lvc, 0, sizeof(LV_COLUMN)); + MemsetZero(lvc); lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; lvc.fmt = (iSmp) ? LVCFMT_RIGHT : LVCFMT_LEFT; lvc.pszText = (LPSTR)gSampleHeaders[iSmp].pszName; @@ -218,7 +218,7 @@ UINT nCol = 0; for (UINT i=0; i<INSLIST_COLUMNS; i++) { - memset(&lvc, 0, sizeof(LV_COLUMN)); + MemsetZero(lvc); lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; lvc.fmt = (i) ? LVCFMT_RIGHT : LVCFMT_LEFT; lvc.pszText = (LPSTR)gInstrumentHeaders[i].pszName; @@ -299,15 +299,12 @@ case SMPLIST_MIDDLEC: if (sample.nLength) { - wsprintf(s, "%d Hz", - pSndFile->GetFreqFromPeriod( - pSndFile->GetPeriodFromNote(NOTE_MIDDLEC + sample.RelativeTone, sample.nFineTune, sample.nC5Speed), - sample.nC5Speed)); + wsprintf(s, "%d Hz", sample.GetSampleRate(pSndFile->GetType())); } break; case SMPLIST_FILENAME: memcpy(s, sample.filename, sizeof(sample.filename)); - s[sizeof(sample.filename)] = 0; + s[CountOf(sample.filename)] = 0; break; } lvi.mask = LVIF_TEXT; @@ -364,15 +361,14 @@ case INSLIST_SAMPLES: if (pIns) { - BYTE smp_tb[(MAX_SAMPLES+7)/8]; - memset(smp_tb, 0, sizeof(smp_tb)); + vector<bool> smpRef(MAX_SAMPLES, false); for (UINT i=0; i<NOTE_MAX; i++) { UINT n = pIns->Keyboard[i]; - if ((n) && (n < MAX_SAMPLES)) smp_tb[n>>3] |= (1<<(n&7)); + if ((n) && (n < MAX_SAMPLES)) smpRef[n] = true; } UINT k = 0; - for (UINT j=1; j<MAX_SAMPLES; j++) if (smp_tb[j>>3] & (1<<(j&7))) + for (UINT j=1; j<MAX_SAMPLES; j++) if (smpRef[j]) { if (k) strcat(s, ","); UINT l = strlen(s); @@ -398,7 +394,7 @@ if (pIns) { memcpy(s, pIns->filename, sizeof(pIns->filename)); - s[sizeof(pIns->filename)] = 0; + s[CountOf(pIns->filename)] = 0; } break; case INSLIST_PLUGIN: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |