From: <sag...@us...> - 2011-10-10 14:15:52
|
Revision: 1100 http://modplug.svn.sourceforge.net/modplug/?rev=1100&view=rev Author: saga-games Date: 2011-10-10 14:15:41 +0000 (Mon, 10 Oct 2011) Log Message: ----------- [Fix] Pattern Editor: Default volume is not shown for MOD an XM files if there's a Cxx command in the same cell. [Mod] Pattern Editor: Improved explanation of E5x in MOD files [Mod] Channel Manager: Removed player stopping when reordering / removing channels - a mutex should be enough. [Mod] Song Cleanup: Reset Song Variables also cleans the MIDI Macros now. [Mod] Small changes here and there. [Mod] OpenMPT: Version is now 1.20.00.41 Modified Paths: -------------- trunk/OpenMPT/mptrack/Autotune.cpp trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp trunk/OpenMPT/mptrack/CleanupSong.cpp trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/View_pat.h trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/test/test.cpp trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Snd_flt.cpp trunk/OpenMPT/soundlib/mod_specifications.cpp trunk/OpenMPT/soundlib/modcommand.cpp Modified: trunk/OpenMPT/mptrack/Autotune.cpp =================================================================== --- trunk/OpenMPT/mptrack/Autotune.cpp 2011-10-09 16:01:46 UTC (rev 1099) +++ trunk/OpenMPT/mptrack/Autotune.cpp 2011-10-10 14:15:41 UTC (rev 1100) @@ -180,7 +180,7 @@ const int8 *normalData = sampleData; const int8 *shiftedData = sampleData + autocorrShift; // Add up squared differences of all values - for(SmpLength i = processLength; i > 0; i--, normalData++, shiftedData++) + for(SmpLength i = processLength; i != 0; i--, normalData++, shiftedData++) { autocorrSum += (*normalData - *shiftedData) * (*normalData - *shiftedData); } @@ -196,9 +196,9 @@ for(int ki = kernelWidth; ki >= 0; ki--) { // Choose bins to interpolate with - int left = (int)i - ki; + int left = i - ki; if(left < 0) left += historyBins; - int right = (int)i + ki; + int right = i + ki; if(right >= historyBins) right -= historyBins; interpolatedHistogram[i] = interpolatedHistogram[i] / 2 + (autocorrHistogram[left] + autocorrHistogram[right]) / 2; Modified: trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp =================================================================== --- trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2011-10-09 16:01:46 UTC (rev 1099) +++ trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2011-10-10 14:15:41 UTC (rev 1100) @@ -167,23 +167,16 @@ if(!m_pSndFile || !pModDoc) return; - - // Stop player (is this necessary?) - CModDoc *pActiveMod = NULL; - HWND followSong = pMainFrm->GetFollowSong(pModDoc); - if(pMainFrm->IsPlaying()){ - if((m_pSndFile) && (!m_pSndFile->IsPaused())) pActiveMod = pMainFrm->GetModPlaying(); - pMainFrm->PauseMod(); - } - EnterCriticalSection(&applying); CHANNELINDEX nChannels, newpat[MAX_BASECHANNELS], newMemory[4][MAX_BASECHANNELS]; // Count new number of channels , copy pattern pointers & manager internal store memory nChannels = 0; - for(CHANNELINDEX nChn = 0; nChn < m_pSndFile->m_nChannels; nChn++){ - if(!removed[pattern[nChn]]){ + for(CHANNELINDEX nChn = 0; nChn < m_pSndFile->m_nChannels; nChn++) + { + if(!removed[pattern[nChn]]) + { newMemory[0][nChannels] = memory[0][nChannels]; newMemory[1][nChannels] = memory[1][nChannels]; newMemory[2][nChannels] = memory[2][nChannels]; @@ -214,8 +207,10 @@ // Update manager internal store memory - for(CHANNELINDEX nChn = 0; nChn < nChannels; nChn++){ - if(nChn != newpat[nChn]){ + for(CHANNELINDEX nChn = 0; nChn < nChannels; nChn++) + { + if(nChn != newpat[nChn]) + { memory[0][nChn] = newMemory[0][newpat[nChn]]; memory[1][nChn] = newMemory[1][newpat[nChn]]; memory[2][nChn] = newMemory[2][newpat[nChn]]; @@ -223,14 +218,6 @@ memory[3][nChn] = nChn; } - /* - if(pActiveMod == pModDoc){ - i = m_pSndFile->GetCurrentPos(); - m_pSndFile->m_dwSongFlags &= ~SONG_STEP; - m_pSndFile->SetCurrentPos(0); - m_pSndFile->SetCurrentPos(i); - } - */ cs.Leave(); EndWaitCursor(); @@ -242,7 +229,6 @@ pModDoc->SetModified(); pModDoc->UpdateAllViews(NULL,0xff,NULL); pModDoc->UpdateAllViews(NULL, HINT_MODCHANNELS ); //refresh channel headers - pMainFrm->PlayMod(pActiveMod, followSong, MPTNOTIFY_POSITION|MPTNOTIFY_VUMETERS); //rewbs.fix2977 // Redraw channel manager window InvalidateRect(NULL,TRUE); @@ -794,7 +780,7 @@ { CHANNELINDEX nThisChn = pattern[nChn]; - if(m_pSndFile->ChnSettings[nThisChn].szName[0] >= 0x20) + if(m_pSndFile->ChnSettings[nThisChn].szName[0] != '\0') wsprintf(s, "%d: %s", (nThisChn + 1), m_pSndFile->ChnSettings[nThisChn].szName); else wsprintf(s, "Channel %d", nThisChn + 1); Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp =================================================================== --- trunk/OpenMPT/mptrack/CleanupSong.cpp 2011-10-09 16:01:46 UTC (rev 1099) +++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2011-10-10 14:15:41 UTC (rev 1100) @@ -904,6 +904,7 @@ pSndFile->m_nMixLevels = mixLevels_compatible; pSndFile->m_nTempoMode = tempo_mode_classic; pSndFile->m_dwSongFlags = SONG_LINEARSLIDES; + CSoundFile::ResetMidiCfg(pSndFile->m_MidiCfg); // Global vars pSndFile->m_nDefaultTempo = 125; Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-10-09 16:01:46 UTC (rev 1099) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-10-10 14:15:41 UTC (rev 1100) @@ -283,9 +283,10 @@ const INSTRUMENTINDEX nSplitIns = m_pModDoc->GetSplitKeyboardSettings()->splitInstrument; const MODCOMMAND::NOTE noteSplit = 1 + m_pModDoc->GetSplitKeyboardSettings()->splitNote; const CString sSplitInsName = m_pModDoc->GetPatternViewInstrumentName(nSplitIns, true, false); - if (m_pSndFile->m_nInstruments) + if (m_pSndFile->GetNumInstruments()) { - for (UINT i=1; i<=m_pSndFile->m_nInstruments; i++) + // Show instrument names + for (INSTRUMENTINDEX i = 1; i <= m_pSndFile->GetNumInstruments(); i++) { if (m_pSndFile->Instruments[i] == nullptr) continue; @@ -306,9 +307,9 @@ } } else { - UINT nmax = m_pSndFile->m_nSamples; - while ((nmax > 1) && (m_pSndFile->GetSample(nmax).pSample == nullptr) && (!m_pSndFile->m_szNames[nmax][0])) nmax--; - for (UINT i=1; i<=nmax; i++) if ((m_pSndFile->m_szNames[i][0]) || (m_pSndFile->GetSample(i).pSample)) + // Show sample names + SAMPLEINDEX nmax = m_pSndFile->GetNumSamples(); + for (SAMPLEINDEX i = 1; i <= nmax; i++) if (m_pSndFile->GetSample(i).pSample) { if (m_pModDoc->GetSplitKeyboardSettings()->IsSplitActive() && nSplitIns < ARRAYELEMCOUNT(m_pSndFile->m_szNames)) wsprintf(s, szSplitFormat, nSplitIns, GetNoteStr(noteSplit), i, m_pSndFile->m_szNames[nSplitIns], m_pSndFile->m_szNames[i]); Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-10-09 16:01:46 UTC (rev 1099) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-10-10 14:15:41 UTC (rev 1100) @@ -2848,16 +2848,6 @@ break; case CMD_MIDI: - if (param < 0x80) - { - wsprintf(pszName, "SFx macro: z=%02X (%d)", param, param); - } else - { - wsprintf(pszName, "Fixed Macro Z%02X", param); - } - break; - - //rewbs.smoothVST case CMD_SMOOTHMIDI: if (param < 0x80) { @@ -2867,8 +2857,7 @@ wsprintf(pszName, "Fixed Macro Z%02X", param); } break; - //end rewbs.smoothVST - + case CMD_DELAYCUT: wsprintf(pszName, "Note delay: %d, cut after %d ticks", (param >> 4), (param & 0x0F)); break; @@ -3016,8 +3005,16 @@ break; case 0x50: // set finetune { - int8 nFinetune = (param & 0x0F) << 4; - if(m_SndFile.GetType() & MOD_TYPE_XM) nFinetune += 128; + int8 nFinetune = (param & 0x0F); + if(m_SndFile.GetType() & MOD_TYPE_XM) + { + // XM finetune + nFinetune = (nFinetune - 8) * 16; + } else + { + // MOD finetune + if(nFinetune > 7) nFinetune -= 16; + } wsprintf(s, "%d", nFinetune); } break; Modified: trunk/OpenMPT/mptrack/View_pat.h =================================================================== --- trunk/OpenMPT/mptrack/View_pat.h 2011-10-09 16:01:46 UTC (rev 1099) +++ trunk/OpenMPT/mptrack/View_pat.h 2011-10-10 14:15:41 UTC (rev 1100) @@ -214,7 +214,7 @@ void DrawDragSel(HDC hdc); void OnDrawDragSel(); // True if default volume should be drawn for a given cell. - bool DrawDefaultVolume(const MODCOMMAND *m) const { return (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_SHOWDEFAULTVOLUME) && m->volcmd == VOLCMD_NONE && m->instr != 0 && m->note != NOTE_NONE && NOTE_IS_VALID(m->note); } + static bool DrawDefaultVolume(const MODCOMMAND *m) { return (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_SHOWDEFAULTVOLUME) && m->volcmd == VOLCMD_NONE && m->command != CMD_VOLUME && m->instr != 0 && m->note != NOTE_NONE && NOTE_IS_VALID(m->note); } //rewbs.customKeys BOOL ExecuteCommand(CommandID command); Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2011-10-09 16:01:46 UTC (rev 1099) +++ trunk/OpenMPT/mptrack/mptrack.rc 2011-10-10 14:15:41 UTC (rev 1100) @@ -1365,7 +1365,7 @@ IDD_SELECTMIXPLUGIN DIALOGEX 0, 0, 249, 220 STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "Mix Plugins" +CAPTION "Plugin Manager" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN LTEXT "Filter:",IDC_STATIC_VSTNAMEFILTER,6,9,18,8 @@ -1424,7 +1424,7 @@ IDD_EFFECTVISUALIZER DIALOGEX 0, 0, 422, 109 STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE -CAPTION "Param Editor" +CAPTION "Parameter Editor" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN EDITTEXT IDC_VISSTATUS,4,92,162,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE Modified: trunk/OpenMPT/mptrack/test/test.cpp =================================================================== --- trunk/OpenMPT/mptrack/test/test.cpp 2011-10-09 16:01:46 UTC (rev 1099) +++ trunk/OpenMPT/mptrack/test/test.cpp 2011-10-10 14:15:41 UTC (rev 1100) @@ -103,6 +103,7 @@ VERIFY_EQUAL( MptVersion::IsTestBuild(MAKE_VERSION_NUMERIC(1,18,01,13)), true); VERIFY_EQUAL( MptVersion::IsTestBuild(MAKE_VERSION_NUMERIC(1,19,01,00)), false); VERIFY_EQUAL( MptVersion::IsTestBuild(MAKE_VERSION_NUMERIC(1,17,02,54)), false); + VERIFY_EQUAL( MptVersion::IsTestBuild(MAKE_VERSION_NUMERIC(1,18,00,00)), false); VERIFY_EQUAL( MptVersion::IsTestBuild(MAKE_VERSION_NUMERIC(1,18,02,00)), false); VERIFY_EQUAL( MptVersion::IsTestBuild(MAKE_VERSION_NUMERIC(1,18,02,01)), true); STATIC_ASSERT( MAKE_VERSION_NUMERIC(1,17,2,28) == 18285096 ); Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-10-09 16:01:46 UTC (rev 1099) +++ trunk/OpenMPT/mptrack/version.h 2011-10-10 14:15:41 UTC (rev 1100) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 20 #define VER_MINOR 00 -#define VER_MINORMINOR 40 +#define VER_MINORMINOR 41 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of @@ -64,7 +64,7 @@ // Returns true if a given version number is from a test build, false if it's a release build. static bool IsTestBuild(const VersionNum num) { - return ((num > MAKE_VERSION_NUMERIC(1,17,02,54) && num < MAKE_VERSION_NUMERIC(1,18,02,00)) || (num > MAKE_VERSION_NUMERIC(1,18,02,00) && RemoveBuildNumber(num) != num)); + return ((num > MAKE_VERSION_NUMERIC(1,17,02,54) && num < MAKE_VERSION_NUMERIC(1,18,02,00) && num != MAKE_VERSION_NUMERIC(1,18,00,00)) || (num > MAKE_VERSION_NUMERIC(1,18,02,00) && RemoveBuildNumber(num) != num)); } }; //namespace MptVersion Modified: trunk/OpenMPT/soundlib/Snd_flt.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_flt.cpp 2011-10-09 16:01:46 UTC (rev 1099) +++ trunk/OpenMPT/soundlib/Snd_flt.cpp 2011-10-10 14:15:41 UTC (rev 1100) @@ -95,7 +95,7 @@ float fc = (float)CutOffToFrequency(cutoff, flt_modifier); const float dmpfac = pow(10.0f, -((24.0f / 128.0f) * (float)resonance) / 20.0f); - fc *= (float)(2.0 * 3.14159265358 / (float)gdwMixingFreq); + fc *= (float)(2.0f * (float)M_PI / (float)gdwMixingFreq); d = (1.0f - 2.0f * dmpfac) * fc; LimitMax(d, 2.0f); Modified: trunk/OpenMPT/soundlib/mod_specifications.cpp =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.cpp 2011-10-09 16:01:46 UTC (rev 1099) +++ trunk/OpenMPT/soundlib/mod_specifications.cpp 2011-10-10 14:15:41 UTC (rev 1100) @@ -50,7 +50,7 @@ else if(note == NOTE_FADE) return hasNoteFade; else - return (memcmp(fileExtension, ModSpecs::mptm.fileExtension, 4) == 0); + return (internalType == MOD_TYPE_MPT); } else if(note == NOTE_NONE) return true; return false; Modified: trunk/OpenMPT/soundlib/modcommand.cpp =================================================================== --- trunk/OpenMPT/soundlib/modcommand.cpp 2011-10-09 16:01:46 UTC (rev 1099) +++ trunk/OpenMPT/soundlib/modcommand.cpp 2011-10-10 14:15:41 UTC (rev 1100) @@ -721,10 +721,10 @@ m->note = NOTE_NONE; // ensure the commands really exist in this format - if(CSoundFile::GetModSpecifications(nNewType).HasCommand(m->command) == false) + if(!CSoundFile::GetModSpecifications(nNewType).HasCommand(m->command)) m->command = CMD_NONE; - if(CSoundFile::GetModSpecifications(nNewType).HasVolCommand(m->volcmd) == false) - m->volcmd = CMD_NONE; + if(!CSoundFile::GetModSpecifications(nNewType).HasVolCommand(m->volcmd)) + m->volcmd = VOLCMD_NONE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |