From: <sag...@us...> - 2011-01-16 21:39:51
|
Revision: 788 http://modplug.svn.sourceforge.net/modplug/?rev=788&view=rev Author: saga-games Date: 2011-01-16 21:39:44 +0000 (Sun, 16 Jan 2011) Log Message: ----------- [Fix] Sample Editor: rev.781 broke the Downsample button. It was allocating too much memory (if it actually succeeded in requesting it). [Imp] Sound Setup: For ASIO devices, only supported sampling rates are now shown. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/soundlib/SNDDEV.H trunk/OpenMPT/soundlib/SNDDEVX.H trunk/OpenMPT/soundlib/Snddev.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-01-15 16:41:51 UTC (rev 787) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-01-16 21:39:44 UTC (rev 788) @@ -1526,7 +1526,7 @@ dwStart = 0; dwEnd = pSmp->nLength; } - smplsize = pSmp->GetSampleSizeInBytes(); + smplsize = pSmp->GetBytesPerSample(); pOriginal = pSmp->pSample; dwRemove = (dwEnd-dwStart+1)>>1; dwNewLen = pSmp->nLength - dwRemove; @@ -1633,7 +1633,7 @@ #define MAX_BUFFER_LENGTH 8192 -#define CLIP_SOUND(v) v = v < -1.0f ? -1.0f : v > 1.0f ? 1.0f : v +#define CLIP_SOUND(v) Limit(v, -1.0f, 1.0f); void CCtrlSamples::ReadTimeStretchParameters() //-------------------------------------------- @@ -2122,7 +2122,8 @@ for(UINT j = startoffset ; j < len + finaloffset ; j++){ // Just perform a little bit of clipping... - float v = outbuf[j]; CLIP_SOUND(v); + float v = outbuf[j]; + CLIP_SOUND(v); // ...before converting back to buffer switch(smpsize){ case 2: @@ -3060,7 +3061,7 @@ return points; } -// Set the currently select part of the sample. +// Set the currently selected part of the sample. // To reset the selection, use nStart = nEnd = 0. void CCtrlSamples::SetSelectionPoints(UINT nStart, UINT nEnd) //----------------------------------------------------------- Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2011-01-15 16:41:51 UTC (rev 787) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2011-01-16 21:39:44 UTC (rev 788) @@ -217,7 +217,7 @@ cbi.iSelectedImage = cbi.iImage; cbi.iOverlay = cbi.iImage; cbi.iIndent = 0; - cbi.lParam = (nDevType<<8)|(nDev&0xff); + cbi.lParam = SNDDEV_BUILD_ID(nDev, nDevType); cbi.pszText = s; int pos = m_CbnDevice.InsertItem(&cbi); if (cbi.lParam == (LONG)m_nSoundDevice) m_CbnDevice.SetCurSel(pos); @@ -310,7 +310,52 @@ if (n >= 0) { int dev = m_CbnDevice.GetItemData(n); - GetDlgItem(IDC_CHECK4)->EnableWindow(((dev>>8)==SNDDEV_DSOUND) ? TRUE : FALSE); + GetDlgItem(IDC_CHECK4)->EnableWindow((SNDDEV_GET_TYPE(dev) == SNDDEV_DSOUND) ? TRUE : FALSE); + + CHAR s[128]; + m_CbnMixingFreq.ResetContent(); + + bool knowRates = false; + vector<bool> supportedRates; + vector<UINT> samplerates; + for(size_t i = 0; i < NUMMIXRATE; i++) + { + samplerates.push_back(nMixingRates[i]); + } + + ISoundDevice *dummy; + if(CreateSoundDevice(SNDDEV_GET_TYPE(dev), &dummy)) + { + knowRates = dummy->CanSampleRate(SNDDEV_GET_NUMBER(dev), samplerates, supportedRates); + delete dummy; + } + + if(knowRates) + { + // We have a valid list of supported playback rates. + int n = 1; + for(size_t i = 0; i < NUMMIXRATE; i++) + { + if(supportedRates[i]) + { + wsprintf(s, "%u Hz", nMixingRates[i]); + int pos = m_CbnMixingFreq.AddString(s); + if (m_dwRate == nMixingRates[i]) n = pos; + } + } + m_CbnMixingFreq.SetCurSel(n); + } else + { + // Rates supported by the device are not known, show all rates supported by OpenMPT instead. + UINT n = 1; + for (UINT i=0; i<NUMMIXRATE; i++) + { + wsprintf(s, "%u Hz", nMixingRates[i]); + m_CbnMixingFreq.AddString(s); + if (m_dwRate == nMixingRates[i]) n = i; + } + m_CbnMixingFreq.SetCurSel(n); + } OnSettingsChanged(); } } Modified: trunk/OpenMPT/soundlib/SNDDEV.H =================================================================== --- trunk/OpenMPT/soundlib/SNDDEV.H 2011-01-15 16:41:51 UTC (rev 787) +++ trunk/OpenMPT/soundlib/SNDDEV.H 2011-01-16 21:39:44 UTC (rev 788) @@ -30,10 +30,11 @@ SNDDEV_NUM_DEVTYPES }; -#define SNDDEV_DEVICE_MASK 0xFF // Mask for getting the device number -#define SNDDEV_DEVICE_SHIFT 8 // Shift amount for getting the device type -#define SNDDEV_GET_NUMBER(x) (x & SNDDEV_DEVICE_MASK) // Use this for getting the device number -#define SNDDEV_GET_TYPE(x) (x >> SNDDEV_DEVICE_SHIFT) // ...and this for getting the device type +#define SNDDEV_DEVICE_MASK 0xFF // Mask for getting the device number +#define SNDDEV_DEVICE_SHIFT 8 // Shift amount for getting the device type +#define SNDDEV_GET_NUMBER(x) (x & SNDDEV_DEVICE_MASK) // Use this for getting the device number +#define SNDDEV_GET_TYPE(x) (x >> SNDDEV_DEVICE_SHIFT) // ...and this for getting the device type +#define SNDDEV_BUILD_ID(number, type) ((number & SNDDEV_DEVICE_MASK) | (type << SNDDEV_DEVICE_SHIFT)) // Build a sound device ID from device number and device type. #define SNDDEV_MINBUFFERS 2 #define SNDDEV_MAXBUFFERS 16 @@ -80,6 +81,8 @@ virtual UINT GetCurrentLatency() = 0; virtual void SilenceAudioBuffer(ISoundSource *pSource, ULONG nMaxLatency, DWORD dwUser=0) = 0; virtual UINT GetCurrentSampleRate(UINT nDevice) { UNREFERENCED_PARAMETER(nDevice); return 0; } + // Return which samplerates are actually supported by the device. Currently only implemented properly for ASIO. + virtual bool CanSampleRate(UINT nDevice, vector<UINT> &samplerates, vector<bool> &result) { UNREFERENCED_PARAMETER(nDevice); result.assign(samplerates.size(), true); return true; } ; }; Modified: trunk/OpenMPT/soundlib/SNDDEVX.H =================================================================== --- trunk/OpenMPT/soundlib/SNDDEVX.H 2011-01-15 16:41:51 UTC (rev 787) +++ trunk/OpenMPT/soundlib/SNDDEVX.H 2011-01-16 21:39:44 UTC (rev 788) @@ -131,6 +131,7 @@ UINT GetCurrentLatency() { return m_nAsioBufferLen; } void SilenceAudioBuffer(ISoundSource *pSource, ULONG nMaxLatency, DWORD dwBuffer); + bool CanSampleRate(UINT nDevice, vector<UINT> &samplerates, vector<bool> &result); UINT GetCurrentSampleRate(UINT nDevice); public: Modified: trunk/OpenMPT/soundlib/Snddev.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snddev.cpp 2011-01-15 16:41:51 UTC (rev 787) +++ trunk/OpenMPT/soundlib/Snddev.cpp 2011-01-16 21:39:44 UTC (rev 788) @@ -1,4 +1,6 @@ #include "stdafx.h" +#include <vector> +using std::vector; #include "snddev.h" #include "snddevx.h" @@ -1301,6 +1303,39 @@ } +bool CASIODevice::CanSampleRate(UINT nDevice, vector<UINT> &samplerates, vector<bool> &result) +//-------------------------------------------------------------------------------------------- +{ + const bool wasOpen = (m_pAsioDrv != NULL); + if(!wasOpen) + { + OpenDevice(nDevice); + if(m_pAsioDrv == NULL) + { + return false; + } + } + + bool foundSomething = false; // is at least one sample rate supported by the device? + result.clear(); + for(size_t i = 0; i < samplerates.size(); i++) + { + result.push_back((m_pAsioDrv->canSampleRate((ASIOSampleRate)samplerates[i]) == ASE_OK)); + if(result.back()) + { + foundSomething = true; + } + } + + if(!wasOpen) + { + CloseDevice(); + } + + return foundSomething; +} + + // If the device is open, this returns the current sample rate. If it's not open, it returns some sample rate supported by the device. UINT CASIODevice::GetCurrentSampleRate(UINT nDevice) //-------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2011-01-23 21:32:29
|
Revision: 790 http://modplug.svn.sourceforge.net/modplug/?rev=790&view=rev Author: relabsoluness Date: 2011-01-23 21:32:23 +0000 (Sun, 23 Jan 2011) Log Message: ----------- [Fix] DSL loader: Fix to code level bug in instrument loading. Modified Paths: -------------- trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/soundlib/Dlsbank.cpp Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-01-16 21:41:10 UTC (rev 789) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-01-23 21:32:23 UTC (rev 790) @@ -254,12 +254,15 @@ if (dwKey < 0x80) nDrumRgn = pEmbeddedBank->GetRegionFromKey(nDlsIns, dwKey); if (pEmbeddedBank->ExtractInstrument(&m_SndFile, nIns, nDlsIns, nDrumRgn)) { + pIns = m_SndFile.Instruments[nIns]; // Reset pIns because ExtractInstrument may delete the previous value. if ((dwKey >= 24) && (dwKey < 100)) { lstrcpyn(pIns->name, szMidiPercussionNames[dwKey-24], sizeof(pIns->name)); } bEmbedded = TRUE; } + else + pIns = m_SndFile.Instruments[nIns]; // Reset pIns because ExtractInstrument may delete the previous value. } } if ((pszMidiMapName) && (pszMidiMapName[0]) && (!bEmbedded)) @@ -293,6 +296,7 @@ { if (dwKey < 0x80) nDrumRgn = pDLSBank->GetRegionFromKey(nDlsIns, dwKey); pDLSBank->ExtractInstrument(&m_SndFile, nIns, nDlsIns, nDrumRgn); + pIns = m_SndFile.Instruments[nIns]; // Reset pIns because ExtractInstrument may delete the previous value. if ((dwKey >= 24) && (dwKey < 24+61)) { lstrcpyn(pIns->name, szMidiPercussionNames[dwKey-24], sizeof(pIns->name)); Modified: trunk/OpenMPT/soundlib/Dlsbank.cpp =================================================================== --- trunk/OpenMPT/soundlib/Dlsbank.cpp 2011-01-16 21:41:10 UTC (rev 789) +++ trunk/OpenMPT/soundlib/Dlsbank.cpp 2011-01-23 21:32:23 UTC (rev 790) @@ -1641,7 +1641,7 @@ #endif pIns = new MODINSTRUMENT; if (!pIns) return FALSE; - memset(pIns, 0, sizeof(MODINSTRUMENT)); + MemsetZero(*pIns); pIns->pTuning = pIns->s_DefaultTuning; if (pSndFile->Instruments[nInstr]) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-01-30 13:38:59
|
Revision: 791 http://modplug.svn.sourceforge.net/modplug/?rev=791&view=rev Author: saga-games Date: 2011-01-30 13:38:50 +0000 (Sun, 30 Jan 2011) Log Message: ----------- [Fix] Sound Setup: Rev.788 pretty much broke the sample rate selection for ASIO devices... Now it should be working properly. [Mod] Updated unmo3-free install scripts to point to a new download location for unmo3.dll [Mod] Updated history.txt Modified Paths: -------------- trunk/OpenMPT/installer/install-unmo3-free-itd.iss trunk/OpenMPT/installer/install-unmo3-free.iss trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/Mpdlgs.h trunk/OpenMPT/packageTemplate/History.txt Modified: trunk/OpenMPT/installer/install-unmo3-free-itd.iss =================================================================== --- trunk/OpenMPT/installer/install-unmo3-free-itd.iss 2011-01-23 21:32:23 UTC (rev 790) +++ trunk/OpenMPT/installer/install-unmo3-free-itd.iss 2011-01-30 13:38:50 UTC (rev 791) @@ -21,7 +21,7 @@ begin if(IsTaskSelected('downloadmo3') And FileExists(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp'))) then begin - if(GetSHA1OfFile(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp')) <> '2e17f7bb6d19ce326851333b918070c5357cacd1') then + if(GetSHA1OfFile(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp')) <> '393be7e0f50c62d142386a16d6855ca771025554') then begin MsgBox('Warning: unmo3.dll has been downloaded, but its checksum is wrong! This means that either the downloaded file is corrupted or that a newer version of unmo3.dll is available. The file has thus not been installed. Please obtain unmo3.dll from http://openmpt.com/ and verify its checksum.', mbCriticalError, MB_OK) end else @@ -51,7 +51,7 @@ begin if(IsTaskSelected('downloadmo3')) then begin - ITD_AddMirror('http://openmpt.com/download/unmo3.dll', ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp')); + ITD_AddMirror('http://openmpt.org/files/unmo3/2.4.0.1/unmo3.dll', ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp')); ITD_AddFile('ftp://ftp.untergrund.net/users/sagamusix/openmpt/unmo3.dll', ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp')); end else begin Modified: trunk/OpenMPT/installer/install-unmo3-free.iss =================================================================== --- trunk/OpenMPT/installer/install-unmo3-free.iss 2011-01-23 21:32:23 UTC (rev 790) +++ trunk/OpenMPT/installer/install-unmo3-free.iss 2011-01-30 13:38:50 UTC (rev 791) @@ -15,14 +15,14 @@ #include "install.iss" [_ISToolDownload] -Source: http://openmpt.com/download/unmo3.dll; DestDir: {tmp}; DestName: openmpt-unmo3.dll.tmp; Tasks: downloadmo3 +Source: http://openmpt.org/files/unmo3/2.4.0.1/unmo3.dll; DestDir: {tmp}; DestName: openmpt-unmo3.dll.tmp; Tasks: downloadmo3 [Code] // Verify checksum of downloaded file, and if it is OK, copy it to the app directory. procedure VerifyUNMO3Checksum(); begin if(IsTaskSelected('downloadmo3') And FileExists(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp'))) then begin - if(GetSHA1OfFile(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp')) <> '2e17f7bb6d19ce326851333b918070c5357cacd1') then + if(GetSHA1OfFile(ExpandConstant('{tmp}\openmpt-unmo3.dll.tmp')) <> '393be7e0f50c62d142386a16d6855ca771025554') then begin MsgBox('Warning: unmo3.dll has been downloaded, but its checksum is wrong! This means that either the downloaded file is corrupted or that a newer version of unmo3.dll is available. The file has thus not been installed. Please obtain unmo3.dll from http://openmpt.com/ and verify its checksum.', mbCriticalError, MB_OK) end else Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2011-01-23 21:32:23 UTC (rev 790) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2011-01-30 13:38:50 UTC (rev 791) @@ -124,16 +124,8 @@ } // Sampling Rate - { - UINT n = 1; - for (UINT i=0; i<NUMMIXRATE; i++) - { - wsprintf(s, "%u Hz", nMixingRates[i]); - m_CbnMixingFreq.AddString(s); - if (m_dwRate == nMixingRates[i]) n = i; - } - m_CbnMixingFreq.SetCurSel(n); - } + UpdateSampleRates(m_nSoundDevice); + // Max Mixing Channels { for (UINT n=0; n<8; n++) @@ -225,7 +217,7 @@ nDev++; } } - GetDlgItem(IDC_CHECK4)->EnableWindow(((m_nSoundDevice>>8)==SNDDEV_DSOUND) ? TRUE : FALSE); + GetDlgItem(IDC_CHECK4)->EnableWindow((SNDDEV_GET_TYPE(m_nSoundDevice) == SNDDEV_DSOUND) ? TRUE : FALSE); } // Sample Format { @@ -311,53 +303,66 @@ { int dev = m_CbnDevice.GetItemData(n); GetDlgItem(IDC_CHECK4)->EnableWindow((SNDDEV_GET_TYPE(dev) == SNDDEV_DSOUND) ? TRUE : FALSE); - - CHAR s[128]; - m_CbnMixingFreq.ResetContent(); + UpdateSampleRates(dev); + OnSettingsChanged(); + } +} - bool knowRates = false; - vector<bool> supportedRates; - vector<UINT> samplerates; - for(size_t i = 0; i < NUMMIXRATE; i++) + +// Fill the dropdown box with a list of valid sample rates, depending on the selected sound device. +void COptionsSoundcard::UpdateSampleRates(int dev) +//------------------------------------------------ +{ + CHAR s[16]; + m_CbnMixingFreq.ResetContent(); + + vector<bool> supportedRates; + vector<UINT> samplerates; + for(size_t i = 0; i < NUMMIXRATE; i++) + { + samplerates.push_back(nMixingRates[i]); + } + + ISoundDevice *dummy = nullptr; + bool justCreated = false, knowRates = false; + if(CMainFrame::m_nWaveDevice == dev) + { + // If this is the currently active sound device, it might already be playing something, so we shouldn't create yet another instance of it. + dummy = CMainFrame::gpSoundDevice; + } + if(dummy == nullptr) + { + justCreated = true; + CreateSoundDevice(SNDDEV_GET_TYPE(dev), &dummy); + } + + if(dummy != nullptr) + { + // Now we can query the supported sample rates. + knowRates = dummy->CanSampleRate(SNDDEV_GET_NUMBER(dev), samplerates, supportedRates); + if(justCreated) { - samplerates.push_back(nMixingRates[i]); - } - - ISoundDevice *dummy; - if(CreateSoundDevice(SNDDEV_GET_TYPE(dev), &dummy)) - { - knowRates = dummy->CanSampleRate(SNDDEV_GET_NUMBER(dev), samplerates, supportedRates); delete dummy; } + } - if(knowRates) + if(!knowRates) + { + // We have no valid list of supported playback rates! Assume all rates supported by OpenMPT are possible... + supportedRates.assign(samplerates.size(), true); + } + int n = 1; + for(size_t i = 0; i < NUMMIXRATE; i++) + { + if(supportedRates[i]) { - // We have a valid list of supported playback rates. - int n = 1; - for(size_t i = 0; i < NUMMIXRATE; i++) - { - if(supportedRates[i]) - { - wsprintf(s, "%u Hz", nMixingRates[i]); - int pos = m_CbnMixingFreq.AddString(s); - if (m_dwRate == nMixingRates[i]) n = pos; - } - } - m_CbnMixingFreq.SetCurSel(n); - } else - { - // Rates supported by the device are not known, show all rates supported by OpenMPT instead. - UINT n = 1; - for (UINT i=0; i<NUMMIXRATE; i++) - { - wsprintf(s, "%u Hz", nMixingRates[i]); - m_CbnMixingFreq.AddString(s); - if (m_dwRate == nMixingRates[i]) n = i; - } - m_CbnMixingFreq.SetCurSel(n); + wsprintf(s, "%u Hz", nMixingRates[i]); + int pos = m_CbnMixingFreq.AddString(s); + m_CbnMixingFreq.SetItemData(pos, nMixingRates[i]); + if(m_dwRate == nMixingRates[i]) n = pos; } - OnSettingsChanged(); } + m_CbnMixingFreq.SetCurSel(n); } @@ -379,9 +384,7 @@ if (IsDlgButtonChecked(IDC_CHECK4)) m_dwSoundSetup |= SOUNDSETUP_SECONDARY; // Mixing Freq { - UINT n = m_CbnMixingFreq.GetCurSel(); - if (n >= NUMMIXRATE) n = 3; - m_dwRate = nMixingRates[n]; + m_dwRate = m_CbnMixingFreq.GetItemData(m_CbnMixingFreq.GetCurSel()); } // Quality { Modified: trunk/OpenMPT/mptrack/Mpdlgs.h =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.h 2011-01-23 21:32:23 UTC (rev 790) +++ trunk/OpenMPT/mptrack/Mpdlgs.h 2011-01-30 13:38:50 UTC (rev 791) @@ -25,6 +25,7 @@ m_nBufferLength = bufsize; m_nSoundDevice = sd; m_PreAmpNoteShowed = false;} private: + void UpdateSampleRates(int dev); void SetPreAmpSliderPosition(); protected: Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2011-01-23 21:32:23 UTC (rev 790) +++ trunk/OpenMPT/packageTemplate/History.txt 2011-01-30 13:38:50 UTC (rev 791) @@ -10,7 +10,7 @@ (tx XYZ): thanks to XYZ for telling us about the bug -v1.19.01.00 (January 2011, revision 781) +v1.19.01.00 (January 2011, revision 791) ---------------------------------------- Pattern tab [New] <Jojo> Clicking and dragging the row numbers selects the whole row now (Excel / Calc style) - see http://bugs.openmpt.org/view.php?id=45 @@ -22,6 +22,8 @@ [Fix] <Jojo> When entering chords into the pattern editor, the module was only marked as modified if the base note of the chord was changed. [Fix] <Jojo> When jumping to an order which is normally not played, the song variables are now reset (previously, if the main song had f.e. a global volume fade out at the end, this was retained when switching to an unplayed order, effectively muting all sub songs). [Fix] <Jojo> OpenMPT should not crash anymore when applying the Amplify command on a pattern selection that just covers the note / instrument column of the first channel. + [Fix] <Jojo> Queueing a "---" or "+++" item now automatically moves the queue "cursor" to the next available pattern. Previously, queueing a "---" pattern restarted the song. + [Fix] <Jojo> When restarting a pattern, the timer was not reset properly. [Reg] <Jojo> The "Position aware timer" option is gone. The position aware timer is now automatically used. It was optional in the first place because of some buggy code, which is now fixed. Pattern tab::Note properties @@ -36,14 +38,17 @@ Sample tab [New] <Jojo> The new "sample grid" feature can create equally-sized sample selections, so it is f.e. easy to split a sample into four equally-sized samples. [Imp] <re> Ctrl + Mouse Wheel can now be used for zooming into the sample data. - [Mod] <Jojo> Undo steps have been increased from 100 to 1000. + [Mod] <Jojo> Undo steps have been increased from 100 to 1000 (per sample). [Fix] <Jojo> When cutting samples with a loop, the loop end point was not always moved correctly if the cut start was in the loop. [Fix] <re> Changing zoom level should now preserve the view position better. Instrument tab [Imp] <re> Ctrl + Mouse Wheel can now be used for zooming into the envelopes. + [Imp] <Jojo> When pressing the up arrow key in the sample map while the cursor is on the lowest note (C-0), the sample map doesn't lose focus anymore. It is also not possible anymore to move the sample map out of view by clicking the area above the lowest note. [Mod] <Jojo> Copying and pasting envelopes with no points isn't possible anymore. (Who wants to do that anyway?) [Fix] <Jojo> Changing the filter mode didn't mark the file as modified. + [Fix] <Jojo> The note mapping doesn't allow items anymore that aren't notes (such as "no note" or "note cut"). Such notes couldn't be entered manually, however when converting from other formats this was possible and it could crash the tracker (http://bugs.openmpt.org/view.php?id=61). + [Fix] <Jojo> Various actions in the instrument note map and envelope view should now also mark the instrument as modified (when working in the ITP format). Mod Conversion [Imp] <Jojo> When converting patterns from a format with instruments to a format without instruments (or when removing all instruments using the cleanup dialog), the instrument note mapping is now also taken care of. @@ -59,14 +64,15 @@ [Fix] <Jojo> Pattern jumps to the same row + pattern as the jump command are not ignored anymore. (http://forum.openmpt.org/index.php?topic=1810.0) IT - [New] <Jojo> Edit history information can now be read from IT files and saved to IT / MPTM files. This is based on an undocumented feature in Impulse Tracker. Use View -> Edit History for viewing or deleting this information. - [Imp] <Jojo> ITs made with Modplug Tracker 1.00a5 are now also detected as such. + [New] <Jojo> Edit history information can now be read from and saved to IT / MPTM files. This is based on an undocumented feature in Impulse Tracker. Use View -> Edit History for viewing or deleting this information. + [Imp] <Jojo> IT files made with Modplug Tracker 1.00a5 are now also detected as such. [Mod] <Jojo> Sane values are used again for the "cwtv" and "cmwt" header fields when saving IT files; in fact the same values as in compatibility export are used. To be able to distinguish between raped and compatibility-exported IT files, "OMPT" is written in the "reserved" header field. As a consequence, IT files made with OpenMPT can now be loaded in Impulse Tracker again. [Mod] <Jojo> IT Loader: MIDI macros are now cleared when loading IT files made with old Impulse Tracker versions (< 2.14), so that Zxx commands won't break the songs anymore (fixes denonde.it, fix from Schism Tracker). [Fix] <Jojo> Sample autovibrato is now hopefully a bit closer to Impulse Tracker in compatible mode... [Fix] <Jojo> The envelope handling was altered slightly to work more like in Schism Tracker. This fixes a combination of Envelope Carry + Portamento as it can be found in "electric bunny" by Alpha C. [Fix] <Jojo> Various fixes to playback of multi-sample instruments. "Ultima Ratio" by Nebularia and "Shuttle Departure" by Sphenx sound better now. [Fix] <Jojo> The extended sample map is not saved anymore in the instrument headers when using compatibility export. + [Fix] <Jojo> IT Loader / Saver: Note mapping items that aren't notes are now ignored. MPTM [New] <Jojo> Each pattern can now have a custom time signature (rows per beat and rows per measure) which can be set from the pattern properties dialog. @@ -99,7 +105,7 @@ [Mod] <Jojo> When automatically inserting a new instrument from the VST editor, the bank and patch values are now not filled in anymore, so it is easier to change to another patch while editing. [Mod] <Jojo> Various small improvements to support VST 2.4 plugins better. [Fix] <Jojo> Speaker arrangement is now sent to the plugins upon initialization. This fixes Voxengo SPAN 2 (a VST 2.4 plugin). Does this break other multichannel plugins? - [Fix] <Jojo> The time signature sent to VST plugins should be correct now. + [Fix] <Jojo> The time signature sent to VST plugins should be correct now. The denominator is always assumed to be 4, so a 6/8 signature is for example not possible. Other modules [Imp] <Jojo> Garbage characters in sample / instrument / song names should be gone now.. This should f.e. avoid sample names like " ntitled" turning up in modules after deleting sample names. @@ -111,14 +117,17 @@ Misc [New] <Jojo> WAV Export: Sample-exact cue points are now written at each pattern transition. + [Imp] <Jojo> Paths to VST plugins in mptrack.ini and plugin.cache are now also relative in portable mode. This means that finally, *all* stored paths are now relative in portable mode. [Imp] <Jojo> New keyboard shortcuts: Panic, View Edit History, Set Invalid / Ignore (--- / +++) Pattern (in the orderlist) [Imp] <Jojo> Some improvements were made to the Registry / INI reading: If there were no Registry settings because MPT 1.16 was previously not installed, the INI file is now also read as it might contain some lines created by the installer. + [Imp] <Jojo> Sound Setup: For ASIO devices, only supported sampling rates are now shown. [Mod] <Jojo> Changes to keymap file handling: The active keymap is now always saved to Keybindings.mkb (in either %APPDATA%\OpenMPT or the executable's directory). Any other keymaps are now only overwritten when using the "Save keys as" function. [Mod] <Jojo> On first run, the default ASIO driver is now chosen instead of DirectSound (if there is one). [Mod] <Jojo> The "Original" mix mode now also has a version number (1.16) to reflect what the "original" thing is. [Mod] <Jojo> Updated genre list in the MP3 export dialog. [Mod] <Jojo> When using the ACM MP3 codec, 320kbit/s bitrate should now theoretically be available. [Mod] <Jojo> The MMX acceleration label in the Soundcard setup dialog is now updated according to the multimedia extensions that are supported by the CPU (3DNow! / SSE) + [Mod] <Jojo> Updated unmo3.dll to version 2.4.0.1 [Fix] <Jojo> Mod Cleanup: Rearrange patterns was broken when using more than one sequence in the MPTM format. (tx Skaven) [Fix] <Jojo> Mod Cleanup: Various sample / instrument rearranging functions broke PC Notes. [Fix] <Jojo> The text length was calculated wrong in the message reader, leading to a possible buffer overflow when reading song messages with mixed line endings where CR or LF line endings where expected. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-01-30 14:50:26
|
Revision: 792 http://modplug.svn.sourceforge.net/modplug/?rev=792&view=rev Author: saga-games Date: 2011-01-30 14:50:20 +0000 (Sun, 30 Jan 2011) Log Message: ----------- [Fix] IT Loader: Try to fix loading some IT files that were extracted with unmo3.exe/.dll [Fix] VST: Changed some stuff in the file selection code, now VOPM shouldn't crash anymore. [Ref] Some small changes [Mod] OpenMPT: Version is now 1.19.00.21 Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/Vstplug.h trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Load_it.cpp Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2011-01-30 13:38:50 UTC (rev 791) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2011-01-30 14:50:20 UTC (rev 792) @@ -187,7 +187,7 @@ DWORD CMainFrame::m_nBitsPerSample = 16; DWORD CMainFrame::m_nPreAmp = 128; DWORD CMainFrame::gbLoopSong = TRUE; -LONG CMainFrame::m_nWaveDevice = (SNDDEV_DSOUND << SNDDEV_DEVICE_SHIFT); +LONG CMainFrame::m_nWaveDevice = SNDDEV_BUILD_ID(0, SNDDEV_DSOUND); LONG CMainFrame::m_nMidiDevice = 0; DWORD CMainFrame::m_nBufferLength = 75; LONG CMainFrame::gnLVuMeter = 0; @@ -713,10 +713,10 @@ // Check for valid sound device if (!EnumerateSoundDevices(SNDDEV_GET_TYPE(m_nWaveDevice), SNDDEV_GET_NUMBER(m_nWaveDevice), nullptr, 0)) { - m_nWaveDevice = (SNDDEV_DSOUND << SNDDEV_DEVICE_SHIFT); + m_nWaveDevice = SNDDEV_BUILD_ID(0, SNDDEV_DSOUND); if (!EnumerateSoundDevices(SNDDEV_GET_TYPE(m_nWaveDevice), SNDDEV_GET_NUMBER(m_nWaveDevice), nullptr, 0)) { - m_nWaveDevice = (SNDDEV_WAVEOUT << SNDDEV_DEVICE_SHIFT); + m_nWaveDevice = SNDDEV_BUILD_ID(0, SNDDEV_WAVEOUT); } } // Default directory location @@ -986,7 +986,8 @@ WritePrivateProfileDWord("Display", "MsgBoxVisibilityFlags", gnMsgBoxVisiblityFlags, iniFile); CHAR s[16]; - for (int ncol=0; ncol<MAX_MODCOLORS; ncol++) { + for (int ncol=0; ncol<MAX_MODCOLORS; ncol++) + { wsprintf(s, "Color%02d", ncol); WritePrivateProfileDWord("Display", s, rgbCustomColors[ncol], iniFile); } Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-01-30 13:38:50 UTC (rev 791) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-01-30 14:50:20 UTC (rev 792) @@ -1050,6 +1050,8 @@ } +// Check if a given note of an instrument or sample is playing. +// If note == 0, just check if an instrument or sample is playing. BOOL CModDoc::IsNotePlaying(UINT note, UINT nsmp, UINT nins) //---------------------------------------------------------- { @@ -2299,9 +2301,7 @@ case sfx_drywet: chanSpec.Append("Plug wet/dry ratio"); break; case sfx_cc: { int nCC = MacroToMidiCC(macroText); - CString temp; - temp.Format("MidiCC %d", nCC); - chanSpec.Append(temp); + chanSpec.AppendFormat("MidiCC %d", nCC); break; } case sfx_plug: { @@ -2318,9 +2318,7 @@ } if (paramName[0] == 0) strcpy(paramName, "N/A - no plug"); - CString temp; - temp.Format("param %d (%s)", nParam, paramName); - chanSpec.Append(temp); + chanSpec.AppendFormat("param %d (%s)", nParam, paramName); break; } case sfx_custom: default: chanSpec.Append("Custom"); Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2011-01-30 13:38:50 UTC (rev 791) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2011-01-30 14:50:20 UTC (rev 792) @@ -1070,6 +1070,7 @@ if(!destructor) { pFileSel->nbReturnPath = 0; + pFileSel->reserved = 0; if(pFileSel->command != kVstDirectorySelect) { @@ -1130,24 +1131,32 @@ } else { // Single path + + // VOPM doesn't initialize required information properly (it doesn't memset the struct to 0)... + if(!memcmp(&(effect->uniqueID), "MPOV", 4)) + { + pFileSel->sizeReturnPath = _MAX_PATH; + } + if(pFileSel->returnPath == nullptr || pFileSel->sizeReturnPath == 0) { // Provide some memory for the return path. - pFileSel->sizeReturnPath = files.first_file.length(); - pFileSel->returnPath = new char[pFileSel->sizeReturnPath + 1]; + pFileSel->sizeReturnPath = files.first_file.length() + 1; + pFileSel->returnPath = new char[pFileSel->sizeReturnPath]; if(pFileSel->returnPath == nullptr) { return 0; } - pFileSel->returnPath[pFileSel->sizeReturnPath] = '\0'; + pFileSel->returnPath[pFileSel->sizeReturnPath - 1] = '\0'; pFileSel->reserved = 1; } else { pFileSel->reserved = 0; } - strncpy(pFileSel->returnPath, files.first_file.c_str(), pFileSel->sizeReturnPath); + strncpy(pFileSel->returnPath, files.first_file.c_str(), pFileSel->sizeReturnPath - 1); pFileSel->nbReturnPath = 1; + pFileSel->returnMultiplePaths = nullptr; } return 1; @@ -1179,25 +1188,25 @@ // old versions of reViSiT (which still relied on the host's file selection code) seem to be dodgy. // They report a path size of 0, but when using an own buffer, they will crash. // So we'll just assume that reViSiT can handle long enough (_MAX_PATH) paths here. - pFileSel->sizeReturnPath = strlen(szBuffer); - pFileSel->returnPath[pFileSel->sizeReturnPath] = '\0'; + pFileSel->sizeReturnPath = strlen(szBuffer) + 1; + pFileSel->returnPath[pFileSel->sizeReturnPath - 1] = '\0'; } if(pFileSel->returnPath == nullptr || pFileSel->sizeReturnPath == 0) { // Provide some memory for the return path. - pFileSel->sizeReturnPath = strlen(szBuffer); - pFileSel->returnPath = new char[pFileSel->sizeReturnPath + 1]; + pFileSel->sizeReturnPath = strlen(szBuffer) + 1; + pFileSel->returnPath = new char[pFileSel->sizeReturnPath]; if(pFileSel->returnPath == nullptr) { return 0; } - pFileSel->returnPath[pFileSel->sizeReturnPath] = '\0'; + pFileSel->returnPath[pFileSel->sizeReturnPath - 1] = '\0'; pFileSel->reserved = 1; } else { pFileSel->reserved = 0; } - strncpy(pFileSel->returnPath, szBuffer, pFileSel->sizeReturnPath); + strncpy(pFileSel->returnPath, szBuffer, pFileSel->sizeReturnPath - 1); pFileSel->nbReturnPath = 1; return 1; } else @@ -2009,8 +2018,8 @@ } //rewbs.VSTcompliance: changed from BOOL to long -long CVstPlugin::GetNumParameters() -//--------------------------------- +PlugParamIndex CVstPlugin::GetNumParameters() +//------------------------------------------- { if ((m_pEffect) && (m_pEffect->numParams > 0)) { @@ -2084,7 +2093,7 @@ bool success; //Collect required data - long numParams = GetNumParameters(); + PlugParamIndex numParams = GetNumParameters(); long ID = GetUID(); long plugVersion = GetVersion(); float *params = new float[numParams]; @@ -2115,7 +2124,7 @@ } bool CVstPlugin::LoadProgram(CString fileName) -//------------------------------------ +//-------------------------------------------- { if (!(m_pEffect)) return false; Modified: trunk/OpenMPT/mptrack/Vstplug.h =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.h 2011-01-30 13:38:50 UTC (rev 791) +++ trunk/OpenMPT/mptrack/Vstplug.h 2011-01-30 14:50:20 UTC (rev 792) @@ -106,7 +106,7 @@ PVSTPLUGINLIB GetPluginFactory() const { return m_pFactory; } BOOL HasEditor(); long GetNumPrograms(); - long GetNumParameters(); + PlugParamIndex GetNumParameters(); long GetCurrentProgram(); long GetNumProgramCategories(); //rewbs.VSTpresets long GetProgramNameIndexed(long index, long category, char *text); //rewbs.VSTpresets @@ -198,13 +198,13 @@ void MidiPitchBend(UINT nMidiCh, short pitchBendPos); #else // case: NO_VST public: - long GetNumParameters() {return 0;} + PlugParamIndex GetNumParameters() {return 0;} VOID GetParamName(UINT, LPSTR, UINT) {} void ToggleEditor() {} BOOL HasEditor() {return FALSE;} UINT GetNumCommands() {return 0;} VOID GetPluginType(LPSTR) {} - long GetNumPrograms() {return 0;} + PlugParamIndex GetNumPrograms() {return 0;} long GetProgramNameIndexed(long, long, char*) {return 0;} VOID SetParameter(PlugParamIndex nIndex, PlugParamValue fValue) {} VOID GetParamLabel(UINT, LPSTR) {} Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-01-30 13:38:50 UTC (rev 791) +++ trunk/OpenMPT/mptrack/version.h 2011-01-30 14:50:20 UTC (rev 792) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 19 #define VER_MINOR 00 -#define VER_MINORMINOR 20 +#define VER_MINORMINOR 21 //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/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2011-01-30 13:38:50 UTC (rev 791) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2011-01-30 14:50:20 UTC (rev 792) @@ -718,7 +718,7 @@ // the first parapointer, we assume that it's actually no history data. if (dwMemPos + 2 < dwMemLength && (pifh->special & 0x02)) { - size_t nflt = LittleEndianW(*((uint16*)(lpStream + dwMemPos))); + const size_t nflt = LittleEndianW(*((uint16*)(lpStream + dwMemPos))); dwMemPos += 2; if (nflt * 8 <= dwMemLength - dwMemPos && dwMemPos + nflt * 8 <= minptr) @@ -766,6 +766,17 @@ dwMemPos -= 2; } } + // Another non-conforming application is unmo3 < v2.4.0.1, which doesn't set the special bit + // at all, but still writes the two edit history length bytes (zeroes)... + else if(dwMemPos + 2 < dwMemLength && pifh->highlight_major == 0 && pifh->highlight_minor == 0 && pifh->cmwt == 0x0214 && pifh->cwtv == 0x0214 && pifh->reserved == 0 && (pifh->special & (0x02|0x04)) == 0) + { + const size_t nflt = LittleEndianW(*((uint16*)(lpStream + dwMemPos))); + if(nflt == 0) + { + dwMemPos += 2; + } + } + // Reading MIDI Output & Macros if (m_dwSongFlags & SONG_EMBEDMIDICFG) { @@ -866,9 +877,9 @@ continue; } - UINT ch = b & IT_bitmask_patternChanField_c; // 0x7f We have some data grab a byte keeping only 127 bits + UINT ch = b & IT_bitmask_patternChanField_c; // 0x7f We have some data grab a byte keeping only 7 bits if (ch) - ch = (ch - 1);// & IT_bitmask_patternChanMask_c; // 0x3f mask of the byte again, keeping only 64 bits + ch = (ch - 1);// & IT_bitmask_patternChanMask_c; // 0x3f mask of the byte again, keeping only 6 bits if (b & IT_bitmask_patternChanEnabled_c) // 0x80 check if the upper bit is enabled. { @@ -2776,12 +2787,12 @@ const BYTE *p = (const BYTE *)pData; UINT nPos = 0; - while (nPos+8 < nLen) // so plugin data chunks must be multiples of 8 bytes? + while (nPos+8 < nLen) // read 4 magic bytes + size { DWORD nPluginSize; UINT nPlugin; - nPluginSize = *(DWORD *)(p+nPos+4); // why +4? + nPluginSize = *(DWORD *)(p+nPos+4); if (nPluginSize > nLen-nPos-8) break;; if ((*(DWORD *)(p+nPos)) == 'XFHC') { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-01-31 23:32:19
|
Revision: 793 http://modplug.svn.sourceforge.net/modplug/?rev=793&view=rev Author: saga-games Date: 2011-01-31 23:32:12 +0000 (Mon, 31 Jan 2011) Log Message: ----------- [Fix] IT Compatibility: Bidi loops are now treated like in IT's software mixer. Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/soundlib/Fastmix.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2011-01-30 14:50:20 UTC (rev 792) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2011-01-31 23:32:12 UTC (rev 793) @@ -1885,6 +1885,9 @@ const bool bPaused = pSndFile->IsPaused(); const bool bPatLoop = (pSndFile->m_dwSongFlags & SONG_PATTERNLOOP) ? true : false; pSndFile->ResetChannels(); + // Select correct bidi loop mode when playing a module. + pSndFile->SetupITBidiMode(); + if ((m_pSndFile) || (m_dwStatus & MODSTATUS_PLAYING)) PauseMod(); if (((m_pSndFile) && (pSndFile != m_pSndFile)) || (!m_dwElapsedTime)) CSoundFile::ResetAGC(); m_pSndFile = pSndFile; Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-01-30 14:50:20 UTC (rev 792) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-01-31 23:32:12 UTC (rev 793) @@ -479,6 +479,8 @@ m_pSndFile->m_nDefaultRowsPerBeat = GetDlgItemInt(IDC_ROWSPERBEAT); m_pSndFile->m_nDefaultRowsPerMeasure = GetDlgItemInt(IDC_ROWSPERMEASURE); + m_pSndFile->SetupITBidiMode(); + if(CChannelManagerDlg::sharedInstance(FALSE) && CChannelManagerDlg::sharedInstance()->IsDisplayed()) CChannelManagerDlg::sharedInstance()->Update(); CDialog::OnOK(); @@ -1433,13 +1435,15 @@ combo->SetItemData(combo->AddString("No note"), 0); AppendNotesToControlEx(*combo, pSndFile, m_nInstr); - if (m_nNote <= NOTE_MAX) + if (NOTE_IS_VALID(m_nNote)) { + // Normal note / no note const MODCOMMAND::NOTE noteStart = (pSndFile != nullptr) ? pSndFile->GetModSpecifications().noteMin : 1; combo->SetCurSel(m_nNote - (noteStart - 1)); } else { + // Special notes for(int i = combo->GetCount() - 1; i >= 0; --i) { if(combo->GetItemData(i) == m_nNote) @@ -3191,7 +3195,6 @@ for(size_t n = 0; n < num; n++) { - CString temp; FileHistory *hist = &(m_pModDoc->GetFileHistory()->at(n)); totalTime += hist->openTime; @@ -3200,9 +3203,8 @@ _tcsftime(szDate, sizeof(szDate), _T("%d %b %Y, %H:%M:%S"), &hist->loadDate); // Time + stuff uint32 duration = (uint32)((double)(hist->openTime) / HISTORY_TIMER_PRECISION); - temp.Format(_T("Loaded %s, open in the editor for %luh %02lum %02lus\r\n"), + s.AppendFormat(_T("Loaded %s, open in the editor for %luh %02lum %02lus\r\n"), szDate, duration / 3600, (duration / 60) % 60, duration % 60); - s += temp; } if(num == 0) { Modified: trunk/OpenMPT/soundlib/Fastmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Fastmix.cpp 2011-01-30 14:50:20 UTC (rev 792) +++ trunk/OpenMPT/soundlib/Fastmix.cpp 2011-01-31 23:32:12 UTC (rev 793) @@ -1479,8 +1479,8 @@ pChn->nPos = pChn->nLength - nDeltaHi - (nDeltaLo>>16); pChn->nPosLo = nDeltaLo & 0xffff; // Impulse Tracker's software mixer would put a -2 (instead of -1) in the following line (doesn't happen on a GUS) - // TODO: How can we add IT compatibility here without slowing down the mixing routines? - if ((pChn->nPos <= pChn->nLoopStart) || (pChn->nPos >= pChn->nLength)) pChn->nPos = pChn->nLength-1; + // The bidi mode flag is stored in a static CSoundFile variable. Dirty! + if ((pChn->nPos <= pChn->nLoopStart) || (pChn->nPos >= pChn->nLength)) pChn->nPos = pChn->nLength - (CSoundFile::m_bITBidiMode ? 2 : 1); } else { if (nInc < 0) // This is a bug Modified: trunk/OpenMPT/soundlib/Snd_defs.h =================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h 2011-01-30 14:50:20 UTC (rev 792) +++ trunk/OpenMPT/soundlib/Snd_defs.h 2011-01-31 23:32:12 UTC (rev 793) @@ -349,7 +349,6 @@ #define SNDMIX_MAXDEFAULTPAN 0x80000 // Used by the MOD loader (currently unused) #define SNDMIX_MUTECHNMODE 0x100000 // Notes are not played on muted channels #define SNDMIX_SMARTRAMP 0x200000 // Don't apply ramping to sample beginning, but only when it ends -#define SNDMIX_ITBIDIMODE 0x400000 // Process bidi loops like Impulse Tracker (see Fastmix.cpp for explanation) #define MAX_GLOBAL_VOLUME 256 Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-01-30 14:50:20 UTC (rev 792) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-01-31 23:32:12 UTC (rev 793) @@ -438,6 +438,7 @@ CTuningCollection* CSoundFile::s_pTuningsSharedBuiltIn(0); CTuningCollection* CSoundFile::s_pTuningsSharedLocal(0); uint8 CSoundFile::s_DefaultPlugVolumeHandling = PLUGIN_VOLUMEHANDLING_IGNORE; +bool CSoundFile::m_bITBidiMode = false; #pragma warning(disable : 4355) // "'this' : used in base member initializer list" CSoundFile::CSoundFile() : @@ -3031,6 +3032,7 @@ m_nType = newType; SetModSpecsPointer(m_pModSpecs, m_nType); SetupMODPanning(); // Setup LRRL panning scheme if needed + SetupITBidiMode(); // Setup IT bidi mode m_ModFlags = m_ModFlags & GetModFlagMask(oldtype, newType); @@ -3087,3 +3089,11 @@ ChnSettings[nChn].nPan = (((nChn & 3) == 1) || ((nChn & 3) == 2)) ? 0xC0 : 0x40; } } + + +// Set or unset the IT bidi loop mode (see Fastmix.cpp for an explanation). The variable has to be static... +void CSoundFile::SetupITBidiMode() +//-------------------------------- +{ + CSoundFile::m_bITBidiMode = IsCompatibleMode(TRK_IMPULSETRACKER); +} Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2011-01-30 14:50:20 UTC (rev 792) +++ trunk/OpenMPT/soundlib/Sndfile.h 2011-01-31 23:32:12 UTC (rev 793) @@ -107,7 +107,7 @@ INSTRUMENTENVELOPE PanEnv; // Panning envelope data INSTRUMENTENVELOPE PitchEnv; // Pitch / filter envelope data - BYTE NoteMap[128]; // Note mapping, f.e. C-5 => D-5 + BYTE NoteMap[128]; // Note mapping, f.e. C-5 => D-5. WORD Keyboard[128]; // Sample mapping, f.e. C-5 => Sample 1 BYTE nNNA; // New note action @@ -376,6 +376,7 @@ CHAR szLibraryName[64]; // original DLL name }; // Size should be 128 typedef SNDMIXPLUGININFO* PSNDMIXPLUGININFO; +STATIC_ASSERT(sizeof(SNDMIXPLUGININFO) == 128); // this is directly written to files, so the size must be correct! struct SNDMIXPLUGIN { @@ -452,6 +453,7 @@ CHAR szMidiZXXExt[128*32]; }; typedef MODMIDICFG* LPMODMIDICFG; +STATIC_ASSERT(sizeof(MODMIDICFG) == 4896); // this is directly written to files, so the size must be correct! typedef VOID (__cdecl * LPSNDMIXHOOKPROC)(int *, unsigned long, unsigned long); // buffer, samples, channels @@ -581,11 +583,12 @@ static LPSNDMIXHOOKPROC gpSndMixHook; static PMIXPLUGINCREATEPROC gpMixPluginCreateProc; static uint8 s_DefaultPlugVolumeHandling; + static bool m_bITBidiMode; // Process bidi loops like Impulse Tracker (see Fastmix.cpp for an explanation) public: // for Editing - CModDoc* m_pModDoc; + CModDoc* m_pModDoc; // Can be a null pointer f.e. when previewing samples from the treeview. MODTYPE m_nType; CHANNELINDEX m_nChannels; SAMPLEINDEX m_nSamples; @@ -711,6 +714,8 @@ CHANNELINDEX ReArrangeChannels(const vector<CHANNELINDEX>& fromToArray); bool MoveChannel(UINT chn_from, UINT chn_to); + void SetupITBidiMode(); + bool InitChannel(CHANNELINDEX nChn); void ResetChannelState(CHANNELINDEX chn, BYTE resetStyle); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-02-11 23:29:06
|
Revision: 797 http://modplug.svn.sourceforge.net/modplug/?rev=797&view=rev Author: saga-games Date: 2011-02-11 23:28:58 +0000 (Fri, 11 Feb 2011) Log Message: ----------- [Mod] The visited rows mechanism is now used everywhere, not only for song length detection. This introduces some great changes in the code. One advantage of the new mechanism is that backwards playing patterns can now be exported to WAV properly (hehe). The new code might break the "loop song" feature sometimes, let's see how that works... [Ref] Some changes to GetLength()'s return values and other stuff related to the modification above. [Mod] OpenMPT: Version is now 1.19.00.23 Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/Mod2wave.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2011-02-11 22:45:26 UTC (rev 796) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2011-02-11 23:28:58 UTC (rev 797) @@ -303,24 +303,26 @@ if ((bIsPlaying) && (pSndFile->m_dwSongFlags & SONG_PATTERNLOOP)) { BEGIN_CRITICAL(); + // update channel parameters and play time + m_pModDoc->SetElapsedTime(m_nScrollPos, 0); + pSndFile->m_nPattern = n; pSndFile->m_nCurrentPattern = pSndFile->m_nNextPattern = m_nScrollPos; pMainFrm->ResetNotificationBuffer(); //rewbs.toCheck pSndFile->m_nNextRow = 0; END_CRITICAL(); - } else - if (m_pParent->GetFollowSong()) + } else if (m_pParent->GetFollowSong()) { BEGIN_CRITICAL(); DWORD dwPaused = pSndFile->m_dwSongFlags & (SONG_PAUSED|SONG_STEP|SONG_PATTERNLOOP); + + //if (!(dwPaused & SONG_PATTERNLOOP)) // why? + // update channel parameters and play time + m_pModDoc->SetElapsedTime(m_nScrollPos, 0); + pSndFile->m_nCurrentPattern = m_nScrollPos; pSndFile->SetCurrentOrder(m_nScrollPos); pSndFile->m_dwSongFlags |= dwPaused; - //if (!(dwPaused & SONG_PATTERNLOOP)) // why? - { - // update channel parameters and play time - m_pModDoc->SetElapsedTime(m_nScrollPos, 0); - } if (bIsPlaying) pMainFrm->ResetNotificationBuffer(); END_CRITICAL(); } Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-02-11 22:45:26 UTC (rev 796) +++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-02-11 23:28:58 UTC (rev 797) @@ -690,6 +690,8 @@ DWORD dwOrds = m_pSndFile->Order.GetLengthFirstEmpty(); if ((m_nMaxPatterns < dwOrds) && (dwOrds > 0)) l = (l*m_nMaxPatterns) / dwOrds; } + m_pSndFile->InitializeVisitedRows(true); + if (l < max) max = l; if (progress != NULL) @@ -1048,6 +1050,7 @@ CSoundFile::InitPlayer(TRUE); CSoundFile::gdwSoundSetup |= SNDMIX_DIRECTTODISK; if ((!m_dwFileLimit) && (!m_dwSongLimit)) CSoundFile::gdwSoundSetup |= SNDMIX_NOBACKWARDJUMPS; + m_pSndFile->InitializeVisitedRows(true); // Setting up file limits and progress range if ((!m_dwFileLimit) || (m_dwFileLimit > 512000)) m_dwFileLimit = 512000; m_dwFileLimit <<= 10; @@ -1138,6 +1141,7 @@ CSoundFile::gdwSoundSetup &= ~(SNDMIX_DIRECTTODISK|SNDMIX_NOBACKWARDJUMPS); m_pSndFile->SetRepeatCount(oldrepeat); m_pSndFile->m_nMaxOrderPosition = 0; + m_pSndFile->InitializeVisitedRows(true); CMainFrame::UpdateAudioParameters(TRUE); // Success if (bSaveWave) Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-02-11 22:45:26 UTC (rev 796) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-02-11 23:28:58 UTC (rev 797) @@ -1923,6 +1923,7 @@ //m_SndFile.m_dwSongFlags &= ~SONG_STEP; m_SndFile.m_dwSongFlags &= ~(SONG_STEP|SONG_PATTERNLOOP); m_SndFile.SetCurrentPos(0); + m_SndFile.InitializeVisitedRows(true); pMainFrm->ResetElapsedTime(); BEGIN_CRITICAL(); m_SndFile.ResumePlugins(); @@ -3692,7 +3693,7 @@ if(pMainFrm == NULL) return; - const double dPatternPlaytime = m_SndFile.GetPlaybackTimeAt(nOrd, nRow, false); + const double dPatternPlaytime = m_SndFile.GetPlaybackTimeAt(nOrd, nRow, true); pMainFrm->SetElapsedTime((DWORD) (max(0, dPatternPlaytime) * 1000)); } Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2011-02-11 22:45:26 UTC (rev 796) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-02-11 23:28:58 UTC (rev 797) @@ -5453,7 +5453,7 @@ ORDERINDEX currentOrder = SendCtrlMessage(CTRLMSG_GETCURRENTORDER); if(pSndFile->Order[currentOrder] == m_nPattern) { - const double t = pSndFile->GetPlaybackTimeAt(currentOrder, m_nRow, true); + const double t = pSndFile->GetPlaybackTimeAt(currentOrder, m_nRow, false); if(t < 0) msg.Format("Unable to determine the time. Possible cause: No order %d, row %d found from play sequence", currentOrder, m_nRow); else Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-02-11 22:45:26 UTC (rev 796) +++ trunk/OpenMPT/mptrack/version.h 2011-02-11 23:28:58 UTC (rev 797) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 19 #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/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-02-11 22:45:26 UTC (rev 796) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-02-11 23:28:58 UTC (rev 797) @@ -73,23 +73,24 @@ } */ -double CSoundFile::GetLength(bool bAdjust, ORDERINDEX endOrder, ROWINDEX endRow) -//------------------------------------------------------------------------------ -{ - bool dummy = false; - double result = GetLength(dummy, bAdjust, endOrder, endRow); - return result; -} - // Get mod length in various cases. Parameters: -// &targetReached: Will be set to true if the specified order/row combination has been reached while going through the module. -// bAdjust: If enabled, the mod parameters (such as global volume, speed, tempo, etc...) will be memorized (if the target has been reached) when leaving the function (i.e. they won't be reset to the previous values) -// endOrder: Order which should be reached (ORDERINDEX_INVALID means whole song) -// endRow: Row in that order that should be reached -double CSoundFile::GetLength(bool& targetReached, bool bAdjust, ORDERINDEX endOrder, ROWINDEX endRow) -//--------------------------------------------------------------------------------------------------- +// [in] bAdjust: If enabled, the mod parameters (such as global volume, speed, tempo, etc...) will be memorized (if the target has been reached) when leaving the function (i.e. they won't be reset to the previous values) +// [in] endOrder: Order which should be reached (ORDERINDEX_INVALID means whole song) +// [in] endRow: Row in that order that should be reached +// [out] duration: total time in seconds +// [out] targetReached: true if the specified order/row combination has been reached while going through the module. +// [out] endOrder: last parsed order (if no target is specified, this is the first order that is parsed twice, i.e. not the *last* played order) +// [out] endRow: last parsed row (dito) +GetLengthType CSoundFile::GetLength(bool bAdjust, ORDERINDEX endOrder, ROWINDEX endRow) +//------------------------------------------------------------------------------------- { + GetLengthType retval; + retval.duration = 0.0; + retval.targetReached = false; + retval.endOrder = ORDERINDEX_INVALID; + retval.endRow = ROWINDEX_INVALID; + // -> CODE#0022 // -> DESC="alternative BPM/Speed interpretation method" // UINT dwElapsedTime=0, nRow=0, nCurrentPattern=0, nNextPattern=0, nPattern=Order[0]; @@ -166,7 +167,7 @@ //Check whether target reached. if(nCurrentPattern == endOrder && nRow == endRow) { - targetReached = true; + retval.targetReached = true; break; } @@ -420,10 +421,17 @@ } } + if(retval.targetReached || endOrder == ORDERINDEX_INVALID || endRow == ROWINDEX_INVALID) + { + retval.endOrder = nCurrentPattern; + retval.endRow = nRow; + } + retval.duration = dElapsedTime / 1000.0; + // Store final variables if (bAdjust) { - if (targetReached || endOrder == ORDERINDEX_INVALID || endRow == ROWINDEX_INVALID) + if (retval.targetReached || endOrder == ORDERINDEX_INVALID || endRow == ROWINDEX_INVALID) { // Target found, or there is no target (i.e. play whole song)... m_nGlobalVolume = nGlbVol; @@ -438,7 +446,7 @@ if (vols[n] != 0xFF) { if (vols[n] > 64) vols[n] = 64; - Chn[n].nVolume = vols[n] << 2; + Chn[n].nVolume = vols[n] * 4; } } } else @@ -449,10 +457,10 @@ m_nGlobalVolume = m_nDefaultGlobalVolume; } // When adjusting the playback status, we will also want to update the visited rows vector according to the current position. - m_bVisitedRows = visitedRows; + m_VisitedRows = visitedRows; } - return dElapsedTime / 1000.0; + return retval; } @@ -1194,7 +1202,7 @@ //rewbs: Copy mute and FX status from master chan. //I'd like to copy other flags too, but this would change playback behaviour. - p->dwFlags |= (pChn->dwFlags & CHN_MUTE) | (pChn->dwFlags & CHN_NOFX); + p->dwFlags |= (pChn->dwFlags & (CHN_MUTE|CHN_NOFX)); p->nMasterChn = nChn+1; p->nCommand = 0; @@ -1241,7 +1249,8 @@ //------------------------------- { MODCHANNEL *pChn = Chn; - int nBreakRow = -1, nPosJump = -1, nPatLoopRow = -1; + ROWINDEX nBreakRow = ROWINDEX_INVALID, nPatLoopRow = ROWINDEX_INVALID; + ORDERINDEX nPosJump = ORDERINDEX_INVALID; // -> CODE#0010 // -> DESC="add extended parameter mechanism to pattern effects" @@ -2088,45 +2097,28 @@ if(m_dwSongFlags & SONG_FIRSTTICK) { // Pattern Loop - if (nPatLoopRow >= 0) + if (nPatLoopRow != ROWINDEX_INVALID) { m_nNextPattern = m_nCurrentPattern; m_nNextRow = nPatLoopRow; if (m_nPatternDelay) m_nNextRow++; + // As long as the pattern loop is running, mark the looped rows as not visited yet + for(ROWINDEX nRow = nPatLoopRow; nRow <= m_nRow; nRow++) + { + SetRowVisited(m_nCurrentPattern, nRow, false); + } } else // Pattern Break / Position Jump only if no loop running - if ((nBreakRow >= 0) || (nPosJump >= 0)) + if ((nBreakRow != ROWINDEX_INVALID) || (nPosJump != ORDERINDEX_INVALID)) { - bool bNoLoop = false; - if (nPosJump < 0) nPosJump = m_nCurrentPattern+1; - if (nBreakRow < 0) nBreakRow = 0; + if (nPosJump == ORDERINDEX_INVALID) nPosJump = m_nCurrentPattern + 1; + if (nBreakRow == ROWINDEX_INVALID) nBreakRow = 0; + m_dwSongFlags |= SONG_BREAKTOROW; - if(nBreakRow >= 0) m_dwSongFlags |= SONG_BREAKTOROW; - // ModPlug Tracker & ModPlugin allow backward jumps - #ifndef FASTSOUNDLIB - if ((nPosJump < (int)m_nCurrentPattern) - || ((nPosJump == (int)m_nCurrentPattern) && (nBreakRow <= (int)m_nRow))) + if (nPosJump >= Order.size()) { - if (!IsValidBackwardJump(m_nCurrentPattern, m_nRow, nPosJump, nBreakRow)) - { - if (m_nRepeatCount) - { - if (m_nRepeatCount > 0) m_nRepeatCount--; - } else - { - #ifdef MODPLUG_TRACKER - if (gdwSoundSetup & SNDMIX_NOBACKWARDJUMPS) - #endif - // Backward jump disabled - bNoLoop = true; - } - } - } - #endif // FASTSOUNDLIB - //rewbs.fix - //if (((!bNoLoop) && (nPosJump < MAX_ORDERS)) - if (nPosJump>=Order.size()) nPosJump = 0; + } // This checks whether we're jumping to the same row we're already on. // Sounds pretty stupid and pointless to me. And noone else does this, either. @@ -2145,6 +2137,7 @@ m_bPatternTransitionOccurred = true; } } //Ends condition (nBreakRow >= 0) || (nPosJump >= 0) + //SetRowVisited(m_nCurrentPattern, m_nRow); } return TRUE; } @@ -3864,6 +3857,7 @@ } +// This is how backward jumps should not be tested. :) (now unused) BOOL CSoundFile::IsValidBackwardJump(UINT nStartOrder, UINT nStartRow, UINT nJumpOrder, UINT nJumpRow) const //---------------------------------------------------------------------------------------------------------- { @@ -4236,7 +4230,7 @@ { if(pRowVector == nullptr) { - pRowVector = &m_bVisitedRows; + pRowVector = &m_VisitedRows; } pRowVector->resize(Order.GetLengthTailTrimmed()); @@ -4268,7 +4262,7 @@ if(pRowVector == nullptr) { - pRowVector = &m_bVisitedRows; + pRowVector = &m_VisitedRows; } // The module might have been edited in the meantime - so we have to extend this a bit. @@ -4296,7 +4290,7 @@ if(pRowVector == nullptr) { - pRowVector = &m_bVisitedRows; + pRowVector = &m_VisitedRows; } // The row slot for this row has not been assigned yet - Just return false, as this means that the program has not played the row yet. Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-02-11 22:45:26 UTC (rev 796) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-02-11 23:28:58 UTC (rev 797) @@ -755,6 +755,8 @@ m_nNextRow = 0; m_nRow = 0; + InitializeVisitedRows(true); + switch(m_nTempoMode) { case tempo_mode_alternative: @@ -1212,7 +1214,7 @@ //rewbs.VSTCompliance void CSoundFile::SuspendPlugins() -//------------------------------ +//------------------------------- { for (UINT iPlug=0; iPlug<MAX_MIXPLUGINS; iPlug++) { @@ -1269,7 +1271,7 @@ void CSoundFile::RecalculateGainForAllPlugs() -//------------------------------------------ +//------------------------------------------- { for (UINT iPlug=0; iPlug<MAX_MIXPLUGINS; iPlug++) { @@ -1337,7 +1339,7 @@ } ORDERINDEX CSoundFile::FindOrder(PATTERNINDEX nPat, UINT startFromOrder, bool direction) -//------------------------------------------------------------------------------------- +//-------------------------------------------------------------------------------------- { ORDERINDEX foundAtOrder = ORDERINDEX_INVALID; ORDERINDEX candidateOrder = 0; @@ -1626,7 +1628,7 @@ } bool CSoundFile::MoveChannel(UINT chnFrom, UINT chnTo) -//----------------------------------------------------- +//---------------------------------------------------- { //Implementation of move channel using ReArrangeChannels(...). So this function //only creates correct newOrder-vector used in the ReArrangeChannels(...). @@ -1734,7 +1736,7 @@ #ifndef MODPLUG_NO_FILESAVE UINT CSoundFile::WriteSample(FILE *f, MODSAMPLE *pSmp, UINT nFlags, UINT nMaxLen) -//----------------------------------------------------------------------------------- +//------------------------------------------------------------------------------- { UINT len = 0, bufcount; char buffer[4096]; @@ -1949,7 +1951,7 @@ // 6 = unsigned 16-bit PCM data UINT CSoundFile::ReadSample(MODSAMPLE *pSmp, UINT nFlags, LPCSTR lpMemFile, DWORD dwMemLength, const WORD format) -//----------------------------------------------------------------------------------------------------------------------- +//--------------------------------------------------------------------------------------------------------------- { if ((!pSmp) || (pSmp->nLength < 2) || (!lpMemFile)) return 0; @@ -2429,7 +2431,7 @@ void CSoundFile::AdjustSampleLoop(MODSAMPLE *pSmp) -//---------------------------------------------------- +//------------------------------------------------ { if ((!pSmp->pSample) || (!pSmp->nLength)) return; if (pSmp->nLoopEnd > pSmp->nLength) pSmp->nLoopEnd = pSmp->nLength; @@ -2578,7 +2580,7 @@ void CSoundFile::FrequencyToTranspose(MODSAMPLE *psmp) -//-------------------------------------------------------- +//---------------------------------------------------- { int f2t = FrequencyToTranspose(psmp->nC5Speed); int transp = f2t >> 7; @@ -2814,14 +2816,14 @@ if (!from || from >= MAX_SAMPLES || !to || to >= MAX_SAMPLES) return false; if (/*!Ins[from].pSample ||*/ Samples[to].pSample) return true; - MODSAMPLE *pinsf = &Samples[from]; - MODSAMPLE *pinst = &Samples[to]; + MODSAMPLE *pFrom = &Samples[from]; + MODSAMPLE *pTo = &Samples[to]; - memcpy(pinst, pinsf, sizeof(MODSAMPLE)); + memcpy(pTo, pFrom, sizeof(MODSAMPLE)); - pinsf->pSample = nullptr; - pinsf->nLength = 0; - pinsf->uFlags &= ~(CHN_16BIT); + pFrom->pSample = nullptr; + pFrom->nLength = 0; + pFrom->uFlags &= ~(CHN_16BIT); return true; } @@ -2847,7 +2849,7 @@ { // m_defaultInstrument is currently only used to get default values for extented properties. // In the future we can make better use of this. - memset(&m_defaultInstrument, 0, sizeof(MODINSTRUMENT)); + MemsetZero(m_defaultInstrument); m_defaultInstrument.nResampling = SRCMODE_DEFAULT; m_defaultInstrument.nFilterMode = FLTMODE_UNCHANGED; m_defaultInstrument.nPPC = 5*12; @@ -2889,7 +2891,7 @@ } bool CSoundFile::LoadStaticTunings() -//----------------------------------- +//---------------------------------- { if(s_pTuningsSharedLocal || s_pTuningsSharedBuiltIn) return true; //For now not allowing to reload tunings(one should be careful when reloading them @@ -2941,8 +2943,8 @@ -void CSoundFile::SetDefaultInstrumentValues(MODINSTRUMENT *pIns) -//----------------------------------------------------------------- +void CSoundFile::SetDefaultInstrumentValues(MODINSTRUMENT *pIns) +//-------------------------------------------------------------- { pIns->nResampling = m_defaultInstrument.nResampling; pIns->nFilterMode = m_defaultInstrument.nFilterMode; @@ -2957,7 +2959,7 @@ long CSoundFile::GetSampleOffset() -//------------------------------- +//-------------------------------- { //TODO: This is where we could inform patterns of the exact song position when playback starts. //order: m_nNextPattern @@ -2967,7 +2969,7 @@ } string CSoundFile::GetNoteName(const CTuning::NOTEINDEXTYPE& note, const INSTRUMENTINDEX inst) const -//---------------------------------------------------------------------------------- +//-------------------------------------------------------------------------------------------------- { if((inst >= MAX_INSTRUMENTS && inst != INSTRUMENTINDEX_INVALID) || note < 1 || note > NOTE_MAX) return "BUG"; @@ -3054,12 +3056,11 @@ } -double CSoundFile::GetPlaybackTimeAt(ORDERINDEX ord, ROWINDEX row, bool resetVars) -//-------------------------------------------------------------------------------- +double CSoundFile::GetPlaybackTimeAt(ORDERINDEX ord, ROWINDEX row, bool updateVars) +//--------------------------------------------------------------------------------- { - bool targetReached = false; - const double t = GetLength(targetReached, !resetVars, ord, row); - if(targetReached) return t; + const GetLengthType t = GetLength(updateVars, ord, row); + if(t.targetReached) return t.duration; else return -1; //Given position not found from play sequence. } Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2011-02-11 22:45:26 UTC (rev 796) +++ trunk/OpenMPT/soundlib/Sndfile.h 2011-02-11 23:28:58 UTC (rev 797) @@ -487,6 +487,16 @@ typedef vector<VisitedRowsBaseType> VisitedRowsType; +// Return values for GetLength() +struct GetLengthType +{ + double duration; // total time in seconds + bool targetReached; // true if the specified order/row combination has been reached while going through the module + ORDERINDEX endOrder; // last parsed order (if no target is specified, this is the first order that is parsed twice, i.e. not the *last* played order) + ROWINDEX endRow; // last parsed row (dito) +}; + + //Note: These are bit indeces. MSF <-> Mod(Specific)Flag. //If changing these, ChangeModTypeTo() might need modification. const BYTE MSF_COMPATIBLE_PLAY = 0; //IT/MPT/XM @@ -508,8 +518,8 @@ void ChangeModTypeTo(const MODTYPE& newType); // Returns value in seconds. If given position won't be played at all, returns -1. - // If resetVars is true, the state of various playback variables will be retained. - double GetPlaybackTimeAt(ORDERINDEX ord, ROWINDEX row, bool resetVars); + // If updateVars is true, the state of various playback variables will be updated according to the playback position. + double GetPlaybackTimeAt(ORDERINDEX ord, ROWINDEX row, bool updateVars); uint16 GetModFlags() const {return m_ModFlags;} void SetModFlags(const uint16 v) {m_ModFlags = v;} @@ -566,7 +576,7 @@ const CModSpecifications* m_pModSpecs; // For handling backwards jumps and stuff to prevent infinite loops when counting the mod length or rendering to wav. - VisitedRowsType m_bVisitedRows; + VisitedRowsType m_VisitedRows; @@ -693,15 +703,13 @@ UINT GetMusicSpeed() const { return m_nMusicSpeed; } UINT GetMusicTempo() const { return m_nMusicTempo; } - double GetLength(bool bAdjust, ORDERINDEX ord = ORDERINDEX_MAX, ROWINDEX row = ROWINDEX_MAX); -private: //Get modlength in various cases: total length, length to //specific order&row etc. Return value is in seconds. - double GetLength(bool& targetReached, bool bAdjust, ORDERINDEX ord, ROWINDEX row); + GetLengthType GetLength(bool bAdjust, ORDERINDEX ord = ORDERINDEX_INVALID, ROWINDEX row = ROWINDEX_INVALID); public: //Returns song length in seconds. - DWORD GetSongTime() { return static_cast<DWORD>((m_nTempoMode == tempo_mode_alternative) ? GetLength(false) + 1.0 : GetLength(false) + 0.5); } + DWORD GetSongTime() { return static_cast<DWORD>((m_nTempoMode == tempo_mode_alternative) ? GetLength(false).duration + 1.0 : GetLength(false).duration + 0.5); } // A repeat count value of -1 means infinite loop void SetRepeatCount(int n) { m_nRepeatCount = n; } @@ -901,6 +909,7 @@ BOOL IsValidBackwardJump(UINT nStartOrder, UINT nStartRow, UINT nJumpOrder, UINT nJumpRow) const; void UpdateTimeSignature(); + UINT GetNumTicksOnCurrentRow() { return m_nMusicSpeed * (m_nPatternDelay + 1) + m_nFrameDelay; }; public: // Write pattern effect functions bool TryWriteEffect(PATTERNINDEX nPat, ROWINDEX nRow, BYTE nEffect, BYTE nParam, bool bIsVolumeEffect, CHANNELINDEX nChn = CHANNELINDEX_INVALID, bool bAllowMultipleEffects = true, bool bAllowNextRow = false, bool bRetry = true); Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2011-02-11 22:45:26 UTC (rev 796) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2011-02-11 23:28:58 UTC (rev 797) @@ -657,7 +657,7 @@ if ((m_nPattern == Order.GetInvalidPatIndex()) || (m_nCurrentPattern >= Order.size())) { - if (!m_nRepeatCount) return FALSE; + //if (!m_nRepeatCount) return FALSE; ORDERINDEX nRestartPosOverride = m_nRestartPos; if(!m_nRestartPos && m_nCurrentPattern <= Order.size() && m_nCurrentPattern > 0) @@ -734,9 +734,10 @@ } //Check for end of song or bad pattern if (m_nCurrentPattern >= Order.size() - || - (Order[m_nCurrentPattern] >= Patterns.Size()) - || (!Patterns[Order[m_nCurrentPattern]]) ) { + || (Order[m_nCurrentPattern] >= Patterns.Size()) + || (!Patterns[Order[m_nCurrentPattern]]) ) + { + InitializeVisitedRows(true); return FALSE; } @@ -761,9 +762,42 @@ } // Weird stuff? - if ((m_nPattern >= Patterns.Size()) || (!Patterns[m_nPattern])) return FALSE; + if (!Patterns.IsValidPat(m_nPattern)) return FALSE; // Should never happen if (m_nRow >= Patterns[m_nPattern].GetNumRows()) m_nRow = 0; + + // Has this row been visited before? We might want to stop playback now. + // But: We will not mark the row as modified if the song is not in loop mode but + // the pattern loop (editor flag, not to be confused with the pattern loop effect) + // flag is set - because in that case, the module would stop after the first pattern loop... + const bool overrideLoopCheck = (m_nRepeatCount != -1) && (m_dwSongFlags & SONG_PATTERNLOOP); + if(!overrideLoopCheck && IsRowVisited(m_nCurrentPattern, m_nRow, true)) + { + InitializeVisitedRows(true); + if(m_nRepeatCount) + { + // repeat count == -1 means repeat infinitely. + if (m_nRepeatCount > 0) + { + m_nRepeatCount--; + } + // We shouldn't forget that we actually just visited this row (InitializeVisitedRows cleared it). + SetRowVisited(m_nCurrentPattern, m_nRow); + } else + { +#ifdef MODPLUG_TRACKER + // Let's check again if this really is the end of the song. + // The visited rows vector might have been screwed up while editing... + GetLengthType t = GetLength(false); + if(t.endOrder == m_nCurrentPattern && t.endRow == m_nRow) +#endif // MODPLUG_TRACKER + { + // This is really the song's end! + return FALSE; + } + } + } + m_nNextRow = m_nRow + 1; if (m_nNextRow >= Patterns[m_nPattern].GetNumRows()) { @@ -1611,7 +1645,6 @@ if ((pChn->nAutoVibDepth >> 8) > pSmp->nVibDepth) pChn->nAutoVibDepth = pSmp->nVibDepth << 8; } - const int vibpos = pChn->nAutoVibPos & 0xFF; pChn->nAutoVibPos += pSmp->nVibRate; int vdelta; switch(pSmp->nVibType) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-02-14 18:35:38
|
Revision: 800 http://modplug.svn.sourceforge.net/modplug/?rev=800&view=rev Author: saga-games Date: 2011-02-14 18:35:31 +0000 (Mon, 14 Feb 2011) Log Message: ----------- [Fix] Wave Export: Rendering an order selection was a bit broken since rev. 797 [Imp] Changes to song end detection in "loop once" mode. [Mod] OpenMPT: Version is now 1.19.00.24 Modified Paths: -------------- trunk/OpenMPT/mptrack/Mod2wave.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-02-14 18:33:16 UTC (rev 799) +++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-02-14 18:35:31 UTC (rev 800) @@ -690,7 +690,6 @@ DWORD dwOrds = m_pSndFile->Order.GetLengthFirstEmpty(); if ((m_nMaxPatterns < dwOrds) && (dwOrds > 0)) l = (l*m_nMaxPatterns) / dwOrds; } - m_pSndFile->InitializeVisitedRows(true); if (l < max) max = l; Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-02-14 18:33:16 UTC (rev 799) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-02-14 18:35:31 UTC (rev 800) @@ -1609,12 +1609,13 @@ } // Render song (or current channel, or current sample/instrument) + m_SndFile.InitializeVisitedRows(true); m_SndFile.SetCurrentPos(0); m_SndFile.m_dwSongFlags &= ~SONG_PATTERNLOOP; if (wsdlg.m_bSelectPlay) { m_SndFile.SetCurrentOrder(wsdlg.m_nMinOrder); - m_SndFile.GetLength(true, wsdlg.m_nMinOrder, 0); + m_SndFile.GetLength(true, wsdlg.m_nMinOrder, 0); // adjust playback variables / visited rows vector m_SndFile.m_nCurrentPattern = wsdlg.m_nMinOrder; m_SndFile.m_nMaxOrderPosition = wsdlg.m_nMaxOrder + 1; } @@ -2393,7 +2394,7 @@ } UINT CModDoc::GetEffectMaskFromIndex(UINT ndx) -//------------------------------------------------------- +//-------------------------------------------- { if (ndx >= MAX_FXINFO) { return 0; Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-02-14 18:33:16 UTC (rev 799) +++ trunk/OpenMPT/mptrack/version.h 2011-02-14 18:35:31 UTC (rev 800) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 19 #define VER_MINOR 00 -#define VER_MINORMINOR 23 +#define VER_MINORMINOR 24 //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/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2011-02-14 18:33:16 UTC (rev 799) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2011-02-14 18:35:31 UTC (rev 800) @@ -773,7 +773,6 @@ const bool overrideLoopCheck = (m_nRepeatCount != -1) && (m_dwSongFlags & SONG_PATTERNLOOP); if(!overrideLoopCheck && IsRowVisited(m_nCurrentPattern, m_nRow, true)) { - InitializeVisitedRows(true); if(m_nRepeatCount) { // repeat count == -1 means repeat infinitely. @@ -781,7 +780,8 @@ { m_nRepeatCount--; } - // We shouldn't forget that we actually just visited this row (InitializeVisitedRows cleared it). + // Forget all but the current row. + InitializeVisitedRows(true); SetRowVisited(m_nCurrentPattern, m_nRow); } else { @@ -793,7 +793,12 @@ #endif // MODPLUG_TRACKER { // This is really the song's end! + InitializeVisitedRows(true); return FALSE; + } else + { + // Ok, this is really dirty, but we have to update the visited rows vector... + GetLength(true, m_nCurrentPattern, m_nRow); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-02-20 15:29:00
|
Revision: 802 http://modplug.svn.sourceforge.net/modplug/?rev=802&view=rev Author: saga-games Date: 2011-02-20 15:28:53 +0000 (Sun, 20 Feb 2011) Log Message: ----------- [Imp] Comments Tab: The instrument list also shows assigned plugins now. [Fix] Pattern Editor: Entering a note-off event in the MOD format created an unnecessary undo event (one for the C effect, one of the 00 param). [Mod] Updated History.txt [Mod] OpenMPT: Version is now 1.19.00.25 Modified Paths: -------------- trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/mptrack/view_com.cpp trunk/OpenMPT/packageTemplate/History.txt Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2011-02-16 13:26:26 UTC (rev 801) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-02-20 15:28:53 UTC (rev 802) @@ -3913,8 +3913,8 @@ // Enter an effect letter in the pattenr -void CViewPattern::TempEnterFX(int c) -//----------------------------------- +void CViewPattern::TempEnterFX(int c, int v) +//------------------------------------------ { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); CModDoc *pModDoc = GetDocument(); @@ -3945,6 +3945,10 @@ m_cmdOld.command = c; } p->command = c; + if(v >= 0) + { + p->param = v; + } // Check for MOD/XM Speed/Tempo command if ((pSndFile->m_nType & (MOD_TYPE_MOD|MOD_TYPE_XM)) @@ -4261,8 +4265,7 @@ // Special case: Convert note off commands to C00 for MOD files if((pSndFile->GetType() == MOD_TYPE_MOD) && (note == NOTE_NOTECUT || note == NOTE_FADE || note == NOTE_KEYOFF)) { - TempEnterFX(CMD_VOLUME); - TempEnterFXparam(0); + TempEnterFX(CMD_VOLUME, 0); return; } Modified: trunk/OpenMPT/mptrack/View_pat.h =================================================================== --- trunk/OpenMPT/mptrack/View_pat.h 2011-02-16 13:26:26 UTC (rev 801) +++ trunk/OpenMPT/mptrack/View_pat.h 2011-02-20 15:28:53 UTC (rev 802) @@ -201,7 +201,7 @@ void TempEnterIns(int val); void TempEnterOctave(int val); void TempEnterVol(int v); - void TempEnterFX(int v); + void TempEnterFX(int c, int v = -1); void TempEnterFXparam(int v); void SetSpacing(int n); void OnClearField(int, bool, bool=false); Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-02-16 13:26:26 UTC (rev 801) +++ trunk/OpenMPT/mptrack/version.h 2011-02-20 15:28:53 UTC (rev 802) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 19 #define VER_MINOR 00 -#define VER_MINORMINOR 24 +#define VER_MINORMINOR 25 //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-02-16 13:26:26 UTC (rev 801) +++ trunk/OpenMPT/mptrack/view_com.cpp 2011-02-20 15:28:53 UTC (rev 802) @@ -35,6 +35,7 @@ INSLIST_SAMPLES, INSLIST_ENVELOPES, INSLIST_FILENAME, + INSLIST_PLUGIN, // -> CODE#0023 // -> DESC="IT project files (.itp)" INSLIST_PATH, @@ -68,6 +69,7 @@ {"Samples", 64}, {"Envelopes", 128}, {"File Name", 128}, + {"Plugin", 128}, // -> CODE#0023 // -> DESC="IT project files (.itp)" {"Path", 128}, @@ -398,6 +400,12 @@ s[sizeof(pIns->filename)] = 0; } break; + case INSLIST_PLUGIN: + if (pIns != nullptr && pIns->nMixPlug > 0 && pSndFile->m_MixPlugins[pIns->nMixPlug - 1].pMixPlugin != nullptr) + { + wsprintf(s, "FX%02d: %s", pIns->nMixPlug, pSndFile->m_MixPlugins[pIns->nMixPlug - 1].Info.szLibraryName); + } + break; // -> CODE#0023 // -> DESC="IT project files (.itp)" case INSLIST_PATH: Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2011-02-16 13:26:26 UTC (rev 801) +++ trunk/OpenMPT/packageTemplate/History.txt 2011-02-20 15:28:53 UTC (rev 802) @@ -10,8 +10,8 @@ (tx XYZ): thanks to XYZ for telling us about the bug -v1.19.01.00 (January 2011, revision 791) ----------------------------------------- +v1.19.01.00 (February 2011, revision 802) +----------------------------------------- Pattern tab [New] <Jojo> Clicking and dragging the row numbers selects the whole row now (Excel / Calc style) - see http://bugs.openmpt.org/view.php?id=45 [New] <Jojo> Experimental feature: Play the whole pattern row when entering notes and chords into the pattern editor. This can be enabled from the setup screen. @@ -23,7 +23,9 @@ [Fix] <Jojo> When jumping to an order which is normally not played, the song variables are now reset (previously, if the main song had f.e. a global volume fade out at the end, this was retained when switching to an unplayed order, effectively muting all sub songs). [Fix] <Jojo> OpenMPT should not crash anymore when applying the Amplify command on a pattern selection that just covers the note / instrument column of the first channel. [Fix] <Jojo> Queueing a "---" or "+++" item now automatically moves the queue "cursor" to the next available pattern. Previously, queueing a "---" pattern restarted the song. + [Fix] <Jojo> Changing a channel name from the pattern editor didn't set the document as modified (http://bugs.openmpt.org/view.php?id=65) [Fix] <Jojo> When restarting a pattern, the timer was not reset properly. + [Fix] <Jojo> Entering a note-off event in the MOD format created an unnecessary undo event. [Reg] <Jojo> The "Position aware timer" option is gone. The position aware timer is now automatically used. It was optional in the first place because of some buggy code, which is now fixed. Pattern tab::Note properties @@ -35,6 +37,10 @@ [Imp] <Jojo> When changing the content of a combobox, the corresponding checkbox is now automatically checked. Likewise, the "Replace By" checkbox is checked if a checkbox or combobox on the "Replace" tab is enabled. [Mod] <Jojo> "Replace All" just creates one undo point now. +Pattern tab::GUI + [Imp] <Jojo> The dodgy note colour is now also customisable. + [Mod] <Jojo> When removing a channel (via context menu) that contains no data in any pattern, no warning is shown anymore. + Sample tab [New] <Jojo> The new "sample grid" feature can create equally-sized sample selections, so it is f.e. easy to split a sample into four equally-sized samples. [Imp] <re> Ctrl + Mouse Wheel can now be used for zooming into the sample data. @@ -61,6 +67,7 @@ Playback [New] <Jojo> New mix mode: Compatible. This is used for MOD / S3M / XM / IT by default and has more appropriate mixing levels for those formats (same levels as Schism Tracker) than mix mode RC3, and it forces soft panning to be *disabled*. Please use compatible mixing levels when working with legacy formats from now on. [Imp] <Jojo> Improved the algorithm for finding a free channel for note playback in the editor (does not affect normal module playback). + [Mod] <Jojo> A new mechanism is used to determine the end of playback. This introduces some great changes in the code. One advantage of the new mechanism is that backwards playing patterns can now be exported to WAV properly (hehe). The new code might not stop playback properly if "loop song" is disabled and the user jumped around in the module - let's see how that works... [Fix] <Jojo> Pattern jumps to the same row + pattern as the jump command are not ignored anymore. (http://forum.openmpt.org/index.php?topic=1810.0) IT @@ -68,6 +75,7 @@ [Imp] <Jojo> IT files made with Modplug Tracker 1.00a5 are now also detected as such. [Mod] <Jojo> Sane values are used again for the "cwtv" and "cmwt" header fields when saving IT files; in fact the same values as in compatibility export are used. To be able to distinguish between raped and compatibility-exported IT files, "OMPT" is written in the "reserved" header field. As a consequence, IT files made with OpenMPT can now be loaded in Impulse Tracker again. [Mod] <Jojo> IT Loader: MIDI macros are now cleared when loading IT files made with old Impulse Tracker versions (< 2.14), so that Zxx commands won't break the songs anymore (fixes denonde.it, fix from Schism Tracker). + [Fix] <Jojo> In compatible mode, bidi loops are now treated like in IT's software mixer. [Fix] <Jojo> Sample autovibrato is now hopefully a bit closer to Impulse Tracker in compatible mode... [Fix] <Jojo> The envelope handling was altered slightly to work more like in Schism Tracker. This fixes a combination of Envelope Carry + Portamento as it can be found in "electric bunny" by Alpha C. [Fix] <Jojo> Various fixes to playback of multi-sample instruments. "Ultima Ratio" by Nebularia and "Shuttle Departure" by Sphenx sound better now. @@ -113,6 +121,7 @@ [Mod] <Jojo> Improved portamento import precision for DBM and ULT loaders (patch from Schism Tracker) [Mod] <Jojo> Added a version check to the ITP loader (why was this not there in the first place?) [Fix] <Jojo> As MTM files were converted to MOD automatically when being loaded, channel panning was lost. Now they're loaded as S3M instead. + [Fix] <Jojo> Short loops in AMF / MED files are now ignored (http://bugs.openmpt.org/view.php?id=70) - probably caused by bad MOD conversions, at least in the AMF example? [Reg] <Jojo> Disabled the Velvet Studio loader for now, since it either crashes on almost all AMS files or at least imports them completely wrong. Misc @@ -121,16 +130,17 @@ [Imp] <Jojo> New keyboard shortcuts: Panic, View Edit History, Set Invalid / Ignore (--- / +++) Pattern (in the orderlist) [Imp] <Jojo> Some improvements were made to the Registry / INI reading: If there were no Registry settings because MPT 1.16 was previously not installed, the INI file is now also read as it might contain some lines created by the installer. [Imp] <Jojo> Sound Setup: For ASIO devices, only supported sampling rates are now shown. + [Imp] <Jojo> The instrument list on the comments tab also shows assigned plugins now. [Mod] <Jojo> Changes to keymap file handling: The active keymap is now always saved to Keybindings.mkb (in either %APPDATA%\OpenMPT or the executable's directory). Any other keymaps are now only overwritten when using the "Save keys as" function. [Mod] <Jojo> On first run, the default ASIO driver is now chosen instead of DirectSound (if there is one). [Mod] <Jojo> The "Original" mix mode now also has a version number (1.16) to reflect what the "original" thing is. [Mod] <Jojo> Updated genre list in the MP3 export dialog. - [Mod] <Jojo> When using the ACM MP3 codec, 320kbit/s bitrate should now theoretically be available. + [Mod] <Jojo> When using the ACM MP3 codec, 320kbit/s bitrate should now be available. [Mod] <Jojo> The MMX acceleration label in the Soundcard setup dialog is now updated according to the multimedia extensions that are supported by the CPU (3DNow! / SSE) [Mod] <Jojo> Updated unmo3.dll to version 2.4.0.1 [Fix] <Jojo> Mod Cleanup: Rearrange patterns was broken when using more than one sequence in the MPTM format. (tx Skaven) [Fix] <Jojo> Mod Cleanup: Various sample / instrument rearranging functions broke PC Notes. - [Fix] <Jojo> The text length was calculated wrong in the message reader, leading to a possible buffer overflow when reading song messages with mixed line endings where CR or LF line endings where expected. + [Fix] <Jojo> The text length was calculated wrong in the message reader, leading to a possible buffer overflow when reading song messages with mixed line endings where CR or LF line endings were expected. [Fix] <Jojo> When there was no INI file, the size of the upper pattern view was defaulting to a wrong value. [Fix] <Jojo> The ID3v2 "comments" field was not formatted properly when exporting to MP3. [Fix] <Jojo> unmo3.dll and uxtheme.dll (for theming the general tab) are now loaded "safely", to avoid the currently spreading DLL exploits. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-02-26 19:25:02
|
Revision: 804 http://modplug.svn.sourceforge.net/modplug/?rev=804&view=rev Author: saga-games Date: 2011-02-26 19:24:53 +0000 (Sat, 26 Feb 2011) Log Message: ----------- [Mod] Updated various documents, installer URLs, etc. Modified Paths: -------------- trunk/OpenMPT/installer/install.iss trunk/OpenMPT/installer/packageTemplate/readme.txt trunk/OpenMPT/packageTemplate/History.txt trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html trunk/OpenMPT/packageTemplate/readme.txt Added Paths: ----------- trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.19/ trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.19/edithistory.png trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.19/timesignature.png Modified: trunk/OpenMPT/installer/install.iss =================================================================== --- trunk/OpenMPT/installer/install.iss 2011-02-26 19:22:28 UTC (rev 803) +++ trunk/OpenMPT/installer/install.iss 2011-02-26 19:24:53 UTC (rev 804) @@ -21,9 +21,9 @@ AppVersion={#GetAppVersion} AppName=OpenMPT AppPublisher=OpenMPT Devs / Olivier Lapicque -AppPublisherURL=http://openmpt.com/ -AppSupportURL=http://openmpt.com/forum/ -AppUpdatesURL=http://openmpt.com/ +AppPublisherURL=http://openmpt.org/ +AppSupportURL=http://forum.openmpt.org/ +AppUpdatesURL=http://openmpt.org/ DefaultDirName={pf}\OpenMPT DefaultGroupName=OpenMPT AllowNoIcons=yes @@ -109,7 +109,7 @@ ; enable portable mode Filename: {app}\mptrack.ini; Section: Paths; Key: UseAppDataDirectory; String: 0; Flags: createkeyifdoesntexist; Tasks: portable ; internet shortcut -Filename: {app}\ModPlug Central.url; Section: InternetShortcut; Key: URL; String: http://openmpt.com/forum/; Flags: createkeyifdoesntexist +Filename: {app}\ModPlug Central.url; Section: InternetShortcut; Key: URL; String: http://forum.openmpt.org/; Flags: createkeyifdoesntexist [Run] ; duh Modified: trunk/OpenMPT/installer/packageTemplate/readme.txt =================================================================== --- trunk/OpenMPT/installer/packageTemplate/readme.txt 2011-02-26 19:22:28 UTC (rev 803) +++ trunk/OpenMPT/installer/packageTemplate/readme.txt 2011-02-26 19:24:53 UTC (rev 804) @@ -1,5 +1,5 @@ ****************** -* OpenMPT 1.18 * +* OpenMPT 1.19 * ****************** @@ -21,13 +21,15 @@ Changes ------- -See history.txt. +See History.txt. Questions, comments, bug reports... ----------------------------------- -See forums at http://openmpt.com/forum/. +For help and general talk, visit our forums at http://forum.openmpt.org/. +If you found a bug or want to request a new feature, you can do so at our issue +tracker at http://bugs.openmpt.org/ Release package contents: @@ -45,14 +47,14 @@ stretching feature. readme.txt: this document unmo3.dll: Used in MO3-file import. -OMPT_1.18_ReleaseNotes.html: Release notes for this version. +OMPT_1.19_ReleaseNotes.html: Release notes for this version. Misc: ----- OpenMPT is partially under the following license: -> Copyright (c) 2004-2010, OpenMPT contributors +> Copyright (c) 2004-2011, OpenMPT contributors > Copyright (c) 1997-2003, Olivier Lapicque > All rights reserved. > @@ -86,7 +88,7 @@ unmo3.dll --------- -Copyright (c) 2001-2009 Ian Luck. All rights reserved +Copyright (c) 2001-2011 Ian Luck. All rights reserved The MO3 software is free for non-commercial use; if anyone tries to charge you for it, kick 'em where it hurts! Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2011-02-26 19:22:28 UTC (rev 803) +++ trunk/OpenMPT/packageTemplate/History.txt 2011-02-26 19:24:53 UTC (rev 804) @@ -10,7 +10,7 @@ (tx XYZ): thanks to XYZ for telling us about the bug -v1.19.01.00 (February 2011, revision 802) +v1.19.01.00 (February 2011, revision 803) ----------------------------------------- Pattern tab [New] <Jojo> Clicking and dragging the row numbers selects the whole row now (Excel / Calc style) - see http://bugs.openmpt.org/view.php?id=45 @@ -26,6 +26,7 @@ [Fix] <Jojo> Changing a channel name from the pattern editor didn't set the document as modified (http://bugs.openmpt.org/view.php?id=65) [Fix] <Jojo> When restarting a pattern, the timer was not reset properly. [Fix] <Jojo> Entering a note-off event in the MOD format created an unnecessary undo event. + [Fix] <Jojo> Automation data is not written to the pattern if the current module format does not support smooth midi macros. [Reg] <Jojo> The "Position aware timer" option is gone. The position aware timer is now automatically used. It was optional in the first place because of some buggy code, which is now fixed. Pattern tab::Note properties @@ -114,6 +115,7 @@ [Mod] <Jojo> Various small improvements to support VST 2.4 plugins better. [Fix] <Jojo> Speaker arrangement is now sent to the plugins upon initialization. This fixes Voxengo SPAN 2 (a VST 2.4 plugin). Does this break other multichannel plugins? [Fix] <Jojo> The time signature sent to VST plugins should be correct now. The denominator is always assumed to be 4, so a 6/8 signature is for example not possible. + [Fix] <Jojo> The EnergyXT GUI does now also work after closing and re-opening the VST editor. (tx Nahkranoth, http://forum.openmpt.org/index.php?topic=2307.0) Other modules [Imp] <Jojo> Garbage characters in sample / instrument / song names should be gone now.. This should f.e. avoid sample names like " ntitled" turning up in modules after deleting sample names. Modified: trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html =================================================================== --- trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2011-02-26 19:22:28 UTC (rev 803) +++ trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2011-02-26 19:24:53 UTC (rev 804) @@ -196,7 +196,7 @@ </p> <ul> <li>Lacking support for VST 2.4+</li> - <li>Some controls are vanishing randomly all the time, most notably under Windows Vista and Windows 7.</li> + <li>Some controls vanish randomly all the time, most notably under Windows Vista and Windows 7.</li> <li>Previewing samples from the treeview's file browser stops the playing module.</li> <li>Cannot preview instruments directly from the MIDI library in the treeview.</li> <li>Excessive performance drop when dragging over the graphical parameter editor during playback.</li> Added: trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html =================================================================== --- trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html (rev 0) +++ trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html 2011-02-26 19:24:53 UTC (rev 804) @@ -0,0 +1,156 @@ +<?xml version="1.0" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <title>OpenMPT 1.19 Release Notes</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta name="language" content="en" /> + <style type="text/css"> + * { font-family: sans-serif; } + body + { + color: #000; + background: #fff; + font-size:12pt; + } + + a { color: #00c; text-decoration: none; } + a:visited { color: #909; text-decoration: none; } + a:hover { text-decoration: underline; } + + .screenshots + { + float:right; + text-align:right; + } + + .screenshots img, h1 + { + border: 1px solid #ccc; + padding: 3px; + background: #eee; + margin: 0 0 3px 3px; + } + + p { padding: 5px; } + + h1 + { + margin: 0; + font-size:24pt; + } + h1 img { vertical-align: middle; } + + h2, h3, h4 + { + border: 1px solid #ddd; + border-width: 0 0 0 3em; + margin: 15px 5px; + padding: 0px 5px; + font-size: 18pt; + } + + h3 { border-left-width: 2em; } + h4 { border-left-width: 1em; } + + li {list-style-type: none; padding: 0 0 1em 0; } + li:before { content: "» "; } + + li li { padding: 0; } + + /* use this for pattern data */ + pre + { + font-family: monospace; + display: inline; + color: #006; + } + + </style> + </head> + <body> + + <h1> + <img src="ReleaseNotesImages/general/modplug.png" width="114" height="110" alt="OpenMPT Logo" /> + OpenMPT 1.19 - Release Notes + </h1> + + <p> + OpenMPT has introduced a number of noteworthy new features since the last official release (version 1.18.03.00). + This document should give a rough overview about the greatest changes in OpenMPT 1.19. + </p> + + <h2>What's new?</h2> + + <h3>General</h3> + <div class="screenshots"> + <a href="ReleaseNotesImages/1.19/edithistory.png"><img src="ReleaseNotesImages/1.19/edithistory.png" width="240" height="163" alt="Edit history dialog" title="Edit history dialog (click to view big screenshot)" /></a> + </div> + <ul> + <li>Based on an undocumented feature in Impulse Tracker, OpenMPT can now save an <strong>edit history</strong> in IT and MPTM files, which reveals when and for how long a module has been edited in the tracker.</li> + <li>When exporting to WAV, <strong>cue points</strong> are now inserted at every pattern transition.</li> + <li>The last remaining absolute paths in the settings files have been removed; OpenMPT is now <strong>fully portable</strong>!</li> + <li>The <strong>sample grid</strong> can be used to create equally-sized sample selections.</li> + <li>Ctrl + Mouse Wheel can now be used to <strong>zoom into samples and envelopes</strong>.</li> + <li>The instrument list on the comments tab also shows <strong>assigned plugins</strong> now.</li> + <li>New <strong>keyboard shortcuts</strong>: Panic, View Edit History, Set Invalid / Ignore Pattern (in the orderlist)</li> + <li>Changes to <strong>keymap file handling</strong>: The active keymap is now always saved to Keybindings.mkb. Any other keymaps are now only overwritten when using the "Save keys as" function.</li> + <li>When using the ACM MP3 codec, 320kbit/s bitrate should now be available.</li> + </ul> + + <h3>Pattern Editor</h3> + <div class="screenshots"> + <img src="ReleaseNotesImages/1.19/timesignature.png" width="291" height="228" alt="Per-pattern time signatures" title="Per-pattern time signatures" /> + </div> + <ul> + <li><strong>Per-pattern time signatures</strong> allow to override the global time signature. This is especially useful in modern tempo mode if you want to use several time signatures in the same song, or if you just temporarily need more detail in a pattern.</li> + <li>You can now <strong>select a whole row</strong> by clicking the row index on the left side of the pattern.</li> + <li>The search feature has been extended to allow for <strong>searching in pattern selections</strong>.</li> + <li>Furthermore, the usability of the Find / Replace dialog has been improved: Corresponding checkboxes are now automatically ticked when the value of a dropdown box has been changed. "Replace All" no longer creates an undo point for every replaced command.</li> + <li>It is now possible to <strong>play the whole pattern row when entering notes</strong> and chords into the pattern editor. This behaviour can be enabled from the setup screen.</li> + </ul> + + <h3>Compatibility</h3> + <ul> + <li>Sample <strong>auto-vibrato</strong> in IT files sounds a lot closer to Impulse Tracker's implementation now.</li> + <li>IT files not saved using compatibility export can now finally be opened in Impulse Tracker again.</li> + <li>The new <strong>compatible mix mode</strong> should be used when composing music in the XM and IT format (it is automatically used when working with MOD and S3M). It uses the same volume levels and panning settings as Schism Tracker and should therefore allow for easier interchange of tracked tunes between various trackers.</li> + <li>The MOD loader has been extended with heuristic detection methods for files with 7-bit panning, VBlank MODs and MODs made with ProTracker 1.x.</li> + <li>As always, countless other <strong>playback compatibility fixes</strong> have made it into this version of OpenMPT.</li> + </ul> + + <h3>VST Plugins</h3> + <ul> + <li><strong>Much improved compatibility</strong> with many VST 2.4 plugins! Examples of plugins that work better in this version: Voxengo SPAN 2, Angelina, EnergyXT, MetroGnome.</li> + </ul> + + <h3>There's more...</h3> + <p> + For a detailed description of what has changed, check <a href="History.txt">History.txt</a>. + </p> + + <h2>Known Issues</h2> + <p> + <i>This list has mostly been copied over from the old 1.17RC2 release notes, so this not very comprehensive... :-)</i> + </p> + <ul> + <li>Far from perfect VST support (routing, etc...)</li> + <li>Some controls vanish randomly all the time, most notably under Windows Vista and Windows 7.</li> + <li>Previewing samples from the treeview's file browser stops the playing module.</li> + <li>Cannot preview instruments directly from the MIDI library in the treeview.</li> + <li>Excessive performance drop when dragging over the graphical parameter editor during playback.</li> + <li>The Right Alt (or Alt Gr) key is not handled well by the keyboard configuration.</li> + <li>In Windows 98, the graphical parameter editor and instrument envelope editor grid display are messed up.</li> + <li>There is no real way to find out what features of the tracker are supported by the original trackers (Impulse Tracker, Fasttracker 2, etc...) when working with those file formats...</li> + </ul> + + <h2>Contact</h2> + <p> + Helpful bug reports, new ideas and brave volunteers to test early development builds or contribute to the code are more than welcome!<br /> + Our issue tracker is located at <a href="http://bugs.openmpt.org/">http://bugs.openmpt.org/</a> and can be used to report bugs and feature requests.<br /> + You can also meet us at the ModPlug Central forums: <a href="http://forum.openmpt.org/">http://forum.openmpt.org/</a>. + </p> + + </body> +</html> \ No newline at end of file Property changes on: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.19 ___________________________________________________________________ Added: tsvn:logminsize + 10 Added: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.19/edithistory.png =================================================================== (Binary files differ) Property changes on: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.19/edithistory.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.19/timesignature.png =================================================================== (Binary files differ) Property changes on: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.19/timesignature.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/OpenMPT/packageTemplate/readme.txt =================================================================== --- trunk/OpenMPT/packageTemplate/readme.txt 2011-02-26 19:22:28 UTC (rev 803) +++ trunk/OpenMPT/packageTemplate/readme.txt 2011-02-26 19:24:53 UTC (rev 804) @@ -1,15 +1,17 @@ ****************** -* OpenMPT 1.18 * +* OpenMPT 1.19 * ****************** Installation ------------ --If you have an existing installation of OpenMPT and wish to re-use its +-If you have an existing portable installation of OpenMPT and wish to re-use its settings, copy your mptrack.ini and plugin.cache to the directory into which you extract the archive. --If not, you're done: just extract the archive and launch mptrack.exe. +-If there is no previous installation or if you have an existing standard + installation of OpenMPT, you're done: just extract the archive and launch + mptrack.exe. Uninstallation @@ -28,17 +30,23 @@ [Paths] UseAppDataDirectory=0 +Alternatively, you can copy your existing configuration file over from +%appdata%\OpenMPT and add UseAppDataDirectory=0 in the [Paths] section of this +file. + Changes ------- -See history.txt. +See History.txt. Questions, comments, bug reports... ----------------------------------- -See forums at http://openmpt.com/forum/. +For help and general talk, visit our forums at http://forum.openmpt.org/. +If you found a bug or want to request a new feature, you can do so at our issue +tracker at http://bugs.openmpt.org/ Release package contents: @@ -55,7 +63,7 @@ stretching feature. readme.txt: this document unmo3.dll: Used in MO3-file import. -OMPT_1.18_ReleaseNotes.html: Release notes for this version. +OMPT_1.19_ReleaseNotes.html: Release notes for this version. Misc: @@ -63,7 +71,7 @@ OpenMPT is partially under the following license: -> Copyright (c) 2004-2010, OpenMPT contributors +> Copyright (c) 2004-2011, OpenMPT contributors > Copyright (c) 1997-2003, Olivier Lapicque > All rights reserved. > @@ -97,7 +105,7 @@ unmo3.dll --------- -Copyright (c) 2001-2009 Ian Luck. All rights reserved +Copyright (c) 2001-2011 Ian Luck. All rights reserved The MO3 software is free for non-commercial use; if anyone tries to charge you for it, kick 'em where it hurts! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-02-27 17:20:26
|
Revision: 805 http://modplug.svn.sourceforge.net/modplug/?rev=805&view=rev Author: saga-games Date: 2011-02-27 17:20:20 +0000 (Sun, 27 Feb 2011) Log Message: ----------- [New] Sample Editor: New keyboard shortcut: Quick fade for samples. If the sample start is selected, a fade-in is automatically performed. Likewise, if the sample end is selected, a fade-out is performed. If neither is selected, the default amplification dialog is shown. [Mod] Updated DE_jojo.mkb: Changed shortcut for DC Offset removal, added Quick fade shortcut for samples. Modified Paths: -------------- trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/CommandSet.h trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/Ctrl_smp.h trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/View_smp.h trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb Modified: trunk/OpenMPT/mptrack/CommandSet.cpp =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp 2011-02-26 19:24:53 UTC (rev 804) +++ trunk/OpenMPT/mptrack/CommandSet.cpp 2011-02-27 17:20:20 UTC (rev 805) @@ -602,6 +602,7 @@ DefineKeyCommand(kcOrderlistPatIgnore, 1853, kcVisible, kcNoDummy, _T("Ignore (+++) Index")); DefineKeyCommand(kcOrderlistPatInvalid, 1854, kcVisible, kcNoDummy, _T("Invalid (---) Index")); DefineKeyCommand(kcViewEditHistory, 1855, kcVisible, kcNoDummy, _T("View Edit History")); + DefineKeyCommand(kcSampleQuickFade, 1856, kcVisible, kcNoDummy, _T("Quick fade")); // Add new key commands here. #ifdef _DEBUG Modified: trunk/OpenMPT/mptrack/CommandSet.h =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.h 2011-02-26 19:24:53 UTC (rev 804) +++ trunk/OpenMPT/mptrack/CommandSet.h 2011-02-27 17:20:20 UTC (rev 805) @@ -611,7 +611,8 @@ kcSampleInvert, kcSampleSignUnsign, kcSampleRemoveDCOffset, - kcEndSampleEditing=kcSampleRemoveDCOffset, + kcSampleQuickFade, + kcEndSampleEditing=kcSampleQuickFade, //kcSampStartNotes to kcInsNoteMapEndNoteStops must be contiguous. kcSampStartNotes, Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-02-26 19:24:53 UTC (rev 804) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-02-27 17:20:20 UTC (rev 805) @@ -475,6 +475,10 @@ OnAmplify(); break; + case IDC_SAMPLE_QUICKFADE: + OnQuickFade(); + break; + case IDC_SAMPLE_OPEN: OnSampleOpen(); break; @@ -1351,6 +1355,26 @@ } +// Quickly fade the selection in/out without asking the user. +// Fade-In is applied if the selection starts at the beginning of the sample. +// Fade-Out is applied if the selection ends and the end of the sample. +void CCtrlSamples::OnQuickFade() +//------------------------------ +{ + if ((!m_pSndFile) || (!m_pSndFile->Samples[m_nSample].pSample)) return; + + SELECTIONPOINTS sel = GetSelectionPoints(); + if(sel.bSelected && (sel.nStart == 0 || sel.nEnd == m_pSndFile->Samples[m_nSample].nLength)) + { + ApplyAmplify(100, (sel.nStart == 0), (sel.nEnd == m_pSndFile->Samples[m_nSample].nLength)); + } else + { + // Can't apply quick fade as no appropriate selection has been made, so ask the user to amplify the whole sample instead. + OnAmplify(); + } +} + + const int gSinc2x16Odd[16] = { // Kaiser window, beta=7.400 -19, 97, -295, 710, -1494, 2958, -6155, 20582, 20582, -6155, 2958, -1494, 710, -295, 97, -19, Modified: trunk/OpenMPT/mptrack/Ctrl_smp.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.h 2011-02-26 19:24:53 UTC (rev 804) +++ trunk/OpenMPT/mptrack/Ctrl_smp.h 2011-02-27 17:20:20 UTC (rev 805) @@ -82,6 +82,7 @@ afx_msg void OnSamplePlay(); afx_msg void OnNormalize(); afx_msg void OnAmplify(); + afx_msg void OnQuickFade(); afx_msg void OnRemoveDCOffset(); afx_msg void OnUpsample(); afx_msg void OnDownsample(); Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2011-02-26 19:24:53 UTC (rev 804) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2011-02-27 17:20:20 UTC (rev 805) @@ -92,6 +92,7 @@ ON_COMMAND(ID_SAMPLE_DRAW, OnDrawingToggle) ON_COMMAND(ID_SAMPLE_ADDSILENCE, OnAddSilence) ON_COMMAND(ID_SAMPLE_GRID, OnChangeGridSize) + ON_COMMAND(ID_SAMPLE_QUICKFADE, OnQuickFade) ON_MESSAGE(WM_MOD_MIDIMSG, OnMidiMsg) ON_MESSAGE(WM_MOD_KEYCOMMAND, OnCustomKeyMsg) //rewbs.customKeys //}}AFX_MSG_MAP @@ -1524,11 +1525,11 @@ sTrimMenuText += "\t" + ih->GetKeyTextFromCommand(kcSampleTrim); - // change by jojo: "trim" menu item is also available - // if there's no selection, but loop points - //::AppendMenu(hMenu, MF_STRING|(m_dwEndSel>m_dwBeginSel)?0:MF_GRAYED, - // ID_SAMPLE_TRIM, "Trim\t" + ih->GetKeyTextFromCommand(kcSampleTrim)); ::AppendMenu(hMenu, MF_STRING|(bIsGrayed) ? MF_GRAYED : 0, ID_SAMPLE_TRIM, sTrimMenuText.c_str()); + if((m_dwBeginSel == 0 && m_dwEndSel != 0) || (m_dwBeginSel < pSmp->nLength && m_dwEndSel == pSmp->nLength)) + { + ::AppendMenu(hMenu, MF_STRING, ID_SAMPLE_QUICKFADE, "Quick fade\t" + ih->GetKeyTextFromCommand(kcSampleQuickFade)); + } ::AppendMenu(hMenu, MF_STRING, ID_EDIT_CUT, "Cut\t" + ih->GetKeyTextFromCommand(kcEditCut)); ::AppendMenu(hMenu, MF_STRING, ID_EDIT_COPY, "Copy\t" + ih->GetKeyTextFromCommand(kcEditCopy)); } @@ -2645,6 +2646,7 @@ case kcSampleInvert: PostCtrlMessage(IDC_SAMPLE_INVERT); return wParam; case kcSampleSignUnsign: PostCtrlMessage(IDC_SAMPLE_SIGN_UNSIGN); return wParam; case kcSampleRemoveDCOffset: PostCtrlMessage(IDC_SAMPLE_DCOFFSET); return wParam; + case kcSampleQuickFade: PostCtrlMessage(IDC_SAMPLE_QUICKFADE); return wParam; case kcNoteOff: PlayNote(NOTE_KEYOFF); return wParam; case kcNoteCut: PlayNote(NOTE_NOTECUT); return wParam; Modified: trunk/OpenMPT/mptrack/View_smp.h =================================================================== --- trunk/OpenMPT/mptrack/View_smp.h 2011-02-26 19:24:53 UTC (rev 804) +++ trunk/OpenMPT/mptrack/View_smp.h 2011-02-27 17:20:20 UTC (rev 805) @@ -129,6 +129,7 @@ afx_msg void OnDrawingToggle(); afx_msg void OnAddSilence(); afx_msg void OnChangeGridSize(); + afx_msg void OnQuickFade() { PostCtrlMessage(IDC_SAMPLE_QUICKFADE); }; afx_msg LRESULT OnMidiMsg(WPARAM, LPARAM); afx_msg LRESULT OnCustomKeyMsg(WPARAM, LPARAM); //rewbs.customKeys afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2011-02-26 19:24:53 UTC (rev 804) +++ trunk/OpenMPT/mptrack/resource.h 2011-02-27 17:20:20 UTC (rev 805) @@ -927,6 +927,7 @@ #define IDC_BTN_CLEAR 2430 #define IDC_TOTAL_EDIT_TIME 2431 #define IDC_EDIT_HISTORY 2432 +#define IDC_SAMPLE_QUICKFADE 2433 #define ID_FILE_NEWMOD 32771 #define ID_FILE_NEWXM 32772 #define ID_FILE_NEWS3M 32773 @@ -1187,6 +1188,7 @@ #define ID_PANIC 60451 #define ID_VIEW_EDITHISTORY 60452 #define ID_SAMPLE_GRID 60453 +#define ID_SAMPLE_QUICKFADE 60454 // Next default values for new objects // @@ -1194,8 +1196,8 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 #define _APS_NEXT_RESOURCE_VALUE 528 -#define _APS_NEXT_COMMAND_VALUE 60454 -#define _APS_NEXT_CONTROL_VALUE 2433 +#define _APS_NEXT_COMMAND_VALUE 60455 +#define _APS_NEXT_CONTROL_VALUE 2434 #define _APS_NEXT_SYMED_VALUE 901 #endif #endif Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2011-02-26 19:24:53 UTC (rev 804) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2011-02-27 17:20:20 UTC (rev 805) @@ -280,7 +280,8 @@ 8:1387:0:109:1 //Zoom In: - (ZEHNERTASTATUR) (KeyDown) 8:1784:2:73:1 //Invert sample phase: Ctrl+I (KeyDown) 8:1785:2:85:1 //Signed/Unsigned conversion: Ctrl+U (KeyDown) -8:1790:2:68:1 //Remove DC Offset: Ctrl+D (KeyDown) +8:1790:2:69:1 //Remove DC Offset: Ctrl+E (KeyDown) +8:1856:2:68:1 //Quick fade: Ctrl+D (KeyDown) //----( Instrument Context [bottom] (9) )------------ 9:1837:0:107:5 //Zoom In: + (ZEHNERTASTATUR) (KeyDown|KeyHold) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-03-04 18:00:43
|
Revision: 808 http://modplug.svn.sourceforge.net/modplug/?rev=808&view=rev Author: saga-games Date: 2011-03-04 18:00:36 +0000 (Fri, 04 Mar 2011) Log Message: ----------- [Imp] Mod Conversion: When converting to XM, the E60 bug is now tried to be compensated. [Imp] Mod Conversion: If compatible play is disabled, it is recommended to be enabled when converting to XM / IT. [New] Mod Conversion: If the new format doesn't support restart positions, it is now tried to convert the restart position to a pattern command. [Mod] OpenMPT: Version is now 1.19.00.27 Modified Paths: -------------- trunk/OpenMPT/mptrack/MPTHacks.cpp trunk/OpenMPT/mptrack/ModConvert.cpp trunk/OpenMPT/mptrack/ModConvert.h trunk/OpenMPT/mptrack/Moddoc.h trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/modcommand.cpp Modified: trunk/OpenMPT/mptrack/MPTHacks.cpp =================================================================== --- trunk/OpenMPT/mptrack/MPTHacks.cpp 2011-03-04 17:52:53 UTC (rev 807) +++ trunk/OpenMPT/mptrack/MPTHacks.cpp 2011-03-04 18:00:36 UTC (rev 808) @@ -10,7 +10,7 @@ #include "Moddoc.h" /* TODO: -stereo/16bit samples (only XM? maybe S3M? many new IT trackers support stereo samples) +stereo/16bit samples (only XM? stereo/16bit flags are defined in the S3M and IT specs...) out-of range sample pre-amp song flags and properties (just look at the song properties window) +++/--- orders in XM/MOD sequence @@ -351,7 +351,9 @@ AddToLog("Found restart position\n"); foundHacks = true; if(autofix) - m_SndFile.m_nRestartPos = 0; + { + RestartPosToPattern(); + } } if(m_SndFile.m_nMixLevels != mixLevels_compatible) Modified: trunk/OpenMPT/mptrack/ModConvert.cpp =================================================================== --- trunk/OpenMPT/mptrack/ModConvert.cpp 2011-03-04 17:52:53 UTC (rev 807) +++ trunk/OpenMPT/mptrack/ModConvert.cpp 2011-03-04 18:00:36 UTC (rev 808) @@ -178,6 +178,7 @@ cEffectMemory[i].resize(MAX_EFFECTS, 0); } + bool addBreak = false; // When converting to XM, avoid the E60 bug. CHANNELINDEX nChannel = m_SndFile.m_nChannels - 1; for (UINT len = m_SndFile.Patterns[nPat].GetNumRows() * m_SndFile.m_nChannels; len; m++, len--) @@ -222,7 +223,29 @@ } } + + // When converting to XM, avoid the E60 bug. + if(newTypeIsXM) + { + switch(m->command) + { + case CMD_MODCMDEX: + if((m->param & 0xF0) == 0x60) + { + addBreak = true; + } + break; + case CMD_POSITIONJUMP: + case CMD_PATTERNBREAK: + addBreak = false; + break; + } + } } + if(addBreak) + { + m_SndFile.TryWriteEffect(nPat, m_SndFile.Patterns[nPat].GetNumRows() - 1, CMD_PATTERNBREAK, 0, false, CHANNELINDEX_INVALID, false, false); + } } //////////////////////////////////////////////// @@ -370,7 +393,8 @@ // Is the "restart position" value allowed in this format? if(m_SndFile.m_nRestartPos > 0 && !CSoundFile::GetModSpecifications(nNewType).hasRestartPos) { - m_SndFile.m_nRestartPos = 0; + // Try to fix it + RestartPosToPattern(); CHANGEMODTYPE_WARNING(wRestartPos); } @@ -439,6 +463,11 @@ CHANGEMODTYPE_WARNING(wMixmode); } + if((nNewType & (MOD_TYPE_XM|MOD_TYPE_IT)) && !m_SndFile.GetModFlag(MSF_COMPATIBLE_PLAY)) + { + CHANGEMODTYPE_WARNING(wCompatibilityMode); + } + END_CRITICAL(); ChangeFileExtension(nNewType); @@ -475,6 +504,7 @@ CHANGEMODTYPE_CHECK(wReleaseNode, "Instrument envelope release nodes are not supported by the new format.\n"); CHANGEMODTYPE_CHECK(wEditHistory, "Edit history will not be saved in the new format.\n"); CHANGEMODTYPE_CHECK(wMixmode, "Consider setting the mix levels to \"Compatible\" in the song properties when working with legacy formats.\n"); + CHANGEMODTYPE_CHECK(wCompatibilityMode, "Consider enabling the \"compatible playback\" option in the song properties to increase compatiblity with other players.\n"); SetModified(); GetPatternUndo()->ClearUndo(); Modified: trunk/OpenMPT/mptrack/ModConvert.h =================================================================== --- trunk/OpenMPT/mptrack/ModConvert.h 2011-03-04 17:52:53 UTC (rev 807) +++ trunk/OpenMPT/mptrack/ModConvert.h 2011-03-04 18:00:36 UTC (rev 808) @@ -34,6 +34,7 @@ wReleaseNode, wEditHistory, wMixmode, + wCompatibilityMode, wNumWarnings }; Modified: trunk/OpenMPT/mptrack/Moddoc.h =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.h 2011-03-04 17:52:53 UTC (rev 807) +++ trunk/OpenMPT/mptrack/Moddoc.h 2011-03-04 18:00:36 UTC (rev 808) @@ -323,6 +323,8 @@ bool RemoveChannels(bool bChnMask[MAX_BASECHANNELS]); + bool RestartPosToPattern(); + bool HasMPTHacks(bool autofix = false); void FixNullStrings(); Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2011-03-04 17:52:53 UTC (rev 807) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2011-03-04 18:00:36 UTC (rev 808) @@ -474,7 +474,7 @@ { if(pIns == nullptr) return; - memset(pIns, 0, sizeof(MODINSTRUMENT)); + MemsetZero(*pIns); pIns->nFadeOut = 256; pIns->nGlobalVol = 64; pIns->nPan = 128; @@ -1276,3 +1276,16 @@ } +// Convert the module's restart position information to a pattern command. +bool CModDoc::RestartPosToPattern() +//--------------------------------- +{ + bool result = false; + GetLengthType length = m_SndFile.GetLength(false); + if(length.endOrder != ORDERINDEX_INVALID && length.endRow != ROWINDEX_INVALID) + { + result = m_SndFile.TryWriteEffect(m_SndFile.Order[length.endOrder], length.endRow, CMD_POSITIONJUMP, m_SndFile.m_nRestartPos, false, CHANNELINDEX_INVALID, false, true); + } + m_SndFile.m_nRestartPos = 0; + return result; +} Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-03-04 17:52:53 UTC (rev 807) +++ trunk/OpenMPT/mptrack/version.h 2011-03-04 18:00:36 UTC (rev 808) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 19 #define VER_MINOR 00 -#define VER_MINORMINOR 26 +#define VER_MINORMINOR 27 //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/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-04 17:52:53 UTC (rev 807) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-04 18:00:36 UTC (rev 808) @@ -80,16 +80,18 @@ // [in] endRow: Row in that order that should be reached // [out] duration: total time in seconds // [out] targetReached: true if the specified order/row combination has been reached while going through the module. -// [out] endOrder: last parsed order (if no target is specified, this is the first order that is parsed twice, i.e. not the *last* played order) -// [out] endRow: last parsed row (dito) +// [out] lastOrder: last parsed order (if no target is specified, this is the first order that is parsed twice, i.e. not the *last* played order) +// [out] lastRow: last parsed row (dito) +// [out] endOrder: last order before module loops (UNDEFINED if a target is specified) +// [out] endRow: last row before module loops (dito) GetLengthType CSoundFile::GetLength(bool bAdjust, ORDERINDEX endOrder, ROWINDEX endRow) //------------------------------------------------------------------------------------- { GetLengthType retval; retval.duration = 0.0; retval.targetReached = false; - retval.endOrder = ORDERINDEX_INVALID; - retval.endRow = ROWINDEX_INVALID; + retval.lastOrder = retval.endOrder = ORDERINDEX_INVALID; + retval.lastRow = retval.endRow = ROWINDEX_INVALID; // -> CODE#0022 // -> DESC="alternative BPM/Speed interpretation method" @@ -174,6 +176,9 @@ if(IsRowVisited(nCurrentPattern, nRow, true, &visitedRows)) break; + retval.endOrder = nCurrentPattern; + retval.endRow = nRow; + // Update next position nNextRow = nRow + 1; @@ -423,8 +428,8 @@ if(retval.targetReached || endOrder == ORDERINDEX_INVALID || endRow == ROWINDEX_INVALID) { - retval.endOrder = nCurrentPattern; - retval.endRow = nRow; + retval.lastOrder = nCurrentPattern; + retval.lastRow = nRow; } retval.duration = dElapsedTime / 1000.0; Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2011-03-04 17:52:53 UTC (rev 807) +++ trunk/OpenMPT/soundlib/Sndfile.h 2011-03-04 18:00:36 UTC (rev 808) @@ -369,7 +369,7 @@ { DWORD dwPluginId1; DWORD dwPluginId2; - DWORD dwInputRouting; // MIXPLUG_INPUTF_XXXX + DWORD dwInputRouting; // MIXPLUG_INPUTF_XXXX, bits 16-23 = gain DWORD dwOutputRouting; // 0=mix 0x80+=fx DWORD dwReserved[4]; // Reserved for routing info CHAR szName[32]; @@ -492,8 +492,10 @@ { double duration; // total time in seconds bool targetReached; // true if the specified order/row combination has been reached while going through the module - ORDERINDEX endOrder; // last parsed order (if no target is specified, this is the first order that is parsed twice, i.e. not the *last* played order) - ROWINDEX endRow; // last parsed row (dito) + ORDERINDEX lastOrder; // last parsed order (if no target is specified, this is the first order that is parsed twice, i.e. not the *last* played order) + ROWINDEX lastRow; // last parsed row (dito) + ORDERINDEX endOrder; // last order before module loops (UNDEFINED if a target is specified) + ROWINDEX endRow; // last row before module loops (dito) }; Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2011-03-04 17:52:53 UTC (rev 807) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2011-03-04 18:00:36 UTC (rev 808) @@ -789,7 +789,7 @@ // Let's check again if this really is the end of the song. // The visited rows vector might have been screwed up while editing... GetLengthType t = GetLength(false); - if(t.endOrder == m_nCurrentPattern && t.endRow == m_nRow) + if(t.lastOrder == m_nCurrentPattern && t.lastRow == m_nRow) #endif // MODPLUG_TRACKER { // This is really the song's end! Modified: trunk/OpenMPT/soundlib/modcommand.cpp =================================================================== --- trunk/OpenMPT/soundlib/modcommand.cpp 2011-03-04 17:52:53 UTC (rev 807) +++ trunk/OpenMPT/soundlib/modcommand.cpp 2011-03-04 18:00:36 UTC (rev 808) @@ -656,11 +656,17 @@ bAllowMultipleEffects - If false, No effect will be written if an effect of the same type is already present in the channel(s). Useful for f.e. tempo effects. bAllowNextRow - Indicates whether it is allowed to use the next row if there's no space for the effect bRetry - For internal use only. Indicates whether an effect "rewrite" has already taken place (for recursive calls) + NOTE: Effect remapping is only implemented for a few basic effects. */ bool CSoundFile::TryWriteEffect(PATTERNINDEX nPat, ROWINDEX nRow, BYTE nEffect, BYTE nParam, bool bIsVolumeEffect, CHANNELINDEX nChn, bool bAllowMultipleEffects, bool bAllowNextRow, bool bRetry) //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ { - // NOTE: Effect remapping is only implemented for a few basic effects. + // First, reject invalid parameters. + if(!Patterns.IsValidIndex(nPat) || nRow >= Patterns[nPat].GetNumRows() || (nChn >= GetNumChannels() && nChn != CHANNELINDEX_INVALID)) + { + return false; + } + CHANNELINDEX nScanChnMin = nChn, nScanChnMax = nChn; MODCOMMAND *p = Patterns[nPat], *m; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-03-07 00:51:50
|
Revision: 810 http://modplug.svn.sourceforge.net/modplug/?rev=810&view=rev Author: saga-games Date: 2011-03-07 00:51:43 +0000 (Mon, 07 Mar 2011) Log Message: ----------- [New] Sample Editor: There's a new tool to create seamless sample loops: The loop crossfader. Includes a new keyboard shortcut. [Mod] OpenMPT: Version is now 1.19.00.28 Modified Paths: -------------- trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/CommandSet.h trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/Ctrl_smp.h trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp trunk/OpenMPT/mptrack/SampleEditorDialogs.h trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/res/patterns.bmp trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/modsmp_ctrl.cpp trunk/OpenMPT/soundlib/modsmp_ctrl.h Modified: trunk/OpenMPT/mptrack/CommandSet.cpp =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp 2011-03-07 00:21:50 UTC (rev 809) +++ trunk/OpenMPT/mptrack/CommandSet.cpp 2011-03-07 00:51:43 UTC (rev 810) @@ -603,6 +603,7 @@ DefineKeyCommand(kcOrderlistPatInvalid, 1854, kcVisible, kcNoDummy, _T("Invalid (---) Index")); DefineKeyCommand(kcViewEditHistory, 1855, kcVisible, kcNoDummy, _T("View Edit History")); DefineKeyCommand(kcSampleQuickFade, 1856, kcVisible, kcNoDummy, _T("Quick fade")); + DefineKeyCommand(kcSampleXFade, 1857, kcVisible, kcNoDummy, _T("Crossfade sample loop")); // Add new key commands here. #ifdef _DEBUG @@ -1550,7 +1551,13 @@ CString err; if (errorCount < 10) { - err.Format("Line %d was not understood.", l); + if(spos == -1) + { + err.Format("Line %d was not understood.", l); + } else + { + err.Format("Line %d contained an unknown command.", l); + } errText += err + "\n"; Log(err); } else if (errorCount == 10) Modified: trunk/OpenMPT/mptrack/CommandSet.h =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.h 2011-03-07 00:21:50 UTC (rev 809) +++ trunk/OpenMPT/mptrack/CommandSet.h 2011-03-07 00:51:43 UTC (rev 810) @@ -612,7 +612,8 @@ kcSampleSignUnsign, kcSampleRemoveDCOffset, kcSampleQuickFade, - kcEndSampleEditing=kcSampleQuickFade, + kcSampleXFade, + kcEndSampleEditing=kcSampleXFade, //kcSampStartNotes to kcInsNoteMapEndNoteStops must be contiguous. kcSampStartNotes, Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-03-07 00:21:50 UTC (rev 809) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-03-07 00:51:43 UTC (rev 810) @@ -71,6 +71,7 @@ ON_COMMAND(IDC_SAMPLE_INVERT, OnInvert) ON_COMMAND(IDC_SAMPLE_SIGN_UNSIGN, OnSignUnSign) ON_COMMAND(IDC_SAMPLE_DCOFFSET, OnRemoveDCOffset) + ON_COMMAND(IDC_SAMPLE_XFADE, OnXFade) ON_COMMAND(IDC_CHECK1, OnSetPanningChanged) ON_COMMAND(ID_PREVINSTRUMENT, OnPrevInstrument) ON_COMMAND(ID_NEXTINSTRUMENT, OnNextInstrument) @@ -213,13 +214,16 @@ m_ToolBar2.AddButton(IDC_SAMPLE_SILENCE, TIMAGE_SAMPLE_SILENCE); m_ToolBar2.AddButton(IDC_SAMPLE_INVERT, TIMAGE_SAMPLE_INVERT); m_ToolBar2.AddButton(IDC_SAMPLE_SIGN_UNSIGN, TIMAGE_SAMPLE_UNSIGN); + m_ToolBar2.AddButton(IDC_SAMPLE_XFADE, TIMAGE_SAMPLE_FIXLOOP); // Setup Controls m_SpinVolume.SetRange(0, 64); m_SpinGlobalVol.SetRange(0, 64); //rewbs.fix36944 - if (m_pSndFile->m_nType == MOD_TYPE_XM) { + if (m_pSndFile->m_nType == MOD_TYPE_XM) + { m_SpinPanning.SetRange(0, 255); - } else { + } else + { m_SpinPanning.SetRange(0, 64); } //end rewbs.fix36944 @@ -460,6 +464,9 @@ OnInvert(); break; + case IDC_SAMPLE_XFADE: + OnXFade(); + case IDC_SAMPLE_SIGN_UNSIGN: OnSignUnSign(); break; @@ -3102,3 +3109,49 @@ viewstate.dwEndSel = nEnd; SendViewMessage(VIEWMSG_LOADSTATE, (LPARAM)&viewstate); } + + +// Crossfade loop to create smooth loop transitions +#define DEFAULT_XFADE_LENGTH 16384 //4096 +#define LimitXFadeLength(x) min(min(x, pSmp->nLoopEnd - pSmp->nLoopStart), pSmp->nLoopEnd / 2) + +void CCtrlSamples::OnXFade() +//-------------------------- +{ + static UINT nFadeLength = DEFAULT_XFADE_LENGTH; + MODSAMPLE *pSmp = &m_pSndFile->Samples[m_nSample]; + + if(pSmp->pSample == nullptr) return; + if(pSmp->nLoopEnd <= pSmp->nLoopStart || pSmp->nLoopEnd > pSmp->nLength) return; + // Case 1: The loop start is preceeded by > XFADE_LENGTH samples. Nothing has to be adjusted. + // Case 2: The actual loop is shorter than XFADE_LENGTH samples. + // Case 3: There is not enough sample material before the loop start. Move the loop start. + nFadeLength = LimitXFadeLength(nFadeLength); + + CSampleXFadeDlg dlg(this, nFadeLength, LimitXFadeLength(GetDocument()->GetSoundFile()->Samples[m_nSample].nLength)); + if(dlg.DoModal() == IDOK) + { + nFadeLength = dlg.m_nSamples; + + if(nFadeLength < 4) return; + + m_pModDoc->GetSampleUndo()->PrepareUndo(m_nSample, sundo_update, pSmp->nLoopEnd - nFadeLength, pSmp->nLoopEnd); + // If we want to fade nFadeLength bytes, we need as much sample material before the loop point. nFadeLength has been adjusted above. + if(pSmp->nLoopStart < nFadeLength) + { + pSmp->nLoopStart = nFadeLength; + } + + if(ctrlSmp::XFadeSample(pSmp, nFadeLength, m_pSndFile)) + { + m_pModDoc->AdjustEndOfSample(m_nSample); + m_pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); + m_pModDoc->SetModified(); + } else + { + m_pModDoc->GetSampleUndo()->RemoveLastUndoStep(m_nSample); + } + + } +} + Modified: trunk/OpenMPT/mptrack/Ctrl_smp.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.h 2011-03-07 00:21:50 UTC (rev 809) +++ trunk/OpenMPT/mptrack/Ctrl_smp.h 2011-03-07 00:51:43 UTC (rev 810) @@ -108,6 +108,7 @@ afx_msg void OnVibDepthChanged(); afx_msg void OnVibSweepChanged(); afx_msg void OnVibRateChanged(); + afx_msg void OnXFade(); afx_msg void OnVScroll(UINT, UINT, CScrollBar *); afx_msg LRESULT OnCustomKeyMsg(WPARAM, LPARAM); //rewbs.customKeys Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2011-03-07 00:21:50 UTC (rev 809) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2011-03-07 00:51:43 UTC (rev 810) @@ -285,6 +285,7 @@ TIMAGE_SAMPLE_UNSIGN, TIMAGE_SAMPLE_DCOFFSET, TIMAGE_PATTERN_OVERFLOWPASTE, + TIMAGE_SAMPLE_FIXLOOP, }; Modified: trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp =================================================================== --- trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp 2011-03-07 00:21:50 UTC (rev 809) +++ trunk/OpenMPT/mptrack/SampleEditorDialogs.cpp 2011-03-07 00:51:43 UTC (rev 810) @@ -170,3 +170,37 @@ CDialog::OnOK(); } + +///////////////////////////////////////////////////////////////////////// +// Sample cross-fade dialog + +void CSampleXFadeDlg::DoDataExchange(CDataExchange* pDX) +//------------------------------------------------------ +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CSampleGridDlg) + DDX_Control(pDX, IDC_EDIT1, m_EditSamples); + DDX_Control(pDX, IDC_SPIN1, m_SpinSamples); + //}}AFX_DATA_MAP +} + + +BOOL CSampleXFadeDlg::OnInitDialog() +//---------------------------------- +{ + CDialog::OnInitDialog(); + m_SpinSamples.SetRange32(0, m_nMaxSamples); + m_SpinSamples.SetPos(m_nSamples); + SetDlgItemInt(IDC_EDIT1, m_nSamples, FALSE); + GetDlgItem(IDC_EDIT1)->SetFocus(); + return TRUE; +} + + +void CSampleXFadeDlg::OnOK() +//-------------------------- +{ + m_nSamples = GetDlgItemInt(IDC_EDIT1, NULL, FALSE); + CDialog::OnOK(); +} + Modified: trunk/OpenMPT/mptrack/SampleEditorDialogs.h =================================================================== --- trunk/OpenMPT/mptrack/SampleEditorDialogs.h 2011-03-07 00:21:50 UTC (rev 809) +++ trunk/OpenMPT/mptrack/SampleEditorDialogs.h 2011-03-07 00:51:43 UTC (rev 810) @@ -96,4 +96,29 @@ virtual void OnOK(); }; + +///////////////////////////////////////////////////////////////////////// +// Sample cross-fade dialog + +//=================================== +class CSampleXFadeDlg: public CDialog +//=================================== +{ +public: + UINT m_nSamples, m_nMaxSamples; + +protected: + CEdit m_EditSamples; + CSpinButtonCtrl m_SpinSamples; + +public: + CSampleXFadeDlg(CWnd *parent, UINT nSamples, UINT nMaxSamples) : CDialog(IDD_SAMPLE_XFADE, parent) { m_nSamples = nSamples; m_nMaxSamples = nMaxSamples; }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); + virtual BOOL OnInitDialog(); + virtual void OnOK(); +}; + + #endif Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2011-03-07 00:21:50 UTC (rev 809) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2011-03-07 00:51:43 UTC (rev 810) @@ -2646,6 +2646,7 @@ case kcSampleInvert: PostCtrlMessage(IDC_SAMPLE_INVERT); return wParam; case kcSampleSignUnsign: PostCtrlMessage(IDC_SAMPLE_SIGN_UNSIGN); return wParam; case kcSampleRemoveDCOffset: PostCtrlMessage(IDC_SAMPLE_DCOFFSET); return wParam; + case kcSampleXFade: PostCtrlMessage(IDC_SAMPLE_XFADE); return wParam; case kcSampleQuickFade: PostCtrlMessage(IDC_SAMPLE_QUICKFADE); return wParam; // Those don't seem to work. Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2011-03-07 00:21:50 UTC (rev 809) +++ trunk/OpenMPT/mptrack/mptrack.rc 2011-03-07 00:51:43 UTC (rev 810) @@ -173,7 +173,20 @@ LTEXT "Grid Segments:",IDC_STATIC,6,8,60,8 END +IDD_SAMPLE_XFADE DIALOGEX 0, 0, 178, 82 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Sample Crossfader" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,66,60,50,14 + PUSHBUTTON "Cancel",IDCANCEL,120,60,50,14 + EDITTEXT IDC_EDIT1,108,6,54,12,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,144,6,11,14 + LTEXT "Higher numbers generate smoother loop transitions. However, the number is limited by the loop length and the amount of samples before the loop start.",IDC_STATIC,6,24,168,36 + LTEXT "Samples used for fading:",IDC_STATIC,6,8,96,8 +END + ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO @@ -245,6 +258,14 @@ TOPMARGIN, 7 BOTTOMMARGIN, 64 END + + IDD_SAMPLE_XFADE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 171 + TOPMARGIN, 7 + BOTTOMMARGIN, 75 + END END #endif // APSTUDIO_INVOKED @@ -723,7 +744,7 @@ CTEXT "Resampling",IDC_STATIC,7,151,39,13,SS_CENTERIMAGE,WS_EX_STATICEDGE CONTROL "Highpass",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | BS_FLAT | NOT WS_VISIBLE | WS_TABSTOP,181,19,45,10 CTEXT "Mode",IDC_STATIC,135,70,23,13,SS_CENTERIMAGE,WS_EX_STATICEDGE - RTEXT "--",IDC_TEXT1,204,62,27,8 + RTEXT "--",IDC_TEXT1,186,62,45,8 GROUPBOX "Pitch/Tempo Lock",IDC_STATIC,364,57,89,25 GROUPBOX "Sample Map",IDC_STATIC,461,27,62,141 CTEXT "Velocity handling",IDC_STATIC,367,102,83,10,SS_CENTERIMAGE,WS_EX_STATICEDGE @@ -1309,7 +1330,7 @@ END IDD_PLUGINEDITOR DIALOGEX 0, 0, 187, 95 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE CAPTION "Editor" MENU IDR_PLUGINMENU @@ -2455,6 +2476,11 @@ ID_VIEW_SONGPROPERTIES "Edit global song properties or convert the module to another format" END +STRINGTABLE +BEGIN + IDC_SAMPLE_XFADE "Crossfade Loop Points\nCrossfade between loop start and loop end to create seamless sample loops." +END + #endif // Englisch (USA) resources ///////////////////////////////////////////////////////////////////////////// Modified: trunk/OpenMPT/mptrack/res/patterns.bmp =================================================================== (Binary files differ) Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2011-03-07 00:21:50 UTC (rev 809) +++ trunk/OpenMPT/mptrack/resource.h 2011-03-07 00:51:43 UTC (rev 810) @@ -137,6 +137,7 @@ #define IDD_SAMPLE_GENERATOR_PRESETS 525 #define IDD_EDITHISTORY 526 #define IDD_SAMPLE_GRID_SIZE 527 +#define IDD_SAMPLE_XFADE 528 #define IDC_BUTTON1 1001 #define IDC_BUTTON2 1002 #define IDC_BUTTON3 1003 @@ -928,6 +929,7 @@ #define IDC_TOTAL_EDIT_TIME 2431 #define IDC_EDIT_HISTORY 2432 #define IDC_SAMPLE_QUICKFADE 2433 +#define IDC_SAMPLE_XFADE 2434 #define ID_FILE_NEWMOD 32771 #define ID_FILE_NEWXM 32772 #define ID_FILE_NEWS3M 32773 @@ -1195,9 +1197,9 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 528 +#define _APS_NEXT_RESOURCE_VALUE 529 #define _APS_NEXT_COMMAND_VALUE 60455 -#define _APS_NEXT_CONTROL_VALUE 2434 +#define _APS_NEXT_CONTROL_VALUE 2435 #define _APS_NEXT_SYMED_VALUE 901 #endif #endif Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-03-07 00:21:50 UTC (rev 809) +++ trunk/OpenMPT/mptrack/version.h 2011-03-07 00:51:43 UTC (rev 810) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 19 #define VER_MINOR 00 -#define VER_MINORMINOR 27 +#define VER_MINORMINOR 28 //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/soundlib/modsmp_ctrl.cpp =================================================================== --- trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2011-03-07 00:21:50 UTC (rev 809) +++ trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2011-03-07 00:51:43 UTC (rev 810) @@ -37,7 +37,7 @@ SmpLength InsertSilence(MODSAMPLE& smp, const SmpLength nSilenceLength, const SmpLength nStartFrom, CSoundFile* pSndFile) -//---------------------------------------------------------------------------------------------------------------------------- +//----------------------------------------------------------------------------------------------------------------------- { if(nSilenceLength == 0 || nSilenceLength >= MAX_SAMPLE_LENGTH || smp.nLength > MAX_SAMPLE_LENGTH - nSilenceLength) return smp.nLength; @@ -92,7 +92,7 @@ } SmpLength ResizeSample(MODSAMPLE& smp, const SmpLength nNewLength, CSoundFile* pSndFile) -//---------------------------------------------------------------------------------------- +//-------------------------------------------------------------------------------------- { // Invalid sample size if(nNewLength > MAX_SAMPLE_LENGTH || nNewLength == smp.nLength) @@ -139,7 +139,7 @@ template <class T> void AdjustEndOfSampleImpl(MODSAMPLE& smp) -//-------------------------------------------- +//---------------------------------------- { MODSAMPLE* const pSmp = &smp; const UINT len = pSmp->nLength; @@ -168,7 +168,7 @@ bool AdjustEndOfSample(MODSAMPLE& smp, CSoundFile* pSndFile) -//-------------------------------------------------------------- +//---------------------------------------------------------- { MODSAMPLE* const pSmp = &smp; @@ -477,6 +477,43 @@ } +template <class T> +void XFadeSampleImpl(T* pStart, const SmpLength nOffset, SmpLength nFadeLength) +//----------------------------------------------------------------------------- +{ + for(SmpLength i = 0; i <= nFadeLength; i++) + { + double dPercentage = sqrt((double)i / (double)nFadeLength); // linear fades are boring + pStart[nOffset + i] = (T)(((double)pStart[nOffset + i]) * (1 - dPercentage) + ((double)pStart[i]) * dPercentage); + } +} + +// X-Fade sample data to create smooth loop transitions +bool XFadeSample(MODSAMPLE *pSmp, SmpLength iFadeLength, CSoundFile *pSndFile) +//---------------------------------------------------------------------------- +{ + if(pSmp->pSample == nullptr) return false; + if(pSmp->nLoopEnd <= pSmp->nLoopStart || pSmp->nLoopEnd > pSmp->nLength) return false; + if(pSmp->nLoopStart < iFadeLength) return false; + + SmpLength iStart = pSmp->nLoopStart - iFadeLength; + SmpLength iEnd = pSmp->nLoopEnd - iFadeLength; + iStart *= pSmp->GetNumChannels(); + iEnd *= pSmp->GetNumChannels(); + iFadeLength *= pSmp->GetNumChannels(); + + if(pSmp->GetElementarySampleSize() == 2) + XFadeSampleImpl(reinterpret_cast<int16*>(pSmp->pSample) + iStart, iEnd - iStart, iFadeLength); + else if(pSmp->GetElementarySampleSize() == 1) + XFadeSampleImpl(reinterpret_cast<int8*>(pSmp->pSample) + iStart, iEnd - iStart, iFadeLength); + else + return false; + + AdjustEndOfSample(*pSmp, pSndFile); + return true; +} + + } // namespace ctrlSmp Modified: trunk/OpenMPT/soundlib/modsmp_ctrl.h =================================================================== --- trunk/OpenMPT/soundlib/modsmp_ctrl.h 2011-03-07 00:21:50 UTC (rev 809) +++ trunk/OpenMPT/soundlib/modsmp_ctrl.h 2011-03-07 00:51:43 UTC (rev 810) @@ -62,6 +62,9 @@ // Invert sample data (flip by 180 degrees) bool InvertSample(MODSAMPLE *pSmp, SmpLength iStart, SmpLength iEnd, CSoundFile *pSndFile); +// Crossfade sample data to create smooth loops +bool XFadeSample(MODSAMPLE *pSmp, SmpLength iFadeLength, CSoundFile *pSndFile); + } // Namespace ctrlSmp namespace ctrlChn This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-03-07 14:58:35
|
Revision: 811 http://modplug.svn.sourceforge.net/modplug/?rev=811&view=rev Author: saga-games Date: 2011-03-07 14:58:28 +0000 (Mon, 07 Mar 2011) Log Message: ----------- [Mod] Code should now also compile without having the DirectX SDK installed by defining NO_DSOUND in StdAfx.h (since I have the SDK installed, I cannot tell at the moment if it will actually compile, but it should in theory) Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Stdafx.h trunk/OpenMPT/soundlib/SNDDEVX.H trunk/OpenMPT/soundlib/Snddev.cpp Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2011-03-07 00:51:43 UTC (rev 810) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2011-03-07 14:58:28 UTC (rev 811) @@ -187,7 +187,11 @@ DWORD CMainFrame::m_nBitsPerSample = 16; DWORD CMainFrame::m_nPreAmp = 128; DWORD CMainFrame::gbLoopSong = TRUE; +#ifndef NO_DSOUND LONG CMainFrame::m_nWaveDevice = SNDDEV_BUILD_ID(0, SNDDEV_DSOUND); +#else +LONG CMainFrame::m_nWaveDevice = SNDDEV_BUILD_ID(0, SNDDEV_WAVEOUT); +#endif // NO_DSOUND LONG CMainFrame::m_nMidiDevice = 0; DWORD CMainFrame::m_nBufferLength = 75; LONG CMainFrame::gnLVuMeter = 0; @@ -412,12 +416,16 @@ rgbCustomColors[ncol] = GetPrivateProfileDWord("Display", s, rgbCustomColors[ncol], iniFile); } - DWORD defaultDevice = SNDDEV_DSOUND << 8; // first DirectSound device +#ifndef NO_DSOUND + DWORD defaultDevice = SNDDEV_BUILD_ID(0, SNDDEV_DSOUND); // first DirectSound device +#else + DWORD defaultDevice = SNDDEV_BUILD_ID(0, SNDDEV_WAVEOUT); // first DirectSound device +#endif // NO_DSOUND #ifndef NO_ASIO // If there's an ASIO device available, prefer it over DirectSound if(EnumerateSoundDevices(SNDDEV_ASIO, 0, nullptr, 0)) { - defaultDevice = SNDDEV_ASIO << 8; + defaultDevice = SNDDEV_BUILD_ID(0, SNDDEV_ASIO); } #endif // NO_ASIO m_nWaveDevice = GetPrivateProfileLong("Sound Settings", "WaveDevice", defaultDevice, iniFile); @@ -707,6 +715,9 @@ #ifdef NO_ASIO title += " NO_ASIO"; #endif + #ifdef NO_DSOUND + title += " NO_DSOUND"; + #endif SetTitle(title); OnUpdateFrameTitle(false); Modified: trunk/OpenMPT/mptrack/Stdafx.h =================================================================== --- trunk/OpenMPT/mptrack/Stdafx.h 2011-03-07 00:51:43 UTC (rev 810) +++ trunk/OpenMPT/mptrack/Stdafx.h 2011-03-07 14:58:28 UTC (rev 811) @@ -88,7 +88,10 @@ // Define to build without MO3 support. //#define NO_MO3_SUPPORT +// Define to build without DirectSound support. +//#define NO_DSOUND + void Log(LPCSTR format,...); #include "typedefs.h" Modified: trunk/OpenMPT/soundlib/SNDDEVX.H =================================================================== --- trunk/OpenMPT/soundlib/SNDDEVX.H 2011-03-07 00:51:43 UTC (rev 810) +++ trunk/OpenMPT/soundlib/SNDDEVX.H 2011-03-07 14:58:28 UTC (rev 811) @@ -2,7 +2,10 @@ #define _SNDDEVX_H_ #include <mmsystem.h> + +#ifndef NO_DSOUND #include <dsound.h> +#endif #ifndef NO_ASIO #include <iasiodrv.h> @@ -50,11 +53,14 @@ static BOOL EnumerateDevices(UINT nIndex, LPSTR pszDescription, UINT cbSize); }; + //////////////////////////////////////////////////////////////////////////////////// // // DirectSound device // +#ifndef NO_DSOUND + //====================================== class CDSoundDevice: public ISoundDevice //====================================== @@ -89,7 +95,9 @@ static BOOL EnumerateDevices(UINT nIndex, LPSTR pszDescription, UINT cbSize); }; +#endif // NO_DIRECTSOUND + //////////////////////////////////////////////////////////////////////////////////// // // ASIO device @@ -165,6 +173,7 @@ #endif // NO_ASIO + //////////////////////////////////////////////////////////////////////////////////// #endif // _SNDDEVX_H_ Modified: trunk/OpenMPT/soundlib/Snddev.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snddev.cpp 2011-03-07 00:51:43 UTC (rev 810) +++ trunk/OpenMPT/soundlib/Snddev.cpp 2011-03-07 14:58:28 UTC (rev 811) @@ -253,6 +253,8 @@ // DirectSound device // +#ifndef NO_DSOUND + #ifndef DSBCAPS_GLOBALFOCUS #define DSBCAPS_GLOBALFOCUS 0x8000 #endif @@ -537,7 +539,9 @@ return TRUE; } +#endif // NO_DIRECTSOUND + /////////////////////////////////////////////////////////////////////////////////////// // // ASIO Device implementation @@ -1378,10 +1382,12 @@ switch(nType) { case SNDDEV_WAVEOUT: return CWaveDevice::EnumerateDevices(nIndex, pszDesc, cbSize); +#ifndef NO_DSOUND case SNDDEV_DSOUND: return CDSoundDevice::EnumerateDevices(nIndex, pszDesc, cbSize); +#endif // NO_DIRECTSOUND #ifndef NO_ASIO case SNDDEV_ASIO: return CASIODevice::EnumerateDevices(nIndex, pszDesc, cbSize); -#endif +#endif // NO_ASIO } return FALSE; } @@ -1394,10 +1400,12 @@ switch(nType) { case SNDDEV_WAVEOUT: *ppsd = new CWaveDevice(); break; +#ifndef NO_DSOUND case SNDDEV_DSOUND: *ppsd = new CDSoundDevice(); break; +#endif // NO_DIRECTSOUND #ifndef NO_ASIO case SNDDEV_ASIO: *ppsd = new CASIODevice(); break; -#endif +#endif // NO_ASIO } return (*ppsd) ? TRUE : FALSE; } @@ -1406,12 +1414,14 @@ BOOL SndDevInitialize() //--------------------- { +#ifndef NO_DSOUND if (ghDSoundDLL) return TRUE; if ((ghDSoundDLL = LoadLibrary("dsound.dll")) == NULL) return FALSE; static_assert(sizeof(TCHAR) == 1, "Check DirectSoundEnumerateA below"); if ((gpDSoundEnumerate = (LPDSOUNDENUMERATE)GetProcAddress(ghDSoundDLL, "DirectSoundEnumerateA")) == NULL) return FALSE; if ((gpDSoundCreate = (LPDSOUNDCREATE)GetProcAddress(ghDSoundDLL, "DirectSoundCreate")) == NULL) return FALSE; RtlZeroMemory(glpDSoundGUID, sizeof(glpDSoundGUID)); +#endif // NO_DIRECTSOUND return TRUE; } @@ -1419,6 +1429,7 @@ BOOL SndDevUninitialize() //----------------------- { +#ifndef NO_DSOUND gpDSoundEnumerate = NULL; gpDSoundCreate = NULL; if (ghDSoundDLL) @@ -1436,6 +1447,7 @@ } gbDSoundEnumerated = FALSE; gnDSoundDevices = 0; +#endif // NO_DIRECTSOUND return TRUE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-03-07 16:33:33
|
Revision: 812 http://modplug.svn.sourceforge.net/modplug/?rev=812&view=rev Author: saga-games Date: 2011-03-07 16:33:26 +0000 (Mon, 07 Mar 2011) Log Message: ----------- [Fix] Made changes to song length detection code so that global variables aren't reset when looping a subsong in "no loop" mode. Modified Paths: -------------- trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-03-07 14:58:28 UTC (rev 811) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-03-07 16:33:26 UTC (rev 812) @@ -1615,7 +1615,7 @@ if (wsdlg.m_bSelectPlay) { m_SndFile.SetCurrentOrder(wsdlg.m_nMinOrder); - m_SndFile.GetLength(true, wsdlg.m_nMinOrder, 0); // adjust playback variables / visited rows vector + m_SndFile.GetLength(eAdjust, wsdlg.m_nMinOrder, 0); // adjust playback variables / visited rows vector m_SndFile.m_nCurrentPattern = wsdlg.m_nMinOrder; m_SndFile.m_nMaxOrderPosition = wsdlg.m_nMaxOrder + 1; } Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2011-03-07 14:58:28 UTC (rev 811) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2011-03-07 16:33:26 UTC (rev 812) @@ -1281,7 +1281,7 @@ //--------------------------------- { bool result = false; - GetLengthType length = m_SndFile.GetLength(false); + GetLengthType length = m_SndFile.GetLength(eNoAdjust); if(length.endOrder != ORDERINDEX_INVALID && length.endRow != ROWINDEX_INVALID) { result = m_SndFile.TryWriteEffect(m_SndFile.Order[length.endOrder], length.endRow, CMD_POSITIONJUMP, m_SndFile.m_nRestartPos, false, CHANNELINDEX_INVALID, false, true); Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-07 14:58:28 UTC (rev 811) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-07 16:33:26 UTC (rev 812) @@ -75,7 +75,7 @@ // Get mod length in various cases. Parameters: -// [in] bAdjust: If enabled, the mod parameters (such as global volume, speed, tempo, etc...) will be memorized (if the target has been reached) when leaving the function (i.e. they won't be reset to the previous values) +// [in] adjustMode: See enmGetLengthResetMode for possible adjust modes. // [in] endOrder: Order which should be reached (ORDERINDEX_INVALID means whole song) // [in] endRow: Row in that order that should be reached // [out] duration: total time in seconds @@ -84,8 +84,8 @@ // [out] lastRow: last parsed row (dito) // [out] endOrder: last order before module loops (UNDEFINED if a target is specified) // [out] endRow: last row before module loops (dito) -GetLengthType CSoundFile::GetLength(bool bAdjust, ORDERINDEX endOrder, ROWINDEX endRow) -//------------------------------------------------------------------------------------- +GetLengthType CSoundFile::GetLength(enmGetLengthResetMode adjustMode, ORDERINDEX endOrder, ROWINDEX endRow) +//--------------------------------------------------------------------------------------------------------- { GetLengthType retval; retval.duration = 0.0; @@ -219,7 +219,7 @@ if(!patternBreakOnThisRow || (GetType() == MOD_TYPE_XM)) nNextRow = 0; - if (bAdjust) + if ((adjustMode & eAdjust)) { pChn->nPatternLoopCount = 0; pChn->nPatternLoop = 0; @@ -247,7 +247,7 @@ { nNextPattern = nCurrentPattern + 1; } - if (bAdjust) + if ((adjustMode & eAdjust)) { pChn->nPatternLoopCount = 0; pChn->nPatternLoop = 0; @@ -264,7 +264,7 @@ break; // Set Tempo case CMD_TEMPO: - if ((bAdjust) && (m_nType & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT))) + if ((adjustMode & eAdjust) && (m_nType & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT))) { if (param) pChn->nOldTempo = (BYTE)param; else param = pChn->nOldTempo; } @@ -310,7 +310,7 @@ if (((param & 0xF0) == 0xA0) && !IsCompatibleMode(TRK_FASTTRACKER2)) pChn->nOldHiOffset = param & 0x0F; break; } - if (!bAdjust) continue; + if ((adjustMode & eAdjust) == 0) continue; switch(command) { // Portamento Up/Down @@ -434,7 +434,7 @@ retval.duration = dElapsedTime / 1000.0; // Store final variables - if (bAdjust) + if ((adjustMode & eAdjust)) { if (retval.targetReached || endOrder == ORDERINDEX_INVALID || endRow == ROWINDEX_INVALID) { @@ -454,7 +454,7 @@ Chn[n].nVolume = vols[n] * 4; } } - } else + } else if(adjustMode != eAdjustOnSuccess) { // Target not found (f.e. when jumping to a hidden sub song), reset global variables... m_nMusicSpeed = m_nDefaultSpeed; Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-03-07 14:58:28 UTC (rev 811) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-03-07 16:33:26 UTC (rev 812) @@ -3059,7 +3059,7 @@ double CSoundFile::GetPlaybackTimeAt(ORDERINDEX ord, ROWINDEX row, bool updateVars) //--------------------------------------------------------------------------------- { - const GetLengthType t = GetLength(updateVars, ord, row); + const GetLengthType t = GetLength(updateVars ? eAdjust : eNoAdjust, ord, row); if(t.targetReached) return t.duration; else return -1; //Given position not found from play sequence. } Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2011-03-07 14:58:28 UTC (rev 811) +++ trunk/OpenMPT/soundlib/Sndfile.h 2011-03-07 16:33:26 UTC (rev 812) @@ -498,7 +498,18 @@ ROWINDEX endRow; // last row before module loops (dito) }; +// Reset mode for GetLength() +enum enmGetLengthResetMode +{ + // Never adjust global variables / mod parameters + eNoAdjust = 0x00, + // Mod parameters (such as global volume, speed, tempo, etc...) will always be memorized if the target was reached (i.e. they won't be reset to the previous values). If target couldn't be reached, they are reset to their default values. + eAdjust = 0x01, + // Same as above, but global variables will only be memorized if the target could be reached. This does *NOT* influence the visited rows vector - it will *ALWAYS* be adjusted in this mode. + eAdjustOnSuccess = 0x02 | eAdjust, +}; + //Note: These are bit indeces. MSF <-> Mod(Specific)Flag. //If changing these, ChangeModTypeTo() might need modification. const BYTE MSF_COMPATIBLE_PLAY = 0; //IT/MPT/XM @@ -705,11 +716,11 @@ //Get modlength in various cases: total length, length to //specific order&row etc. Return value is in seconds. - GetLengthType GetLength(bool bAdjust, ORDERINDEX ord = ORDERINDEX_INVALID, ROWINDEX row = ROWINDEX_INVALID); + GetLengthType GetLength(enmGetLengthResetMode adjustMode, ORDERINDEX ord = ORDERINDEX_INVALID, ROWINDEX row = ROWINDEX_INVALID); public: //Returns song length in seconds. - DWORD GetSongTime() { return static_cast<DWORD>((m_nTempoMode == tempo_mode_alternative) ? GetLength(false).duration + 1.0 : GetLength(false).duration + 0.5); } + DWORD GetSongTime() { return static_cast<DWORD>((m_nTempoMode == tempo_mode_alternative) ? GetLength(eNoAdjust).duration + 1.0 : GetLength(eNoAdjust).duration + 0.5); } // A repeat count value of -1 means infinite loop void SetRepeatCount(int n) { m_nRepeatCount = n; } Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2011-03-07 14:58:28 UTC (rev 811) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2011-03-07 16:33:26 UTC (rev 812) @@ -788,7 +788,7 @@ #ifdef MODPLUG_TRACKER // Let's check again if this really is the end of the song. // The visited rows vector might have been screwed up while editing... - GetLengthType t = GetLength(false); + GetLengthType t = GetLength(eNoAdjust); if(t.lastOrder == m_nCurrentPattern && t.lastRow == m_nRow) #endif // MODPLUG_TRACKER { @@ -798,7 +798,7 @@ } else { // Ok, this is really dirty, but we have to update the visited rows vector... - GetLength(true, m_nCurrentPattern, m_nRow); + GetLength(eAdjustOnSuccess, m_nCurrentPattern, m_nRow); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-03-08 13:11:07
|
Revision: 813 http://modplug.svn.sourceforge.net/modplug/?rev=813&view=rev Author: saga-games Date: 2011-03-08 13:10:59 +0000 (Tue, 08 Mar 2011) Log Message: ----------- [Fix] S3M Loader: Fix to pattern loader (for empty patterns)... God this code is so ugly! [Mod] Updated internet links. Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/soundlib/Load_s3m.cpp Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2011-03-07 16:33:26 UTC (rev 812) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2011-03-08 13:10:59 UTC (rev 813) @@ -92,16 +92,8 @@ ON_COMMAND(ID_PANIC, OnPanic) ON_COMMAND(ID_PLAYER_PAUSE, OnPlayerPause) ON_COMMAND_EX(IDD_TREEVIEW, OnBarCheck) - ON_COMMAND_EX(ID_NETLINK_OPENMPTWIKI, OnInternetLink) ON_COMMAND_EX(ID_NETLINK_MODPLUG, OnInternetLink) - ON_COMMAND_EX(ID_NETLINK_UT, OnInternetLink) - ON_COMMAND_EX(ID_NETLINK_OSMUSIC, OnInternetLink) - ON_COMMAND_EX(ID_NETLINK_MPTFR, OnInternetLink) - ON_COMMAND_EX(ID_NETLINK_HANDBOOK, OnInternetLink) - ON_COMMAND_EX(ID_NETLINK_FORUMS, OnInternetLink) - ON_COMMAND_EX(ID_NETLINK_PLUGINS, OnInternetLink) - ON_COMMAND_EX(ID_NETLINK_OPENMPTWIKI_GERMAN, OnInternetLink) - ON_COMMAND_EX(ID_NETLINK_MODARCHIVE, OnInternetLink) + ON_COMMAND_EX(ID_NETLINK_TOP_PICKS, OnInternetLink) ON_CBN_SELCHANGE(IDC_COMBO_BASEOCTAVE, OnOctaveChanged) ON_UPDATE_COMMAND_UI(ID_MIDI_RECORD, OnUpdateMidiRecord) ON_UPDATE_COMMAND_UI(ID_INDICATOR_TIME, OnUpdateTime) @@ -2801,6 +2793,8 @@ switch(nID) { case ID_NETLINK_MODPLUG: pszURL = "http://openmpt.org/"; break; + case ID_NETLINK_TOP_PICKS: pszURL = "http://openmpt.org/top_picks"; break; + /* case ID_NETLINK_OPENMPTWIKI:pszURL = "http://wiki.openmpt.org/"; break; // case ID_NETLINK_UT: pszURL = "http://www.united-trackers.org"; break; // case ID_NETLINK_OSMUSIC: pszURL = "http://www.osmusic.net/"; break; @@ -2810,6 +2804,7 @@ case ID_NETLINK_PLUGINS: pszURL = "http://www.kvraudio.com/"; break; case ID_NETLINK_MODARCHIVE: pszURL = "http://modarchive.org/"; break; case ID_NETLINK_OPENMPTWIKI_GERMAN: pszURL = "http://wikide.openmpt.org/Hauptseite"; break; + */ } if (pszURL) return CTrackApp::OpenURL(pszURL); return FALSE; Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2011-03-07 16:33:26 UTC (rev 812) +++ trunk/OpenMPT/mptrack/mptrack.rc 2011-03-08 13:10:59 UTC (rev 813) @@ -2031,15 +2031,8 @@ MENUITEM "&Search...", ID_HELP_SEARCH MENUITEM "&Report a bug", ID_REPORT_BUG MENUITEM SEPARATOR - POPUP "&Internet" - BEGIN - MENUITEM "ModPlug Central &Forums", ID_NETLINK_FORUMS - MENUITEM "OpenMPT Wiki", ID_NETLINK_OPENMPTWIKI - MENUITEM "OpenMPT Wiki (German)", ID_NETLINK_OPENMPTWIKI_GERMAN - MENUITEM "MPT-FR", ID_NETLINK_MPTFR - MENUITEM "&Kvr Audio (plugins)", ID_NETLINK_PLUGINS - MENUITEM "The Mod Archive", ID_NETLINK_MODARCHIVE - END + MENUITEM "&OpenMPT Website", ID_NETLINK_MODPLUG + MENUITEM "&Web Resources", ID_NETLINK_TOP_PICKS MENUITEM SEPARATOR MENUITEM "&About OpenMPT...", ID_APP_ABOUT END @@ -2371,10 +2364,8 @@ ID_PATTERN_EXPAND "Expand pattern\nExpand Pattern" ID_PATTERN_SHRINK "Shrink Pattern\nShrink Pattern" ID_HELP_SEARCH "Displays the help index\nHelp Index" - ID_NETLINK_MODPLUG "Go to ModPlug Central" - ID_NETLINK_UT "Go to United Trackers" - ID_NETLINK_OSMUSIC "Go to OSMusic.net" - ID_NETLINK_HANDBOOK "Go to the Tracker's Handbook" + ID_NETLINK_MODPLUG "Visit the OpenMPT website" + ID_NETLINK_TOP_PICKS "Visit our list of free web resources!" END STRINGTABLE @@ -2386,9 +2377,7 @@ BEGIN ID_SAMPLE_TRIM "Delete everything except the current selection\nTrim Sample" ID_FILE_SAVEMIDI "Export the current song to a standard MIDI file" - ID_NETLINK_FORUMS "Go to the ModPlug Central Music Forums" ID_INSTRUMENT_SAMPLEMAP "Edit the sample map" - ID_NETLINK_PLUGINS "Go to KVR Audio to download plugins" ID_PATTERNDETAIL_LO "Low pattern detail level\nLow pattern detail level" ID_PATTERNDETAIL_MED "Medium pattern detail level\nMedium pattern detail level" ID_PATTERNDETAIL_HI "High pattern detail level\nHigh pattern detail level" Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2011-03-07 16:33:26 UTC (rev 812) +++ trunk/OpenMPT/mptrack/resource.h 2011-03-08 13:10:59 UTC (rev 813) @@ -1036,17 +1036,13 @@ #define ID_PATTERNCOPY 32874 #define ID_PATTERNPASTE 32875 #define ID_NETLINK_MODPLUG 32876 -#define ID_NETLINK_UT 32877 -#define ID_NETLINK_OSMUSIC 32878 -#define ID_NETLINK_HANDBOOK 32879 +#define ID_NETLINK_TOP_PICKS 32877 #define ID_SAMPLE_TRIM 32880 #define ID_FILE_SAVEMIDI 32881 #define ID_MODTREE_OPENITEM 32882 -#define ID_NETLINK_FORUMS 32883 #define ID_CONTROLENTER 32885 #define ID_INSTRUMENT_SAMPLEMAP 32886 #define ID_SAMPLE_MONOCONVERT 32887 -#define ID_NETLINK_PLUGINS 32888 #define ID_SAMPLE_ZOOMUP 32889 #define ID_SAMPLE_ZOOMDOWN 32890 #define ID_PATTERNDETAIL_LO 32891 @@ -1116,7 +1112,6 @@ #define ID_VSTPRESETBACKWARDJUMP 36031 #define ID_VSTPRESETFORWARDJUMP 36032 #define ID_SELECTINST 36100 -#define ID_NETLINK_MPTFR 37001 #define ID_PLUG_RECORDAUTOMATION 37003 #define ID_LEARN_MACRO_FROM_PLUGGUI 37004 #define ID_CHANGE_INSTRUMENT 37020 @@ -1152,10 +1147,7 @@ #define ID_ENVELOPE_TOGGLERELEASENODE 59206 #define ID_Menu59207 59207 #define ID_ENVELOPE_SCALEPOINTS 59208 -#define ID_NETLINK_OPENMPTWIKI 59210 #define ID_VIEW_MIDIMAPPING 59211 -#define ID_NETLINK_OPENMPTWIKI_GERMAN 59213 -#define ID_NETLINK_MODARCHIVE 59214 #define ID_PATTERN_DUPLICATECHANNEL 59216 #define ID_EDIT_GOTO_MENU 59220 #define ID_CLEANUP_COMPO 59221 Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_s3m.cpp 2011-03-07 16:33:26 UTC (rev 812) +++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2011-03-08 13:10:59 UTC (rev 813) @@ -222,11 +222,13 @@ if ((!lpStream) || (dwMemLength <= sizeof(S3MFILEHEADER) + 64)) return false; UINT insnum, patnum, nins, npat; - DWORD insfile[128]; - WORD ptr[256]; BYTE s[1024]; DWORD dwMemPos; - BYTE insflags[128], inspack[128]; + vector<DWORD> smpdatapos; + vector<WORD> smppos; + vector<WORD> patpos; + vector<BYTE> insflags; + vector<BYTE> inspack; S3MFILEHEADER psfh = *(S3MFILEHEADER *)lpStream; bool bKeepMidiMacros = false, bHasAdlibPatches = false; @@ -321,44 +323,46 @@ m_nSamples = insnum; patnum = npat = psfh.patnum; if (patnum > MAX_PATTERNS) patnum = MAX_PATTERNS; - memset(ptr, 0, sizeof(ptr)); - // this seems to be corrupted, the table can't really hold that many values. - if(nins + npat > 256) - return false; - - if (nins + npat) + // Read sample header offsets + smppos.resize(nins, 0); + for(UINT i = 0; i < nins; i++, dwMemPos += 2) { - memcpy(ptr, lpStream + dwMemPos, 2 * (nins + npat)); - dwMemPos += 2 * (nins + npat); - const UINT nLoopEnd = min(256, nins + npat); - for(UINT j = 0; j < nLoopEnd; ++j) + WORD ptr = *((WORD *)(lpStream + dwMemPos)); + smppos[i] = LittleEndianW(ptr); + } + // Read pattern offsets + patpos.resize(npat, 0); + for(UINT i = 0; i < npat; i++, dwMemPos += 2) + { + WORD ptr = *((WORD *)(lpStream + dwMemPos)); + patpos[i] = LittleEndianW(ptr); + } + // Read channel panning + if (psfh.panning_present == 0xFC) + { + const BYTE *chnpan = lpStream+dwMemPos; + for (UINT i=0; i<32; i++) if (chnpan[i] & 0x20) { - ptr[j] = LittleEndianW(ptr[j]); + ChnSettings[i].nPan = ((chnpan[i] & 0x0F) << 4) + 8; } - if (psfh.panning_present == 252) - { - const BYTE *chnpan = lpStream+dwMemPos; - for (UINT i=0; i<32; i++) if (chnpan[i] & 0x20) - { - ChnSettings[i].nPan = ((chnpan[i] & 0x0F) << 4) + 8; - } - } } - if (!m_nChannels) return true; + // Reading instrument headers - memset(insfile, 0, sizeof(insfile)); + smpdatapos.resize(insnum, 0); + inspack.resize(insnum, 0); + insflags.resize(insnum, 0); for (UINT iSmp=1; iSmp<=insnum; iSmp++) { - UINT nInd = ((DWORD)ptr[iSmp-1])*16; + UINT nInd = ((DWORD)smppos[iSmp - 1]) * 16; if ((!nInd) || (nInd + 0x50 > dwMemLength)) continue; - memcpy(s, lpStream+nInd, 0x50); + memcpy(s, lpStream + nInd, 0x50); memcpy(Samples[iSmp].filename, s+1, 12); SpaceToNullStringFixed<12>(Samples[iSmp].filename); - insflags[iSmp-1] = s[0x1F]; - inspack[iSmp-1] = s[0x1E]; + insflags[iSmp - 1] = s[0x1F]; + inspack[iSmp - 1] = s[0x1E]; s[0x4C] = 0; lstrcpy(m_szNames[iSmp], (LPCSTR)&s[0x30]); SpaceToNullStringFixed<28>(m_szNames[iSmp]); @@ -378,7 +382,7 @@ if (c5Speed < 1024) c5Speed = 1024; Samples[iSmp].nC5Speed = c5Speed; - insfile[iSmp - 1] = (s[0x0E] << 4) | (s[0x0F] << 12) | (s[0x0D] << 20); + smpdatapos[iSmp - 1] = (s[0x0E] << 4) | (s[0x0F] << 12) | (s[0x0D] << 20); if(Samples[iSmp].nLoopEnd < 2) Samples[iSmp].nLoopStart = Samples[iSmp].nLoopEnd = 0; @@ -393,6 +397,8 @@ } } + if (!m_nChannels) return true; + /* Try to find out if Zxx commands are supposed to be panning commands (PixPlay). We won't convert if there are not enough Zxx commands, too "high" Zxx commands or there are only "left" or "right" pannings (we assume that stereo should be somewhat balanced) */ @@ -400,13 +406,13 @@ int iZxxCountRight = 0, iZxxCountLeft = 0; // Reading patterns - for (UINT iPat=0; iPat<patnum; iPat++) + for (UINT iPat = 0; iPat < patnum; iPat++) { - UINT nInd = ((DWORD)ptr[nins+iPat]) << 4; - if (nInd + 0x40 > dwMemLength) continue; - WORD len = LittleEndianW(*((WORD *)(lpStream+nInd))); + bool fail = Patterns.Insert(iPat, 64); + UINT nInd = ((DWORD)patpos[iPat]) * 16; + if (nInd == 0 || nInd + 0x40 > dwMemLength) continue; + WORD len = LittleEndianW(*((WORD *)(lpStream + nInd))); nInd += 2; - bool fail = Patterns.Insert(iPat, 64); if ((!len) || (nInd + len > dwMemLength - 6) || (fail) ) continue; LPBYTE src = (LPBYTE)(lpStream+nInd); @@ -426,7 +432,7 @@ UINT chn = b & 0x1F; if (chn < m_nChannels) { - MODCOMMAND *m = &p[row*m_nChannels+chn]; + MODCOMMAND *m = &p[row * m_nChannels + chn]; if (b & 0x20) { if(j + nInd + 2 >= dwMemLength) break; @@ -498,15 +504,15 @@ } // Reading samples - for (UINT iRaw = 1; iRaw <= insnum; iRaw++) if ((Samples[iRaw].nLength) && (insfile[iRaw - 1])) + for (UINT iRaw = 1; iRaw <= insnum; iRaw++) if ((Samples[iRaw].nLength) && (smpdatapos[iRaw - 1])) { UINT flags = (psfh.version == 1) ? RS_PCM8S : RS_PCM8U; if (insflags[iRaw-1] & 4) flags += 5; if (insflags[iRaw-1] & 2) flags |= RSF_STEREO; if (inspack[iRaw-1] == 4) flags = RS_ADPCM4; - if(insfile[iRaw - 1] < dwMemLength) + if(smpdatapos[iRaw - 1] < dwMemLength) { - dwMemPos = insfile[iRaw - 1]; + dwMemPos = smpdatapos[iRaw - 1]; } if(dwMemPos < dwMemLength) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-03-09 12:35:32
|
Revision: 815 http://modplug.svn.sourceforge.net/modplug/?rev=815&view=rev Author: saga-games Date: 2011-03-09 12:35:25 +0000 (Wed, 09 Mar 2011) Log Message: ----------- [Mod] Updated some keymaps, history.txt, release notes Modified Paths: -------------- trunk/OpenMPT/installer/install.iss trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb trunk/OpenMPT/packageTemplate/History.txt trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb trunk/OpenMPT/packageTemplate/extraKeymaps/FR_FT2Style_(goor00).mkb trunk/OpenMPT/packageTemplate/extraKeymaps/FR_mpt_classic_(vanisherIII).mkb trunk/OpenMPT/packageTemplate/extraKeymaps/SE_laptop_(ganja).mkb trunk/OpenMPT/packageTemplate/extraKeymaps/UK_mpt_it2_hybrid_(rewbs).mkb trunk/OpenMPT/packageTemplate/extraKeymaps/US_it2_(lpchip).mkb trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(nobuyuki).mkb trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(snu).mkb trunk/OpenMPT/packageTemplate/extraKeymaps/dvorak_(snu).mkb Modified: trunk/OpenMPT/installer/install.iss =================================================================== --- trunk/OpenMPT/installer/install.iss 2011-03-08 19:03:30 UTC (rev 814) +++ trunk/OpenMPT/installer/install.iss 2011-03-09 12:35:25 UTC (rev 815) @@ -72,8 +72,8 @@ ; release notes Source: ..\packageTemplate\ReleaseNotesImages\general\*.*; DestDir: {app}\ReleaseNotesImages\general\; Flags: ignoreversion sortfilesbyextension -Source: ..\packageTemplate\ReleaseNotesImages\1.18\*.*; DestDir: {app}\ReleaseNotesImages\1.18\; Flags: ignoreversion sortfilesbyextension -Source: ..\packageTemplate\OMPT_1.18_ReleaseNotes.html; DestDir: {app}; Flags: ignoreversion +Source: ..\packageTemplate\ReleaseNotesImages\1.19\*.*; DestDir: {app}\ReleaseNotesImages\1.18\; Flags: ignoreversion sortfilesbyextension +Source: ..\packageTemplate\OMPT_1.19_ReleaseNotes.html; DestDir: {app}; Flags: ignoreversion ; soundtouch license stuff Source: ..\packageTemplate\SoundTouch\*.*; DestDir: {app}\SoundTouch; Flags: ignoreversion sortfilesbyextension Modified: trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb =================================================================== --- trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb 2011-03-08 19:03:30 UTC (rev 814) +++ trunk/OpenMPT/mptrack/res/defaultKeybindings.mkb 2011-03-09 12:35:25 UTC (rev 815) @@ -280,7 +280,9 @@ 8:1387:0:109:1 //Zoom In: NUM SUB (KeyDown) 8:1784:2:73:1 //Invert sample phase: Ctrl+I (KeyDown) 8:1785:2:85:1 //Signed/Unsigned conversion: Ctrl+U (KeyDown) -8:1790:2:68:1 //Remove DC Offset: Ctrl+D (KeyDown) +8:1790:2:69:1 //Remove DC Offset: Ctrl+E (KeyDown) +8:1856:2:68:1 //Quick fade: Ctrl+D (KeyDown) +8:1857:2:76:1 //Crossfade sample loop: Ctrl+L (KeyDown) //----( Instrument Context [bottom] (9) )------------ 9:1837:0:107:5 //Zoom In: NUM PLUS (KeyDown|KeyHold) @@ -325,6 +327,16 @@ //----( Sample Context [top] (16) )------------ //----( Instrument Context [top] (17) )------------ +17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown) +17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown) +17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown) +17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown) +17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown) +17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown) +17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown) +17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown) +17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown) +17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown) //----( Comments Context [top] (18) )------------ Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2011-03-08 19:03:30 UTC (rev 814) +++ trunk/OpenMPT/packageTemplate/History.txt 2011-03-09 12:35:25 UTC (rev 815) @@ -10,11 +10,12 @@ (tx XYZ): thanks to XYZ for telling us about the bug -v1.19.01.00 (February 2011, revision 803) +v1.19.01.00 (February 2011, revision 813) ----------------------------------------- Pattern tab [New] <Jojo> Clicking and dragging the row numbers selects the whole row now (Excel / Calc style) - see http://bugs.openmpt.org/view.php?id=45 [New] <Jojo> Experimental feature: Play the whole pattern row when entering notes and chords into the pattern editor. This can be enabled from the setup screen. + [Imp] <Jojo> Special paste modes have been moved to a sub menu in the context menu, to save some space. [Mod] <Jojo> Using the Goto Dialog should now update channel parameters and set the elapsed time. (http://bugs.openmpt.org/view.php?id=28) [Mod] <Jojo> Undo steps have been increased from 100 to 1000. [Fix] <Jojo> Cursor paste was possible even when editing was disabled. @@ -34,7 +35,7 @@ [Fix] <Jojo> Changing a value didn't create an undo point. (http://bugs.openmpt.org/view.php?id=56) Pattern tab::Find/replace - [New] <Jojo> Added Find / Replace mode: Find in current pattern selection. + [New] <Jojo> Added Find / Replace mode: Find in current pattern selection. (http://bugs.openmpt.org/view.php?id=42) [Imp] <Jojo> When changing the content of a combobox, the corresponding checkbox is now automatically checked. Likewise, the "Replace By" checkbox is checked if a checkbox or combobox on the "Replace" tab is enabled. [Mod] <Jojo> "Replace All" just creates one undo point now. @@ -43,11 +44,14 @@ [Mod] <Jojo> When removing a channel (via context menu) that contains no data in any pattern, no warning is shown anymore. Sample tab + [New] <Jojo> There's a new tool to create seamless sample loops: The loop crossfader. Includes a new keyboard shortcut. (http://bugs.openmpt.org/view.php?id=53) [New] <Jojo> The new "sample grid" feature can create equally-sized sample selections, so it is f.e. easy to split a sample into four equally-sized samples. + [New] <Jojo> New context menu item and keyboard shortcut: Quick fade for samples. If the sample start is selected, a fade-in is automatically performed. Likewise, if the sample end is selected, a fade-out is performed. If neither is selected, the default amplification dialog is shown. [Imp] <re> Ctrl + Mouse Wheel can now be used for zooming into the sample data. [Mod] <Jojo> Undo steps have been increased from 100 to 1000 (per sample). [Fix] <Jojo> When cutting samples with a loop, the loop end point was not always moved correctly if the cut start was in the loop. - [Fix] <re> Changing zoom level should now preserve the view position better. + [Fix] <Jojo> Sample Undo didn't preserve the sample name. + [Fix] <re> Changing zoom level should now preserve the view position better. (http://bugs.openmpt.org/view.php?id=3) Instrument tab [Imp] <re> Ctrl + Mouse Wheel can now be used for zooming into the envelopes. @@ -57,18 +61,28 @@ [Fix] <Jojo> The note mapping doesn't allow items anymore that aren't notes (such as "no note" or "note cut"). Such notes couldn't be entered manually, however when converting from other formats this was possible and it could crash the tracker (http://bugs.openmpt.org/view.php?id=61). [Fix] <Jojo> Various actions in the instrument note map and envelope view should now also mark the instrument as modified (when working in the ITP format). +VST + [New] <Jojo> Plugins can now request common file dialogs (file and directory selection). + [Mod] <Jojo> When automatically inserting a new instrument from the VST editor, the bank and patch values are now not filled in anymore, so it is easier to change to another patch while editing. + [Mod] <Jojo> Various small improvements to support VST 2.4 plugins better. + [Fix] <Jojo> Speaker arrangement is now sent to the plugins upon initialization. This fixes Voxengo SPAN 2 (a VST 2.4 plugin). Does this break other multichannel plugins? + [Fix] <Jojo> The time signature sent to VST plugins should be correct now. The denominator is always assumed to be 4, so a 6/8 signature is for example not possible. + [Fix] <Jojo> The EnergyXT GUI does now also work after closing and re-opening the VST editor. (tx Nahkranoth, http://forum.openmpt.org/index.php?topic=2307.0) + Mod Conversion + [Imp] <Jojo> If the new format doesn't support restart positions, it is now tried to convert the restart position to a pattern command. [Imp] <Jojo> When converting patterns from a format with instruments to a format without instruments (or when removing all instruments using the cleanup dialog), the instrument note mapping is now also taken care of. [Imp] <Jojo> Sample sustain loops are now converted to normal loops if needed and possible. [Imp] <Jojo> Bidi loops are disabled when converting to MOD / S3M now. [Imp] <Jojo> More warnings are shown, old warning messages were improved. [Imp] <Jojo> Volume command priority when converting from XM to IT / S3M has been changed - Cxx overrides vxx in XM, so this is now taken into account. + [Imp] <Jojo> When converting to XM, the E60 bug is now tried to be compensated. [Fix] <Jojo> Q0y means "no volume change" in S3M / IT, but R0y means "continue volume change" in FT2, and converting from IT / S3M to XM didn't consider this. Q0y is now converted to R8y, and E9y is now converted to Q0y (instead of Q8y). Playback - [New] <Jojo> New mix mode: Compatible. This is used for MOD / S3M / XM / IT by default and has more appropriate mixing levels for those formats (same levels as Schism Tracker) than mix mode RC3, and it forces soft panning to be *disabled*. Please use compatible mixing levels when working with legacy formats from now on. + [New] <Jojo> New mix mode: Compatible. This is used for MOD / S3M / XM / IT by default and has more appropriate mixing levels for those formats (same levels as Schism Tracker) than mix mode RC3, and it forces soft panning to be *disabled*. Please use compatible mixing levels when working with legacy formats from now on. (http://bugs.openmpt.org/view.php?id=6) [Imp] <Jojo> Improved the algorithm for finding a free channel for note playback in the editor (does not affect normal module playback). - [Mod] <Jojo> A new mechanism is used to determine the end of playback. This introduces some great changes in the code. One advantage of the new mechanism is that backwards playing patterns can now be exported to WAV properly (hehe). The new code might not stop playback properly if "loop song" is disabled and the user jumped around in the module - let's see how that works... + [Mod] <Jojo> A new mechanism is used to determine the end of playback. This introduces some great changes in the code. One advantage of the new mechanism is that backwards playing patterns can now be exported to WAV properly (http://bugs.openmpt.org/view.php?id=21). The new code might not stop playback properly if "loop song" is disabled and the user jumped around in the module - let's see how that works... (it's not like this has worked properly before anyway) [Fix] <Jojo> Pattern jumps to the same row + pattern as the jump command are not ignored anymore. (http://forum.openmpt.org/index.php?topic=1810.0) IT @@ -76,8 +90,8 @@ [Imp] <Jojo> IT files made with Modplug Tracker 1.00a5 are now also detected as such. [Mod] <Jojo> Sane values are used again for the "cwtv" and "cmwt" header fields when saving IT files; in fact the same values as in compatibility export are used. To be able to distinguish between raped and compatibility-exported IT files, "OMPT" is written in the "reserved" header field. As a consequence, IT files made with OpenMPT can now be loaded in Impulse Tracker again. [Mod] <Jojo> IT Loader: MIDI macros are now cleared when loading IT files made with old Impulse Tracker versions (< 2.14), so that Zxx commands won't break the songs anymore (fixes denonde.it, fix from Schism Tracker). - [Fix] <Jojo> In compatible mode, bidi loops are now treated like in IT's software mixer. - [Fix] <Jojo> Sample autovibrato is now hopefully a bit closer to Impulse Tracker in compatible mode... + [Fix] <Jojo> In compatible mode, bidi loops are now treated like in IT's software mixer. (http://bugs.openmpt.org/view.php?id=29) + [Fix] <Jojo> Sample autovibrato is now hopefully a bit closer to Impulse Tracker in compatible mode... (http://bugs.openmpt.org/view.php?id=5) [Fix] <Jojo> The envelope handling was altered slightly to work more like in Schism Tracker. This fixes a combination of Envelope Carry + Portamento as it can be found in "electric bunny" by Alpha C. [Fix] <Jojo> Various fixes to playback of multi-sample instruments. "Ultima Ratio" by Nebularia and "Shuttle Departure" by Sphenx sound better now. [Fix] <Jojo> The extended sample map is not saved anymore in the instrument headers when using compatibility export. @@ -94,7 +108,7 @@ [Fix] <Jojo> XM Loader: Fixed handling of instruments with no samples, so that instruments assigned to VST plugins work correctly. MOD - [Imp] <Jojo> It's now possible to create MOD files with more than 64 patterns. Just like in ProTracker, such MOD files are identified by the "M!K!" signature (instead of M.K.) + [Imp] <Jojo> It's now possible to create MOD files with more than 64 distinct patterns. Just like in ProTracker, such MOD files are identified by the "M!K!" signature (instead of M.K.) [Fix] <Jojo> The maximum speed for MOD files was off by one in some places (31 instead of 32). MOD::Loading @@ -106,17 +120,10 @@ S3M [Mod] <Jojo> Changed some code in the S3M loader that should only affect really broken S3M files which every player handles different anyway (at least my broken version of aa-polym.s3m sounds better now) [Fix] <Jojo> Octave 8 was allowed in S3M files while it shouldn't (it wasn't even saved in the file) + [Fix] <Jojo> S3M Loader: Fix to pattern loader (for empty patterns) [Fix] <Jojo> Removed the X param (#) effect from the supported effect list. [Fix] <Jojo> Speed and tempo values are now adjusted to what Scream Tracker actually expects (speed 1 - 254, tempo 32 - 255) - anything out of this range is ignored by Scream Tracker, so it is now also ignored by OpenMPT. -VST - [New] <Jojo> Plugins can now request common file dialogs (file and directory selection). - [Mod] <Jojo> When automatically inserting a new instrument from the VST editor, the bank and patch values are now not filled in anymore, so it is easier to change to another patch while editing. - [Mod] <Jojo> Various small improvements to support VST 2.4 plugins better. - [Fix] <Jojo> Speaker arrangement is now sent to the plugins upon initialization. This fixes Voxengo SPAN 2 (a VST 2.4 plugin). Does this break other multichannel plugins? - [Fix] <Jojo> The time signature sent to VST plugins should be correct now. The denominator is always assumed to be 4, so a 6/8 signature is for example not possible. - [Fix] <Jojo> The EnergyXT GUI does now also work after closing and re-opening the VST editor. (tx Nahkranoth, http://forum.openmpt.org/index.php?topic=2307.0) - Other modules [Imp] <Jojo> Garbage characters in sample / instrument / song names should be gone now.. This should f.e. avoid sample names like " ntitled" turning up in modules after deleting sample names. [Imp] <Jojo> Improved handling of the note cut effect in PTM (Polytracker) files a bit. @@ -129,17 +136,19 @@ Misc [New] <Jojo> WAV Export: Sample-exact cue points are now written at each pattern transition. [Imp] <Jojo> Paths to VST plugins in mptrack.ini and plugin.cache are now also relative in portable mode. This means that finally, *all* stored paths are now relative in portable mode. - [Imp] <Jojo> New keyboard shortcuts: Panic, View Edit History, Set Invalid / Ignore (--- / +++) Pattern (in the orderlist) + [Imp] <Jojo> Additional new keyboard shortcuts: Panic, View Edit History, Set Invalid / Ignore (--- / +++) Pattern (in the orderlist), plus the ones mentioned in above categories [Imp] <Jojo> Some improvements were made to the Registry / INI reading: If there were no Registry settings because MPT 1.16 was previously not installed, the INI file is now also read as it might contain some lines created by the installer. [Imp] <Jojo> Sound Setup: For ASIO devices, only supported sampling rates are now shown. [Imp] <Jojo> The instrument list on the comments tab also shows assigned plugins now. - [Mod] <Jojo> Changes to keymap file handling: The active keymap is now always saved to Keybindings.mkb (in either %APPDATA%\OpenMPT or the executable's directory). Any other keymaps are now only overwritten when using the "Save keys as" function. + [Imp] <Jojo> Added Mix Paste (IT Style) to the "Paste Special" edit menu + [Mod] <Jojo> Changes to keymap file handling: The active keymap is now always saved to Keybindings.mkb (in either %APPDATA%\OpenMPT or the executable's directory). Any other keymaps are now only overwritten when using the "Save keys as" function. (http://bugs.openmpt.org/view.php?id=20) [Mod] <Jojo> On first run, the default ASIO driver is now chosen instead of DirectSound (if there is one). [Mod] <Jojo> The "Original" mix mode now also has a version number (1.16) to reflect what the "original" thing is. [Mod] <Jojo> Updated genre list in the MP3 export dialog. [Mod] <Jojo> When using the ACM MP3 codec, 320kbit/s bitrate should now be available. [Mod] <Jojo> The MMX acceleration label in the Soundcard setup dialog is now updated according to the multimedia extensions that are supported by the CPU (3DNow! / SSE) [Mod] <Jojo> Updated unmo3.dll to version 2.4.0.1 + [Mod] <Jojo> Updated the internet link list in the Help menu. [Fix] <Jojo> Mod Cleanup: Rearrange patterns was broken when using more than one sequence in the MPTM format. (tx Skaven) [Fix] <Jojo> Mod Cleanup: Various sample / instrument rearranging functions broke PC Notes. [Fix] <Jojo> The text length was calculated wrong in the message reader, leading to a possible buffer overflow when reading song messages with mixed line endings where CR or LF line endings were expected. @@ -966,8 +975,8 @@ Sample tab [New] <Jojo> Can now normalize sample selections. (rev. 254) [New] <Jojo> Can now optionally normalize all samples instead of just one (click normalize with shift down) (rev. 249) - [New] <Jojo & re> Status bar now displays offset value at given sample point. (rev. 232) - [New] <Jojo & re> Sample amplify now accepts negative values(inverts sample phase) (request 2219) (rev. 234) + [New] <Jojo & re> Status bar now displays Oxx / 9xx offset value at current mouse cursor position. (rev. 232) + [New] <Jojo & re> Sample amplify now accepts negative values (inverts sample phase) (http://forum.openmpt.org/index.php?topic=2219.0) (rev. 234) [New] <Jojo & re> Signed/unsigned sample conversion. (rev. 235) [New] <re> Added button for phase invert to toolbar. (rev. 235) [New] <Jojo> Ability to save sample as raw. (rev. 236) Modified: trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html =================================================================== --- trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html 2011-03-08 19:03:30 UTC (rev 814) +++ trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html 2011-03-09 12:35:25 UTC (rev 815) @@ -91,10 +91,8 @@ <li>Based on an undocumented feature in Impulse Tracker, OpenMPT can now save an <strong>edit history</strong> in IT and MPTM files, which reveals when and for how long a module has been edited in the tracker.</li> <li>When exporting to WAV, <strong>cue points</strong> are now inserted at every pattern transition.</li> <li>The last remaining absolute paths in the settings files have been removed; OpenMPT is now <strong>fully portable</strong>!</li> - <li>The <strong>sample grid</strong> can be used to create equally-sized sample selections.</li> - <li>Ctrl + Mouse Wheel can now be used to <strong>zoom into samples and envelopes</strong>.</li> <li>The instrument list on the comments tab also shows <strong>assigned plugins</strong> now.</li> - <li>New <strong>keyboard shortcuts</strong>: Panic, View Edit History, Set Invalid / Ignore Pattern (in the orderlist)</li> + <li>New <strong>keyboard shortcuts</strong>: Panic, View Edit History, Set Invalid / Ignore Pattern (in the orderlist), Quick fade (sample editor)</li> <li>Changes to <strong>keymap file handling</strong>: The active keymap is now always saved to Keybindings.mkb. Any other keymaps are now only overwritten when using the "Save keys as" function.</li> <li>When using the ACM MP3 codec, 320kbit/s bitrate should now be available.</li> </ul> @@ -105,12 +103,20 @@ </div> <ul> <li><strong>Per-pattern time signatures</strong> allow to override the global time signature. This is especially useful in modern tempo mode if you want to use several time signatures in the same song, or if you just temporarily need more detail in a pattern.</li> - <li>You can now <strong>select a whole row</strong> by clicking the row index on the left side of the pattern.</li> + <li>You can now <strong>select whole rows</strong> by clicking / dragging the row index on the left side of the pattern.</li> <li>The search feature has been extended to allow for <strong>searching in pattern selections</strong>.</li> <li>Furthermore, the usability of the Find / Replace dialog has been improved: Corresponding checkboxes are now automatically ticked when the value of a dropdown box has been changed. "Replace All" no longer creates an undo point for every replaced command.</li> <li>It is now possible to <strong>play the whole pattern row when entering notes</strong> and chords into the pattern editor. This behaviour can be enabled from the setup screen.</li> </ul> + <h3>Sample Editor / Instrument Editor</h3> + <ul> + <li>The <strong>sample grid</strong> can be used to create equally-sized sample selections.</li> + <li>You can now create seamless loop transitations using the <strong>sample loop crossfader</strong>.</li> + <li>There is a new context menu item for <strong>quickly fading</strong> in the sample start or fading out the sample end.</li> + <li>Ctrl + Mouse Wheel can now be used to <strong>zoom into samples and envelopes</strong>.</li> + </ul> + <h3>Compatibility</h3> <ul> <li>Sample <strong>auto-vibrato</strong> in IT files sounds a lot closer to Impulse Tracker's implementation now.</li> @@ -135,7 +141,7 @@ <i>This list has mostly been copied over from the old 1.17RC2 release notes, so this not very comprehensive... :-)</i> </p> <ul> - <li>Far from perfect VST support (routing, etc...)</li> + <li>Far from perfect VST support (no busses for routing, no MIDI routing, only a few tracker effects are supported, etc...)</li> <li>Some controls vanish randomly all the time, most notably under Windows Vista and Windows 7.</li> <li>Previewing samples from the treeview's file browser stops the playing module.</li> <li>Cannot preview instruments directly from the MIDI library in the treeview.</li> Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2011-03-08 19:03:30 UTC (rev 814) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2011-03-09 12:35:25 UTC (rev 815) @@ -282,6 +282,7 @@ 8:1785:2:85:1 //Signed/Unsigned conversion: Ctrl+U (KeyDown) 8:1790:2:69:1 //Remove DC Offset: Ctrl+E (KeyDown) 8:1856:2:68:1 //Quick fade: Ctrl+D (KeyDown) +8:1857:2:76:1 //Crossfade sample loop: Ctrl+L (KeyDown) //----( Instrument Context [bottom] (9) )------------ 9:1837:0:107:5 //Zoom In: + (ZEHNERTASTATUR) (KeyDown|KeyHold) Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/FR_FT2Style_(goor00).mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/FR_FT2Style_(goor00).mkb 2011-03-08 19:03:30 UTC (rev 814) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/FR_FT2Style_(goor00).mkb 2011-03-09 12:35:25 UTC (rev 815) @@ -274,6 +274,16 @@ //----( Sample Context [top] (16) )------------ //----( Instrument Context [top] (17) )------------ +17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown) +17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown) +17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown) +17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown) +17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown) +17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown) +17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown) +17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown) +17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown) +17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown) //----( Comments Context [top] (18) )------------ Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/FR_mpt_classic_(vanisherIII).mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/FR_mpt_classic_(vanisherIII).mkb 2011-03-08 19:03:30 UTC (rev 814) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/FR_mpt_classic_(vanisherIII).mkb 2011-03-09 12:35:25 UTC (rev 815) @@ -260,6 +260,16 @@ //----( Sample Context [top] (16) )------------ //----( Instrument Context [top] (17) )------------ +17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown) +17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown) +17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown) +17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown) +17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown) +17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown) +17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown) +17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown) +17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown) +17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown) //----( Comments Context [top] (18) )------------ Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/SE_laptop_(ganja).mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/SE_laptop_(ganja).mkb 2011-03-08 19:03:30 UTC (rev 814) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/SE_laptop_(ganja).mkb 2011-03-09 12:35:25 UTC (rev 815) @@ -184,6 +184,16 @@ //----( Sample Context [top] (16) )------------ //----( Instrument Context [top] (17) )------------ +17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown) +17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown) +17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown) +17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown) +17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown) +17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown) +17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown) +17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown) +17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown) +17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown) //----( Comments Context [top] (18) )------------ Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/UK_mpt_it2_hybrid_(rewbs).mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/UK_mpt_it2_hybrid_(rewbs).mkb 2011-03-08 19:03:30 UTC (rev 814) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/UK_mpt_it2_hybrid_(rewbs).mkb 2011-03-09 12:35:25 UTC (rev 815) @@ -281,6 +281,16 @@ //----( Sample Context [top] (16) )------------ //----( Instrument Context [top] (17) )------------ +17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown) +17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown) +17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown) +17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown) +17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown) +17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown) +17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown) +17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown) +17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown) +17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown) //----( Comments Context [top] (18) )------------ Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/US_it2_(lpchip).mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/US_it2_(lpchip).mkb 2011-03-08 19:03:30 UTC (rev 814) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/US_it2_(lpchip).mkb 2011-03-09 12:35:25 UTC (rev 815) @@ -252,6 +252,16 @@ //----( Sample Context [top] (16) )------------ //----( Instrument Context [top] (17) )------------ +17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown) +17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown) +17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown) +17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown) +17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown) +17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown) +17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown) +17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown) +17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown) +17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown) //----( Comments Context [top] (18) )------------ Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(nobuyuki).mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(nobuyuki).mkb 2011-03-08 19:03:30 UTC (rev 814) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(nobuyuki).mkb 2011-03-09 12:35:25 UTC (rev 815) @@ -265,6 +265,16 @@ //----( Sample Context [top] (16) )------------ //----( Instrument Context [top] (17) )------------ +17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown) +17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown) +17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown) +17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown) +17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown) +17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown) +17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown) +17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown) +17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown) +17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown) //----( Comments Context [top] (18) )------------ Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(snu).mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(snu).mkb 2011-03-08 19:03:30 UTC (rev 814) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/US_mpt_classic_(snu).mkb 2011-03-09 12:35:25 UTC (rev 815) @@ -319,6 +319,16 @@ //----( Sample Context [top] (16) )------------ //----( Instrument Context [top] (17) )------------ +17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown) +17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown) +17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown) +17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown) +17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown) +17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown) +17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown) +17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown) +17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown) +17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown) //----( Comments Context [top] (18) )------------ Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/dvorak_(snu).mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/dvorak_(snu).mkb 2011-03-08 19:03:30 UTC (rev 814) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/dvorak_(snu).mkb 2011-03-09 12:35:25 UTC (rev 815) @@ -319,6 +319,16 @@ //----( Sample Context [top] (16) )------------ //----( Instrument Context [top] (17) )------------ +17:1851:2:68:1 //Duplicate instrument: Ctrl+D (KeyDown) +17:1850:3:69:1 //Edit sample map: Shift+Ctrl+E (KeyDown) +17:1849:2:69:1 //Edit current sample: Ctrl+E (KeyDown) +17:1846:3:77:1 //Map all notes to selected note: Shift+Ctrl+M (KeyDown) +17:1847:2:77:1 //Map all notes to selected sample: Ctrl+M (KeyDown) +17:1848:2:82:1 //Reset note mapping: Ctrl+R (KeyDown) +17:1843:2:81:1 //Transpose +1 (note map): Ctrl+Q (KeyDown) +17:1842:2:65:1 //Transpose -1 (note map): Ctrl+A (KeyDown) +17:1845:3:81:1 //Transpose +12 (note map): Shift+Ctrl+Q (KeyDown) +17:1844:3:65:1 //Transpose -12 (note map): Shift+Ctrl+A (KeyDown) //----( Comments Context [top] (18) )------------ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-03-19 14:00:29
|
Revision: 818 http://modplug.svn.sourceforge.net/modplug/?rev=818&view=rev Author: saga-games Date: 2011-03-19 14:00:23 +0000 (Sat, 19 Mar 2011) Log Message: ----------- [Ref] Small bits of refactoring in various places. Modified Paths: -------------- trunk/OpenMPT/mptrack/AutoSaver.cpp trunk/OpenMPT/mptrack/View_pat.h trunk/OpenMPT/mptrack/Vstplug.h trunk/OpenMPT/mptrack/fxp.cpp trunk/OpenMPT/mptrack/fxp.h trunk/OpenMPT/soundlib/Load_mt2.cpp trunk/OpenMPT/soundlib/Snd_defs.h Modified: trunk/OpenMPT/mptrack/AutoSaver.cpp =================================================================== --- trunk/OpenMPT/mptrack/AutoSaver.cpp 2011-03-19 13:56:03 UTC (rev 817) +++ trunk/OpenMPT/mptrack/AutoSaver.cpp 2011-03-19 14:00:23 UTC (rev 818) @@ -378,8 +378,8 @@ CHAR szPath[_MAX_PATH] = ""; BROWSEINFO bi; - GetDlgItemText(IDC_AUTOSAVE_PATH, szPath, sizeof(szPath)); - memset(&bi, 0, sizeof(bi)); + GetDlgItemText(IDC_AUTOSAVE_PATH, szPath, CountOf(szPath)); + MemsetZero(bi); bi.hwndOwner = m_hWnd; bi.lpszTitle = "Select a folder to store autosaved files in..."; bi.pszDisplayName = szPath; Modified: trunk/OpenMPT/mptrack/View_pat.h =================================================================== --- trunk/OpenMPT/mptrack/View_pat.h 2011-03-19 13:56:03 UTC (rev 817) +++ trunk/OpenMPT/mptrack/View_pat.h 2011-03-19 14:00:23 UTC (rev 818) @@ -30,9 +30,19 @@ #define PATSTATUS_PLUGNAMESINHEADERS 0x2000 // Show plugin names in channel headers //rewbs.patPlugName #define PATSTATUS_SELECTROW 0x4000 // Selecting a whole pattern row by clicking the row numbers + // Row Spacing #define MAX_SPACING 64 // MAX_PATTERN_ROWS + +// Selection - bit masks +// --------------------- +// A selection point (m_dwStartSel and the like) is stored in a 32-Bit variable. The structure is as follows (MSB to LSB): +// | 16 bits - row | 13 bits - channel | 3 bits - channel component | +// As you can see, the highest 16 bits contain a row index. +// It is followed by a channel index, which is 13 bits wide. +// The lowest 3 bits are used for addressing the components of a channel. They are *not* used as a bit set, but treated as one of the following integer numbers: + enum PatternColumns { NOTE_COLUMN=0, @@ -43,7 +53,9 @@ LAST_COLUMN = PARAM_COLUMN }; +static_assert(MAX_CHANNELS <= 0x1FFF, "Check: Channel index in pattern editor is only 13 bits wide!"); + //Struct for controlling selection clearing. This is used to define which data fields //should be cleared. struct RowMask @@ -67,10 +79,10 @@ struct FindReplaceStruct { MODCOMMAND cmdFind, cmdReplace; // Find/replace notes/instruments/effects - DWORD dwFindFlags, dwReplaceFlags; // PATSEARCH_XXX flags + DWORD dwFindFlags, dwReplaceFlags; // PATSEARCH_XXX flags (=> PatternEditorDialogs.h) CHANNELINDEX nFindMinChn, nFindMaxChn; // Find in these channels (if PATSEARCH_CHANNEL is set) signed char cInstrRelChange; // relative instrument change (quick'n'dirty fix, this should be implemented in a less cryptic way) - DWORD dwBeginSel, dwEndSel; // Find in this selection (if PATSEARCH_PATSEL is set) + DWORD dwBeginSel, dwEndSel; // Find in this selection (if PATSEARCH_PATSELECTION is set) }; @@ -94,7 +106,8 @@ bool m_bDragging, m_bInItemRect, m_bContinueSearch, m_bWholePatternFitsOnScreen; RECT m_rcDragItem; DWORD m_dwStatus, m_dwCursor; - DWORD m_dwBeginSel, m_dwEndSel, m_dwStartSel, m_dwDragPos; + DWORD m_dwBeginSel, m_dwEndSel; // Upper-left / Lower-right corners of selection + DWORD m_dwStartSel, m_dwDragPos; // Point where selection was started WORD ChnVUMeters[MAX_BASECHANNELS]; WORD OldVUMeters[MAX_BASECHANNELS]; CListBox *ChnEffectList[MAX_BASECHANNELS]; //rewbs.patPlugName Modified: trunk/OpenMPT/mptrack/Vstplug.h =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.h 2011-03-19 13:56:03 UTC (rev 817) +++ trunk/OpenMPT/mptrack/Vstplug.h 2011-03-19 14:00:23 UTC (rev 818) @@ -205,7 +205,7 @@ UINT GetNumCommands() {return 0;} VOID GetPluginType(LPSTR) {} PlugParamIndex GetNumPrograms() {return 0;} - bool GetProgramNameIndexed(long, long, char*) {return 0;} + bool GetProgramNameIndexed(long, long, char*) {return false;} VOID SetParameter(PlugParamIndex nIndex, PlugParamValue fValue) {} VOID GetParamLabel(UINT, LPSTR) {} VOID GetParamDisplay(UINT, LPSTR) {} Modified: trunk/OpenMPT/mptrack/fxp.cpp =================================================================== --- trunk/OpenMPT/mptrack/fxp.cpp 2011-03-19 13:56:03 UTC (rev 817) +++ trunk/OpenMPT/mptrack/fxp.cpp 2011-03-19 14:00:23 UTC (rev 818) @@ -279,14 +279,14 @@ bool Cfxp::NeedSwap() //------------------- { - if (m_bNeedSwap<0) //don't yet know if we need to swap - find out! + if (m_bNeedSwap < 0) //don't yet know if we need to swap - find out! { static char szChnk[] = "CcnK"; static long lChnk = 'CcnK'; m_bNeedSwap = !!memcmp(szChnk, &lChnk, 4); } - return m_bNeedSwap; + return m_bNeedSwap ? true : false; } Modified: trunk/OpenMPT/mptrack/fxp.h =================================================================== --- trunk/OpenMPT/mptrack/fxp.h 2011-03-19 13:56:03 UTC (rev 817) +++ trunk/OpenMPT/mptrack/fxp.h 2011-03-19 14:00:23 UTC (rev 818) @@ -26,7 +26,7 @@ bool Save(CString fileName); protected: - BOOL m_bNeedSwap; + int m_bNeedSwap; bool Load(CString fileName); bool ReadLE(CFile &in, long &l); Modified: trunk/OpenMPT/soundlib/Load_mt2.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mt2.cpp 2011-03-19 13:56:03 UTC (rev 817) +++ trunk/OpenMPT/soundlib/Load_mt2.cpp 2011-03-19 14:00:23 UTC (rev 818) @@ -276,7 +276,7 @@ dwMemPos += 6; if (dwMemPos + wDataLen > dwMemLength) break; UINT nLines = pmp->wLines; - if ((iPat < MAX_PATTERNS) && (nLines > 0) && (nLines <= 256)) + if ((iPat < MAX_PATTERNS) && (nLines > 0) && (nLines <= MAX_PATTERN_ROWS)) { #ifdef MT2DEBUG Log("Pattern #%d @%04X: %d lines, %d bytes\n", iPat, dwMemPos-6, nLines, pmp->wDataLen); Modified: trunk/OpenMPT/soundlib/Snd_defs.h =================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h 2011-03-19 13:56:03 UTC (rev 817) +++ trunk/OpenMPT/soundlib/Snd_defs.h 2011-03-19 14:00:23 UTC (rev 818) @@ -76,12 +76,12 @@ #define MAX_ENVPOINTS 240 #define MIN_PERIOD 0x0020 #define MAX_PERIOD 0xFFFF -// String lengths +// String lengths (including trailing null char) #define MAX_SAMPLENAME 32 // also affects module name! #define MAX_SAMPLEFILENAME 22 #define MAX_PATTERNNAME 32 #define MAX_CHANNELNAME 20 -#define MAX_INFONAME 80 + #define MAX_EQ_BANDS 6 #define MAX_MIXPLUGINS 100 //50 // -> CODE#0006 -> DESC="misc quantity changes" -! BEHAVIOUR_CHANGE#0006 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-03-19 14:02:27
|
Revision: 819 http://modplug.svn.sourceforge.net/modplug/?rev=819&view=rev Author: saga-games Date: 2011-03-19 14:02:21 +0000 (Sat, 19 Mar 2011) Log Message: ----------- [Imp] IT Loader: Autovibrato sweep is now fixed when loading IT files made with old versions of (Open)MPT. [Imp] IT Loader: Since long patterns can also be created in other trackers (e.g. Chibi), long patterns are not used to identify files made with MPT anymore. [Mod] OpenMPT: Version is now 1.19.00.29 Modified Paths: -------------- trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Load_it.cpp Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-03-19 14:00:23 UTC (rev 818) +++ trunk/OpenMPT/mptrack/version.h 2011-03-19 14:02:21 UTC (rev 819) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 19 #define VER_MINOR 00 -#define VER_MINORMINOR 28 +#define VER_MINORMINOR 29 //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/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2011-03-19 14:00:23 UTC (rev 818) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2011-03-19 14:02:21 UTC (rev 819) @@ -853,7 +853,7 @@ if(rows <= ModSpecs::itEx.patternRowsMax && rows > ModSpecs::it.patternRowsMax) { - interpretModPlugMade = true; + //interpretModPlugMade = true; // Chibi also does this. hasModPlugExtensions = true; } @@ -970,6 +970,10 @@ pSmp->nVibRate = pis->vis; pSmp->nVibDepth = pis->vid & 0x7F; pSmp->nVibSweep = pis->vir; //(pis->vir + 3) / 4; + if(pSmp->nVibSweep == 0 && (pSmp->nVibDepth || pSmp->nVibRate) && m_dwLastSavedWithVersion && m_dwLastSavedWithVersion < MAKE_VERSION_NUMERIC(1, 17, 03, 02)) + { + pSmp->nVibSweep = 255; // Let's correct this little stupid mistake in history. + } if(pis->samplepointer) lastSampleOffset = pis->samplepointer; // MPTX hack This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-03-19 14:03:42
|
Revision: 820 http://modplug.svn.sourceforge.net/modplug/?rev=820&view=rev Author: saga-games Date: 2011-03-19 14:03:32 +0000 (Sat, 19 Mar 2011) Log Message: ----------- [Mod] Updated DE_jojo.mkb to include new Select beat / measure shortcuts. [Mod] Updated History.txt [Mod] Installer also backups Keybindings.mkb now. Modified Paths: -------------- trunk/OpenMPT/installer/install.iss trunk/OpenMPT/packageTemplate/History.txt trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb Modified: trunk/OpenMPT/installer/install.iss =================================================================== --- trunk/OpenMPT/installer/install.iss 2011-03-19 14:02:21 UTC (rev 819) +++ trunk/OpenMPT/installer/install.iss 2011-03-19 14:03:32 UTC (rev 820) @@ -81,6 +81,7 @@ Source: ..\packageTemplate\extraKeymaps\*.*; DestDir: {app}\extraKeymaps; Flags: ignoreversion sortfilesbyextension ; kind of auto-backup - handy! +Source: {userappdata}\OpenMPT\Keybindings.mkb; DestDir: {userappdata}\OpenMPT; DestName: Keybindings.mkb.old; Flags: external skipifsourcedoesntexist; Tasks: not portable Source: {userappdata}\OpenMPT\mptrack.ini; DestDir: {userappdata}\OpenMPT; DestName: mptrack.ini.old; Flags: external skipifsourcedoesntexist; Tasks: not portable Source: {userappdata}\OpenMPT\plugin.cache; DestDir: {userappdata}\OpenMPT; DestName: plugin.cache.old; Flags: external skipifsourcedoesntexist; Tasks: not portable @@ -246,31 +247,15 @@ begin if(GetIniInt('Paths', 'UseAppDataDirectory', 1, 0, 0, ExpandConstant('{app}\mptrack.ini')) = 1) then begin - filepath := ExpandConstant('{userappdata}\OpenMPT\mptrack.ini'); - if FileExists(filepath) then DeleteFile(filepath); - - filepath := ExpandConstant('{userappdata}\OpenMPT\Keybindings.mkb'); - if FileExists(filepath) then DeleteFile(filepath); - - filepath := ExpandConstant('{userappdata}\OpenMPT\plugin.cache'); - if FileExists(filepath) then DeleteFile(filepath); - - filepath := ExpandConstant('{userappdata}\OpenMPT\tunings\local_tunings.tc'); - if FileExists(filepath) then DeleteFile(filepath); + filepath := ExpandConstant('{userappdata}\OpenMPT\'); end else + filepath := ExpandConstant('{app}\'); begin - filepath := ExpandConstant('{app}\mptrack.ini'); - if FileExists(filepath) then DeleteFile(filepath); - - filepath := ExpandConstant('{app}\Keybindings.mkb'); - if FileExists(filepath) then DeleteFile(filepath); - - filepath := ExpandConstant('{app}\plugin.cache'); - if FileExists(filepath) then DeleteFile(filepath); - - filepath := ExpandConstant('{app}\tunings\local_tunings.tc'); - if FileExists(filepath) then DeleteFile(filepath); end; + DeleteFile(filepath + 'mptrack.ini'); + DeleteFile(filepath + 'Keybindings.mkb'); + DeleteFile(filepath + 'plugin.cache'); + DeleteFile(filepath + 'tunings\local_tunings.tc'); end; end; end; Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2011-03-19 14:02:21 UTC (rev 819) +++ trunk/OpenMPT/packageTemplate/History.txt 2011-03-19 14:03:32 UTC (rev 820) @@ -10,10 +10,11 @@ (tx XYZ): thanks to XYZ for telling us about the bug -v1.19.01.00 (February 2011, revision 813) ------------------------------------------ +v1.19.01.00 (March 2011, revision 820) +-------------------------------------- Pattern tab [New] <Jojo> Clicking and dragging the row numbers selects the whole row now (Excel / Calc style) - see http://bugs.openmpt.org/view.php?id=45 + [New] <Jojo> The new keyboard shortcuts "Select beat" and "Select measure" can be used to automatically extend the current selection to the beat / measure boundaries. [New] <Jojo> Experimental feature: Play the whole pattern row when entering notes and chords into the pattern editor. This can be enabled from the setup screen. [Imp] <Jojo> Special paste modes have been moved to a sub menu in the context menu, to save some space. [Mod] <Jojo> Using the Goto Dialog should now update channel parameters and set the elapsed time. (http://bugs.openmpt.org/view.php?id=28) @@ -68,6 +69,7 @@ [Fix] <Jojo> Speaker arrangement is now sent to the plugins upon initialization. This fixes Voxengo SPAN 2 (a VST 2.4 plugin). Does this break other multichannel plugins? [Fix] <Jojo> The time signature sent to VST plugins should be correct now. The denominator is always assumed to be 4, so a 6/8 signature is for example not possible. [Fix] <Jojo> The EnergyXT GUI does now also work after closing and re-opening the VST editor. (tx Nahkranoth, http://forum.openmpt.org/index.php?topic=2307.0) + [Fix] <Jojo> Fixed garbage characters shown in preset fields of plugins that don't return program names. Mod Conversion [Imp] <Jojo> If the new format doesn't support restart positions, it is now tried to convert the restart position to a pattern command. @@ -87,7 +89,8 @@ IT [New] <Jojo> Edit history information can now be read from and saved to IT / MPTM files. This is based on an undocumented feature in Impulse Tracker. Use View -> Edit History for viewing or deleting this information. - [Imp] <Jojo> IT files made with Modplug Tracker 1.00a5 are now also detected as such. + [Imp] <Jojo> IT files made with Modplug Tracker 1.00a5 are now also detected as such. Since long patterns can also be created in other trackers (e.g. Chibi), long patterns are not used to identify files made with MPT anymore. + [Imp] <Jojo> IT Loader: Autovibrato sweep is now fixed when loading IT files made with old versions of (Open)MPT. [Mod] <Jojo> Sane values are used again for the "cwtv" and "cmwt" header fields when saving IT files; in fact the same values as in compatibility export are used. To be able to distinguish between raped and compatibility-exported IT files, "OMPT" is written in the "reserved" header field. As a consequence, IT files made with OpenMPT can now be loaded in Impulse Tracker again. [Mod] <Jojo> IT Loader: MIDI macros are now cleared when loading IT files made with old Impulse Tracker versions (< 2.14), so that Zxx commands won't break the songs anymore (fixes denonde.it, fix from Schism Tracker). [Fix] <Jojo> In compatible mode, bidi loops are now treated like in IT's software mixer. (http://bugs.openmpt.org/view.php?id=29) @@ -156,6 +159,7 @@ [Fix] <Jojo> The ID3v2 "comments" field was not formatted properly when exporting to MP3. [Fix] <Jojo> unmo3.dll and uxtheme.dll (for theming the general tab) are now loaded "safely", to avoid the currently spreading DLL exploits. [Fix] <Jojo> Editing a sample / instrument name on the comments tab didn't mark the module as modified (tx djmakas) + [Fix] <Jojo> When changing the font size of the song message while the comments tab is open, the message editor is now resized instantly. Previously, only the font size was updated. [Reg] <Jojo> "Set highlights to songs' time signatures" is gone. Custom song highlighting is now always applied, and the values found in the colour options are now always applied to new modules. Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2011-03-19 14:02:21 UTC (rev 819) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2011-03-19 14:03:32 UTC (rev 820) @@ -77,6 +77,8 @@ 2:1050:1:16:1 //Selection key: Shift+UMSCHALT (KeyDown) 2:1051:2:17:1 //Copy select key: Ctrl+STRG (KeyDown) 2:1011:2:76:1 //Select channel / Select all: Ctrl+L (KeyDown) +2:1858:2:66:1 //Select beat: Ctrl+B (KeyDown) +2:1859:3:66:1 //Select measure: Shift+Ctrl+B (KeyDown) 2:1663:0:19:1 //Toggle follow song: (KeyDown) 2:1003:0:13:1 //Quick copy: EINGABE (KeyDown) 2:1004:0:32:5 //Quick paste: LEER (KeyDown|KeyHold) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-03-19 22:02:47
|
Revision: 822 http://modplug.svn.sourceforge.net/modplug/?rev=822&view=rev Author: saga-games Date: 2011-03-19 22:02:38 +0000 (Sat, 19 Mar 2011) Log Message: ----------- [Fix] FreePattern() was not deallocating pattern data properly (delete vs. delete[]). [Ref] Moved AllocatePattern() / FreePattern() to CPattern, as I think it makes more sense. Modified Paths: -------------- trunk/OpenMPT/mptrack/CleanupSong.cpp trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/Undo.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/soundlib/LOAD_AMF.CPP trunk/OpenMPT/soundlib/Load_itp.cpp trunk/OpenMPT/soundlib/Load_mdl.cpp trunk/OpenMPT/soundlib/Load_mid.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/pattern.cpp trunk/OpenMPT/soundlib/pattern.h trunk/OpenMPT/soundlib/patternContainer.cpp trunk/OpenMPT/soundlib/patternContainer.h Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp =================================================================== --- trunk/OpenMPT/mptrack/CleanupSong.cpp 2011-03-19 16:37:10 UTC (rev 821) +++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2011-03-19 22:02:38 UTC (rev 822) @@ -392,6 +392,7 @@ } // Remove all completely empty patterns above last used pattern (those are safe to remove) + BEGIN_CRITICAL(); for (PATTERNINDEX nPat = maxpat; nPat < maxPatIndex; nPat++) if ((pSndFile->Patterns[nPat]) && (nPat >= nMinToRemove)) { if(pSndFile->Patterns.IsPatternEmpty(nPat)) @@ -400,6 +401,7 @@ nPatRemoved++; } } + END_CRITICAL(); // Number of unused patterns size_t nWaste = 0; Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2011-03-19 16:37:10 UTC (rev 821) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2011-03-19 22:02:38 UTC (rev 822) @@ -74,7 +74,7 @@ for (UINT i=0; i<m_SndFile.Patterns.Size(); i++) if (m_SndFile.Patterns[i]) { MODCOMMAND *p = m_SndFile.Patterns[i]; - MODCOMMAND *newp = CSoundFile::AllocatePattern(m_SndFile.Patterns[i].GetNumRows(), nNewChannels); + MODCOMMAND *newp = CPattern::AllocatePattern(m_SndFile.Patterns[i].GetNumRows(), nNewChannels); if (!newp) { END_CRITICAL(); @@ -86,7 +86,7 @@ memcpy(&newp[j*nNewChannels], &p[j*m_SndFile.m_nChannels], m_SndFile.m_nChannels*sizeof(MODCOMMAND)); } m_SndFile.Patterns[i] = newp; - CSoundFile::FreePattern(p); + CPattern::FreePattern(p); } //if channel was removed before and is added again, mute status has to be unset! (bug 1814) @@ -134,7 +134,7 @@ for (i=0; i<m_SndFile.Patterns.Size(); i++) if (m_SndFile.Patterns[i]) { MODCOMMAND *p = m_SndFile.Patterns[i]; - MODCOMMAND *newp = CSoundFile::AllocatePattern(m_SndFile.Patterns[i].GetNumRows(), nRemainingChannels); + MODCOMMAND *newp = CPattern::AllocatePattern(m_SndFile.Patterns[i].GetNumRows(), nRemainingChannels); if (!newp) { END_CRITICAL(); @@ -150,7 +150,7 @@ } } m_SndFile.Patterns[i] = newp; - CSoundFile::FreePattern(p); + CPattern::FreePattern(p); } UINT tmpchn = 0; for (i=0; i<m_SndFile.m_nChannels; i++) @@ -517,10 +517,8 @@ if ((nPat < m_SndFile.Patterns.Size()) && (m_SndFile.Patterns[nPat])) { BEGIN_CRITICAL(); - LPVOID p = m_SndFile.Patterns[nPat]; - m_SndFile.Patterns[nPat] = nullptr; m_SndFile.SetPatternName(nPat, ""); - CSoundFile::FreePattern(p); + m_SndFile.Patterns.Remove(nPat); END_CRITICAL(); SetModified(); return true; Modified: trunk/OpenMPT/mptrack/Undo.cpp =================================================================== --- trunk/OpenMPT/mptrack/Undo.cpp 2011-03-19 16:37:10 UTC (rev 821) +++ trunk/OpenMPT/mptrack/Undo.cpp 2011-03-19 22:02:38 UTC (rev 822) @@ -133,7 +133,7 @@ { if((!pSndFile->Patterns[nPattern]) || (pSndFile->Patterns[nPattern].GetNumRows() < nRows)) { - MODCOMMAND *newPattern = CSoundFile::AllocatePattern(nRows, pSndFile->m_nChannels); + MODCOMMAND *newPattern = CPattern::AllocatePattern(nRows, pSndFile->m_nChannels); MODCOMMAND *oldPattern = pSndFile->Patterns[nPattern]; if (!newPattern) return PATTERNINDEX_INVALID; const ROWINDEX nOldRowCount = pSndFile->Patterns[nPattern].GetNumRows(); @@ -141,7 +141,7 @@ if(oldPattern) { memcpy(newPattern, oldPattern, pSndFile->m_nChannels * nOldRowCount * sizeof(MODCOMMAND)); - CSoundFile::FreePattern(oldPattern); + CPattern::FreePattern(oldPattern); } } linkToPrevious = pUndo->linkToPrevious; Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2011-03-19 16:37:10 UTC (rev 821) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-03-19 22:02:38 UTC (rev 822) @@ -2483,7 +2483,7 @@ dy = (int)(m_dwDragPos >> 16) - (int)(m_dwStartSel >> 16); if ((!dx) && (!dy)) return; pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, 0,0, nChannels, nRows); - pNewPattern = CSoundFile::AllocatePattern(nRows, nChannels); + pNewPattern = CPattern::AllocatePattern(nRows, nChannels); if (!pNewPattern) return; x1 = (m_dwBeginSel & 0xFFF8) >> 3; y1 = (m_dwBeginSel) >> 16; @@ -2559,7 +2559,7 @@ SetCursorPosition( y1, (x1<<3)|c1 ); SetCurSel((y1<<16)|(x1<<3)|c1, (y2<<16)|(x2<<3)|c2); InvalidatePattern(); - CSoundFile::FreePattern(pOldPattern); + CPattern::FreePattern(pOldPattern); pModDoc->SetModified(); EndWaitCursor(); } Modified: trunk/OpenMPT/soundlib/LOAD_AMF.CPP =================================================================== --- trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2011-03-19 16:37:10 UTC (rev 821) +++ trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2011-03-19 22:02:38 UTC (rev 822) @@ -312,13 +312,13 @@ } // Setup sequence list Order.resize(pfh->numorders, Order.GetInvalidPatIndex()); + vector<ROWINDEX> patternLength(pfh->numorders, 64); for (UINT iOrd=0; iOrd < pfh->numorders; iOrd++) { Order[iOrd] = iOrd; - Patterns[iOrd].Resize(64, false); if (pfh->version >= 14) { - Patterns[iOrd].Resize(LittleEndianW(*(USHORT *)(lpStream+dwMemPos))); + patternLength[iOrd] = LittleEndianW(*(uint16 *)(lpStream+dwMemPos)); dwMemPos += 2; } ptracks[iOrd] = (USHORT *)(lpStream+dwMemPos); @@ -386,9 +386,10 @@ // Create the patterns from the list of tracks for (UINT iPat=0; iPat<pfh->numorders; iPat++) { - MODCOMMAND *p = AllocatePattern(Patterns[iPat].GetNumRows(), m_nChannels); - if (!p) break; - Patterns[iPat] = p; + if(Patterns.Insert(iPat, patternLength[iPat])) + { + break; + } for (UINT iChn=0; iChn<m_nChannels; iChn++) { UINT nTrack = LittleEndianW(ptracks[iPat][iChn]); @@ -400,7 +401,7 @@ realtrk--; if ((realtrk < realtrackcnt) && (pTrackData[realtrk])) { - AMF_Unpack(p+iChn, pTrackData[realtrk], Patterns[iPat].GetNumRows(), m_nChannels); + AMF_Unpack(Patterns[iPat].GetpModCommand(0, iChn), pTrackData[realtrk], Patterns[iPat].GetNumRows(), m_nChannels); } } } Modified: trunk/OpenMPT/soundlib/Load_itp.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_itp.cpp 2011-03-19 16:37:10 UTC (rev 821) +++ trunk/OpenMPT/soundlib/Load_itp.cpp 2011-03-19 22:02:38 UTC (rev 822) @@ -256,21 +256,20 @@ for(PATTERNINDEX npat=0; npat<size; npat++) { - // Free pattern if not empty - if(Patterns[npat]) { FreePattern(Patterns[npat]); Patterns[npat] = NULL; } - // Patterns[npat].GetNumRows() ASSERT_CAN_READ(4); memcpy(&id,lpStream+dwMemPos,sizeof(DWORD)); if(id > MAX_PATTERN_ROWS) return false; - Patterns[npat].Resize(id, false); + const ROWINDEX nRows = id; dwMemPos += sizeof(DWORD); // Try to allocate & read only sized patterns - if(Patterns[npat].GetNumRows()){ + if(nRows) + { // Allocate pattern - if(Patterns.Insert(npat, Patterns[npat].GetNumRows())){ + if(Patterns.Insert(npat, nRows)) + { dwMemPos += m_nChannels * Patterns[npat].GetNumRows() * n; continue; } Modified: trunk/OpenMPT/soundlib/Load_mdl.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mdl.cpp 2011-03-19 16:37:10 UTC (rev 821) +++ trunk/OpenMPT/soundlib/Load_mdl.cpp 2011-03-19 22:02:38 UTC (rev 822) @@ -241,6 +241,7 @@ BYTE inspanenv[MAX_INSTRUMENTS]; LPCBYTE pvolenv, ppanenv, ppitchenv; UINT nvolenv, npanenv, npitchenv; + vector<ROWINDEX> patternLength; if ((!lpStream) || (dwMemLength < 1024)) return false; if ((pmsh->id != 0x4C444D44) || ((pmsh->version & 0xF0) > 0x10)) return false; @@ -313,6 +314,9 @@ npatterns = lpStream[dwMemPos]; if (npatterns > MAX_PATTERNS) npatterns = MAX_PATTERNS; dwPos = dwMemPos + 1; + + patternLength.assign(npatterns, 64); + for (i=0; i<npatterns; i++) { const WORD *pdata; @@ -323,7 +327,7 @@ { const MDLPATTERNDATA *pmpd = (const MDLPATTERNDATA *)(lpStream + dwPos); if (pmpd->channels > 32) break; - Patterns[i].Resize(pmpd->lastrow+1); + patternLength[i] = pmpd->lastrow + 1; if (m_nChannels < pmpd->channels) m_nChannels = pmpd->channels; dwPos += 18 + 2*pmpd->channels; pdata = pmpd->data; @@ -331,7 +335,7 @@ } else { pdata = (const WORD *)(lpStream + dwPos); - Patterns[i].Resize(64, false); + //Patterns[i].Resize(64, false); if (m_nChannels < 32) m_nChannels = 32; dwPos += 2*32; ch = 32; @@ -527,7 +531,10 @@ { for (UINT ipat=0; ipat<npatterns; ipat++) { - if ((Patterns[ipat] = AllocatePattern(Patterns[ipat].GetNumRows(), m_nChannels)) == NULL) break; + if(Patterns.Insert(ipat, patternLength[ipat])) + { + break; + } for (UINT chn=0; chn<m_nChannels; chn++) if ((patterntracks[ipat*32+chn]) && (patterntracks[ipat*32+chn] <= ntracks)) { MODCOMMAND *m = Patterns[ipat] + chn; Modified: trunk/OpenMPT/soundlib/Load_mid.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mid.cpp 2011-03-19 16:37:10 UTC (rev 821) +++ trunk/OpenMPT/soundlib/Load_mid.cpp 2011-03-19 22:02:38 UTC (rev 822) @@ -571,7 +571,6 @@ memset(midichstate, 0, sizeof(midichstate)); // Initializing Patterns Order[0] = 0; - for (UINT ipat=0; ipat<Patterns.Size(); ipat++) Patterns[ipat].Resize(gnMidiPatternLen, false); // Initializing Channels for (UINT ics=0; ics<MAX_BASECHANNELS; ics++) { @@ -628,10 +627,9 @@ do { // Allocate current pattern if not allocated yet - if (!Patterns[pat]) + if (!Patterns[pat] && Patterns.Insert(pat, gnMidiPatternLen)) { - Patterns[pat] = AllocatePattern(Patterns[pat].GetNumRows(), m_nChannels); - if (!Patterns[pat]) break; + break; } dwGlobalFlags |= MIDIGLOBAL_SONGENDED; MODCOMMAND *m = Patterns[pat] + row * m_nChannels; Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-03-19 16:37:10 UTC (rev 821) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-03-19 22:02:38 UTC (rev 822) @@ -517,9 +517,9 @@ BOOL CSoundFile::Create(LPCBYTE lpStream, CModDoc *pModDoc, DWORD dwMemLength) -//--------------------------------------------------------------------------- +//---------------------------------------------------------------------------- { - m_pModDoc=pModDoc; + m_pModDoc = pModDoc; m_nType = MOD_TYPE_NONE; m_dwSongFlags = 0; m_nChannels = 0; @@ -564,7 +564,6 @@ memset(&m_SongEQ, 0, sizeof(m_SongEQ)); ResetMidiCfg(); - //for (UINT npt=0; npt<Patterns.Size(); npt++) Patterns[npt].GetNumRows() = 64; for (CHANNELINDEX nChn = 0; nChn < MAX_BASECHANNELS; nChn++) { InitChannel(nChn); @@ -731,8 +730,8 @@ pSmp->nSustainStart = 0; pSmp->nSustainEnd = 0; } - if (!pSmp->nLoopEnd) pSmp->uFlags &= ~CHN_LOOP; - if (!pSmp->nSustainEnd) pSmp->uFlags &= ~CHN_SUSTAINLOOP; + if (!pSmp->nLoopEnd) pSmp->uFlags &= ~(CHN_LOOP|CHN_PINGPONGLOOP); + if (!pSmp->nSustainEnd) pSmp->uFlags &= ~(CHN_SUSTAINLOOP|CHN_PINGPONGSUSTAIN); if (pSmp->nGlobalVol > 64) pSmp->nGlobalVol = 64; } // Check invalid instruments @@ -827,7 +826,7 @@ for(std::list<PLUGINDEX>::iterator i = notFoundIDs.begin(); i != notFoundIDs.end(); ++i) { CString sUrl; - sUrl.Format("http://www.kvraudio.com/search.php?q=%s&lq=db", m_MixPlugins[*i].Info.szLibraryName); + sUrl.Format("http://www.kvraudio.com/search.php?lq=inurl%3Aget&q=%s", m_MixPlugins[*i].Info.szLibraryName); CTrackApp::OpenURL(sUrl); } } @@ -853,11 +852,7 @@ //------------------------ { size_t i; - for (i=0; i<Patterns.Size(); i++) if (Patterns[i]) - { - FreePattern(Patterns[i]); - Patterns[i] = NULL; - } + Patterns.DestroyPatterns(); m_nPatternNames = 0; delete[] m_lpszPatternNames; @@ -903,23 +898,6 @@ ////////////////////////////////////////////////////////////////////////// // Memory Allocation -MODCOMMAND *CSoundFile::AllocatePattern(UINT rows, UINT nchns) -//------------------------------------------------------------ -{ - MODCOMMAND *p = new MODCOMMAND[rows*nchns]; - if (p) memset(p, 0, rows*nchns*sizeof(MODCOMMAND)); - return p; -} - - -void CSoundFile::FreePattern(LPVOID pat) -//-------------------------------------- -{ - - if (pat) delete pat; -} - - LPSTR CSoundFile::AllocateSample(UINT nbytes) //------------------------------------------- { @@ -1551,7 +1529,7 @@ if (Patterns[nPat]) { MODCOMMAND *p = Patterns[nPat]; - MODCOMMAND *newp = CSoundFile::AllocatePattern(Patterns[nPat].GetNumRows(), nRemainingChannels); + MODCOMMAND *newp = CPattern::AllocatePattern(Patterns[nPat].GetNumRows(), nRemainingChannels); if (!newp) { END_CRITICAL(); @@ -1571,7 +1549,7 @@ } } Patterns[nPat] = newp; - CSoundFile::FreePattern(p); + CPattern::FreePattern(p); } } Modified: trunk/OpenMPT/soundlib/pattern.cpp =================================================================== --- trunk/OpenMPT/soundlib/pattern.cpp 2011-03-19 16:37:10 UTC (rev 821) +++ trunk/OpenMPT/soundlib/pattern.cpp 2011-03-19 22:02:38 UTC (rev 822) @@ -55,11 +55,11 @@ BEGIN_CRITICAL(); if (newRowCount > m_Rows) { - MODCOMMAND *p = CSoundFile::AllocatePattern(newRowCount, sndFile.m_nChannels); + MODCOMMAND *p = AllocatePattern(newRowCount, sndFile.m_nChannels); if (p) { memcpy(p, m_ModCommands, sndFile.m_nChannels*m_Rows*sizeof(MODCOMMAND)); - CSoundFile::FreePattern(m_ModCommands); + FreePattern(m_ModCommands); m_ModCommands = p; m_Rows = newRowCount; } @@ -93,11 +93,11 @@ #endif // MODPLUG_TRACKER if (bOk) { - MODCOMMAND *pnew = CSoundFile::AllocatePattern(newRowCount, sndFile.m_nChannels); + MODCOMMAND *pnew = AllocatePattern(newRowCount, sndFile.m_nChannels); if (pnew) { memcpy(pnew, m_ModCommands, sndFile.m_nChannels*newRowCount*sizeof(MODCOMMAND)); - CSoundFile::FreePattern(m_ModCommands); + FreePattern(m_ModCommands); m_ModCommands = pnew; m_Rows = newRowCount; } @@ -121,11 +121,12 @@ void CPattern::Deallocate() //------------------------- { - BEGIN_CRITICAL(); + // Removed critical section as it can cause problems when destroying patterns in the CSoundFile constructor. + //BEGIN_CRITICAL(); m_Rows = m_RowsPerBeat = m_RowsPerMeasure = 0; - CSoundFile::FreePattern(m_ModCommands); + FreePattern(m_ModCommands); m_ModCommands = nullptr; - END_CRITICAL(); + //END_CRITICAL(); } bool CPattern::Expand() @@ -143,7 +144,7 @@ rModDoc.BeginWaitCursor(); const ROWINDEX nRows = m_Rows; const CHANNELINDEX nChns = sndFile.m_nChannels; - newPattern = CSoundFile::AllocatePattern(nRows * 2, nChns); + newPattern = AllocatePattern(nRows * 2, nChns); if (!newPattern) return true; const PATTERNINDEX nPattern = m_rPatternContainer.GetIndex(this); @@ -155,7 +156,7 @@ } m_ModCommands = newPattern; m_Rows = nRows * 2; - CSoundFile::FreePattern(oldPattern); oldPattern = nullptr; + FreePattern(oldPattern); oldPattern = nullptr; rModDoc.SetModified(); rModDoc.UpdateAllViews(NULL, HINT_PATTERNDATA | (nPattern << HINT_SHIFT_PAT), NULL); rModDoc.EndWaitCursor(); @@ -210,7 +211,22 @@ } +MODCOMMAND *CPattern::AllocatePattern(ROWINDEX rows, CHANNELINDEX nchns) +//---------------------------------------------------------------------- +{ + MODCOMMAND *p = new MODCOMMAND[rows*nchns]; + if (p) memset(p, 0, rows*nchns*sizeof(MODCOMMAND)); + return p; +} + +void CPattern::FreePattern(MODCOMMAND *pat) +//----------------------------------------- +{ + if (pat) delete[] pat; +} + + bool CPattern::WriteITPdata(FILE* f) const //---------------------------------------- { Modified: trunk/OpenMPT/soundlib/pattern.h =================================================================== --- trunk/OpenMPT/soundlib/pattern.h 2011-03-19 16:37:10 UTC (rev 821) +++ trunk/OpenMPT/soundlib/pattern.h 2011-03-19 22:02:38 UTC (rev 822) @@ -86,6 +86,10 @@ //4. Length of the stream. //Returns true on error. + // Static allocation / deallocation helpers + static MODCOMMAND* AllocatePattern(ROWINDEX rows, CHANNELINDEX nchns); + static void FreePattern(MODCOMMAND *pat); + //END: INTERFACE METHODS typedef MODCOMMAND* iterator; Modified: trunk/OpenMPT/soundlib/patternContainer.cpp =================================================================== --- trunk/OpenMPT/soundlib/patternContainer.cpp 2011-03-19 16:37:10 UTC (rev 821) +++ trunk/OpenMPT/soundlib/patternContainer.cpp 2011-03-19 22:02:38 UTC (rev 822) @@ -5,11 +5,30 @@ #include "../mptrack/serialization_utils.h" #include "../mptrack/version.h" + +void CPatternContainer::ClearPatterns() +//------------------------------------- +{ + DestroyPatterns(); + m_Patterns.assign(m_Patterns.size(), MODPATTERN(*this)); +} + + +void CPatternContainer::DestroyPatterns() +//--------------------------------------- +{ + for(PATTERNINDEX i = 0; i < m_Patterns.size(); i++) + { + Remove(i); + } +} + + PATTERNINDEX CPatternContainer::Insert(const ROWINDEX rows) //--------------------------------------------------------- { PATTERNINDEX i = 0; - for(i = 0; i<m_Patterns.size(); i++) + for(i = 0; i < m_Patterns.size(); i++) if(!m_Patterns[i]) break; if(Insert(i, rows)) return PATTERNINDEX_INVALID; @@ -38,7 +57,11 @@ } } - m_Patterns[index] = CSoundFile::AllocatePattern(rows, m_rSndFile.m_nChannels); + if(m_Patterns[index].m_ModCommands != nullptr) + { + CPattern::FreePattern(m_Patterns[index].m_ModCommands); + } + m_Patterns[index].m_ModCommands = CPattern::AllocatePattern(rows, m_rSndFile.m_nChannels); m_Patterns[index].m_Rows = rows; m_Patterns[index].RemoveSignature(); Modified: trunk/OpenMPT/soundlib/patternContainer.h =================================================================== --- trunk/OpenMPT/soundlib/patternContainer.h 2011-03-19 16:37:10 UTC (rev 821) +++ trunk/OpenMPT/soundlib/patternContainer.h 2011-03-19 22:02:38 UTC (rev 822) @@ -31,8 +31,10 @@ // Clears existing patterns and resizes array to default size. void Init(); - //Note: No memory handling here. - void ClearPatterns() {m_Patterns.assign(m_Patterns.size(), MODPATTERN(*this));} + // Empty and initialize all patterns. + void ClearPatterns(); + // Delete all patterns. + void DestroyPatterns(); //Insert (default)pattern to given position. If pattern already exists at that position, //ignoring request. Returns true on failure, false otherwise. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-03-22 22:13:02
|
Revision: 824 http://modplug.svn.sourceforge.net/modplug/?rev=824&view=rev Author: saga-games Date: 2011-03-22 22:12:56 +0000 (Tue, 22 Mar 2011) Log Message: ----------- [Imp] Macro Editor: User is now warned if the current macro configuration differs from the default configuration but embedding macro configuration is disabled. [Mod] Updated DE_jojo.mkb (Play song from cursor, load sample) Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/mptrack/Moddoc.h trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-03-20 12:58:53 UTC (rev 823) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-03-22 22:12:56 UTC (rev 824) @@ -1117,6 +1117,26 @@ { if (m_pSndFile->m_dwSongFlags & SONG_EMBEDMIDICFG) m_pModDoc->SetModified(); m_pSndFile->m_dwSongFlags &= ~SONG_EMBEDMIDICFG; + + // If this macro is not the default IT macro, display a warning. + bool isDefault = (CModDoc::GetMacroType(&(dlg.m_MidiCfg.szMidiSFXExt[0])) == sfx_cutoff) + && (CModDoc::GetZxxType(dlg.m_MidiCfg.szMidiZXXExt) == 1); + for(size_t i = 1; i <= 15; i++) + { + if(CModDoc::GetMacroType(&(dlg.m_MidiCfg.szMidiSFXExt[i * 32])) != sfx_unused) + { + isDefault = false; + break; + } + } + if(!isDefault) + { + if(AfxMessageBox(_T("You have chosen not to embed MIDI macros. However, the current macro configuration differs from the default macro configuration that is assumed when loading a file that has no macros embedded. This can result in data loss and broken playback.\nWould you like to embed MIDI macros now?"), MB_YESNO) == IDYES) + { + m_pSndFile->m_dwSongFlags |= SONG_EMBEDMIDICFG; + m_pModDoc->SetModified(); + } + } } } } Modified: trunk/OpenMPT/mptrack/Moddoc.h =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.h 2011-03-20 12:58:53 UTC (rev 823) +++ trunk/OpenMPT/mptrack/Moddoc.h 2011-03-22 22:12:56 UTC (rev 824) @@ -235,7 +235,7 @@ LONG GetIndexFromVolCmd(UINT volcmd); UINT GetVolCmdFromIndex(UINT ndx); BOOL GetVolCmdInfo(UINT ndx, LPSTR s, DWORD *prangeMin=NULL, DWORD *prangeMax=NULL); - int GetMacroType(CString value); //rewbs.xinfo + static int GetMacroType(CString value); //rewbs.xinfo int MacroToPlugParam(CString value); //rewbs.xinfo int MacroToMidiCC(CString value); int FindMacroForParam(long param); Modified: trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb =================================================================== --- trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2011-03-20 12:58:53 UTC (rev 823) +++ trunk/OpenMPT/packageTemplate/extraKeymaps/DE_jojo.mkb 2011-03-22 22:12:56 UTC (rev 824) @@ -16,6 +16,7 @@ 0:1031:0:119:1 //Pause song: F8 (KeyDown) 0:1375:0:27:1 //Stop Song: ESC (KeyDown) 0:1029:0:117:1 //Play song from start: F6 (KeyDown) +0:1028:2:117:1 //Play song from cursor: Ctrl+F6 (KeyDown) 0:1027:0:118:5 //Play pattern from start: F7 (KeyDown|KeyHold) 0:1026:2:118:5 //Play pattern from cursor: Ctrl+F7 (KeyDown|KeyHold) 0:1376:0:120:1 //Toggle Midi Record: F9 (KeyDown) @@ -271,6 +272,7 @@ 7:1262:0:70:1 //FX Param digit F: F (KeyDown) //----( Sample Context [bottom] (8) )------------ +8:1673:0:13:1 //Load a Sample: EINGABE (KeyDown) 8:1380:2:84:1 //Trim sample around loop points: Ctrl+T (KeyDown) 8:1383:0:8:1 //Silence sample selection: R\xDCCK (KeyDown) 8:1384:1:78:1 //Normalise Sample: Shift+N (KeyDown) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-03-23 20:48:15
|
Revision: 825 http://modplug.svn.sourceforge.net/modplug/?rev=825&view=rev Author: saga-games Date: 2011-03-23 20:48:08 +0000 (Wed, 23 Mar 2011) Log Message: ----------- [Ref] MIDI Macro code cleanup. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moddoc.h trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-03-22 22:12:56 UTC (rev 824) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-03-23 20:48:08 UTC (rev 825) @@ -1119,18 +1119,8 @@ m_pSndFile->m_dwSongFlags &= ~SONG_EMBEDMIDICFG; // If this macro is not the default IT macro, display a warning. - bool isDefault = (CModDoc::GetMacroType(&(dlg.m_MidiCfg.szMidiSFXExt[0])) == sfx_cutoff) - && (CModDoc::GetZxxType(dlg.m_MidiCfg.szMidiZXXExt) == 1); - for(size_t i = 1; i <= 15; i++) + if(!m_pModDoc->IsMacroDefaultSetupUsed()) { - if(CModDoc::GetMacroType(&(dlg.m_MidiCfg.szMidiSFXExt[i * 32])) != sfx_unused) - { - isDefault = false; - break; - } - } - if(!isDefault) - { if(AfxMessageBox(_T("You have chosen not to embed MIDI macros. However, the current macro configuration differs from the default macro configuration that is assumed when loading a file that has no macros embedded. This can result in data loss and broken playback.\nWould you like to embed MIDI macros now?"), MB_YESNO) == IDYES) { m_pSndFile->m_dwSongFlags |= SONG_EMBEDMIDICFG; Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-03-22 22:12:56 UTC (rev 824) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-03-23 20:48:08 UTC (rev 825) @@ -3165,8 +3165,8 @@ } -int CModDoc::GetMacroType(CString value) -//-------------------------------------- +enmParameteredMacroType CModDoc::GetMacroType(CString value) +//---------------------------------------------------------- { if (value.Compare("")==0) return sfx_unused; if (value.Compare("F0F000z")==0) return sfx_cutoff; @@ -3185,24 +3185,23 @@ { int code=0; char* param = (char *) (LPCTSTR) macro; - param +=4; + param += 4; if ((param[0] >= '0') && (param[0] <= '9')) code = (param[0] - '0') << 4; else if ((param[0] >= 'A') && (param[0] <= 'F')) code = (param[0] - 'A' + 0x0A) << 4; if ((param[1] >= '0') && (param[1] <= '9')) code += (param[1] - '0'); else if ((param[1] >= 'A') && (param[1] <= 'F')) code += (param[1] - 'A' + 0x0A); - if (macro.GetLength()>=4 && macro.GetAt(3)=='0') { - return (code-128); - } else { - return (code+128); - } + if (macro.GetLength()>=4 && macro.GetAt(3)=='0') + return (code - 128); + else + return (code + 128); } int CModDoc::MacroToMidiCC(CString macro) //--------------------------------------- { int code=0; char* param = (char *) (LPCTSTR) macro; - param +=2; + param += 2; if ((param[0] >= '0') && (param[0] <= '9')) code = (param[0] - '0') << 4; else if ((param[0] >= 'A') && (param[0] <= 'F')) code = (param[0] - 'A' + 0x0A) << 4; if ((param[1] >= '0') && (param[1] <= '9')) code += (param[1] - '0'); else @@ -3211,12 +3210,19 @@ return code; } -int CModDoc::FindMacroForParam(long param) -//---------------------------------------- +int CModDoc::FindMacroForParam(long param) const +//---------------------------------------------- { - for (int macro=0; macro<16; macro++) { //what's the named_const for num macros?? :D - CString macroString = &(GetSoundFile()->m_MidiCfg.szMidiSFXExt[macro*32]); - if (GetMacroType(macroString) == sfx_plug && MacroToPlugParam(macroString) == param) { + const CSoundFile *pSndFile = GetSoundFile(); + if(pSndFile == nullptr) + { + return -1; + } + for (int macro = 0; macro < NUM_MACROS; macro++) + { + CString macroString = &(pSndFile->m_MidiCfg.szMidiSFXExt[macro * 32]); + if (GetMacroType(macroString) == sfx_plug && MacroToPlugParam(macroString) == param) + { return macro; } } @@ -3225,15 +3231,15 @@ } // Retrieve Zxx (Z80-ZFF) type from current macro configuration -int CModDoc::GetZxxType(const CHAR (&szMidiZXXExt)[128 * 32]) -//----------------------------------------------------------- +enmFixedMacroType CModDoc::GetZxxType(const CHAR (&szMidiZXXExt)[128 * 32]) +//------------------------------------------------------------------------- { // Compare with all possible preset patterns - for(int i = 1; i <= 5; i++) + for(int i = 1; i < sfx_fixed_max; i++) { // Prepare pattern to compare CHAR szPatterns[128 * 32]; - CreateZxxFromType(szPatterns, i); + CreateZxxFromType(szPatterns, static_cast<enmFixedMacroType>(i)); bool bFound = true; for(int j = 0; j < 128; j++) @@ -3244,41 +3250,41 @@ break; } } - if(bFound) return i; + if(bFound) return static_cast<enmFixedMacroType>(i); } - return 0; // Type 0 - Custom setup + return sfx_fixed_custom; // Custom setup } // Create Zxx (Z80 - ZFF) from one out of five presets -void CModDoc::CreateZxxFromType(CHAR (&szMidiZXXExt)[128 * 32], int iZxxType) -//--------------------------------------------------------------------------- +void CModDoc::CreateZxxFromType(CHAR (&szMidiZXXExt)[128 * 32], enmFixedMacroType iZxxType) +//----------------------------------------------------------------------------------------- { for(int i = 0; i < 128; i++) { switch(iZxxType) { - case 1: + case sfx_fixed_reso4Bit: // Type 1 - Z80 - Z8F controls resonance if (i < 16) wsprintf(&szMidiZXXExt[i * 32], "F0F001%02X", i * 8); else szMidiZXXExt[i * 32] = 0; break; - case 2: + case sfx_fixed_reso7Bit: // Type 2 - Z80 - ZFF controls resonance wsprintf(&szMidiZXXExt[i * 32], "F0F001%02X", i); break; - case 3: + case sfx_fixed_cutoff: // Type 3 - Z80 - ZFF controls cutoff wsprintf(&szMidiZXXExt[i * 32], "F0F000%02X", i); break; - case 4: + case sfx_fixed_mode: // Type 4 - Z80 - ZFF controls filter mode wsprintf(&szMidiZXXExt[i * 32], "F0F002%02X", i); break; - case 5: + case sfx_fixed_resomode: // Type 5 - Z80 - Z9F controls resonance + filter mode if (i < 16) wsprintf(&szMidiZXXExt[i * 32], "F0F001%02X", i * 8); else if (i < 32) wsprintf(&szMidiZXXExt[i * 32], "F0F002%02X", (i - 16) * 8); @@ -3289,6 +3295,38 @@ } +// Check if the MIDI Macro configuration used is the default one, +// i.e. the configuration that is assumed when loading a file that has no macros embedded. +bool CModDoc::IsMacroDefaultSetupUsed() const +//------------------------------------------- +{ + const CSoundFile *pSndFile = GetSoundFile(); + if(pSndFile == nullptr) + { + return false; + } + // SF0: Z00-Z7F controls cutoff + if(GetMacroType(&(pSndFile->m_MidiCfg.szMidiSFXExt[0])) != sfx_cutoff) + { + return false; + } + // Z80-Z8F controls resonance + if(GetZxxType(pSndFile->m_MidiCfg.szMidiZXXExt) != sfx_fixed_reso4Bit) + { + return false; + } + // All other parametered macros are unused + for(size_t i = 1; i < NUM_MACROS; i++) + { + if(GetMacroType(&(pSndFile->m_MidiCfg.szMidiSFXExt[i * 32])) != sfx_unused) + { + return false; + } + } + return true; +} + + //////////////////////////////////////////////////////////////////////////////////////// // Playback Modified: trunk/OpenMPT/mptrack/Moddoc.h =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.h 2011-03-22 22:12:56 UTC (rev 824) +++ trunk/OpenMPT/mptrack/Moddoc.h 2011-03-23 20:48:08 UTC (rev 825) @@ -90,20 +90,35 @@ STATIC_ASSERT( ((-1 << HINT_SHIFT_SEQUENCE) & HINT_MASK_ITEM) == (-1 << HINT_SHIFT_SEQUENCE) ); -//parametered macro presets: -enum +// parametered macro presets: +enum enmParameteredMacroType { - sfx_unused=0, + sfx_unused = 0, sfx_cutoff, sfx_reso, sfx_mode, sfx_drywet, sfx_plug, sfx_cc, - sfx_custom + sfx_custom, + + sfx_max }; +// fixed macro presets: +enum enmFixedMacroType +{ + sfx_fixed_custom = 0, + sfx_fixed_reso4Bit, // Type 1 - Z80 - Z8F controls resonance + sfx_fixed_reso7Bit, // Type 2 - Z80 - ZFF controls resonance + sfx_fixed_cutoff, // Type 3 - Z80 - ZFF controls cutoff + sfx_fixed_mode, // Type 4 - Z80 - ZFF controls filter mode + sfx_fixed_resomode, // Type 5 - Z80 - Z9F controls resonance + filter mode + sfx_fixed_max +}; + + // pattern paste modes enum enmPatternPasteModes { @@ -191,8 +206,10 @@ // public members public: + CSoundFile *GetSoundFile() { return &m_SndFile; } + const CSoundFile *GetSoundFile() const { return &m_SndFile; } + void InitPlayer(); - CSoundFile *GetSoundFile() { return &m_SndFile; } void SetPause(BOOL bPause) { m_bPaused = bPause; } void SetModified(BOOL bModified=TRUE) { SetModifiedFlag(bModified); bModifiedAutosave = (bModified != FALSE); } bool ModifiedSinceLastAutosave() { bool bRetval = bModifiedAutosave; bModifiedAutosave = false; return bRetval; } // return "IsModified" value and reset it until the next SetModified() (as this is only used for polling) @@ -235,12 +252,16 @@ LONG GetIndexFromVolCmd(UINT volcmd); UINT GetVolCmdFromIndex(UINT ndx); BOOL GetVolCmdInfo(UINT ndx, LPSTR s, DWORD *prangeMin=NULL, DWORD *prangeMax=NULL); - static int GetMacroType(CString value); //rewbs.xinfo - int MacroToPlugParam(CString value); //rewbs.xinfo - int MacroToMidiCC(CString value); - int FindMacroForParam(long param); - static int GetZxxType(const CHAR (&szMidiZXXExt)[128 * 32]); - static void CreateZxxFromType(CHAR (&szMidiZXXExt)[128 * 32], int iZxxType); + + // Various MIDI Macro helpers + static enmParameteredMacroType GetMacroType(CString value); //rewbs.xinfo + static int MacroToPlugParam(CString value); //rewbs.xinfo + static int MacroToMidiCC(CString value); + static enmFixedMacroType GetZxxType(const CHAR (&szMidiZXXExt)[128 * 32]); + static void CreateZxxFromType(CHAR (&szMidiZXXExt)[128 * 32], enmFixedMacroType iZxxType); + bool IsMacroDefaultSetupUsed() const; + int FindMacroForParam(long param) const; + void SongProperties(); CPatternUndo *GetPatternUndo() { return &m_PatternUndo; } Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2011-03-22 22:12:56 UTC (rev 824) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2011-03-23 20:48:08 UTC (rev 825) @@ -614,7 +614,7 @@ strcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_NOTEOFF*32], "9c n 0"); strcpy(&m_MidiCfg.szMidiGlb[MIDIOUT_PROGRAM*32], "Cc p"); strcpy(&m_MidiCfg.szMidiSFXExt[0], "F0F000z"); - CModDoc::CreateZxxFromType(m_MidiCfg.szMidiZXXExt, 1); + CModDoc::CreateZxxFromType(m_MidiCfg.szMidiZXXExt, sfx_fixed_reso4Bit); #ifdef UPDATECHECKENABLED m_pRequestContext = NULL; Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-03-22 22:12:56 UTC (rev 824) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-03-23 20:48:08 UTC (rev 825) @@ -946,9 +946,9 @@ void CMidiMacroSetup::OnZxxPresetChanged() //---------------------------------------- { - UINT zxx_preset = m_CbnZxxPreset.GetCurSel(); + enmFixedMacroType zxx_preset = static_cast<enmFixedMacroType>(m_CbnZxxPreset.GetCurSel()); - if (zxx_preset && m_pModDoc != nullptr) + if (zxx_preset != sfx_fixed_custom && m_pModDoc != nullptr) { m_pModDoc->CreateZxxFromType(m_MidiCfg.szMidiZXXExt, zxx_preset); UpdateDialog(); Modified: trunk/OpenMPT/soundlib/Snd_defs.h =================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h 2011-03-22 22:12:56 UTC (rev 824) +++ trunk/OpenMPT/soundlib/Snd_defs.h 2011-03-23 20:48:08 UTC (rev 825) @@ -409,6 +409,11 @@ INST_NUMFILTERMODES };*/ +// MIDI Macros +#define MACRO_MASK 0x7F5F7F5F +#define MACRO_INTERNAL 0x30463046 // internal macro, low 7 bits (f.e. cutoff, resonance, low plugin params) +#define MACRO_INTERNALEX 0x31463046 // internal macro, high 7 bits (high plugin params) + // Vibrato Types #define VIB_SINE 0 #define VIB_SQUARE 1 Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-22 22:12:56 UTC (rev 824) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-23 20:48:08 UTC (rev 825) @@ -3012,11 +3012,11 @@ //--------------------------------------------------------------------------- { MODCHANNEL *pChn = &Chn[nChn]; - DWORD dwMacro = (*((LPDWORD)pszMidiMacro)) & 0x7F5F7F5F; + DWORD dwMacro = (*((LPDWORD)pszMidiMacro)) & MACRO_MASK; int nInternalCode; // Not Internal Device ? - if (dwMacro != 0x30463046 && dwMacro != 0x31463046) + if (dwMacro != MACRO_INTERNAL && dwMacro != MACRO_INTERNALEX) { UINT pos = 0, nNib = 0, nBytes = 0; DWORD dwMidiCode = 0, dwByteCode = 0; @@ -3070,10 +3070,7 @@ // Internal device //HACK: - bool extendedParam = false; - if (dwMacro == 0x31463046) { - extendedParam = true; - } + const bool extendedParam = (dwMacro == MACRO_INTERNALEX); pszMidiMacro += 4; nInternalCode = -256; @@ -3179,14 +3176,13 @@ //--------------------------------------------------------------------------- { MODCHANNEL *pChn = &Chn[nChn]; - DWORD dwMacro = (*((LPDWORD)pszMidiMacro)) & 0x7F5F7F5F; + DWORD dwMacro = (*((LPDWORD)pszMidiMacro)) & MACRO_MASK; int nInternalCode; CHAR cData1; // rewbs.smoothVST: DWORD dwParam; // increased scope to fuction. - bool extendedParam = false; - - if (dwMacro != 0x30463046 && dwMacro != 0x31463046) { + if (dwMacro != MACRO_INTERNAL && dwMacro != MACRO_INTERNALEX) + { // we don't cater for external devices at tick resolution. if(m_dwSongFlags & SONG_FIRSTTICK) { ProcessMidiMacro(nChn, pszMidiMacro, param); @@ -3195,9 +3191,7 @@ } //HACK: - if (dwMacro == 0x31463046) { - extendedParam = true; - } + const bool extendedParam = (dwMacro == MACRO_INTERNALEX); // not sure what we're doing here; some sort of info gathering from the macros pszMidiMacro += 4; Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2011-03-22 22:12:56 UTC (rev 824) +++ trunk/OpenMPT/soundlib/Sndfile.h 2011-03-23 20:48:08 UTC (rev 825) @@ -446,6 +446,7 @@ }; +#define NUM_MACROS 16 // number of parametered macros struct MODMIDICFG { CHAR szMidiGlb[9*32]; @@ -1006,9 +1007,6 @@ static LPSTR AllocateSample(UINT nbytes); static void FreeSample(LPVOID p); static UINT Normalize24BitBuffer(LPBYTE pbuffer, UINT cbsizebytes, DWORD lmax24, DWORD dwByteInc); -//private: - static MODCOMMAND *AllocatePattern(UINT rows, UINT nchns); - static void FreePattern(LPVOID pat); // Song message helper functions public: @@ -1067,7 +1065,7 @@ size_t GetVisitedRowsVectorSize(const PATTERNINDEX nPat); public: - // "importance" of every FX command. Table is used for importing from formats with multiple effect colums + // "importance" of every FX command. Table is used for importing from formats with multiple effect columns // and is approximately the same as in SchismTracker. static uint16 CSoundFile::GetEffectWeight(MODCOMMAND::COMMAND cmd); // try to convert a an effect into a volume column effect. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-03-23 22:40:43
|
Revision: 827 http://modplug.svn.sourceforge.net/modplug/?rev=827&view=rev Author: saga-games Date: 2011-03-23 22:40:37 +0000 (Wed, 23 Mar 2011) Log Message: ----------- [Fix] IT Compatibility: Incorrect notes were memorized for PPS and possibly other effects when working with instruments that had non-default note assignments (f.e. C-5 => D-4) (commiting this before I forget what it does, because the fix is getting old...) [Mod] Updated History.txt / release notes [Mod] OpenMPT: Version is now 1.19.00.30 Modified Paths: -------------- trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/packageTemplate/History.txt trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-03-23 20:57:22 UTC (rev 826) +++ trunk/OpenMPT/mptrack/version.h 2011-03-23 22:40:37 UTC (rev 827) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 19 #define VER_MINOR 00 -#define VER_MINORMINOR 29 +#define VER_MINORMINOR 30 //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/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2011-03-23 20:57:22 UTC (rev 826) +++ trunk/OpenMPT/packageTemplate/History.txt 2011-03-23 22:40:37 UTC (rev 827) @@ -10,23 +10,25 @@ (tx XYZ): thanks to XYZ for telling us about the bug -v1.19.01.00 (March 2011, revision 820) +v1.19.01.00 (March 2011, revision 827) -------------------------------------- Pattern tab [New] <Jojo> Clicking and dragging the row numbers selects the whole row now (Excel / Calc style) - see http://bugs.openmpt.org/view.php?id=45 [New] <Jojo> The new keyboard shortcuts "Select beat" and "Select measure" can be used to automatically extend the current selection to the beat / measure boundaries. [New] <Jojo> Experimental feature: Play the whole pattern row when entering notes and chords into the pattern editor. This can be enabled from the setup screen. [Imp] <Jojo> Special paste modes have been moved to a sub menu in the context menu, to save some space. + [Imp] <Jojo> Status bar now indicates if highpass filter is enabled on a channel. [Mod] <Jojo> Using the Goto Dialog should now update channel parameters and set the elapsed time. (http://bugs.openmpt.org/view.php?id=28) [Mod] <Jojo> Undo steps have been increased from 100 to 1000. + [Fix] <Jojo> Shrink selection is more consistent with Shrink pattern now: Entries on odd rows are not ignored anymore if there is no entry in the even rows. Also, cleaning of the pattern after shrinking the selection has been fixed - it cleaned whole commands instead of just the selected parts of a command. [Fix] <Jojo> Cursor paste was possible even when editing was disabled. [Fix] <Jojo> Using Right-Click -> Change Plugin on PC notes did not work for plugin numbers that were higher than the highest instrument number. [Fix] <Jojo> When entering chords into the pattern editor, the module was only marked as modified if the base note of the chord was changed. [Fix] <Jojo> When jumping to an order which is normally not played, the song variables are now reset (previously, if the main song had f.e. a global volume fade out at the end, this was retained when switching to an unplayed order, effectively muting all sub songs). - [Fix] <Jojo> OpenMPT should not crash anymore when applying the Amplify command on a pattern selection that just covers the note / instrument column of the first channel. + [Fix] <Jojo> OpenMPT does not crash anymore when applying the Amplify command on a pattern selection that just covers the note / instrument column of the first channel. [Fix] <Jojo> Queueing a "---" or "+++" item now automatically moves the queue "cursor" to the next available pattern. Previously, queueing a "---" pattern restarted the song. - [Fix] <Jojo> Changing a channel name from the pattern editor didn't set the document as modified (http://bugs.openmpt.org/view.php?id=65) - [Fix] <Jojo> When restarting a pattern, the timer was not reset properly. + [Fix] <Jojo> Changing a channel name from the pattern editor didn't mark the document as modified (http://bugs.openmpt.org/view.php?id=65) + [Fix] <Jojo> When restarting a pattern, the song timer was not reset properly. [Fix] <Jojo> Entering a note-off event in the MOD format created an unnecessary undo event. [Fix] <Jojo> Automation data is not written to the pattern if the current module format does not support smooth midi macros. [Reg] <Jojo> The "Position aware timer" option is gone. The position aware timer is now automatically used. It was optional in the first place because of some buggy code, which is now fixed. @@ -93,6 +95,7 @@ [Imp] <Jojo> IT Loader: Autovibrato sweep is now fixed when loading IT files made with old versions of (Open)MPT. [Mod] <Jojo> Sane values are used again for the "cwtv" and "cmwt" header fields when saving IT files; in fact the same values as in compatibility export are used. To be able to distinguish between raped and compatibility-exported IT files, "OMPT" is written in the "reserved" header field. As a consequence, IT files made with OpenMPT can now be loaded in Impulse Tracker again. [Mod] <Jojo> IT Loader: MIDI macros are now cleared when loading IT files made with old Impulse Tracker versions (< 2.14), so that Zxx commands won't break the songs anymore (fixes denonde.it, fix from Schism Tracker). + [Fix] <Jojo> Incorrect notes were memorized for PPS (and possibly other effects) when working with instruments that had non-default note assignments (f.e. C-5 => D-4) [Fix] <Jojo> In compatible mode, bidi loops are now treated like in IT's software mixer. (http://bugs.openmpt.org/view.php?id=29) [Fix] <Jojo> Sample autovibrato is now hopefully a bit closer to Impulse Tracker in compatible mode... (http://bugs.openmpt.org/view.php?id=5) [Fix] <Jojo> The envelope handling was altered slightly to work more like in Schism Tracker. This fixes a combination of Envelope Carry + Portamento as it can be found in "electric bunny" by Alpha C. @@ -144,6 +147,7 @@ [Imp] <Jojo> Sound Setup: For ASIO devices, only supported sampling rates are now shown. [Imp] <Jojo> The instrument list on the comments tab also shows assigned plugins now. [Imp] <Jojo> Added Mix Paste (IT Style) to the "Paste Special" edit menu + [Imp] <Jojo> Macro Editor: User is now warned if the current macro configuration differs from the default configuration but embedding macro configuration is disabled. [Mod] <Jojo> Changes to keymap file handling: The active keymap is now always saved to Keybindings.mkb (in either %APPDATA%\OpenMPT or the executable's directory). Any other keymaps are now only overwritten when using the "Save keys as" function. (http://bugs.openmpt.org/view.php?id=20) [Mod] <Jojo> On first run, the default ASIO driver is now chosen instead of DirectSound (if there is one). [Mod] <Jojo> The "Original" mix mode now also has a version number (1.16) to reflect what the "original" thing is. Modified: trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html =================================================================== --- trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html 2011-03-23 20:57:22 UTC (rev 826) +++ trunk/OpenMPT/packageTemplate/OMPT_1.19_ReleaseNotes.html 2011-03-23 22:40:37 UTC (rev 827) @@ -92,7 +92,7 @@ <li>When exporting to WAV, <strong>cue points</strong> are now inserted at every pattern transition.</li> <li>The last remaining absolute paths in the settings files have been removed; OpenMPT is now <strong>fully portable</strong>!</li> <li>The instrument list on the comments tab also shows <strong>assigned plugins</strong> now.</li> - <li>New <strong>keyboard shortcuts</strong>: Panic, View Edit History, Set Invalid / Ignore Pattern (in the orderlist), Quick fade (sample editor)</li> + <li>New <strong>keyboard shortcuts</strong>: Panic, View Edit History, Set Invalid / Ignore Pattern (in the orderlist), Select beat / measure (pattern editor), Quick fade (sample editor)</li> <li>Changes to <strong>keymap file handling</strong>: The active keymap is now always saved to Keybindings.mkb. Any other keymaps are now only overwritten when using the "Save keys as" function.</li> <li>When using the ACM MP3 codec, 320kbit/s bitrate should now be available.</li> </ul> @@ -104,9 +104,11 @@ <ul> <li><strong>Per-pattern time signatures</strong> allow to override the global time signature. This is especially useful in modern tempo mode if you want to use several time signatures in the same song, or if you just temporarily need more detail in a pattern.</li> <li>You can now <strong>select whole rows</strong> by clicking / dragging the row index on the left side of the pattern.</li> + <li>There are new shortcuts for <strong>selecting a whole beat or measure</strong>.</li> <li>The search feature has been extended to allow for <strong>searching in pattern selections</strong>.</li> <li>Furthermore, the usability of the Find / Replace dialog has been improved: Corresponding checkboxes are now automatically ticked when the value of a dropdown box has been changed. "Replace All" no longer creates an undo point for every replaced command.</li> <li>It is now possible to <strong>play the whole pattern row when entering notes</strong> and chords into the pattern editor. This behaviour can be enabled from the setup screen.</li> + <li>The <strong>context menu</strong> has been restructured slightly to contain all advanced paste modes in a sub menu.</li> </ul> <h3>Sample Editor / Instrument Editor</h3> @@ -141,7 +143,7 @@ <i>This list has mostly been copied over from the old 1.17RC2 release notes, so this not very comprehensive... :-)</i> </p> <ul> - <li>Far from perfect VST support (no busses for routing, no MIDI routing, only a few tracker effects are supported, etc...)</li> + <li>Far from perfect VST support (no buses for routing, no MIDI routing, only a few tracker effects are supported, etc...)</li> <li>Some controls vanish randomly all the time, most notably under Windows Vista and Windows 7.</li> <li>Previewing samples from the treeview's file browser stops the playing module.</li> <li>Cannot preview instruments directly from the MIDI library in the treeview.</li> Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-23 20:57:22 UTC (rev 826) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-23 22:40:37 UTC (rev 827) @@ -522,7 +522,7 @@ } else if (m_nInstruments) { - if (note >= 0xFE) return; + if (note >= NOTE_MIN_SPECIAL) return; pSmp = NULL; } @@ -725,6 +725,8 @@ MODINSTRUMENT *pIns = pChn->pModInstrument; const bool bNewTuning = (m_nType == MOD_TYPE_MPT && pIns && pIns->pTuning); + // save the note that's actually used, as it's necessary to properly calculate PPS and stuff + const int realnote = note; if ((pIns) && (note <= 0x80)) { @@ -798,7 +800,14 @@ { note = CLAMP(note, NOTE_MIN, NOTE_MAX); } - pChn->nNote = note; + if(IsCompatibleMode(TRK_IMPULSETRACKER)) + { + // need to memorize the original note for various effects (f.e. PPS) + pChn->nNote = CLAMP(realnote, NOTE_MIN, NOTE_MAX); + } else + { + pChn->nNote = note; + } pChn->m_CalculateFreq = true; if ((!bPorta) || (m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT))) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-03-24 20:05:09
|
Revision: 828 http://modplug.svn.sourceforge.net/modplug/?rev=828&view=rev Author: saga-games Date: 2011-03-24 20:05:01 +0000 (Thu, 24 Mar 2011) Log Message: ----------- [Ref] Merged ProcessMidiMacro and ProcessSmoothMidiMacro into one function to avoid copypasta [Ref] Project files: Moved mod loaders into own folder in the project tree [Ref] Added Get[Vol]EffectLetter to mod specs. Modified Paths: -------------- trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/mptrack.vcproj trunk/OpenMPT/mptrack/mptrack_08.vcproj trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/mod_specifications.cpp trunk/OpenMPT/soundlib/mod_specifications.h Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2011-03-23 22:40:37 UTC (rev 827) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2011-03-24 20:05:01 UTC (rev 828) @@ -1282,11 +1282,12 @@ if (pMainFrm && m_dwEndSel <= m_dwBeginSel) { - if(m_nSample > 0 && m_nSample < MAX_SAMPLES && x < pSndFile->Samples[m_nSample].nLength ) + if(m_nSample > 0 && m_nSample < MAX_SAMPLES && x < pSndFile->Samples[m_nSample].nLength) { const DWORD xLow = (x / 0x100) % 0x100; const DWORD xHigh = x / 0x10000; - const char cOffsetChar = (pSndFile->TypeIsS3M_IT_MPT()) ? gszS3mCommands[CMD_OFFSET] : gszModCommands[CMD_OFFSET]; + + const char cOffsetChar = pSndFile->GetModSpecifications().GetEffectLetter(CMD_OFFSET); const bool bHasHighOffset = (pSndFile->TypeIsS3M_IT_MPT() || (pSndFile->GetType() == MOD_TYPE_XM)); const char cHighOffsetChar = (pSndFile->TypeIsS3M_IT_MPT()) ? gszS3mCommands[CMD_S3MCMDEX] : gszModCommands[CMD_XFINEPORTAUPDOWN]; @@ -1299,7 +1300,9 @@ pMainFrm->SetInfoText(s); } else + { pMainFrm->SetInfoText(""); + } } } else UpdateIndicator(NULL); if (m_dwStatus & SMPSTATUS_MOUSEDRAG) Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2011-03-23 22:40:37 UTC (rev 827) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2011-03-24 20:05:01 UTC (rev 828) @@ -18,7 +18,7 @@ #ifdef VST_USE_ALTERNATIVE_MAGIC //Pelya's plugin ID fix. Breaks fx presets, so let's avoid it for now. #define ZLIB_WINAPI #include "../zlib/zlib.h" //For CRC32 calculation (to detect plugins with same UID) -#endif +#endif // VST_USE_ALTERNATIVE_MAGIC #define new DEBUG_NEW @@ -52,7 +52,7 @@ return crc32(0, (BYTE *)fn, f); } -#endif +#endif // VST_USE_ALTERNATIVE_MAGIC VstIntPtr VSTCALLBACK CVstPluginManager::MasterCallBack(AEffect *effect, VstInt32 opcode, VstInt32 index, VstIntPtr value, void *ptr, float opt) //---------------------------------------------------------------------------------------------------------------------------------------------- @@ -261,16 +261,16 @@ { p->dwPluginId1 = CalculateCRC32fromFilename(p->szLibraryName); // Make Plugin ID unique for sure (for VSTs with same UID) }; - #endif + #endif // VST_USE_ALTERNATIVE_MAGIC #ifdef VST_LOG Log("Plugin \"%s\" found in PluginCache\n", p->szLibraryName); - #endif + #endif // VST_LOG return p; } else { #ifdef VST_LOG Log("Plugin \"%s\" mismatch in PluginCache: \"%s\" [%s]=\"%s\"\n", s, pszDllPath, (LPCTSTR)IDs, (LPCTSTR)strFullPath); - #endif + #endif // VST_LOG } } } @@ -278,20 +278,21 @@ HINSTANCE hLib = NULL; - try { + try + { hLib = LoadLibrary(pszDllPath); //rewbs.VSTcompliance #ifdef _DEBUG - if (!hLib) - { - TCHAR szBuf[256]; - LPVOID lpMsgBuf; - DWORD dw = GetLastError(); - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); - wsprintf(szBuf, "Warning: encountered problem when loading plugin dll. Error %d: %s", dw, lpMsgBuf); - MessageBox(NULL, szBuf, "DEBUG: Error when loading plugin dll", MB_OK); - LocalFree(lpMsgBuf); - } + if (!hLib) + { + TCHAR szBuf[256]; + LPVOID lpMsgBuf; + DWORD dw = GetLastError(); + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); + wsprintf(szBuf, "Warning: encountered problem when loading plugin dll. Error %d: %s", dw, lpMsgBuf); + MessageBox(NULL, szBuf, "DEBUG: Error when loading plugin dll", MB_OK); + LocalFree(lpMsgBuf); + } #endif //_DEBUG //end rewbs.VSTcompliance } catch(...) @@ -304,7 +305,7 @@ PVSTPLUGENTRY pMainProc = (PVSTPLUGENTRY)GetProcAddress(hLib, "main"); #ifdef ENABLE_BUZZ GET_INFO pBuzzGetInfo = (GET_INFO)GetProcAddress(hLib, "GetInfo"); - #endif + #endif // ENABLE_BUZZ if (pMainProc) { PVSTPLUGINLIB p = new VSTPLUGINLIB; @@ -329,9 +330,9 @@ pEffect->dispatcher(pEffect, effOpen, 0,0,0,0); #ifdef VST_USE_ALTERNATIVE_MAGIC p->dwPluginId1 = CalculateCRC32fromFilename(p->szLibraryName); // Make Plugin ID unique for sure - #else + #else p->dwPluginId1 = pEffect->magic; - #endif + #endif // VST_USE_ALTERNATIVE_MAGIC p->dwPluginId2 = pEffect->uniqueID; if ((pEffect->flags & effFlagsIsSynth) || (!pEffect->numInputs)) p->bIsInstrument = TRUE; #ifdef VST_LOG @@ -342,7 +343,7 @@ pEffect->numInputs, pEffect->numOutputs, pEffect->numPrograms, pEffect->numParams, pEffect->flags, pEffect->realQualities, pEffect->offQualities); - #endif + #endif // VST_LOG pEffect->dispatcher(pEffect, effClose, 0,0,0,0); bOk = TRUE; } @@ -406,7 +407,7 @@ { #ifdef VST_LOG Log("Entry point not found!\n"); - #endif + #endif // VST_LOG } try { @@ -420,7 +421,7 @@ { #ifdef VST_LOG Log("LoadLibrary(%s) failed!\n", pszDllPath); - #endif + #endif // VST_LOG } return NULL; } @@ -753,7 +754,7 @@ //---from here VST 2.0 extension opcodes------------------------------------------------------ - // <value> is a filter which is currently ignored + // <value> is a filter which is currently ignored - DEPRECATED in VST 2.4 // Herman Seib only processes Midi events for plugs that call this. Keep in mind. case audioMasterWantMidi: return 1; // returns const VstTimeInfo* (or 0 if not supported) @@ -761,43 +762,53 @@ case audioMasterGetTime: { CVstPlugin* pVstPlugin = (CVstPlugin*)effect->resvd1; - memset(&timeInfo, 0, sizeof(timeInfo)); + MemsetZero(timeInfo); timeInfo.sampleRate = CMainFrame::GetMainFrame()->GetSampleRate(); - if (pVstPlugin) { + if (pVstPlugin) + { CSoundFile* pSndFile = pVstPlugin->GetSoundFile(); - if (pVstPlugin->IsSongPlaying()) { + if (pVstPlugin->IsSongPlaying()) + { timeInfo.flags |= kVstTransportPlaying; timeInfo.samplePos = CMainFrame::GetMainFrame()->GetTotalSampleCount(); if (timeInfo.samplePos == 0) //samplePos=0 means we just started playing - timeInfo.flags |= kVstTransportChanged; - } else { + { + timeInfo.flags |= kVstTransportChanged; + } + } else + { timeInfo.flags |= kVstTransportChanged; //just stopped. timeInfo.samplePos = 0; } - if ((value & kVstNanosValid)) { + if ((value & kVstNanosValid)) + { timeInfo.flags |= kVstNanosValid; timeInfo.nanoSeconds = pVstPlugin->GetTimeAtStartOfProcess(); } - if ((value & kVstPpqPosValid) && pSndFile) { + if ((value & kVstPpqPosValid) && pSndFile) + { timeInfo.flags |= kVstPpqPosValid; - if (timeInfo.flags & kVstTransportPlaying) { + if (timeInfo.flags & kVstTransportPlaying) + { timeInfo.ppqPos = (timeInfo.samplePos/timeInfo.sampleRate)*(pSndFile->GetCurrentBPM()/60.0); - } else { + } else + { timeInfo.ppqPos = 0; } } - if ((value & kVstTempoValid) && pSndFile) { + if ((value & kVstTempoValid) && pSndFile) + { timeInfo.tempo = pSndFile->GetCurrentBPM(); - if (timeInfo.tempo) { + if (timeInfo.tempo) + { timeInfo.flags |= kVstTempoValid; } } - if ((value & kVstTimeSigValid) && pSndFile) { - timeInfo.flags |= kVstTimeSigValid; - //timeInfo.timeSigNumerator = pSndFile->m_nCurrentRowsPerBeat; - //timeInfo.timeSigDenominator = pSndFile->m_nCurrentRowsPerMeasure; + if ((value & kVstTimeSigValid) && pSndFile) + { + timeInfo.flags |= kVstTimeSigValid; // Time signature. numerator = rows per beats / rows pear measure (should sound somewhat logical to you). // the denominator is a bit more tricky, since it cannot be set explicitely. so we just assume quarters for now. @@ -811,27 +822,31 @@ // We don't support plugs that send VSTEvents to the host case audioMasterProcessEvents: Log("VST plugin to host: Process Events\n"); - break; + break; + // DEPRECATED in VST 2.4 case audioMasterSetTime: Log("VST plugin to host: Set Time\n"); break; - // returns tempo (in bpm * 10000) at sample frame location passed in <value> + // returns tempo (in bpm * 10000) at sample frame location passed in <value> - DEPRECATED in VST 2.4 case audioMasterTempoAt: //Screw it! Let's just return the tempo at this point in time (might be a bit wrong). - if (effect->resvd1) { + if (effect->resvd1) + { CSoundFile *pSndFile = ((CVstPlugin*)effect->resvd1)->GetSoundFile(); - if (pSndFile) { - return pSndFile->GetCurrentBPM()*10000; - } else { - return 125*10000; + if (pSndFile) + { + return (VstInt32)(pSndFile->GetCurrentBPM() * 10000); + } else + { + return (VstInt32)(125 * 10000); } } return 125*10000; - // parameters + // parameters - DEPRECATED in VST 2.4 case audioMasterGetNumAutomatableParameters: Log("VST plugin to host: Get Num Automatable Parameters\n"); break; - // Apparently, this one is broken in VST SDK anyway. + // Apparently, this one is broken in VST SDK anyway. - DEPRECATED in VST 2.4 case audioMasterGetParameterQuantization: Log("VST plugin to host: Audio Master Get Parameter Quantization\n"); break; @@ -839,7 +854,7 @@ case audioMasterIOChanged: Log("VST plugin to host: IOchanged\n"); break; - // plug needs idle calls (outside its editor window) + // plug needs idle calls (outside its editor window) - DEPRECATED in VST 2.4 case audioMasterNeedIdle: if (effect && effect->resvd1) { @@ -880,16 +895,16 @@ VstIntPtr latency = CMainFrame::GetMainFrame()->m_nBufferLength * (CMainFrame::GetMainFrame()->GetSampleRate()/1000L); return latency; } - // input pin in <value> (-1: first to come), returns cEffect* + // input pin in <value> (-1: first to come), returns cEffect* - DEPRECATED in VST 2.4 case audioMasterGetPreviousPlug: Log("VST plugin to host: Get Previous Plug\n"); break; - // output pin in <value> (-1: first to come), returns cEffect* + // output pin in <value> (-1: first to come), returns cEffect* - DEPRECATED in VST 2.4 case audioMasterGetNextPlug: Log("VST plugin to host: Get Next Plug\n"); break; // realtime info - // returns: 0: not supported, 1: replace, 2: accumulate + // returns: 0: not supported, 1: replace, 2: accumulate - DEPRECATED in VST 2.4 (replace is default) case audioMasterWillReplaceOrAccumulate: return 1; //we replace. case audioMasterGetCurrentProcessLevel: @@ -924,16 +939,16 @@ case audioMasterOfflineGetCurrentMetaPass: Log("VST plugin to host: OfflineGetCurrentMetapass\n"); break; - // for variable i/o, sample rate in <opt> + // for variable i/o, sample rate in <opt> - DEPRECATED in VST 2.4 case audioMasterSetOutputSampleRate: Log("VST plugin to host: Set Output Sample Rate\n"); break; - // result in ret + // result in ret - DEPRECATED in VST 2.4 case audioMasterGetOutputSpeakerArrangement: Log("VST plugin to host: Get Output Speaker Arrangement\n"); break; case audioMasterGetVendorString: - strcpy((char*)ptr, s_szHostVendorString); + strcpy((char *) ptr, s_szHostVendorString); //strcpy((char*)ptr,"Steinberg"); //return 0; return true; @@ -941,13 +956,13 @@ return s_nHostVendorVersion; //return 7000; case audioMasterGetProductString: - strcpy((char*)ptr, s_szHostProductString); + strcpy((char *) ptr, s_szHostProductString); //strcpy((char*)ptr,"Cubase VST"); //return 0; return true; case audioMasterVendorSpecific: return 0; - // void* in <ptr>, format not defined yet + // void* in <ptr>, format not defined yet - DEPRECATED in VST 2.4 case audioMasterSetIcon: Log("VST plugin to host: Set Icon\n"); break; @@ -978,11 +993,11 @@ // case audioMasterGetLanguage: return kVstLangEnglish; - // returns platform specific ptr + // returns platform specific ptr - DEPRECATED in VST 2.4 case audioMasterOpenWindow: Log("VST plugin to host: Open Window\n"); break; - // close window, platform specific handle in <ptr> + // close window, platform specific handle in <ptr> - DEPRECATED in VST 2.4 case audioMasterCloseWindow: Log("VST plugin to host: Close Window\n"); break; @@ -1026,19 +1041,19 @@ case audioMasterCloseFileSelector: return VstFileSelector(opcode == audioMasterCloseFileSelector, (VstFileSelect *)ptr, effect); - // open an editor for audio (defined by XML text in ptr) - DEPRECATED + // open an editor for audio (defined by XML text in ptr) - DEPRECATED in VST 2.4 case audioMasterEditFile: Log("VST plugin to host: Edit File\n"); break; // get the native path of currently loading bank or project - // (called from writeChunk) void* in <ptr> (char[2048], or sizeof(FSSpec)) - DEPRECATED + // (called from writeChunk) void* in <ptr> (char[2048], or sizeof(FSSpec)) - DEPRECATED in VST 2.4 case audioMasterGetChunkFile: Log("VST plugin to host: Get Chunk File\n"); break; //---from here VST 2.3 extension opcodes------------------------------------------------------ - // result a VstSpeakerArrangement in ret - DEPRECATED + // result a VstSpeakerArrangement in ret - DEPRECATED in VST 2.4 case audioMasterGetInputSpeakerArrangement: Log("VST plugin to host: Get Input Speaker Arrangement\n"); break; Modified: trunk/OpenMPT/mptrack/mptrack.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack.vcproj 2011-03-23 22:40:37 UTC (rev 827) +++ trunk/OpenMPT/mptrack/mptrack.vcproj 2011-03-24 20:05:01 UTC (rev 828) @@ -259,90 +259,6 @@ RelativePath=".\KeyConfigDlg.cpp"> </File> <File - RelativePath="..\soundlib\Load_669.cpp"> - </File> - <File - RelativePath="..\Soundlib\load_amf.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_ams.cpp"> - </File> - <File - RelativePath="..\soundlib\load_dbm.cpp"> - </File> - <File - RelativePath="..\soundlib\load_dmf.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_dsm.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_far.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_gdm.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_imf.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_it.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_itp.cpp"> - </File> - <File - RelativePath="..\soundlib\load_j2b.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_mdl.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_med.cpp"> - </File> - <File - RelativePath="..\soundlib\load_mid.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_mo3.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_mod.cpp"> - </File> - <File - RelativePath="..\Soundlib\load_mt2.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_mtm.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_okt.cpp"> - </File> - <File - RelativePath="..\Soundlib\load_psm.cpp"> - </File> - <File - RelativePath="..\soundlib\load_ptm.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_s3m.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_stm.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_ult.cpp"> - </File> - <File - RelativePath="..\Soundlib\Load_umx.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_wav.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_xm.cpp"> - </File> - <File RelativePath=".\mainbar.cpp"> </File> <File @@ -804,9 +720,6 @@ RelativePath=".\KeyConfigDlg.h"> </File> <File - RelativePath="..\soundlib\Loaders.h"> - </File> - <File RelativePath=".\mainbar.h"> </File> <File @@ -992,6 +905,97 @@ RelativePath=".\test\test.h"> </File> </Filter> + <Filter + Name="Module Loaders" + Filter=""> + <File + RelativePath="..\soundlib\Load_669.cpp"> + </File> + <File + RelativePath="..\Soundlib\load_amf.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_ams.cpp"> + </File> + <File + RelativePath="..\soundlib\load_dbm.cpp"> + </File> + <File + RelativePath="..\soundlib\load_dmf.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_dsm.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_far.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_gdm.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_imf.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_it.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_itp.cpp"> + </File> + <File + RelativePath="..\soundlib\load_j2b.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_mdl.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_med.cpp"> + </File> + <File + RelativePath="..\soundlib\load_mid.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_mo3.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_mod.cpp"> + </File> + <File + RelativePath="..\Soundlib\load_mt2.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_mtm.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_okt.cpp"> + </File> + <File + RelativePath="..\Soundlib\load_psm.cpp"> + </File> + <File + RelativePath="..\soundlib\load_ptm.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_s3m.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_stm.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_ult.cpp"> + </File> + <File + RelativePath="..\Soundlib\Load_umx.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_wav.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_xm.cpp"> + </File> + <File + RelativePath="..\soundlib\Loaders.h"> + </File> + </Filter> <File RelativePath=".\mptrack.reg"> </File> Modified: trunk/OpenMPT/mptrack/mptrack_08.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_08.vcproj 2011-03-23 22:40:37 UTC (rev 827) +++ trunk/OpenMPT/mptrack/mptrack_08.vcproj 2011-03-24 20:05:01 UTC (rev 828) @@ -349,118 +349,6 @@ > </File> <File - RelativePath="..\soundlib\Load_669.cpp" - > - </File> - <File - RelativePath="..\Soundlib\load_amf.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_ams.cpp" - > - </File> - <File - RelativePath="..\soundlib\load_dbm.cpp" - > - </File> - <File - RelativePath="..\soundlib\load_dmf.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_dsm.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_far.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_gdm.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_imf.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_it.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_itp.cpp" - > - </File> - <File - RelativePath="..\soundlib\load_j2b.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_mdl.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_med.cpp" - > - </File> - <File - RelativePath="..\soundlib\load_mid.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_mo3.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_mod.cpp" - > - </File> - <File - RelativePath="..\Soundlib\load_mt2.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_mtm.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_okt.cpp" - > - </File> - <File - RelativePath="..\Soundlib\load_psm.cpp" - > - </File> - <File - RelativePath="..\soundlib\load_ptm.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_s3m.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_stm.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_ult.cpp" - > - </File> - <File - RelativePath="..\Soundlib\Load_umx.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_wav.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_xm.cpp" - > - </File> - <File RelativePath=".\mainbar.cpp" > </File> @@ -1067,10 +955,6 @@ > </File> <File - RelativePath="..\soundlib\Loaders.h" - > - </File> - <File RelativePath=".\mainbar.h" > </File> @@ -1319,6 +1203,126 @@ > </File> </Filter> + <Filter + Name="Module Loaders" + > + <File + RelativePath="..\soundlib\Load_669.cpp" + > + </File> + <File + RelativePath="..\Soundlib\load_amf.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_ams.cpp" + > + </File> + <File + RelativePath="..\soundlib\load_dbm.cpp" + > + </File> + <File + RelativePath="..\soundlib\load_dmf.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_dsm.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_far.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_gdm.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_imf.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_it.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_itp.cpp" + > + </File> + <File + RelativePath="..\soundlib\load_j2b.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_mdl.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_med.cpp" + > + </File> + <File + RelativePath="..\soundlib\load_mid.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_mo3.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_mod.cpp" + > + </File> + <File + RelativePath="..\Soundlib\load_mt2.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_mtm.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_okt.cpp" + > + </File> + <File + RelativePath="..\Soundlib\load_psm.cpp" + > + </File> + <File + RelativePath="..\soundlib\load_ptm.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_s3m.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_stm.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_ult.cpp" + > + </File> + <File + RelativePath="..\Soundlib\Load_umx.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_wav.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_xm.cpp" + > + </File> + <File + RelativePath="..\soundlib\Loaders.h" + > + </File> + </Filter> <File RelativePath=".\res\built-inTunings.tc" > Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-23 22:40:37 UTC (rev 827) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-24 20:05:01 UTC (rev 828) @@ -1703,7 +1703,7 @@ break; case VOLCMD_OFFSET: //rewbs.volOff - if (m_nTickCount == nStartTick) + if (m_nTickCount == nStartTick) SampleOffset(nChn, vol<<3, bPorta); break; } @@ -2079,23 +2079,17 @@ } break; - // Midi Controller (on first tick only) - case CMD_MIDI: - if(!(m_dwSongFlags & SONG_FIRSTTICK)) break; + // Midi Controller + case CMD_MIDI: // Midi Controller (on first tick only) + case CMD_SMOOTHMIDI: // Midi Controller (smooth, i.e. on every tick) + + if((cmd == CMD_MIDI) && !(m_dwSongFlags & SONG_FIRSTTICK)) break; if (param < 0x80) - ProcessMidiMacro(nChn, &m_MidiCfg.szMidiSFXExt[pChn->nActiveMacro << 5], param); + ProcessMidiMacro(nChn, (cmd == CMD_SMOOTHMIDI), &m_MidiCfg.szMidiSFXExt[pChn->nActiveMacro << 5], param); else - ProcessMidiMacro(nChn, &m_MidiCfg.szMidiZXXExt[(param & 0x7F) << 5], 0); + ProcessMidiMacro(nChn, (cmd == CMD_SMOOTHMIDI), &m_MidiCfg.szMidiZXXExt[(param & 0x7F) << 5], 0); break; - // Midi Controller (smooth, i.e. on every tick) - case CMD_SMOOTHMIDI: - if (param < 0x80) - ProcessSmoothMidiMacro(nChn, &m_MidiCfg.szMidiSFXExt[pChn->nActiveMacro << 5], param); - else - ProcessSmoothMidiMacro(nChn, &m_MidiCfg.szMidiZXXExt[(param & 0x7F) << 5], 0); - break; - // IMF Commands case CMD_NOTESLIDEUP: NoteSlide(pChn, param, 1); @@ -3017,41 +3011,53 @@ } -void CSoundFile::ProcessMidiMacro(UINT nChn, LPCSTR pszMidiMacro, UINT param) -//--------------------------------------------------------------------------- +// Process a Midi Macro. +// Parameters: +// [in] nChn: Mod channel to apply macro on +// [in] isSmooth: If true, internal macros are interpolated between two rows +// [in] pszMidiMacro: Actual Midi Macro +// [in] param: Parameter for parametric macros +void CSoundFile::ProcessMidiMacro(UINT nChn, bool isSmooth, LPCSTR pszMidiMacro, UINT param) +//------------------------------------------------------------------------------------------ { MODCHANNEL *pChn = &Chn[nChn]; - DWORD dwMacro = (*((LPDWORD)pszMidiMacro)) & MACRO_MASK; + DWORD dwMacro = (*((DWORD *)pszMidiMacro)) & MACRO_MASK; int nInternalCode; // Not Internal Device ? if (dwMacro != MACRO_INTERNAL && dwMacro != MACRO_INTERNALEX) { + // we don't cater for external devices at tick resolution. + if(isSmooth && !(m_dwSongFlags & SONG_FIRSTTICK)) + { + return; + } + UINT pos = 0, nNib = 0, nBytes = 0; DWORD dwMidiCode = 0, dwByteCode = 0; - while (pos+6 <= 32) + while (pos + 6 <= 32) { - CHAR cData = pszMidiMacro[pos++]; + const CHAR cData = pszMidiMacro[pos++]; if (!cData) break; - if ((cData >= '0') && (cData <= '9')) { dwByteCode = (dwByteCode<<4) | (cData-'0'); nNib++; } else - if ((cData >= 'A') && (cData <= 'F')) { dwByteCode = (dwByteCode<<4) | (cData-'A'+10); nNib++; } else - if ((cData >= 'a') && (cData <= 'f')) { dwByteCode = (dwByteCode<<4) | (cData-'a'+10); nNib++; } else - if ((cData == 'z') || (cData == 'Z')) { dwByteCode = param & 0x7f; nNib = 2; } else + if ((cData >= '0') && (cData <= '9')) { dwByteCode = (dwByteCode << 4) | (cData - '0'); nNib++; } else + if ((cData >= 'A') && (cData <= 'F')) { dwByteCode = (dwByteCode << 4) | (cData - 'A' + 10); nNib++; } else + if ((cData >= 'a') && (cData <= 'f')) { dwByteCode = (dwByteCode << 4) | (cData - 'a' + 10); nNib++; } else + if ((cData == 'z') || (cData == 'Z')) { dwByteCode = param & 0x7F; nNib = 2; } else if ((cData == 'x') || (cData == 'X')) { dwByteCode = param & 0x70; nNib = 2; } else - if ((cData == 'y') || (cData == 'Y')) { dwByteCode = (param & 0x0f)<<3; nNib = 2; } - if ((cData == 'k') || (cData == 'K')) { dwByteCode = (dwByteCode<<4) | GetBestMidiChan(pChn); nNib++; } + if ((cData == 'y') || (cData == 'Y')) { dwByteCode = (param & 0x0F) << 3; nNib = 2; } + if ((cData == 'k') || (cData == 'K')) { dwByteCode = (dwByteCode << 4) | GetBestMidiChan(pChn); nNib++; } if (nNib >= 2) { nNib = 0; - dwMidiCode |= dwByteCode << (nBytes*8); + dwMidiCode |= dwByteCode << (nBytes * 8); dwByteCode = 0; nBytes++; if (nBytes >= 3) { - UINT nMasterCh = (nChn < m_nChannels) ? nChn+1 : pChn->nMasterChn; + UINT nMasterCh = (nChn < m_nChannels) ? nChn + 1 : pChn->nMasterChn; if ((nMasterCh) && (nMasterCh <= m_nChannels)) { // -> CODE#0015 @@ -3059,9 +3065,10 @@ UINT nPlug = GetBestPlugin(nChn, PRIORITISE_CHANNEL, EVEN_IF_MUTED); if(pChn->dwFlags & CHN_NOFX) nPlug = 0; // -! NEW_FEATURE#0015 - if ((nPlug) && (nPlug <= MAX_MIXPLUGINS)) { - IMixPlugin *pPlugin = m_MixPlugins[nPlug-1].pMixPlugin; - if ((pPlugin) && (m_MixPlugins[nPlug-1].pMixState)) + if ((nPlug) && (nPlug <= MAX_MIXPLUGINS)) + { + IMixPlugin *pPlugin = m_MixPlugins[nPlug - 1].pMixPlugin; + if ((pPlugin) && (m_MixPlugins[nPlug - 1].pMixState)) { pPlugin->MidiSend(dwMidiCode); } @@ -3078,10 +3085,11 @@ } // Internal device - //HACK: const bool extendedParam = (dwMacro == MACRO_INTERNALEX); - pszMidiMacro += 4; + pszMidiMacro += 4; // skip the F0.F0 part of the macro + // Determine which internal device is called; every internal code looks like F0.F0.yy.xx, + // where yy is the "device" (cutoff, resonance, plugin parameter, etc.) and xx is the value. nInternalCode = -256; if ((pszMidiMacro[0] >= '0') && (pszMidiMacro[0] <= '9')) nInternalCode = (pszMidiMacro[0] - '0') << 4; else if ((pszMidiMacro[0] >= 'A') && (pszMidiMacro[0] <= 'F')) nInternalCode = (pszMidiMacro[0] - 'A' + 0x0A) << 4; @@ -3092,17 +3100,21 @@ { CHAR cData1 = pszMidiMacro[2]; DWORD dwParam = 0; + if ((cData1 == 'z') || (cData1 == 'Z')) { + // parametric macro dwParam = param; } else { + // fixed macro CHAR cData2 = pszMidiMacro[3]; if ((cData1 >= '0') && (cData1 <= '9')) dwParam += (cData1 - '0') << 4; else if ((cData1 >= 'A') && (cData1 <= 'F')) dwParam += (cData1 - 'A' + 0x0A) << 4; if ((cData2 >= '0') && (cData2 <= '9')) dwParam += (cData2 - '0'); else if ((cData2 >= 'A') && (cData2 <= 'F')) dwParam += (cData2 - 'A' + 0x0A); } + switch(nInternalCode) { // F0.F0.00.xx: Set CutOff @@ -3111,16 +3123,30 @@ int oldcutoff = pChn->nCutOff; if (dwParam < 0x80) { - pChn->nCutOff = dwParam; + if(!isSmooth) + { + pChn->nCutOff = dwParam; + } else + { + // on the first tick only, calculate step + if(m_dwSongFlags & SONG_FIRSTTICK) + { + pChn->m_nPlugInitialParamValue = pChn->nCutOff; + // (dwParam & 0x7F) extracts the actual value that we're going to pass + pChn->m_nPlugParamValueStep = (float)((int)dwParam - pChn->m_nPlugInitialParamValue) / (float)m_nMusicSpeed; + } + //update param on all ticks + pChn->nCutOff = (BYTE) (pChn->m_nPlugInitialParamValue + (m_nTickCount + 1 ) *pChn->m_nPlugParamValueStep + 0.5); + } pChn->nRestoreCutoffOnNewNote = 0; } - #ifndef NO_FILTER +#ifndef NO_FILTER oldcutoff -= pChn->nCutOff; if (oldcutoff < 0) oldcutoff = -oldcutoff; if ((pChn->nVolume > 0) || (oldcutoff < 0x10) - || (!(pChn->dwFlags & CHN_FILTER)) || (!(pChn->nLeftVol|pChn->nRightVol))) + || (!(pChn->dwFlags & CHN_FILTER)) || (!(pChn->nLeftVol|pChn->nRightVol))) SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); - #endif // NO_FILTER +#endif // NO_FILTER } break; @@ -3129,191 +3155,68 @@ if (dwParam < 0x80) { pChn->nRestoreResonanceOnNewNote = 0; - pChn->nResonance = dwParam; - } - - #ifndef NO_FILTER - SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); - #endif // NO_FILTER - break; - - // F0.F0.02.xx: Set filter mode - case 0x02: - if (dwParam < 0x20) - { - pChn->nFilterMode = (dwParam>>4); - #ifndef NO_FILTER - SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); - #endif // NO_FILTER - } - break; - - // F0.F0.03.xx: Set plug dry/wet - case 0x03: - { - UINT nPlug = GetBestPlugin(nChn, PRIORITISE_CHANNEL, EVEN_IF_MUTED); - if ((nPlug) && (nPlug <= MAX_MIXPLUGINS)) { - if (dwParam < 0x80) - m_MixPlugins[nPlug-1].fDryRatio = 1.0-(static_cast<float>(dwParam)/127.0f); - } - } - break; - - - // F0.F0.{80|n}.xx: Set VST effect parameter n to xx - default: - if (nInternalCode & 0x80 || extendedParam) - { - UINT nPlug = GetBestPlugin(nChn, PRIORITISE_CHANNEL, EVEN_IF_MUTED); - if ((nPlug) && (nPlug <= MAX_MIXPLUGINS)) + if(!isSmooth) { - IMixPlugin *pPlugin = m_MixPlugins[nPlug-1].pMixPlugin; - if ((pPlugin) && (m_MixPlugins[nPlug-1].pMixState)) + pChn->nResonance = dwParam; + } else + { + // on the first tick only, calculate step + if(m_dwSongFlags & SONG_FIRSTTICK) { - pPlugin->SetZxxParameter(extendedParam?(0x80+nInternalCode):(nInternalCode&0x7F), dwParam & 0x7F); + pChn->m_nPlugInitialParamValue = pChn->nResonance; + // (dwParam & 0x7F) extracts the actual value that we're going to pass + pChn->m_nPlugParamValueStep = (float)((int)dwParam - pChn->m_nPlugInitialParamValue) / (float)m_nMusicSpeed; } + //update param on all ticks + pChn->nResonance = (BYTE) (pChn->m_nPlugInitialParamValue + (m_nTickCount + 1) * pChn->m_nPlugParamValueStep + 0.5); } } - - } // end switch - } // end internal device - -} - -//rewbs.smoothVST: begin tick resolution handling. -void CSoundFile::ProcessSmoothMidiMacro(UINT nChn, LPCSTR pszMidiMacro, UINT param) -//--------------------------------------------------------------------------- -{ - MODCHANNEL *pChn = &Chn[nChn]; - DWORD dwMacro = (*((LPDWORD)pszMidiMacro)) & MACRO_MASK; - int nInternalCode; - CHAR cData1; // rewbs.smoothVST: - DWORD dwParam; // increased scope to fuction. - - if (dwMacro != MACRO_INTERNAL && dwMacro != MACRO_INTERNALEX) - { - // we don't cater for external devices at tick resolution. - if(m_dwSongFlags & SONG_FIRSTTICK) { - ProcessMidiMacro(nChn, pszMidiMacro, param); - } - return; - } - - //HACK: - const bool extendedParam = (dwMacro == MACRO_INTERNALEX); - - // not sure what we're doing here; some sort of info gathering from the macros - pszMidiMacro += 4; - nInternalCode = -256; - if ((pszMidiMacro[0] >= '0') && (pszMidiMacro[0] <= '9')) nInternalCode = (pszMidiMacro[0] - '0') << 4; else - if ((pszMidiMacro[0] >= 'A') && (pszMidiMacro[0] <= 'F')) nInternalCode = (pszMidiMacro[0] - 'A' + 0x0A) << 4; - if ((pszMidiMacro[1] >= '0') && (pszMidiMacro[1] <= '9')) nInternalCode += (pszMidiMacro[1] - '0'); else - if ((pszMidiMacro[1] >= 'A') && (pszMidiMacro[1] <= 'F')) nInternalCode += (pszMidiMacro[1] - 'A' + 0x0A); - - if (nInternalCode < 0) // not good plugin param macro. (?) - return; - - cData1 = pszMidiMacro[2]; - dwParam = 0; - - if ((cData1 == 'z') || (cData1 == 'Z')) //parametric macro - { - dwParam = param; - } else //fixed macro - { - CHAR cData2 = pszMidiMacro[3]; - if ((cData1 >= '0') && (cData1 <= '9')) dwParam += (cData1 - '0') << 4; else - if ((cData1 >= 'A') && (cData1 <= 'F')) dwParam += (cData1 - 'A' + 0x0A) << 4; - if ((cData2 >= '0') && (cData2 <= '9')) dwParam += (cData2 - '0'); else - if ((cData2 >= 'A') && (cData2 <= 'F')) dwParam += (cData2 - 'A' + 0x0A); - } - - switch(nInternalCode) - { - // F0.F0.00.xx: Set CutOff - case 0x00: - { - int oldcutoff = pChn->nCutOff; - if (dwParam < 0x80) - { - // on the fist tick only, calculate step - if (m_dwSongFlags & SONG_FIRSTTICK) - { - pChn->m_nPlugInitialParamValue = pChn->nCutOff; - // (dwParam & 0x7F) extracts the actual value that we're going to pass - pChn->m_nPlugParamValueStep = (float)((int)dwParam-pChn->m_nPlugInitialParamValue)/(float)m_nMusicSpeed; - } - //update param on all ticks - pChn->nCutOff = (BYTE) (pChn->m_nPlugInitialParamValue + (m_nTickCount+1)*pChn->m_nPlugParamValueStep + 0.5); - pChn->nRestoreCutoffOnNewNote = 0; - } - #ifndef NO_FILTER - oldcutoff -= pChn->nCutOff; - if (oldcutoff < 0) oldcutoff = -oldcutoff; - if ((pChn->nVolume > 0) || (oldcutoff < 0x10) - || (!(pChn->dwFlags & CHN_FILTER)) || (!(pChn->nLeftVol|pChn->nRightVol))) - SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); - #endif // NO_FILTER - } break; - - // F0.F0.01.xx: Set Resonance - case 0x01: - if (dwParam < 0x80) - { - // on the fist tick only, calculate step - if (m_dwSongFlags & SONG_FIRSTTICK) - { - pChn->m_nPlugInitialParamValue = pChn->nResonance; - // (dwParam & 0x7F) extracts the actual value that we're going to pass - pChn->m_nPlugParamValueStep = (float)((int)dwParam-pChn->m_nPlugInitialParamValue)/(float)m_nMusicSpeed; - } - //update param on all ticks - pChn->nResonance = (BYTE) (pChn->m_nPlugInitialParamValue + (m_nTickCount+1)*pChn->m_nPlugParamValueStep + 0.5); - pChn->nRestoreResonanceOnNewNote = 0; - #ifndef NO_FILTER - SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); - #endif // NO_FILTER - } - + +#ifndef NO_FILTER + SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); +#endif // NO_FILTER break; - // F0.F0.02.xx: Set filter mode + // F0.F0.02.xx: Set filter mode (high nibble determines filter mode) case 0x02: if (dwParam < 0x20) { - pChn->nFilterMode = (dwParam>>4); - #ifndef NO_FILTER + pChn->nFilterMode = (dwParam >> 4); +#ifndef NO_FILTER SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); - #endif // NO_FILTER +#endif // NO_FILTER } break; // F0.F0.03.xx: Set plug dry/wet case 0x03: { - UINT nPlug = GetBestPlugin(nChn, PRIORITISE_CHANNEL, EVEN_IF_MUTED); - if ((nPlug) && (nPlug <= MAX_MIXPLUGINS)) { - // on the fist tick only, calculate step - if (m_dwSongFlags & SONG_FIRSTTICK) + const UINT nPlug = GetBestPlugin(nChn, PRIORITISE_CHANNEL, EVEN_IF_MUTED); + if ((nPlug) && (nPlug <= MAX_MIXPLUGINS) && dwParam < 0x80) + { + if(!isSmooth) { - pChn->m_nPlugInitialParamValue = m_MixPlugins[nPlug-1].fDryRatio; - // (dwParam & 0x7F) extracts the actual value that we're going to pass - pChn->m_nPlugParamValueStep = ((1-((float)(dwParam)/127.0f))-pChn->m_nPlugInitialParamValue)/(float)m_nMusicSpeed; + m_MixPlugins[nPlug - 1].fDryRatio = 1.0 - (static_cast<float>(dwParam) / 127.0f); + } else + { + // on the first tick only, calculate step + if(m_dwSongFlags & SONG_FIRSTTICK) + { + pChn->m_nPlugInitialParamValue = m_MixPlugins[nPlug - 1].fDryRatio; + // (dwParam & 0x7F) extracts the actual value that we're going to pass + pChn->m_nPlugParamValueStep = ((1 - ((float)(dwParam) / 127.0f)) - pChn->m_nPlugInitialParamValue) / (float)m_nMusicSpeed; + } + //update param on all ticks + m_MixPlugins[nPlug - 1].fDryRatio = pChn->m_nPlugInitialParamValue + (float)(m_nTickCount + 1) * pChn->m_nPlugParamValueStep; } - //update param on all ticks - IMixPlugin *pPlugin = m_MixPlugins[nPlug-1].pMixPlugin; - if ((pPlugin) && (m_MixPlugins[nPlug-1].pMixState)) { - m_MixPlugins[nPlug-1].fDryRatio = pChn->m_nPlugInitialParamValue+(float)(m_nTickCount+1)*pChn->m_nPlugParamValueStep; - } - } } break; - + // F0.F0.{80|n}.xx: Set VST effect parameter n to xx default: - if (nInternalCode & 0x80 || extendedParam) + if (nInternalCode & 0x80 || extendedParam) { UINT nPlug = GetBestPlugin(nChn, PRIORITISE_CHANNEL, EVEN_IF_MUTED); if ((nPlug) && (nPlug <= MAX_MIXPLUGINS)) @@ -3321,24 +3224,31 @@ IMixPlugin *pPlugin = m_MixPlugins[nPlug-1].pMixPlugin; if ((pPlugin) && (m_MixPlugins[nPlug-1].pMixState)) { - // on the fist tick only, calculate step - if (m_dwSongFlags & SONG_FIRSTTICK) + if(!isSmooth) { - pChn->m_nPlugInitialParamValue = pPlugin->GetZxxParameter(extendedParam?(0x80+nInternalCode):(nInternalCode&0x7F)); - // (dwParam & 0x7F) extracts the actual value that we're going to pass - pChn->m_nPlugParamValueStep = ((int)(dwParam & 0x7F)-pChn->m_nPlugInitialParamValue)/(float)m_nMusicSpeed; + pPlugin->SetZxxParameter(extendedParam ? (0x80 + nInternalCode) : (nInternalCode & 0x7F), dwParam & 0x7F); + } else + { + // on the first tick only, calculate step + if(m_dwSongFlags & SONG_FIRSTTICK) + { + pChn->m_nPlugInitialParamValue = pPlugin->GetZxxParameter(extendedParam ? (0x80 + nInternalCode) : (nInternalCode & 0x7F)); + // (dwParam & 0x7F) extracts the actual value that we're going to pass + pChn->m_nPlugParamValueStep = ((int)(dwParam & 0x7F) - pChn->m_nPlugInitialParamValue) / (float)m_nMusicSpeed; + } + //update param on all ticks + pPlugin->SetZxxParameter(extendedParam ? (0x80 + nInternalCode) : (nInternalCode & 0x7F), (UINT) (pChn->m_nPlugInitialParamValue + (m_nTickCount + 1) * pChn->m_nPlugParamValueStep + 0.5)); } - //update param on all ticks - pPlugin->SetZxxParameter(extendedParam?(0x80+nInternalCode):(nInternalCode&0x7F), (UINT) (pChn->m_nPlugInitialParamValue + (m_nTickCount+1)*pChn->m_nPlugParamValueStep + 0.5)); } } + } - } - } // end switch + } // end switch + } // end internal device } -//end rewbs.smoothVST + //rewbs.volOffset: moved offset code to own method as it will be used in several places now void CSoundFile::SampleOffset(UINT nChn, UINT param, bool bPorta) //--------------------------------------------------------------- Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2011-03-23 22:40:37 UTC (rev 827) +++ trunk/OpenMPT/soundlib/Sndfile.h 2011-03-24 20:05:01 UTC (rev 828) @@ -911,8 +911,7 @@ void ExtendedS3MCommands(UINT nChn, UINT param); void ExtendedChannelEffect(MODCHANNEL *, UINT param); inline void InvertLoop(MODCHANNEL* pChn); - void ProcessMidiMacro(UINT nChn, LPCSTR pszMidiMacro, UINT param=0); - void ProcessSmoothMidiMacro(UINT nChn, LPCSTR pszMidiMacro, UINT param=0); //rewbs.smoothVST + void ProcessMidiMacro(UINT nChn, bool isSmooth, LPCSTR pszMidiMacro, UINT param = 0); void SetupChannelFilter(MODCHANNEL *pChn, bool bReset, int flt_modifier = 256) const; // Low-Level effect processing void DoFreqSlide(MODCHANNEL *pChn, LONG nFreqSlide); Modified: trunk/OpenMPT/soundlib/mod_specifications.cpp =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.cpp 2011-03-23 22:40:37 UTC (rev 827) +++ trunk/OpenMPT/soundlib/mod_specifications.cpp 2011-03-24 20:05:01 UTC (rev 828) @@ -38,4 +38,16 @@ return true; } +char CModSpecifications::GetVolEffectLetter(MODCOMMAND::VOLCMD volcmd) const +//-------------------------------------------------------------------------- +{ + if(volcmd >= MAX_VOLCMDS) return '?'; + return volcommands[volcmd]; +} +char CModSpecifications::GetEffectLetter(MODCOMMAND::COMMAND cmd) const +//--------------------------------------------------------------------- +{ + if(cmd >= MAX_EFFECTS) return '?'; + return commands[cmd]; +} Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2011-03-23 22:40:37 UTC (rev 827) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2011-03-24 20:05:01 UTC (rev 828) @@ -14,6 +14,9 @@ bool HasNote(MODCOMMAND::NOTE note) const; bool HasVolCommand(MODCOMMAND::VOLCMD volcmd) const; bool HasCommand(MODCOMMAND::COMMAND cmd) const; + // Return corresponding effect letter for this format + char GetEffectLetter(MODCOMMAND::COMMAND cmd) const; + char GetVolEffectLetter(MODCOMMAND::VOLCMD cmd) const; // NOTE: If changing order, update all initializations below. char fileExtension[6]; // File extension without dot. @@ -64,7 +67,7 @@ -savefile format and GUI methods can handle new values(might not be a small task :). */ "mptm", // File extension - 1, // Minimum note index + NOTE_MIN, // Minimum note index NOTE_MAX, // Maximum note index true, // Has notecut. true, // Has noteoff. @@ -383,7 +386,7 @@ // TODO: Set correct values. "it", // File extension 1, // Minimum note index - NOTE_MAX, // Maximum note index + 120, // Maximum note index true, // Has notecut. true, // Has noteoff. true, // Has notefade. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-03-26 15:16:46
|
Revision: 831 http://modplug.svn.sourceforge.net/modplug/?rev=831&view=rev Author: saga-games Date: 2011-03-26 15:16:39 +0000 (Sat, 26 Mar 2011) Log Message: ----------- [Fix] S3M compatibility: Tempo 32 is not allowed anymore (not supported by ST3), default speed of 255 is also forbidden (not supported by ST3) [Fix] S3M compatibility: Global volume commands > V40 are now ignored. Global volume is processed on tick 1 to emulate ST3's behaviour (far from perfect). [Fix] S3M compatibility: Pattern breaks >= C40 are now ingnored. [Fix] Pattern Editor: Automatically generated selections were not clamped properly to the end of the pattern. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/soundlib/Load_s3m.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/mod_specifications.h Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2011-03-26 13:07:43 UTC (rev 830) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2011-03-26 15:16:39 UTC (rev 831) @@ -92,16 +92,17 @@ // -> CODE#0016 // -> DESC="default tempo update" // m_SpinTempo.SetRange(32, 255); // 255 bpm max - // S3M HACK + if(m_pSndFile->GetType() & MOD_TYPE_S3M) { - m_SpinTempo.SetRange(33, 255); - m_SpinSpeed.SetRange(1, 255); + // S3M HACK: ST3 will ignore speed 255, even though it can be used with Axx. + m_SpinSpeed.SetRange(1, 254); } else { - m_SpinTempo.SetRange((short)specs.tempoMin, (short)specs.tempoMax); m_SpinSpeed.SetRange((short)specs.speedMin, (short)specs.speedMax); } + m_SpinTempo.SetRange((short)specs.tempoMin, (short)specs.tempoMax); + // -! BEHAVIOUR_CHANGE#0016 m_SpinGlobalVol.SetRange(0, 128); m_SpinSamplePA.SetRange(0, 2000); Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-03-26 13:07:43 UTC (rev 830) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-03-26 15:16:39 UTC (rev 831) @@ -1318,9 +1318,9 @@ if (pSndFile) { y1 = max(y1, 0); - y2 = min(y2, (int)pSndFile->Patterns[m_nPattern].GetNumRows()); + y2 = min(y2, (int)pSndFile->Patterns[m_nPattern].GetNumRows() - 1); x1 = max(x1, 0); - x2 = min(x2, pSndFile->GetNumChannels() * 8 - 4); + x2 = min(x2, pSndFile->GetNumChannels() * 8 - (8 - LAST_COLUMN)); } } // end rewbs.fix3417 Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_s3m.cpp 2011-03-26 13:07:43 UTC (rev 830) +++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2011-03-26 15:16:39 UTC (rev 831) @@ -598,8 +598,8 @@ header[0x2E] = 'R'; header[0x2F] = 'M'; header[0x30] = m_nDefaultGlobalVolume >> 2; - header[0x31] = CLAMP(m_nDefaultSpeed, 1, 255); - header[0x32] = CLAMP(m_nDefaultTempo, 32, 255); + header[0x31] = CLAMP(m_nDefaultSpeed, 1, 254); + header[0x32] = CLAMP(m_nDefaultTempo, 33, 255); header[0x33] = CLAMP(m_nSamplePreAmp, 0x10, 0x7F) | 0x80; // Bit 8 = Stereo header[0x34] = 0x08; // 8 Channels for UltraClick removal (default) header[0x35] = 0xFC; // Write pan positions Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-26 13:07:43 UTC (rev 830) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-26 15:16:39 UTC (rev 831) @@ -227,6 +227,11 @@ break; // Pattern Break case CMD_PATTERNBREAK: + if(param >= 64 && (GetType() & MOD_TYPE_S3M)) + { + // ST3 ignores invalid pattern breaks. + break; + } patternBreakOnThisRow = true; //Try to check next row for XPARAM nextRow = nullptr; @@ -338,10 +343,16 @@ break; // Global Volume case CMD_GLOBALVOLUME: + // ST3 applies global volume on tick 1 and does other weird things, but we just emulate this part for now. + if((GetType() & MOD_TYPE_S3M) && nMusicSpeed <= 1) + { + break; + } + if (!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT))) param <<= 1; - if(IsCompatibleMode(TRK_IMPULSETRACKER | TRK_FASTTRACKER2)) + if(IsCompatibleMode(TRK_IMPULSETRACKER | TRK_FASTTRACKER2 | TRK_SCREAMTRACKER)) { - //IT compatibility 16. Both FT2 and IT ignore out-of-range values + //IT compatibility 16. FT2, ST3 and IT ignore out-of-range values if (param <= 128) nGlbVol = param << 1; } @@ -1869,11 +1880,16 @@ // Set Global Volume case CMD_GLOBALVOLUME: - if (!(m_dwSongFlags & SONG_FIRSTTICK)) break; + // ST3 applies global volume on tick 1 and does other weird things, but we just emulate this part for now. + if(((GetType() & MOD_TYPE_S3M) && m_nTickCount != 1) + || (!(GetType() & MOD_TYPE_S3M) && !(m_dwSongFlags & SONG_FIRSTTICK))) + { + break; + } - if (!(m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT))) param <<= 1; - //IT compatibility 16. Both FT2 and IT ignore out-of-range values - if(IsCompatibleMode(TRK_IMPULSETRACKER | TRK_FASTTRACKER2)) + if (!(GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT))) param <<= 1; + //IT compatibility 16. FT2, ST3 and IT ignore out-of-range values + if(IsCompatibleMode(TRK_IMPULSETRACKER | TRK_FASTTRACKER2 | TRK_SCREAMTRACKER)) { if (param <= 128) m_nGlobalVolume = param << 1; @@ -2056,6 +2072,11 @@ // Pattern Break case CMD_PATTERNBREAK: + if(param >= 64 && (GetType() & MOD_TYPE_S3M)) + { + // ST3 ignores invalid pattern breaks. + break; + } m_nNextPatStartRow = 0; // FT2 E60 bug m = NULL; if (m_nRow < Patterns[m_nPattern].GetNumRows()-1) @@ -3021,7 +3042,7 @@ //------------------------------------------------------------------------------------------ { MODCHANNEL *pChn = &Chn[nChn]; - DWORD dwMacro = (*((DWORD *)pszMidiMacro)) & MACRO_MASK; + DWORD dwMacro = LittleEndian(*((DWORD *)pszMidiMacro)) & MACRO_MASK; int nInternalCode; // Not Internal Device ? @@ -3775,57 +3796,6 @@ } -// This is how backward jumps should not be tested. :) (now unused) -BOOL CSoundFile::IsValidBackwardJump(UINT nStartOrder, UINT nStartRow, UINT nJumpOrder, UINT nJumpRow) const -//---------------------------------------------------------------------------------------------------------- -{ - while ((nJumpOrder < Patterns.Size()) && (Order[nJumpOrder] == Order.GetIgnoreIndex())) nJumpOrder++; - if ((nStartOrder >= Patterns.Size()) || (nJumpOrder >= Patterns.Size())) return FALSE; - // Treat only case with jumps in the same pattern - if (nJumpOrder > nStartOrder) return TRUE; - - if ((nJumpOrder < nStartOrder) || (nJumpRow >= Patterns[nStartOrder].GetNumRows()) - || (!(Patterns[nStartOrder])) || (nStartRow >= MAX_PATTERN_ROWS) || (nJumpRow >= MAX_PATTERN_ROWS)) return FALSE; - - // See if the pattern is being played backward - BYTE row_hist[MAX_PATTERN_ROWS]; - - memset(row_hist, 0, sizeof(row_hist)); - UINT nRows = Patterns[nStartOrder].GetNumRows(), row = nJumpRow; - - if (nRows > MAX_PATTERN_ROWS) nRows = MAX_PATTERN_ROWS; - row_hist[nStartRow] = TRUE; - while ((row < MAX_PATTERN_ROWS) && (!row_hist[row])) - { - if (row >= nRows) return TRUE; - row_hist[row] = TRUE; - const MODCOMMAND* p = Patterns[nStartOrder].GetpModCommand(row, m_nChannels); - row++; - int breakrow = -1, posjump = 0; - for (UINT i=0; i<m_nChannels; i++, p++) - { - if (p->command == CMD_POSITIONJUMP) - { - if (p->param < nStartOrder) return FALSE; - if (p->param > nStartOrder) return TRUE; - posjump = TRUE; - } else - if (p->command == CMD_PATTERNBREAK) - { - breakrow = p->param; - } - } - if (breakrow >= 0) - { - if (!posjump) return TRUE; - row = breakrow; - } - if (row >= nRows) return TRUE; - } - return FALSE; -} - - ////////////////////////////////////////////////////// // Note/Period/Frequency functions Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2011-03-26 13:07:43 UTC (rev 830) +++ trunk/OpenMPT/soundlib/Sndfile.h 2011-03-26 15:16:39 UTC (rev 831) @@ -917,7 +917,6 @@ void DoFreqSlide(MODCHANNEL *pChn, LONG nFreqSlide); void GlobalVolSlide(UINT param, UINT * nOldGlobalVolSlide); DWORD IsSongFinished(UINT nOrder, UINT nRow) const; - BOOL IsValidBackwardJump(UINT nStartOrder, UINT nStartRow, UINT nJumpOrder, UINT nJumpRow) const; void UpdateTimeSignature(); UINT GetNumTicksOnCurrentRow() { return m_nMusicSpeed * (m_nPatternDelay + 1) + m_nFrameDelay; }; Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2011-03-26 13:07:43 UTC (rev 830) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2011-03-26 15:16:39 UTC (rev 831) @@ -276,7 +276,7 @@ 255, // Order max. 1, // Channel min 32, // Channel max - 32, // Min tempo + 33, // Min tempo 255, // Max tempo 64, // Min pattern rows 64, // Max pattern rows @@ -316,7 +316,7 @@ 255, // Order max. 1, // Channel min 32, // Channel max - 32, // Min tempo + 33, // Min tempo 255, // Max tempo 64, // Min pattern rows 64, // Max pattern rows This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |