From: <sag...@us...> - 2011-05-15 20:29:22
|
Revision: 874 http://modplug.svn.sourceforge.net/modplug/?rev=874&view=rev Author: saga-games Date: 2011-05-15 20:29:13 +0000 (Sun, 15 May 2011) Log Message: ----------- [Fix] Added a fix for the recent VS2008 security update bloatage... [Fix] Hopefully this fixes the line endings in History.txt... [Mod] Installer: Added option to view release notes after installation. [Ref] Minor refactoring in view_pat.cpp Modified Paths: -------------- trunk/OpenMPT/installer/install.iss trunk/OpenMPT/mptrack/STDAFX.CPP trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/packageTemplate/History.txt Modified: trunk/OpenMPT/installer/install.iss =================================================================== --- trunk/OpenMPT/installer/install.iss 2011-05-15 20:26:20 UTC (rev 873) +++ trunk/OpenMPT/installer/install.iss 2011-05-15 20:29:13 UTC (rev 874) @@ -115,8 +115,9 @@ [Run] ; duh +Filename: "https://sourceforge.net/projects/kernelex/"; Description: "Download KernelEx (required on Windows 98 / Me)"; Flags: shellexec nowait postinstall skipifsilent; Check: not UsingWinNT(); +Filename: "{app}\OMPT_{#GetAppVersionShort}_ReleaseNotes.html"; Description: "View Release Notes"; Flags: shellexec nowait postinstall skipifsilent Filename: {app}\mptrack.exe; Parameters: """{app}\ExampleSongs\manwe - evening glow.it"""; Description: {cm:LaunchProgram,OpenMPT}; Flags: nowait postinstall skipifsilent -Filename: "https://sourceforge.net/projects/kernelex/"; Description: "Download KernelEx (required on Windows 98 / Me)"; Flags: shellexec nowait postinstall skipifsilent; Check: not UsingWinNT(); [UninstallDelete] ; internet shortcut has to be deleted manually Modified: trunk/OpenMPT/mptrack/STDAFX.CPP =================================================================== --- trunk/OpenMPT/mptrack/STDAFX.CPP 2011-05-15 20:26:20 UTC (rev 873) +++ trunk/OpenMPT/mptrack/STDAFX.CPP 2011-05-15 20:29:13 UTC (rev 874) @@ -4,3 +4,29 @@ #include "stdafx.h" +// Fix for VS2008 SP1 bloatage (http://tedwvc.wordpress.com/2011/04/16/static-mfc-code-bloat-problem-from-vc2010-is-now-in-vc2008-sp1security-fix/): + +// this is our own local copy of the AfxLoadSystemLibraryUsingFullPath function +HMODULE AfxLoadSystemLibraryUsingFullPath(const WCHAR *pszLibrary) +{ + WCHAR wszLoadPath[MAX_PATH+1]; + if (::GetSystemDirectoryW(wszLoadPath, _countof(wszLoadPath)) == 0) + { + return NULL; + } + + if (wszLoadPath[wcslen(wszLoadPath)-1] != L'\\') + { + if (wcscat_s(wszLoadPath, _countof(wszLoadPath), L"\\") != 0) + { + return NULL; + } + } + + if (wcscat_s(wszLoadPath, _countof(wszLoadPath), pszLibrary) != 0) + { + return NULL; + } + + return(::AfxCtxLoadLibraryW(wszLoadPath)); +} Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2011-05-15 20:26:20 UTC (rev 873) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-05-15 20:29:13 UTC (rev 874) @@ -5070,17 +5070,21 @@ UINT startRow = GetSelectionStartRow(); UINT endRow = GetSelectionEndRow(); - if (ListChansWhereColSelected(NOTE_COLUMN, validChans)>0) { - for (int valChnIdx=0; valChnIdx<validChans.GetCount(); valChnIdx++) { + if (ListChansWhereColSelected(NOTE_COLUMN, validChans) > 0) + { + for (int valChnIdx=0; valChnIdx<validChans.GetCount(); valChnIdx++) + { if (IsInterpolationPossible(startRow, endRow, - validChans[valChnIdx], NOTE_COLUMN, pSndFile)) { + validChans[valChnIdx], NOTE_COLUMN, pSndFile)) + { greyed=0; //Can do interpolation. break; } } } - if (!greyed || !(CMainFrame::m_dwPatternSetup&PATTERN_OLDCTXMENUSTYLE)) { + if (!greyed || !(CMainFrame::m_dwPatternSetup&PATTERN_OLDCTXMENUSTYLE)) + { AppendMenu(hMenu, MF_STRING|greyed, ID_PATTERN_INTERPOLATE_NOTE, "Interpolate Note\t" + ih->GetKeyTextFromCommand(kcPatternInterpolateNote)); return true; } @@ -5096,16 +5100,20 @@ UINT startRow = GetSelectionStartRow(); UINT endRow = GetSelectionEndRow(); - if (ListChansWhereColSelected(VOL_COLUMN, validChans)>0) { - for (int valChnIdx=0; valChnIdx<validChans.GetCount(); valChnIdx++) { + if (ListChansWhereColSelected(VOL_COLUMN, validChans) > 0) + { + for (int valChnIdx=0; valChnIdx<validChans.GetCount(); valChnIdx++) + { if (IsInterpolationPossible(startRow, endRow, - validChans[valChnIdx], VOL_COLUMN, pSndFile)) { - greyed=0; //Can do interpolation. + validChans[valChnIdx], VOL_COLUMN, pSndFile)) + { + greyed = 0; //Can do interpolation. break; } } } - if (!greyed || !(CMainFrame::m_dwPatternSetup&PATTERN_OLDCTXMENUSTYLE)) { + if (!greyed || !(CMainFrame::m_dwPatternSetup&PATTERN_OLDCTXMENUSTYLE)) + { AppendMenu(hMenu, MF_STRING|greyed, ID_PATTERN_INTERPOLATE_VOLUME, "Interpolate Vol Col\t" + ih->GetKeyTextFromCommand(kcPatternInterpolateVol)); return true; } @@ -5122,26 +5130,33 @@ UINT startRow = GetSelectionStartRow(); UINT endRow = GetSelectionEndRow(); - if (ListChansWhereColSelected(EFFECT_COLUMN, validChans)>0) { - for (int valChnIdx=0; valChnIdx<validChans.GetCount(); valChnIdx++) { - if (IsInterpolationPossible(startRow, endRow, validChans[valChnIdx], EFFECT_COLUMN, pSndFile)) { + if (ListChansWhereColSelected(EFFECT_COLUMN, validChans) > 0) + { + for (int valChnIdx=0; valChnIdx<validChans.GetCount(); valChnIdx++) + { + if (IsInterpolationPossible(startRow, endRow, validChans[valChnIdx], EFFECT_COLUMN, pSndFile)) + { greyed=0; //Can do interpolation. break; } } } - if (ListChansWhereColSelected(PARAM_COLUMN, validChans)>0) { - for (int valChnIdx=0; valChnIdx<validChans.GetCount(); valChnIdx++) { - if (IsInterpolationPossible(startRow, endRow, validChans[valChnIdx], EFFECT_COLUMN, pSndFile)) { - greyed=0; //Can do interpolation. + if (ListChansWhereColSelected(PARAM_COLUMN, validChans) > 0) + { + for (int valChnIdx=0; valChnIdx<validChans.GetCount(); valChnIdx++) + { + if (IsInterpolationPossible(startRow, endRow, validChans[valChnIdx], EFFECT_COLUMN, pSndFile)) + { + greyed = 0; //Can do interpolation. break; } } } - if (!greyed || !(CMainFrame::m_dwPatternSetup&PATTERN_OLDCTXMENUSTYLE)) { + if (!greyed || !(CMainFrame::m_dwPatternSetup&PATTERN_OLDCTXMENUSTYLE)) + { AppendMenu(hMenu, MF_STRING|greyed, ID_PATTERN_INTERPOLATE_EFFECT, "Interpolate Effect\t" + ih->GetKeyTextFromCommand(kcPatternInterpolateEffect)); return true; } @@ -5161,10 +5176,10 @@ AppendMenu(pasteSpecialMenu, MF_STRING, ID_EDIT_PASTEFLOOD, "Paste Flood\t" + ih->GetKeyTextFromCommand(kcEditPasteFlood)); AppendMenu(pasteSpecialMenu, MF_STRING, ID_EDIT_PUSHFORWARDPASTE, "Push Forward Paste (Insert)\t" + ih->GetKeyTextFromCommand(kcEditPushForwardPaste)); - DWORD greyed = pModDoc->GetPatternUndo()->CanUndo()?FALSE:MF_GRAYED; + DWORD greyed = pModDoc->GetPatternUndo()->CanUndo() ? MF_ENABLED : MF_GRAYED; if (!greyed || !(CMainFrame::m_dwPatternSetup & PATTERN_OLDCTXMENUSTYLE)) { - AppendMenu(hMenu, MF_STRING|greyed, ID_EDIT_UNDO, "Undo\t" + ih->GetKeyTextFromCommand(kcEditUndo)); + AppendMenu(hMenu, MF_STRING | greyed, ID_EDIT_UNDO, "Undo\t" + ih->GetKeyTextFromCommand(kcEditUndo)); } AppendMenu(hMenu, MF_STRING, ID_CLEAR_SELECTION, "Clear selection\t" + ih->GetKeyTextFromCommand(kcSampleDelete)); Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2011-05-15 20:26:20 UTC (rev 873) +++ trunk/OpenMPT/packageTemplate/History.txt 2011-05-15 20:29:13 UTC (rev 874) @@ -1,1983 +1,1983 @@ -OpenMPT - Full Version History ------------------------------- - -[Fix]: bug fix -[New]: new feature -[Imp]: improvement -[Reg]: known issue / regression -[Mod]: change -[Var]: other -(tx XYZ): thanks to XYZ for telling us about the bug / requesting the feature - - -v1.19.02.00 (May 2011, revision 871) ------------------------------------- -Pattern tab - [New] <Jojo> Channels can now be moved by dragging their channel header. Holding Shift while doing so duplicates the channel. - [Imp] <Jojo> Moving channels through the channel manager creates an undo point now. - [Fix] <Jojo> Order list info text now truncates list length after the first "---" pattern for MOD files in hex display mode as well. - -Pattern tab::Note properties - [Fix] <Jojo> Axx is not limited to value 7F anymore in IT / S3M format. - -VST - [New] <Jojo> New menu entry in the plugin editor: Create instrument from plugin - [Fix] <Jojo> Fixed note handling in VST editor of plugins that actually don't support MIDI input (http://bugs.openmpt.org/view.php?id=102) - -Mod Conversion - [Imp] <Jojo> Improved conversion of Sxx (IT / S3M) and PC Notes. - [Mod] <Jojo> When converting from MOD / S3M to XM / IT, compatible play is automatically enabled. - [Fix] <Jojo> Sustain loop conversion didn't work - -Playback - [Fix] <Jojo> The first triggered note in the pattern / sample / instrument editor is not cut off anymore (tx C-jeff, http://bugs.openmpt.org/view.php?id=123) - -IT - [Imp] <Jojo> When clearing MIDI macros during loading, only the Zxx macros are cleared, but not the global (currently unused) configuration. - [Fix] <Jojo> Panning slides with both parameter nibbles set were not ignored in compatible mode. - -XM - [Fix] <Jojo> When using compatibility export, the number of samples per instrument is now limited to 16. - -MOD - [Imp] <Jojo> Instead of cutting the order list after the first --- pattern, such order items are simply removed from the saved order list. (http://bugs.openmpt.org/view.php?id=118) - [Fix] <Jojo> "+++" separator patterns were allowed in MOD files, which made them break in other trackers / players. (http://bugs.openmpt.org/view.php?id=118) - -S3M - [Imp] <Jojo> When clearing MIDI macros during loading, only the Zxx macros are cleared, but not the global (currently unused) configuration. - -Other formats - [Imp] <Jojo> DMF Loader was rewritten completely and is a whole lot more accurate now. - [Fix] <Jojo> J2B Loader: Empty sample slots are now treated correct in new (RIFF AM) J2B files. - [Fix] <Jojo> DBM Loader: Global volume was scaled wrong. - [Fix] <Jojo> 8SVX Loader: If no sample could be found in the file, the loader does not claim to have successfully loaded a sample anymore. (http://bugs.openmpt.org/view.php?id=117) - -Misc - [New] <Jojo> OpenMPT can now automatically check for updates (daily / weekly / monthly) - [Mod] <Jojo> "Embed MIDI macros" is now only enabled during song creation if the user's default MIDI macro setup differs from standard configuration. - [Fix] <Jojo> When using "Convert instruments to samples" in the Song Cleanup dialog, "Remove samples associated with an instrument" actually destroyed all samples. - [Reg] <Jojo> Removed hidden INI flag to suppress warnings when encountering keymaps with unknown items. This option was introduced when faulty keymaps threw multiple message boxes, but now it's just one and it shouldn't be ignored... - - -v1.19.01.00 (April 2011, revision 836) --------------------------------------- -Pattern tab - [New] <Jojo> Clicking and dragging the row numbers selects the whole row in Excel / Calc style (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. - [Mod] <Jojo> Using the Goto Dialog updates channel parameters and sets the elapsed time now. (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. (http://bugs.openmpt.org/view.php?id=89) - [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 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 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. - [Fix] <Jojo> Selections were not clamped properly to the end of the pattern sometimes. - [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 - [Fix] <Jojo> The meaning of Q0x was displayed wrong for IT / S3M. - [Fix] <Jojo> Changing a value didn't create an undo point. (http://bugs.openmpt.org/view.php?id=56) - [Fix] <Jojo> Setting the PC note plugin didn't work. - -Pattern tab::Find/replace - [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. - -Pattern tab::GUI - [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. (http://bugs.openmpt.org/view.php?id=92) - [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> 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] <Jojo> Loop point controls also accept large numbers to be inputted manually. - [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 - [New] <Jojo> Clicking on an empty plugin slot in the plugin dropdown list opens the "Add Plugin" dialog (tx coda) - [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> Fadeout control also accepts large numbers to be inputted manually. (http://bugs.openmpt.org/view.php?id=81) - [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). - -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) - [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. - [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. (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 (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 - [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. 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] <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. - [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. - [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. - -IT::Loading and Saving - [Imp] <Jojo> Autovibrato sweep is now fixed when loading IT files made with old versions of (Open)MPT. - [Mod] <Jojo> 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> Note mapping items that aren't notes (f.e. empty notes) are now ignored when loading and saving. - [Fix] <Jojo> When saving, non-existing envelopes are now replaced by a default (disabled) envelope, so that they can still be edited in Impulse Tracker. - -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. (http://forum.openmpt.org/index.php?topic=4022.0) - [New] <Jojo> Edit history information (read the "IT" section above for an explanation) - -XM - [Fix] <Jojo> Various mind-boggling combinations of EDx, notes and instrument numbers should work correctly in compatible mode now. - [Fix] <Jojo> When there's a instrument number next to a 3xx effect which differs from the previous instrument number, it resets the instrument properties of the previous instrument in compatible mode. - [Fix] <Jojo> Portamento combined with an Offset command results in the offset command being ignored in compatible mode. - [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 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 - [New] <Jojo> Heuristic detection for VBlank MODs. Most MODs use the CIA timer instead of VBlank timing, but some don't. - [New] <Jojo> Heuristic detection for PT 1.x playback mode: If there is pattern data that looks like it needs on-the-fly sample swapping, PT 1.x mode is enabled. - [New] <Jojo> Heuristic detection for MODs with 7-bit panning, which is then automatically converted to 8-bit panning. - [Fix] <Jojo> Tentative fix for MODs with short loops at the sample start that were most likely not intended. - -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 33 - 255) - anything out of this range is ignored by Scream Tracker, so it is now also ignored by OpenMPT. - [Fix] <Jojo> Pattern breaks >= C40 are now ignored. - [Fix] <Jojo> Global volume commands > V40 are now ignored. - -Other formats - [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. - [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 - [New] <Jojo> WAV Export: Sample-exact cue points are now written at each pattern transition. - [New] <Jojo> Most MPT hacks in modules can now be found through View -> Find MPT Hacks in Song. - [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> 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. - [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. - [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> "No extra-loud samples" is now enabled by default (as it's more suitable for mixmodes RC3 and Original) - [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. - [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. - [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. - - -v1.18.03.00 (August 2010, revision 673) ---------------------------------------- -General tab - [Imp] <Jojo> To prevent OpenMPT from hanging while switching between plugins (or switching to the general tab), the preset box is only filled when it gets the focus. This makes working with Synth1 a lot easier, since it has an insane amount of presets... :) - [Mod] <Jojo> Changed tab order of the lower panel (now it's more logical to me) - -Sequence editor - [Imp] <Jojo> When inserting patterns at an empty position, the position counter is not increased anymore. - [Imp] <Jojo> Improved sequence name display in context menu for empty sequences. - -Pattern tab::pattern editing - [Imp] <Jojo> Just like in MPT 1.16, it is now possible again to interpolate between an effect and "nothing". In that case, the same value as the already existing one is repeated between the two rows. - [Fix] <Jojo> When the first column of a pattern selection (larger than one selection field) was the parameter column, PC Note values in this column were not reset properly. - [Fix] <Jojo> Pattern Editor: Transposing notes up/down doesn't allow notes which are actually supported by the current module format (f.e. notes below C-1 in XMs) anymore. - [Fix] <Jojo> Keyboard shortcut for toggling record state didn't save the change, so it was reset with every new module. - -Pattern tab::Note properties - [Imp] <Jojo> Effect info now shows the real finetune values for E5x in MOD/XM and E2x in S3M instead of just 0...15. - [Imp] <Jojo> Set envelope position effect (Lxx in XM) is now explained better. - [Fix] <Jojo> Fixed a null pointer related crash when accessing the note properties of malicious and not-so-malicious modules (f.e. jt_pools.xm) which have more than 256 sample slots. - -Sample tab - [New] <Jojo> It's now also possible to create sample selections using Shift + click (this is still behaving a bit non-obvious if you don't know what you're doing :). - [New] <Jojo> Sample Drawing: Horizontal lines can now be drawn by holding down the shift key. - [Imp] <Jojo> Finetune range is now limited from -8 to 7 for MOD files. - [Imp] <Jojo> When hovering the relative note and finetune controls, the actual C-5 frequency is now also shown for MOD files. Previously, this only worked for XM files. - [Fix] <Jojo> When using the spin button next to the finetune or frequency control, the module was not marked as modified. - -Instrument tab - [New] <Jojo> Pressing Ctrl while dragging a point in the envelope editor now also moves the tail of the envelope. - [Imp] <Jojo> More helpful value display for the panning envelope in the status bar with indication what's left and what's right. - [Imp] <Jojo> If an instrument is not initialized yet, this is done automatically now, so that changes done to the instrument are not lost, although it looks like they are actually applied (f.e. when trying to edit a previously deleted instrument). - [Imp] <Jojo> Fadeout values up to 32767 are allowed again for XM files, as FT2 can actually handle them (and other apps like Milky support them as well) - [Imp] <Jojo> Panning ranges from 0 to 256 again for MPTM, and from 0 to 64 for IT files (previously, it ranged from 0 to 255). - [Imp] <Jojo> Sample Map accepts various new shortcuts now. - [Imp] <Jojo> When pasting an envelope with a release node, it's now ignored in formats that don't support it. - [Reg] <Jojo> Envelope release nodes cannot be enabled for IT files anymore, but they are still played for compatibility. (One has to start removing the crap from the old formats at some point...) - -Treeview - [Imp] <Jojo> Treeview: Ask for confirmation when deleting patterns, samples, instruments, sequences. - [Fix] <Jojo> Deleting a sample from the treeview and then applying undo for this sample in the sample editor crashed OpenMPT. - -Mod conversion - [Imp] <Jojo> Some improvements with converting note cuts, ECx/SCx and EDx/SDx. - [Imp] <Jojo> When converting to XM, rogue note delays are removed from the patterns to avoid interference with a FT2 bug. - [Imp] <Jojo> Envelope release nodes are now removed when converting from MPTM. - [Fix] <Jojo> When converting to MPTM, "+++" separator patterns are not recognized as sub tune indicators anymore, as that was quite annoying. - [Fix] <Jojo> Channel settings were not reset properly for MOD/XM/S3M, only the first channel was fixed. (tx Sam_Zen) - [Fix] <Jojo> Extra fine portamento was not converted properly when converting from IT/MPTM/S3M to XM. - -Playback (see also format-specific changes below) - [Mod] <Jojo> Invert loop (.MOD effect) is now ignored on 16-bit samples (only important during editing, since .MODs can only contain 8-bit samples anyway) - [Fix] <Jojo> The Pattern Loop command did not work properly on rows > 255 - -IT::Saving - [Imp] <Jojo> If a plugin is specified for an IT instrument and no MIDI channel is assigned, the plugin is written into the IT instrument header (in MPT 1.16's old manner), so that MPT 1.16 / XMPlay / BASS can make us of "FX Send" again. (tx Skaven) - [Imp] <Jojo> If filter envelopes are used, a different value for the cmwt ("compatible with") field is now used in compatibility export (like in SchismTracker). - [Fix] <Jojo> Instrument panning was not converted properly. - -XM - [Fix] <Jojo> Various fixes to the pattern loop command (E6x), including a crucial FT2 bug: When E60 is used on a pattern row x, the following pattern also starts from row x instead of the beginning of the pattern, unless there was a Dxx or Cxx effect. - [Fix] <Jojo> Prevent notes to be stopped after a fadeout. This way, a portamento effect can pick up a faded instrument which is long enough. This occours for example in the bassline (channel 11) of jt_burn.xm. Not tested with many XMs yet, I hope this won't break anything else... - -XM::Saving - [Imp] <Jojo> Panbrello is not saved anymore in compatibility mode. - [Fix] <Jojo> Completely empty patterns are loaded as empty 64-row patterns in FT2, regardless of their original size. This is now being circumvented by adding a D00 effect at the end of such patterns. - [Fix] <Jojo> Saving XM files with 127 channels (sigh) was broken. - -S3M - [Fix] <Jojo> Samples with very short loops (4 bytes) are now loaded properly. Fixes "a tiny problem.s3m" by \slash. - [Fix] <Jojo> Notes with an SD0 effect were not ignored properly when there was a row delay effect on the same row. Now they should be ignored in any case. - -Other formats - [Imp] <Jojo> Song messages are now loaded with more accuracy for some formats. - [Imp] <Jojo> J2B Loader: Files with extended instrument settings and multiple samples per instrument work properly now. Such J2B files were not used in the game but have been created by JJ2 players using MOD2J2B. - [Imp] <Jojo> OKT Loader: Completely new IFF-based loader, translated from SchismTracker code with permission from Storlek. This loader is a *lot* more accurate, but still misses a few pattern effects. - [Imp] <Jojo> PSM Loader: Small improvements. - [Fix] <Jojo> MTM Loader: The "beats per track" (means lines per pattern) setting is now taken into account. - [Fix] <Jojo> PSM16 Loader: Since the control channels were muted, tempo commands were ignored, effectively slowing down some PSM16 tracks. - [Fix] <re> MPTM Saver: When deleting patterns using the treeview, it was possible that Parameter Control Notes were not saved properly anymore. - -Misc - [New] <Jojo> Experimental "panic" button on the main toolbar. At the moment, it just kills all VSTi and sample voices. - [Imp] <Jojo> Added mnemonic codes to the wave export controls. - [Mod] <Jojo> In the mod type dialog, the "misc flags" can now be toggled using check buttons instead of an edit field. - [Mod] <Jojo> Various file loaders / savers: A new logging mechanism is used to display only one message box with errors and warnings instead of many message boxes. - [Mod] <Jojo> Updated DE_jojo.mkb to include new shortcuts, remapped a few others (for IT-style). - [Mod] <Jojo> Updated FR_mpt_(legovitch).mkb and NO_mpt_classic_(rakib).mkb (tx Paul Legovitch, Rakib). - [Fix] <Jojo> Colour Setup: Some colours in the MPT default colour scheme were not set up properly when switching between presets. - - -v1.18.02.00 (May 2010, revision 610) ------------------------------------- -General tab - [Imp] <Jojo> Disabled tempo slider for MOD files (it was just confusing) - [Imp] <Jojo> Disabled global volume slider for MOD files, instead enabled the sample pre-amp slider (so it is also possible to make output louder) - [Imp] <Jojo> The "output to" dropdown list also shows the actual plugin name now (instead of just the library name). - [Fix] <Jojo> Moving a plugin in MOD/S3M files doesn't mark them as modified anymore. The channel fx dropdown lists are now also disabled for those module types. - [Fix] <Jojo> The restart position edit control is disabled for S3M files. - [Fix] <coda> The background colour of the tabs in the channel configuration is now also correct when using WinXP Luna or Vista/Win7 Aero. - -Sequence editor - [New] <Jojo> "Select All" shortcut also works here now. - [Imp] <Jojo> The sequence menu also allows to insert empty sequences now. - [Fix] <Jojo> Jumping between patterns also stops VSTi notes now. - -Pattern tab::pattern editing - [New] <Jojo> Extended context menu for PC Notes - [New] <Jojo> Key shortcut + context menu entry for toggling the plugin editor of the PC Note that's under the cursor. - [Imp] <Jojo> Overflow paste now only uses one undo step. - [Imp] <Jojo> Instead of simply ignoring note off/cut/fade when working with .MOD files, it is converted to C00. - [Fix] <rewbs> Effect visualizer is now aware of PC Notes (http://forum.openmpt.org/index.php?topic=3836.0). - [Fix] <Jojo> When using MIDI record or split keyboard settings, volume data was written into the volume column in MOD format. - [Fix] <Jojo> When converting PC Notes to MIDI Macros, the instrument index is now also cleaned as well. Noticeable for example when pasting PC Notes into an IT module. - [Fix] <Jojo> Now, plugin slot 100 can also be automated using PC Notes. - [Fix] <Jojo> When pasting pattern data that exactly reached the pattern end with overflow paste enabled, a redundant undo point was created. - [Fix] <Jojo> Entered (volume) effects are now properly validated (makes a difference f.e. in MOD format where it was previously possible to enter effects like Hxx) - [Fix] <Jojo> Mix Paste: When in MPT behaviour mode, empty FX commands were not overwritten properly when there previously was an effect in that field but only the effect number (and not the param value) was reset. - [Fix] <Jojo> When deleting all patterns via the treeview and then switching to the pattern editor, pattern 0 is not created automatically anymore, to avoid confusion. - [Reg] <Jojo> Creating a selection using the Shift key + Mouse click now only works if there was previously no selection made; This seems reasonable as the old shift - behaviour seems to be widely used. - -Pattern tab::GUI - [New] <Jojo> When the PT1x mode or the S3M "Amiga" flag are enabled, dodgy notes (i.e lower than C-4 or higher than B-6) are marked red. - [Imp] <Jojo> The status bar shows plugin and parameter names for PC Notes now as well. - [Imp] <Jojo> Effect vis: Make use of song's own row highlighting variables instead of fixed global ones. - [Fix] <Jojo> The status bar ("Position x of y") only the showed order length for the first sub tune if sub tunes were separated by an "---" order item. - [Fix] <Jojo> Changing a channel plugin in MOD/S3M files doesn't mark them as modified anymore. - [Fix] <Jojo> When working with multiple sequences, switching to the pattern editor for the first time automatically marked the document as modified. - -Pattern tab::Note properties - [Imp] <Jojo> Don't allow values > 63 for "break to row" commands in MOD/S3M. - [Imp] <Jojo> Since the behaviour of sliding commands with both nibbles set varies from tracker to tracker, "undefined" is always shown in the note properties in such cases. - [Fix] <Jojo> In the note properties, the Gxx effect for XM files was not limited properly. - [Fix] <Jojo> In Note Properties, the waveform display for S[345]x (and equivalent MOD/XM effects) was not always fully visible ("continue" addition was cut off) - [Fix] <Jojo> Display "fine" / "extra fine" portamento effects properly (S3M/IT/MPTM), display SFx macro properly, display MOD effects with no memory properly. - -Pattern tab::Find/replace - [Fix] <Jojo> Find/Replace didn't work properly when replacing PC Notes with something that's not a PC Note. - [Fix] <Jojo> Instead of turning "Follow Song" off, the Find/Replace dialog toggled it. - -Sample tab - [New] <Jojo> Shift+New = Clone sample slot - [New] <Jojo> Option to not ask for RAW import settings again (settings are remembered independently for all modules) - [Imp] <Jojo> Remember previous settings in RAW import dialog - [Imp] <Jojo> When enabling (sustain) loop and no loop points are set yet, the loop is now set automatically to full sample length or the currently selected part of the sample. - [Imp] <Jojo> Sample name and filename length are now properly limited. - [Fix] <Jojo> When applying time stretch / pitch shift to an 8-bit sample and selecting the sample partly lead to partial upsampling, instead of upsampling the whole sample. - [Fix] <Jojo> Sample Undo: If no custom value was set, the default value was set ridiculously high (tx Paul Legovitch) - [Fix] <Jojo> Sample Undo: Fixed another possible problem when undoing actions with very little memory left. - [Fix] <Jojo> It was not possible to create the last sample slot (i.e. pressing "new sample" with a MOD file that had 30 samples would result in an error, although MOD supports 31 samples). - [Fix] <Jojo> When loading an extremely short raw file (f.e. 1 byte) twice, it crashed OpenMPT. - -Instrument tab - [New] <Jojo> Envelope zooming. Might still look very weird (especially the first tick and around loop points). Includes two new keyboard shortcuts. - [New] <Jojo> Transpose Up/Down for sample map. - [New] <Jojo> VST/Instrument handling: The IT instrument note mapping is now also applied to VST instruments (before, it was just available for samples). This way, VST instruments can be transposed easily. - [Imp] <Jojo> When pasting an envelope, it's now also automatically enabled. - [Imp] <Jojo> Instrument name and filename length are now properly limited. - [Imp] <Jojo> "Scale envelope points" is now also available for scaling the values of the points (y axis). - [Fix] <Jojo> The panning spin button ranged from 0 to 256, however when saving to .IT, 256 was wrapping over to 0. Panning is now limited from 0 to 255. - [Fix] <Jojo> It was impossible to assign plugin slot 100 to an instrument. - -Comments tab - [Fix] <Jojo> Correct C-5 frequency is now also shown for XM modules. - [Fix] <Jojo> When editing sample / instrument names, they are limited properly in length now. - -Treeview - [New] <Jojo> Sequences can now be copied to other modules by simply dragging the sequence header into the the other module's sequence header. Does only work between two different modules, not within the same module, and it will not copy the pattern contents. - [Imp] <Jojo> Display sequence index next to sequence names. - [Imp] <Jojo> Improved order dragging; It is now also possible to drag an order into a non-MPTM module. In that case, the old orderlist will be replaced. - [Imp] <Jojo> J2B files were not shown in the treeview. - [Fix] <Jojo> Soundfont samples were not playing correctly anymore. Note that soundfont samples in the MIDI library still don't work. - [Fix] <Jojo> A crash could occour if the instrument library path was too long (f.e. because of malicious strings in the [Paths] section of the INI file) - [Fix] <Jojo> "Bypass" action for VSTs didn't set the document as modified. - [Fix] <Jojo> Right-Click on module -> Close didn't ask for confirmation when the document was modified. - [Fix] <Jojo> Insert/Duplicate sequence actions didn't set the document modified. Grey out those two actions if no additional sequences can be added. - -VST - [New] <Jojo> VST/Instrument handling: The IT instrument note mapping is now also applied to VST instruments (before, it was just available for samples). This way, VST instruments can be transposed easily. - [Imp] <Jojo> VST Editor: Instead of just saying the user that the plugin has to be assigned to an instrument to play notes, they are queried now whether they want to automatically add an instrument. - [Imp] <Jojo> VST Editor: Added shortcuts for "toggle bypass", "pass keys to plug" and "record params to pattern" - [Mod] <Jojo> VST Editor: Changed number of patches per sub menu from 100 to 128. Now, one sub menu equals ones MIDI bank (more logical) - [Fix] <Jojo> VST Editor: Preset names starting with ' ' >= char > 'A' were cropped (i.e. "123ABC" was displayed as "ABC") - [Fix] <Jojo> VST Editor: Changing a plugin parameter in MOD/S3M files doesn't mark them as modified anymore. - [Fix] <Jojo> Even if an instrument was muted, a VSTi assigned to this instrument was still playing in the pattern. - [Fix] <re> Some VSTs that previously wouldn't load might now load fine. - [Fix] <re> Returned host CanDo-values were wrong (since pre-RC1 era). - -Mod conversion - [Fix] <Jojo> When converting from MOD to S3M or IT, the Invert Loop effect was not removed. - [Fix] <Jojo> When converting from MPTM to another format, the first sequence name is removed and the sequence is now sized properly when merging multiple sequences (tx Skaven). - [Fix] <Jojo> When converting between XM and IT, the sample autovibrato "sweep" factor is now fixed a bit (since sweep = 0 equals "no sweep" in XM, and "no vibrato" in IT). - [Fix] <Jojo> When removing instruments from the treeview and converting the module to a different format which also supports instruments, OpenMPT crashed. - [Fix] <Jojo> When converting to MOD/S3M, the extended filter range flag was not deactivated. - [Fix] <Jojo> S00 (IT/S3M) does not equal E00 (MOD/XM), as Exx doesn't have effect memory. Trying to convert S00 to the last used value now. - [Fix] <Jojo> If necessary (S3M), the restart position attribute is reset. - [Fix] <re> Merging multiple sequences didn't properly convert '---'/'+++' orders. - -IT - [Imp] <Jojo> IT Saver: Compatibility export saves stereo samples again, as other tracker like Schism also support this (and so do the official IT specs). - [Fix] <Jojo> IT Saver: Fixed IT sample flags which could potentially cause IT to screw up on loading/saving MPT-made modules with samples that are not used by an instrument. - [Fix] <Jojo> IT Loader: ChibiTracker uses a different newline characater for the comments text, which was not handled properly. - [Fix] <Jojo> (fix from SchismTracker) IT Loader: Ignore stereo sample flag when loading old IT files (older than IT 2.14) since Impulse Tracker did not reset this flag when importing stereo samples back then. - [Fix] <Jojo> ITI/ITS Loader: Sample flags were not reset when a sample slot was overwritten when loading ITI or ITS files. That way, it was possible that f.e. the bidi loop flag was not disabled when loading a new sample that had a normal loop. - [Fix] <Jojo> IT Compatibility: Note Cut really cuts notes and does not just mute them (so that following volume commands could restore the sample) - [Fix] <Jojo> IT Compatibility: Always reset autovibrato settings when there's an instrument number (fix from SchismTracker) - [Fix] <Jojo> IT Compatibility: S77 / S79/ S7B are supposed to pause the envelope, not disable it. - [Fix] <Jojo> IT Compatibility: ignore slide commands with both nibbles set (f.e. D55, PA1, ...) - [Fix] <Jojo> IT Compatibility: Default Vibrato/Tremolo/Panbrello waveform values to sine waveform if out of range (e.g. S35) - -IT/MPTM/ITP, Instrument extension handling: - [Fix] <re> Fixes to instrument envelope flag handling (broken in 1.18.00.00). - -XM - [Imp] <Jojo> XM Loader: Improved detection of an old version of MPT (1.09?). - [Fix] <Jojo> XM Loader: Some XMs not made with ModPlug were recognized as files made with MPT. - [Fix] <Jojo> XM Loader: The last XM instrument was not always loaded. - [Fix] <Jojo> XM Loader: Early versions of Skale Tracker (R.I.P.) apparently wrote malformed XM sample headers, so OpenMPT failed to load such modules. Such files should be loaded correctly now (fixes IFULOVE.XM by yeep). - [Fix] <Jojo> XM Compatibility: Volume column doesn't have an effect memory, most effects with param = 0 are useless. Those are ignored in compatibility mode playback and also when exporting the file in compatibility mode. - [Fix] <Jojo> XM Compatibility: Improved handling of the situation when a 3xx effect was used, but previously no note was playing. - [Fix] <Jojo> XM Compatibility: An instrument change next to a portamento event is now ignored (fixes partytime.xm by cancer) - -MOD - [Imp] <Jojo> Module creation: When creating a new .MOD, it has 31 sample slots by default. - [Imp] <Jojo> Playback: When the PT1x flag is activated, Amiga note range limits are automatically taken into account. - [Fix] <Jojo> MOD Saving: Samples were shifted badly if the sample size was odd. (wow, this is an OLD bug!) - [Fix] <Jojo> MOD Saving: If a sample had loop points set, but loop disabled, they were still saved in the .MOD file, resulting in the loop being enabled automatically. - [Fix] <Jojo> MOD Loader: Very short loops (4-8 bytes long) are not ignored anymore. This fixes "Crew Generation" by Necros. - -S3M - [Imp] <Jojo> S3M Loader: Display a message if an S3M file contains Adlib instruments (rare). - [Fix] <Jojo> S3M Playback: In ST3, muted channels are completely ignored, not even effects are interpreted. Let's try this in MPT, too. - [Fix] <Jojo> S3M Compatibility: Slightly better handling of vibrato/tremolo waveform types (although the ST3 help screen says that continuous vibrato/tremolo is possible, it does actually not work.) - [Reg] <Jojo> Cannot create S3M files with more than 100 patterns anymore, because... - [Fix] <Jojo> ... it was possible to create S3M files where the 256 parapointers were not enough, resulting in incomplete/broken files. - [Fix] <Jojo> S3M Compatibility: Note Cut really cuts notes and does not just mute them (so that following volume commands could restore the sample) - -MPTM - [New] <rewbs> Added combined note delay & note cut command for MPTM only (":xy" means delay until tick x and play for y ticks). - [New] <Jojo> MPTM command S7D explicitly enforces pitch envelope, S7E enforces filter envelope. - [Fix] <Jojo> MPTM Saving: A missing null pointer check crashed OpenMPT when trying to access a deleted instrument slot. - -Other formats - [Imp] <Jojo> MT2 Loader (MadTracker): Make use of the "lines per beat" header field. Release node is not set anymore for each and every instrument envelope. MT2 files are now loaded as IT files by default (instead of XM) because of their extended instrument properties (NNAs, filters, etc) - I wonder what this breaks, but I don't bother much because MT2 support was already 100% broken before this. :) Some MT example tunes sound a bit better now at least. - [Fix] <Jojo> PTM Loader: Fixed an unhandled null pointer exception that occured when loading some unsupported RAR files. - [Fix] <Jojo> PSM16 Loader: Fix for note cut on tick 0 (warbot tune from Silverball) - [Fix] <Jojo> Threw out the old ULT loader in favor of Storlek's loader from SchismTracker (used with permission from the author himself). This is a lot more accurate than MPT's old loader. - [Fix] <Jojo> DBM Loader: Various fixes to increase import precision and an endianness fix - [Fix] <Jojo> AMF DSM Loader: Made some changes to the pattern reader, which eliminate the strange "vC7" commands in the pattern. I have found no hints on whether my fix is correct or not, apart from the fact that those AMF files that I have play a lot better now. And it makes kind of sense... - [Fix] <Jojo> IMF Loader: Some fixes copied from Schism (copied from MikMod) - -Module cleanup - [Imp] <Jojo> In the cleanup dialog, mutually exclusive items are now automatically unchecked, to avoid confusion. - [Imp] <Jojo> Made the dialog look a bit nicer. - [Fix] <Jojo> Because of an error in pattern count retrieval, the last pattern was not checked when looking for unused samples which sometimes resulted in deleted samples (although they were actually used). - [Fix] <re> Fixed a memory leak in pattern name handling. - -Wave Export - [New] <Jojo> It is now also possible to render by instrument (i.e. one wave file per instrument). - [Imp] <Jojo> The "render by channel" mode ignores empty channels now. - [Imp] <Jojo> When switching to another task and switching back to OpenMPT, it is now less likely that the infamous "OpenMPT does not respond" dialog from Windows occours. - -Misc - [New] <Jojo> INI Settings: When portable mode is enabled, the most common paths in mptrack.ini are now translated to relative paths (if possible). Plugin paths are not translated to relative paths (yet). - [New] <Jojo> Modules in gzip archives (single-file .gz archives) can now be imported, just to satisfy my laziness when downloading gzipped modules from Amiga Music Preservation. :-P - [Imp] <Jojo> Mod Loaders: Instead of creating message boxes in various places, errors are now written to the log and one message box is shown for each file. - [Imp] <Jojo> Binary files are now less often falsely recognized as early MOD files (15 samples without header): If the orderlist contains orderlist items > 128, loading is canceled. - [Imp] <Jojo> Song Properties: Tool tips are shown for various controls. - [Mod] <Jojo> Options: Removed the "space bar repeats previous action" option, as it did not work anymore since the new keyhandler is used; in fact, this option can be achieved instead by using the "on key hold" for the "quick paste" key shortcut. - [Reg] <rewbs> Removed old "velocity" volume command, which was experimental and unused. - [Mod] <Jojo> Replaced default VU-meter colours for the MPT scheme by more pleasant colours that were already used for the other themes. - [Mod] <Jojo> Updated internet links (ModPlug Central Forums link is now a permalink) - [Fix] <Jojo> Multi window edit: When (un)muting a channel from the general tab in window 1, it was instantly shown in the pattern editor of window 2, but not vice versa. - [Fix] <Jojo> Channel Manager: When removing channels using the channel manager, their names were not cleared properly. - [Fix] <Jojo> Song Length Detection: *Much* more accurate song length detection! Doesn't get tricked by pattern jumps anymore, hehe. :) - [Fix] <Jojo/re> Instrument IO: Flags from old ITI/XI files should also be loaded correctly now (broken in 1.18.00.00) - [Fix] <Jojo> When using the "close file" shortcut several times in a row so that multiple message boxes popped up, it was possible to crash OpenMPT. - [Reg] <Jojo> Removed AutodetectITplaystyle option, since the tracker detection works reliably enough now. Tracker detection can not be ignored anymore now. - -Installer/release package - [New] <Jojo> Ladies and gentlemen... we finally have an installer. :) - [Mod] <Jojo> Added OpenMPT 1.18 release notes documents - [Mod] <Jojo> Updated DE_jojo.mkb - [Mod] <Jojo> Updated Paul Legovitch's keymap (now also suitable for desktop keyboards) - [Mod] <re> Updated default keybindings. - - -v1.18.00.00 (January 2010, revision 475) internal test build ------------------------------------------------------------- -General tab - [Fix] <Jojo> Channel name input field was not limited properly. - -Sequence editor - [New] <re> Can now copy/cut/paste order selections. - [Imp] <Jojo> Using the keyboard manager for shortcuts. 0...9, + and - keys are now also configurable. - [Imp] <Jojo> Duplicate / Create new pattern shortcuts do also work here now. - [Imp] <Jojo> Show cut/copy/paste orders in context menu. - [Imp] <Jojo> Middle click can now also be used for queuing patterns. - [Fix] <Jojo> Pasting orders now removes "+++" items if they are not supported by the current format. - [Fix] <Jojo> Fixed display error when selecting multiple orders, inserting them and clicking on another order (only first order of previous selection was un-highlighted). - -Pattern tab::Pattern editing - [New] <Jojo> New paste mode "push forward paste", which resembles the default paste behaviour of Impulse Tracker. Includes new shortcut. - [New] <Jojo> New paste mode "paste flood" pastes the clipboard content again and again until it hits the bottom of the pattern (overflow paste will be disabled automatically if paste flood is used, for obvious reasons). - [Imp] <Jojo> When using the MPTM format, plugin param changes are written to the pattern as PC Notes (instead of smooth midi macros). - [Imp] <Jojo> Assume that the clipboard pattern format is IT (instead of MOD) if no information about the format is available. - [Imp] <Jojo> Pattern c&p: convert pasted commands if necessary. - [Mod] <re> Pattern c&p: Mix paste shouldn't anymore trigger conversion on modcommands that weren't changed at all. Now, however, partial conversion will not be done so this still needs further fixing. - [Fix] <Jojo> Pattern c&p: invalid commands are not pasted anymore. - [Imp] <Jojo> If "record note off" is enabled and Note Off commands are not supported by the current format, try Note Cut and volume commands. - [Mod] <Jojo> It is impossible to enter something into the volume column in MOD format now. - [Mod] <Jojo> When interpolating PC Notes, the plugin number and note type won't get overridden if the note type is already PC or PCs. - [Fix] <re> Pattern c&p: Mix paste should behave better with parameter control notes. - [Fix] <... [truncated message content] |
From: <sag...@us...> - 2011-05-17 18:33:43
|
Revision: 876 http://modplug.svn.sourceforge.net/modplug/?rev=876&view=rev Author: saga-games Date: 2011-05-17 18:33:34 +0000 (Tue, 17 May 2011) Log Message: ----------- [Fix] Welcome to episode 2938 of "this should not have happened afterall". When playing a pattern that is not in the sequence that has more rows than the last played order item, SetRowVisited crashed. I have no idea why it even got there. [Ref] Made pattern rename code look less stupid. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-05-16 14:23:08 UTC (rev 875) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-05-17 18:33:34 UTC (rev 876) @@ -1067,13 +1067,13 @@ { if ((m_pSndFile) && (m_pModDoc) && (!IsLocked())) { - CHAR s[256], sold[128] = ""; - PATTERNINDEX nPat = (PATTERNINDEX)SendViewMessage(VIEWMSG_GETCURRENTPATTERN); + const PATTERNINDEX nPat = (PATTERNINDEX)SendViewMessage(VIEWMSG_GETCURRENTPATTERN); - m_EditPatName.GetWindowText(s, MAX_PATTERNNAME); - s[MAX_PATTERNNAME - 1] = 0; - m_pSndFile->Patterns[nPat].GetName(sold, CountOf(sold)); - if (strcmp(s, sold)) + CHAR s[MAX_PATTERNNAME]; + m_EditPatName.GetWindowText(s, CountOf(s)); + SetNullTerminator(s); + + if (m_pSndFile->Patterns[nPat].GetName().Compare(s)) { if(m_pSndFile->Patterns[nPat].SetName(s)) { Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-05-16 14:23:08 UTC (rev 875) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-05-17 18:33:34 UTC (rev 876) @@ -3993,7 +3993,7 @@ { const MODCHANNEL *pChn = &Chn[nChn]; // Unlike channel settings, pModInstrument is copied from the original chan to the NNA chan, - // so we don't nee to worry about finding the master chan. + // so we don't need to worry about finding the master chan. UINT nPlugin=0; if (pChn && pChn->pModInstrument) { @@ -4148,7 +4148,7 @@ //-------------------------------------------------------------------------------------------------------------------------- { const ORDERINDEX nMaxOrd = Order.GetLengthTailTrimmed(); - if(nOrd >= nMaxOrd || nRow > Patterns[Order[nOrd]].GetNumRows()) + if(nOrd >= nMaxOrd || nRow >= Patterns[Order[nOrd]].GetNumRows()) { return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-05-26 18:35:39
|
Revision: 882 http://modplug.svn.sourceforge.net/modplug/?rev=882&view=rev Author: saga-games Date: 2011-05-26 18:35:33 +0000 (Thu, 26 May 2011) Log Message: ----------- [Ref] Rewrote envelope reset code + minor stuff Modified Paths: -------------- trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-05-26 18:25:41 UTC (rev 881) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-05-26 18:35:33 UTC (rev 882) @@ -914,7 +914,7 @@ if (nins) // Set instrument { - m_SndFile.resetEnvelopes(pChn); + m_SndFile.ResetChannelEnvelopes(pChn); m_SndFile.InstrumentChange(pChn, nins); } else if ((nsmp) && (nsmp < MAX_SAMPLES)) // Or set sample Modified: trunk/OpenMPT/soundlib/Snd_defs.h =================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h 2011-05-26 18:25:41 UTC (rev 881) +++ trunk/OpenMPT/soundlib/Snd_defs.h 2011-05-26 18:35:33 UTC (rev 882) @@ -348,7 +348,6 @@ #define SNDMIX_NOBACKWARDJUMPS 0x40000 // stop when jumping back in the order (currently unused as it seems) #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 MAX_GLOBAL_VOLUME 256 @@ -364,14 +363,6 @@ NUM_SRC_MODES }; -// Envelope reset choices -enum enmResetEnv -{ - ENV_RESET_ALL, - ENV_RESET_VOL, - ENV_RESET_PAN, - ENV_RESET_PITCH, -}; // Release node defines #define ENV_RELEASE_NODE_UNSET 0xFF #define NOT_YET_RELEASED (-1) @@ -416,10 +407,14 @@ #define MACRO_INTERNALEX 0x31463046 // internal extended macro (F0F1), controls higher 8 bits (high plugin params) // Vibrato Types -#define VIB_SINE 0 -#define VIB_SQUARE 1 -#define VIB_RAMP_UP 2 -#define VIB_RAMP_DOWN 3 -#define VIB_RANDOM 4 +enum VibratoType +{ + VIB_SINE = 0, + VIB_SQUARE, + VIB_RAMP_UP, + VIB_RAMP_DOWN, + VIB_RANDOM +}; + #endif Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-05-26 18:25:41 UTC (rev 881) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-05-26 18:35:33 UTC (rev 882) @@ -620,12 +620,12 @@ pChn->dwFlags |= CHN_FASTVOLRAMP; if ((m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)) && (!bInstrumentChanged) && (pIns) && (!(pChn->dwFlags & (CHN_KEYOFF|CHN_NOTEFADE)))) { - if (!(pIns->VolEnv.dwFlags & ENV_CARRY)) resetEnvelopes(pChn, ENV_RESET_VOL); - if (!(pIns->PanEnv.dwFlags & ENV_CARRY)) resetEnvelopes(pChn, ENV_RESET_PAN); - if (!(pIns->PitchEnv.dwFlags & ENV_CARRY)) resetEnvelopes(pChn, ENV_RESET_PITCH); + if (!(pIns->VolEnv.dwFlags & ENV_CARRY)) ResetChannelEnvelope(pChn->VolEnv); + if (!(pIns->PanEnv.dwFlags & ENV_CARRY)) ResetChannelEnvelope(pChn->PanEnv); + if (!(pIns->PitchEnv.dwFlags & ENV_CARRY)) ResetChannelEnvelope(pChn->PitchEnv); } else { - resetEnvelopes(pChn); + ResetChannelEnvelopes(pChn); } // IT Compatibility: Autovibrato reset if(!IsCompatibleMode(TRK_IMPULSETRACKER)) @@ -635,7 +635,13 @@ } } else if ((pIns) && (!(pIns->VolEnv.dwFlags & ENV_ENABLED))) { - resetEnvelopes(pChn, IsCompatibleMode(TRK_IMPULSETRACKER) ? ENV_RESET_VOL : ENV_RESET_ALL); + if(IsCompatibleMode(TRK_IMPULSETRACKER)) + { + ResetChannelEnvelope(pChn->VolEnv); + } else + { + ResetChannelEnvelopes(pChn); + } } } // Invalid sample ? @@ -882,7 +888,7 @@ { if ((m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)) && (pChn->dwFlags & CHN_NOTEFADE) && (!pChn->nFadeOutVol)) { - resetEnvelopes(pChn); + ResetChannelEnvelopes(pChn); // IT Compatibility: Autovibrato reset if(!IsCompatibleMode(TRK_IMPULSETRACKER)) { @@ -1362,7 +1368,7 @@ { //:xy --> note delay until tick x, note cut at tick x+y nStartTick = (param & 0xF0) >> 4; - int cutAtTick = nStartTick + (param & 0x0F); + const UINT cutAtTick = nStartTick + (param & 0x0F); NoteCut(nChn, cutAtTick); } else if ((cmd == CMD_MODCMDEX) || (cmd == CMD_S3MCMDEX)) @@ -1493,7 +1499,7 @@ if (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2)) { pChn->dwFlags |= CHN_FASTVOLRAMP; - resetEnvelopes(pChn); + ResetChannelEnvelopes(pChn); // IT Compatibility: Autovibrato reset if(!IsCompatibleMode(TRK_IMPULSETRACKER)) { @@ -1574,7 +1580,7 @@ if ((bPorta) && (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2)) && (instr)) { pChn->dwFlags |= CHN_FASTVOLRAMP; - resetEnvelopes(pChn); + ResetChannelEnvelopes(pChn); // IT Compatibility: Autovibrato reset if(!IsCompatibleMode(TRK_IMPULSETRACKER)) { @@ -2172,35 +2178,23 @@ } -void CSoundFile::resetEnvelopes(MODCHANNEL* pChn, enmResetEnv envToReset) -//----------------------------------------------------------------------- +void CSoundFile::ResetChannelEnvelopes(MODCHANNEL* pChn) +//------------------------------------------------------ { - switch (envToReset) - { - case ENV_RESET_ALL: - pChn->VolEnv.nEnvPosition = 0; - pChn->PanEnv.nEnvPosition = 0; - pChn->PitchEnv.nEnvPosition = 0; - pChn->VolEnv.nEnvValueAtReleaseJump = NOT_YET_RELEASED; - pChn->PitchEnv.nEnvValueAtReleaseJump = NOT_YET_RELEASED; - pChn->PanEnv.nEnvValueAtReleaseJump = NOT_YET_RELEASED; - break; - case ENV_RESET_VOL: - pChn->VolEnv.nEnvPosition = 0; - pChn->VolEnv.nEnvValueAtReleaseJump = NOT_YET_RELEASED; - break; - case ENV_RESET_PAN: - pChn->PanEnv.nEnvPosition = 0; - pChn->PanEnv.nEnvValueAtReleaseJump = NOT_YET_RELEASED; - break; - case ENV_RESET_PITCH: - pChn->PitchEnv.nEnvPosition = 0; - pChn->PitchEnv.nEnvValueAtReleaseJump = NOT_YET_RELEASED; - break; - } + ResetChannelEnvelope(pChn->VolEnv); + ResetChannelEnvelope(pChn->PanEnv); + ResetChannelEnvelope(pChn->PitchEnv); } +void CSoundFile::ResetChannelEnvelope(MODCHANNEL_ENVINFO &env) +//------------------------------------------------------------ +{ + env.nEnvPosition = 0; + env.nEnvValueAtReleaseJump = NOT_YET_RELEASED; +} + + //////////////////////////////////////////////////////////// // Channels effects @@ -3620,7 +3614,7 @@ if (pIns->VolEnv.nReleaseNode != ENV_RELEASE_NODE_UNSET) { - pChn->VolEnv.nEnvValueAtReleaseJump = getVolEnvValueFromPosition(pChn->VolEnv.nEnvPosition, pIns); + pChn->VolEnv.nEnvValueAtReleaseJump = GetVolEnvValueFromPosition(pChn->VolEnv.nEnvPosition, pIns); pChn->VolEnv.nEnvPosition= pIns->VolEnv.Ticks[pIns->VolEnv.nReleaseNode]; } Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2011-05-26 18:25:41 UTC (rev 881) +++ trunk/OpenMPT/soundlib/Sndfile.h 2011-05-26 18:35:33 UTC (rev 882) @@ -1047,8 +1047,9 @@ UINT GetRawSongMessage(LPSTR s, UINT cbsize, UINT linesize=32); public: - int getVolEnvValueFromPosition(int position, MODINSTRUMENT* pIns); - void resetEnvelopes(MODCHANNEL* pChn, enmResetEnv envToReset = ENV_RESET_ALL); + int GetVolEnvValueFromPosition(int position, MODINSTRUMENT* pIns) const; + void ResetChannelEnvelopes(MODCHANNEL *pChn); + void ResetChannelEnvelope(MODCHANNEL_ENVINFO &env); void SetDefaultInstrumentValues(MODINSTRUMENT *pIns); private: UINT __cdecl GetChannelPlugin(UINT nChan, bool respectMutes) const; Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2011-05-26 18:25:41 UTC (rev 881) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2011-05-26 18:35:33 UTC (rev 882) @@ -986,8 +986,6 @@ { skipchn: - MODINSTRUMENT *pIns = pChn->pModInstrument; - // XM Compatibility: Prevent notes to be stopped after a fadeout. This way, a portamento effect can pick up a faded instrument which is long enough. // This occours for example in the bassline (channel 11) of jt_burn.xm. I hope this won't break anything else... // I also suppose this could decrease mixing performance a bit, but hey, which CPU can't handle 32 muted channels these days... :-) @@ -1003,6 +1001,7 @@ #ifdef ENABLE_STEREOVU pChn->nLeftVU = pChn->nRightVU = 0; #endif + nChn++; pChn++; if (nChn >= m_nChannels) @@ -1021,7 +1020,7 @@ pChn->nInc = 0; pChn->nRealVolume = 0; - if(!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || GetModFlag(MSF_OLDVOLSWING)) + if(GetModFlag(MSF_OLDVOLSWING)) { pChn->nRealPan = pChn->nPan + pChn->nPanSwing; } @@ -1040,8 +1039,8 @@ CTuning::RATIOTYPE vibratoFactor = 1; CTuning::NOTEINDEXTYPE arpeggioSteps = 0; - // Calc Frequency - if ((pChn->nPeriod) && (pChn->nLength)) + MODINSTRUMENT *pIns = pChn->pModInstrument; + { int vol = pChn->nVolume; @@ -1146,15 +1145,14 @@ vol = CLAMP(vol, 0, 256) << 6; // Process Envelopes - if (pChn->pModInstrument) + if (pIns) { - MODINSTRUMENT *pIns = pChn->pModInstrument; // Volume Envelope // IT Compatibility: S77 does not disable the volume envelope, it just pauses the counter // Problem: This pauses on the wrong tick at the moment... if (((pChn->dwFlags & CHN_VOLENV) || ((pIns->VolEnv.dwFlags & ENV_ENABLED) && IsCompatibleMode(TRK_IMPULSETRACKER))) && (pIns->VolEnv.nNodes)) { - int envvol = getVolEnvValueFromPosition(pChn->VolEnv.nEnvPosition, pIns); + int envvol = GetVolEnvValueFromPosition(pChn->VolEnv.nEnvPosition, pIns); // if we are in the release portion of the envelope, // rescale envelope factor so that it is proportional to the release point @@ -2153,7 +2151,7 @@ // Get instrument info and plugin reference MODINSTRUMENT *pIns = pChn->pModInstrument; - IMixPlugin *pPlugin = NULL; + IMixPlugin *pPlugin = nullptr; if ((instr) && (instr < MAX_INSTRUMENTS)) pIns = Instruments[instr]; @@ -2224,18 +2222,19 @@ case PLUGIN_VOLUMEHANDLING_DRYWET: if(hasVolCommand) pPlugin->SetDryRatio(2*vol); else pPlugin->SetDryRatio(2*defaultVolume); - break; + break; case PLUGIN_VOLUMEHANDLING_MIDI: if(hasVolCommand) pPlugin->MidiCC(pIns->nMidiChannel, MIDICC_Volume_Coarse, min(127, 2*vol), nChn); else pPlugin->MidiCC(pIns->nMidiChannel, MIDICC_Volume_Coarse, min(127, 2*defaultVolume), nChn); - break; + break; + } } } -int CSoundFile::getVolEnvValueFromPosition(int position, MODINSTRUMENT* pIns) -//--------------------------------------------------------------------------- +int CSoundFile::GetVolEnvValueFromPosition(int position, MODINSTRUMENT* pIns) const +//--------------------------------------------------------------------------------- { UINT pt = pIns->VolEnv.nNodes - 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-05-30 21:31:10
|
Revision: 887 http://modplug.svn.sourceforge.net/modplug/?rev=887&view=rev Author: saga-games Date: 2011-05-30 21:31:03 +0000 (Mon, 30 May 2011) Log Message: ----------- [Fix] VST Editor: Loading a VST preset (fxp) didn't mark the document as modified [Fix] Instrument Tab: The plugin selection dialog is not shown anymore when switching to an instrument that has an unused VST slot assigned. [Mod] Updated history.txt Modified Paths: -------------- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/packageTemplate/History.txt Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.cpp =================================================================== --- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2011-05-28 15:14:04 UTC (rev 886) +++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2011-05-30 21:31:03 UTC (rev 887) @@ -121,8 +121,14 @@ CMainFrame::SetWorkingDirectory(files.workingDirectory.c_str(), DIR_PLUGINPRESETS, true); //TODO: exception handling to distinguish errors at this level. - if (!(m_pVstPlugin->LoadProgram(files.first_file.c_str()))) + if (m_pVstPlugin->LoadProgram(files.first_file.c_str())) + { + if(m_pVstPlugin->GetModDoc() != nullptr) + m_pVstPlugin->GetModDoc()->SetModified(); + } else + { ::AfxMessageBox("Error loading preset. Are you sure it is for this plugin?"); + } } VOID CAbstractVstEditor::OnSavePreset() Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2011-05-28 15:14:04 UTC (rev 886) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2011-05-30 21:31:03 UTC (rev 887) @@ -2061,7 +2061,7 @@ //--------------------------------------- { MODINSTRUMENT *pIns = m_pSndFile->Instruments[m_nInstrument]; - PLUGINDEX nPlug = static_cast<PLUGINDEX>(m_CbnMixPlug.GetItemData(m_CbnMixPlug.GetCurSel()) & 0xff); // TODO is the 0xFF necessary? + PLUGINDEX nPlug = static_cast<PLUGINDEX>(m_CbnMixPlug.GetItemData(m_CbnMixPlug.GetCurSel())); if (pIns) { @@ -2090,7 +2090,7 @@ if (pIns->nMixPlug) //if we have not just set to no plugin { PSNDMIXPLUGIN pPlug = &(m_pSndFile->m_MixPlugins[pIns->nMixPlug - 1]); - if (pPlug == nullptr || pPlug->pMixPlugin == nullptr) + if ((pPlug == nullptr || pPlug->pMixPlugin == nullptr) && !IsLocked()) { // No plugin in this slot: Ask user to add one. CSelectPluginDlg dlg(m_pModDoc, nPlug - 1, this); Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2011-05-28 15:14:04 UTC (rev 886) +++ trunk/OpenMPT/packageTemplate/History.txt 2011-05-30 21:31:03 UTC (rev 887) @@ -10,6 +10,28 @@ (tx XYZ): thanks to XYZ for telling us about the bug / requesting the feature +v1.20.01.00 (*** 2011, revision 887) +------------------------------------ +Pattern tab + [Fix] <Jojo> When playing a pattern that is actually not in the sequence and that has more rows than the last played order item, a crash could occour while playing those extra rows. (Welcome to episode 2938 of "this should not have happened afterall") + [Fix] <Jojo> Shift + Channel Dragging killed the last channel. + [Fix] <Jojo> When using the pattern play controls (f.e. "Replay Pattern") on a pattern that isn't played in the normal play sequence, tempo and global volume commands on the first played row are not ignored anymore. + +Sample tab + [Imp] <Jojo> When selecting parts of the sample, the selection range is now also displayed in samples, not only seconds. + +Instrument tab + [Imp] <Jojo> When in compatible mode, two envelope points cannot share the same tick anymore. + +VST + [Fix] <Jojo> When a plugin requests song position in nano secods, the correct value should now be returned. + [Fix] <Jojo> Loading a VST preset (fxp) didn't mark the document as modified (tx BooT-SectoR-ViruZ) + +Other formats + [Fix] <Jojo> ITP Saver: Fixed nasty bug when the internal order length was not 256. + [Fix] <Jojo> IMF Loader: Orpheus' 8-Bit cutoff range was not converted to MPT's 7-Bit range. + + v1.19.02.00 (May 2011, revision 871) ------------------------------------ Pattern tab This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-05-31 09:58:32
|
Revision: 888 http://modplug.svn.sourceforge.net/modplug/?rev=888&view=rev Author: saga-games Date: 2011-05-31 09:58:24 +0000 (Tue, 31 May 2011) Log Message: ----------- [Fix] Visitied Rows Check: Yet another error that shouldn't have happened and that I was not able to reproduce... (tx jmkz) [Fix] Setup Dialog: Fixed checkbox list so that it doesn't look weird under Wine and doesn't crash when compiling with VS2010. [Mod] OpenMPT: Version is now 1.19.02.03 Modified Paths: -------------- trunk/OpenMPT/mptrack/Moptions.cpp trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/mptrack/Moptions.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moptions.cpp 2011-05-30 21:31:03 UTC (rev 887) +++ trunk/OpenMPT/mptrack/Moptions.cpp 2011-05-31 09:58:24 UTC (rev 888) @@ -6,9 +6,7 @@ #include "moptions.h" #include "moddoc.h" -#pragma warning(disable:4244) - ////////////////////////////////////////////////////////////// // COptionsColors @@ -552,44 +550,14 @@ ON_CLBN_CHKCHANGE(IDC_LIST1, OnSettingsChanged) END_MESSAGE_MAP() -typedef struct OPTGENDESC + +struct OPTGENDESC { DWORD dwFlagID; LPCSTR pszListName, pszDescription; -} OPTGENDESC; - -enum -{ - OPTGEN_PLAYNEWNOTES=0, - OPTGEN_PLAYEDITROW, - OPTGEN_CENTERROW, - OPTGEN_LARGECOMMENTSFONT, - OPTGEN_HEXROWDISP, - OPTGEN_CURSORWRAP, - OPTGEN_CREATEBACKUP, - OPTGEN_DRAGNDROPEDIT, - OPTGEN_FLATBUTTONS, - OPTGEN_SINGLEEXPAND, - OPTGEN_MUTECHNMODE, - OPTGEN_AUTOSPACEBAR, - OPTGEN_NOEXTRALOUD, - OPTGEN_SHOWPREVIOUS, - OPTGEN_CONTSCROLL, - OPTGEN_KBDNOTEOFF, - OPTGEN_FOLLOWSONGOFF, - OPTGEN_MIDIRECORD, - OPTGEN_PATTERNCTXMENUSTYLE, - OPTGEN_SYNCMUTE, - OPTGEN_AUTODELAY, - OPTGEN_PATNOTEFADE, - OPTGEN_OVERFLOWPASTE, - OPTGEN_POSITIONAWARETIMER, - OPTGEN_RESETCHANNELS, - OPTGEN_LIVEUPDATETREE, - OPTGEN_MAXOPTIONS }; -static OPTGENDESC gOptGenDesc[OPTGEN_MAXOPTIONS] = +static OPTGENDESC gOptGenDesc[] = { {PATTERN_PLAYNEWNOTE, "Play new notes while recording", "When this option is enabled, notes entered in the pattern editor will always be played (If not checked, notes won't be played in record mode)."}, {PATTERN_PLAYEDITROW, "Play whole row while recording", "When this option is enabled, all notes on the current row are played when entering notes in the pattern editor."}, @@ -617,6 +585,7 @@ {PATTERN_LIVEUPDATETREE,"Update sample status in tree", "If enabled, active samples and instruments will be indicated by a different icon in the treeview."} }; + void COptionsGeneral::DoDataExchange(CDataExchange* pDX) //------------------------------------------------------ { @@ -633,16 +602,16 @@ CHAR sname[32], s[256]; CPropertyPage::OnInitDialog(); - for (UINT i = 0; i < OPTGEN_MAXOPTIONS; i++) + for (UINT i = 0; i < CountOf(gOptGenDesc); i++) { - bool bCheck; - wsprintf(sname, "Setup.Gen.Opt%d.Name", i+1); + wsprintf(sname, "Setup.Gen.Opt%d.Name", i + 1); if ((theApp.GetLocalizedString(sname, s, sizeof(s))) && (s[0])) m_CheckList.AddString(s); else m_CheckList.AddString(gOptGenDesc[i].pszListName); - bCheck = (CMainFrame::m_dwPatternSetup & gOptGenDesc[i].dwFlagID) != 0 ? true : false; - m_CheckList.SetCheck(i, (bCheck) ? TRUE : FALSE); + + const int check = (CMainFrame::m_dwPatternSetup & gOptGenDesc[i].dwFlagID) != 0 ? BST_CHECKED : BST_UNCHECKED; + m_CheckList.SetCheck(i, check); } m_CheckList.SetCurSel(0); OnOptionSelChanged(); @@ -669,14 +638,12 @@ GetDlgItemText(IDC_OPTIONS_DIR_VSTS, szVstDir, _MAX_PATH); GetDlgItemText(IDC_OPTIONS_DIR_VSTPRESETS, szPresetDir, _MAX_PATH); - for (UINT i = 0; i < OPTGEN_MAXOPTIONS; i++) + for (UINT i = 0; i < CountOf(gOptGenDesc); i++) { - BOOL bCheck = m_CheckList.GetCheck(i); + const bool check = (m_CheckList.GetCheck(i) != BST_UNCHECKED); - if(bCheck) CMainFrame::m_dwPatternSetup |= gOptGenDesc[i].dwFlagID; + if(check) CMainFrame::m_dwPatternSetup |= gOptGenDesc[i].dwFlagID; else CMainFrame::m_dwPatternSetup &= ~gOptGenDesc[i].dwFlagID; - - m_CheckList.SetCheck(i, (bCheck) ? TRUE : FALSE); } CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); @@ -725,8 +692,8 @@ { CHAR sname[32], s[256]; LPCSTR pszDesc = NULL; - int sel = m_CheckList.GetCurSel(); - if ((sel >= 0) && (sel < OPTGEN_MAXOPTIONS)) + const int sel = m_CheckList.GetCurSel(); + if ((sel >= 0) && (sel < CountOf(gOptGenDesc))) { pszDesc = gOptGenDesc[sel].pszDescription; wsprintf(sname, "Setup.Gen.Opt%d.Desc", sel+1); @@ -734,5 +701,3 @@ } SetDlgItemText(IDC_TEXT1, (pszDesc) ? pszDesc : ""); } - - Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-05-30 21:31:03 UTC (rev 887) +++ trunk/OpenMPT/mptrack/version.h 2011-05-31 09:58:24 UTC (rev 888) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 19 #define VER_MINOR 02 -#define VER_MINORMINOR 02 +#define VER_MINORMINOR 03 //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-05-30 21:31:03 UTC (rev 887) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-05-31 09:58:24 UTC (rev 888) @@ -4142,7 +4142,7 @@ //-------------------------------------------------------------------------------------------------------------------------- { const ORDERINDEX nMaxOrd = Order.GetLengthTailTrimmed(); - if(nOrd >= nMaxOrd || nRow >= Patterns[Order[nOrd]].GetNumRows()) + if(nOrd >= nMaxOrd || nRow >= GetVisitedRowsVectorSize(Order[nOrd])) { return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-06-01 22:21:03
|
Revision: 889 http://modplug.svn.sourceforge.net/modplug/?rev=889&view=rev Author: saga-games Date: 2011-06-01 22:20:57 +0000 (Wed, 01 Jun 2011) Log Message: ----------- [Fix] Song shouldn't stop anymore after playing one time if playback is initially started using play pattern in loop mode (http://bugs.openmpt.org/view.php?id=11) [Imp] Installer: A shortcut to the extraKeymaps folder is now played in the settings folder. Internal: Code should build again with NO_VST defined. Modified Paths: -------------- trunk/OpenMPT/installer/install.iss trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/MainFrm.cpp Modified: trunk/OpenMPT/installer/install.iss =================================================================== --- trunk/OpenMPT/installer/install.iss 2011-05-31 09:58:24 UTC (rev 888) +++ trunk/OpenMPT/installer/install.iss 2011-06-01 22:20:57 UTC (rev 889) @@ -100,8 +100,9 @@ Name: {group}\ModPlug Central; Filename: {app}\ModPlug Central.url Name: {group}\Configuration files; Filename: {userappdata}\OpenMPT\; Tasks: not portable -; app's directory (for ease of use) +; app's directory and keymaps directory (for ease of use) Name: {app}\Configuration files; Filename: {userappdata}\OpenMPT\; Tasks: not portable +Name: {userappdata}\OpenMPT\More Keymaps; Filename: {app}\extraKeymaps\; Tasks: not portable ; desktop, quick launch Name: {userdesktop}\OpenMPT; Filename: {app}\mptrack.exe; Tasks: desktopicon Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2011-05-31 09:58:24 UTC (rev 888) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2011-06-01 22:20:57 UTC (rev 889) @@ -950,6 +950,7 @@ m_CbnPluginVolumeHandling.AddString("MIDI volume"); m_CbnPluginVolumeHandling.AddString("Dry/Wet ratio"); m_CbnPluginVolumeHandling.AddString("None"); + m_CbnPluginVolumeHandling.AddString("Custom (Macro)"); // Vol/Pan Swing m_SliderVolSwing.SetRange(0, 64); @@ -2093,6 +2094,7 @@ if ((pPlug == nullptr || pPlug->pMixPlugin == nullptr) && !IsLocked()) { // No plugin in this slot: Ask user to add one. +#ifndef NO_VST CSelectPluginDlg dlg(m_pModDoc, nPlug - 1, this); if (dlg.DoModal() == IDOK) { @@ -2103,7 +2105,7 @@ UpdatePluginList(); m_pModDoc->UpdateAllViews(NULL, HINT_MIXPLUGINS, NULL); } - +#endif // NO_VST } if (pPlug && pPlug->pMixPlugin) Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2011-05-31 09:58:24 UTC (rev 888) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2011-06-01 22:20:57 UTC (rev 889) @@ -382,14 +382,14 @@ gcsPreviousVersion = GetPrivateProfileCString("Version", "Version", "", iniFile); if(gcsPreviousVersion == "") - vIniVersion = MPT_VERSION_NUMERIC; + vIniVersion = MptVersion::num; else vIniVersion = MptVersion::ToNum(gcsPreviousVersion); gcsInstallGUID = GetPrivateProfileCString("Version", "InstallGUID", "", iniFile); if(gcsInstallGUID == "") { - //No GUID found in INI file - generate one. + // No GUID found in INI file - generate one. GUID guid; CoCreateGuid(&guid); BYTE* Str; @@ -502,7 +502,7 @@ m_dwPatternSetup |= PATTERN_RESETCHANNELS; if(vIniVersion < MAKE_VERSION_NUMERIC(1,19,00,07)) m_dwPatternSetup &= ~0x800; // this was previously deprecated and is now used for something else - if(vIniVersion < MPT_VERSION_NUMERIC) + if(vIniVersion < MptVersion::num) m_dwPatternSetup &= ~(0x200000|0x400000|0x10000000); // various deprecated old options m_nRowSpacing = GetPrivateProfileDWord("Pattern Editor", "RowSpacing", 16, iniFile); @@ -1968,20 +1968,27 @@ } m_nMixChn = m_nAvgMixChn = 0; gsdwTotalSamples = 0; - if (!bPatLoop) { - if (bPaused) { + if (!bPatLoop) + { + if (bPaused) + { pSndFile->m_dwSongFlags |= SONG_PAUSED; - } else { + } else + { pModDoc->SetPause(FALSE); //rewbs.fix3185: removed this check so play position stays on last pattern if song ends and loop is off. //Otherwise play from cursor screws up. //if (pSndFile->GetCurrentPos() + 2 >= pSndFile->GetMaxPosition()) pSndFile->SetCurrentPos(0); - pSndFile->SetRepeatCount((gbLoopSong) ? -1 : 0); + + // Tentative fix for http://bugs.openmpt.org/view.php?id=11 - Moved following line out of any condition checks + //pSndFile->SetRepeatCount((gbLoopSong) ? -1 : 0); } } + pSndFile->SetRepeatCount((gbLoopSong) ? -1 : 0); + m_pSndFile->SetMasterVolume(m_nPreAmp, true); m_pSndFile->InitPlayer(TRUE); - memset(NotifyBuffer, 0, sizeof(NotifyBuffer)); + MemsetZero(NotifyBuffer); m_dwStatus |= MODSTATUS_PLAYING; m_wndToolBar.SetCurrentSong(m_pSndFile); if (gpSoundDevice) gpSoundDevice->Start(); @@ -2124,7 +2131,7 @@ m_WaveFile.m_nDefaultTempo = 125; m_WaveFile.m_nGlobalVolume=64; m_WaveFile.m_nDefaultSpeed = 4; - m_WaveFile.m_nRepeatCount = 0; + m_WaveFile.SetRepeatCount(0); m_WaveFile.m_nType = MOD_TYPE_IT; m_WaveFile.m_nChannels = 4; m_WaveFile.m_nInstruments = 1; @@ -2191,7 +2198,7 @@ m_WaveFile.Create(NULL, 0); m_WaveFile.m_nDefaultTempo = 125; m_WaveFile.m_nDefaultSpeed = 6; - m_WaveFile.m_nRepeatCount = 0; + m_WaveFile.SetRepeatCount(0); m_WaveFile.m_nType = pSong->m_nType; m_WaveFile.m_nChannels = 4; if ((nInstrument) && (nInstrument <= pSong->m_nInstruments)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2011-06-06 20:45:23
|
Revision: 893 http://modplug.svn.sourceforge.net/modplug/?rev=893&view=rev Author: relabsoluness Date: 2011-06-06 20:45:14 +0000 (Mon, 06 Jun 2011) Log Message: ----------- [New] Internal: Added VC2010 project files. [Fix] Internal: Fix to failing builds in VC2003 and VC2010. Also some code- and VC2003 project tweaks to get the build done with less warnings. Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/STDAFX.CPP trunk/OpenMPT/mptrack/Stdafx.h trunk/OpenMPT/mptrack/misc_util.cpp trunk/OpenMPT/mptrack/misc_util.h trunk/OpenMPT/mptrack/mptrack.vcproj trunk/OpenMPT/soundtouch/soundtouch.vcproj trunk/OpenMPT/ungzip/ungzip.vcproj trunk/OpenMPT/unlha/unlha.vcproj trunk/OpenMPT/unrar/UNRAR.vcproj trunk/OpenMPT/unzip/unzip.vcproj trunk/OpenMPT/xsoundlib/xsoundlib.vcproj trunk/OpenMPT/zlib/contrib/vstudio/vc10/zlibstat.vcxproj trunk/OpenMPT/zlib/contrib/vstudio/vc7/zlibstat.vcproj Added Paths: ----------- trunk/OpenMPT/mptrack/MPTRACK_10.sln trunk/OpenMPT/mptrack/mptrack_10.vcxproj trunk/OpenMPT/soundtouch/soundtouch_10.vcxproj trunk/OpenMPT/ungzip/ungzip_10.vcxproj trunk/OpenMPT/unlha/unlha_10.vcxproj trunk/OpenMPT/unrar/unrar_10.vcxproj trunk/OpenMPT/unzip/unzip_10.vcxproj trunk/OpenMPT/xsoundlib/xsoundlib_10.vcxproj Added: trunk/OpenMPT/mptrack/MPTRACK_10.sln =================================================================== --- trunk/OpenMPT/mptrack/MPTRACK_10.sln (rev 0) +++ trunk/OpenMPT/mptrack/MPTRACK_10.sln 2011-06-06 20:45:14 UTC (rev 893) @@ -0,0 +1,108 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mptrack", "mptrack_10.vcxproj", "{21D95071-FB97-4E69-B3B1-050D0D4A5021}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unlha", "..\unlha\unlha_10.vcxproj", "{FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unrar", "..\unrar\unrar_10.vcxproj", "{FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unzip", "..\unzip\unzip_10.vcxproj", "{44316F22-904E-48AA-B841-5A3A6AC77319}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xsoundlib", "..\xsoundlib\xsoundlib_10.vcxproj", "{DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouch", "..\soundtouch\soundtouch_10.vcxproj", "{CF3C2CA5-5D45-4635-BBA4-C1F435E10896}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ungzip", "..\ungzip\ungzip_10.vcxproj", "{94CD7910-649A-4075-9F33-7EBEE614FD45}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlibstat", "..\zlib\contrib\vstudio\vc10\zlibstat.vcxproj", "{745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + ReleaseWithoutAsm|Win32 = ReleaseWithoutAsm|Win32 + ReleaseWithoutAsm|x64 = ReleaseWithoutAsm|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {21D95071-FB97-4E69-B3B1-050D0D4A5021}.Debug|Win32.ActiveCfg = Debug|Win32 + {21D95071-FB97-4E69-B3B1-050D0D4A5021}.Debug|Win32.Build.0 = Debug|Win32 + {21D95071-FB97-4E69-B3B1-050D0D4A5021}.Debug|x64.ActiveCfg = Debug|Win32 + {21D95071-FB97-4E69-B3B1-050D0D4A5021}.Release|Win32.ActiveCfg = Release|Win32 + {21D95071-FB97-4E69-B3B1-050D0D4A5021}.Release|Win32.Build.0 = Release|Win32 + {21D95071-FB97-4E69-B3B1-050D0D4A5021}.Release|x64.ActiveCfg = Release|Win32 + {21D95071-FB97-4E69-B3B1-050D0D4A5021}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {21D95071-FB97-4E69-B3B1-050D0D4A5021}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 + {21D95071-FB97-4E69-B3B1-050D0D4A5021}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 + {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8}.Debug|Win32.ActiveCfg = Debug|Win32 + {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8}.Debug|Win32.Build.0 = Debug|Win32 + {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8}.Debug|x64.ActiveCfg = Debug|Win32 + {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8}.Release|Win32.ActiveCfg = Release|Win32 + {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8}.Release|Win32.Build.0 = Release|Win32 + {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8}.Release|x64.ActiveCfg = Release|Win32 + {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 + {FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 + {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.Debug|Win32.ActiveCfg = Debug|Win32 + {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.Debug|Win32.Build.0 = Debug|Win32 + {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.Debug|x64.ActiveCfg = Debug|Win32 + {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.Release|Win32.ActiveCfg = Release|Win32 + {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.Release|Win32.Build.0 = Release|Win32 + {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.Release|x64.ActiveCfg = Release|Win32 + {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 + {FF541CE2-DAA1-4F84-9883-0A0F111BAA0B}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 + {44316F22-904E-48AA-B841-5A3A6AC77319}.Debug|Win32.ActiveCfg = Debug|Win32 + {44316F22-904E-48AA-B841-5A3A6AC77319}.Debug|Win32.Build.0 = Debug|Win32 + {44316F22-904E-48AA-B841-5A3A6AC77319}.Debug|x64.ActiveCfg = Debug|Win32 + {44316F22-904E-48AA-B841-5A3A6AC77319}.Release|Win32.ActiveCfg = Release|Win32 + {44316F22-904E-48AA-B841-5A3A6AC77319}.Release|Win32.Build.0 = Release|Win32 + {44316F22-904E-48AA-B841-5A3A6AC77319}.Release|x64.ActiveCfg = Release|Win32 + {44316F22-904E-48AA-B841-5A3A6AC77319}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {44316F22-904E-48AA-B841-5A3A6AC77319}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 + {44316F22-904E-48AA-B841-5A3A6AC77319}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 + {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Debug|Win32.ActiveCfg = Debug|Win32 + {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Debug|Win32.Build.0 = Debug|Win32 + {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Debug|x64.ActiveCfg = Debug|Win32 + {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Release|Win32.ActiveCfg = Release|Win32 + {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Release|Win32.Build.0 = Release|Win32 + {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.Release|x64.ActiveCfg = Release|Win32 + {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 + {DCC2BB2F-6778-4FD3-9C00-D6CD8DC917B8}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 + {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.Debug|Win32.ActiveCfg = Debug|Win32 + {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.Debug|Win32.Build.0 = Debug|Win32 + {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.Debug|x64.ActiveCfg = Debug|Win32 + {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.Release|Win32.ActiveCfg = Release|Win32 + {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.Release|Win32.Build.0 = Release|Win32 + {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.Release|x64.ActiveCfg = Release|Win32 + {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 + {CF3C2CA5-5D45-4635-BBA4-C1F435E10896}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 + {94CD7910-649A-4075-9F33-7EBEE614FD45}.Debug|Win32.ActiveCfg = Debug|Win32 + {94CD7910-649A-4075-9F33-7EBEE614FD45}.Debug|Win32.Build.0 = Debug|Win32 + {94CD7910-649A-4075-9F33-7EBEE614FD45}.Debug|x64.ActiveCfg = Debug|Win32 + {94CD7910-649A-4075-9F33-7EBEE614FD45}.Release|Win32.ActiveCfg = Release|Win32 + {94CD7910-649A-4075-9F33-7EBEE614FD45}.Release|Win32.Build.0 = Release|Win32 + {94CD7910-649A-4075-9F33-7EBEE614FD45}.Release|x64.ActiveCfg = Release|Win32 + {94CD7910-649A-4075-9F33-7EBEE614FD45}.ReleaseWithoutAsm|Win32.ActiveCfg = Release|Win32 + {94CD7910-649A-4075-9F33-7EBEE614FD45}.ReleaseWithoutAsm|Win32.Build.0 = Release|Win32 + {94CD7910-649A-4075-9F33-7EBEE614FD45}.ReleaseWithoutAsm|x64.ActiveCfg = Release|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.ActiveCfg = Debug|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|Win32.Build.0 = Debug|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.ActiveCfg = Debug|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Debug|x64.Build.0 = Debug|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.ActiveCfg = Release|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|Win32.Build.0 = Release|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.ActiveCfg = Release|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.Release|x64.Build.0 = Release|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.ActiveCfg = ReleaseWithoutAsm|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|Win32.Build.0 = ReleaseWithoutAsm|Win32 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.ActiveCfg = ReleaseWithoutAsm|x64 + {745DEC58-EBB3-47A9-A9B8-4C6627C01BF8}.ReleaseWithoutAsm|x64.Build.0 = ReleaseWithoutAsm|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2011-06-04 23:49:38 UTC (rev 892) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2011-06-06 20:45:14 UTC (rev 893) @@ -424,7 +424,9 @@ lastUpdate.tm_year -= 1900; lastUpdate.tm_mon--; } - time_t outTime = _mkgmtime(&lastUpdate); + + time_t outTime = Util::sdTime::MakeGmTime(lastUpdate); + if(outTime < 0) outTime = 0; CUpdateCheck::SetUpdateSettings @@ -486,7 +488,7 @@ m_nPreAmp = GetPrivateProfileDWord("Sound Settings", "PreAmp", 128, iniFile); CSoundFile::m_nStereoSeparation = GetPrivateProfileLong("Sound Settings", "StereoSeparation", 128, iniFile); CSoundFile::m_nMaxMixChannels = GetPrivateProfileLong("Sound Settings", "MixChannels", MAX_CHANNELS, iniFile); - gbWFIRType = GetPrivateProfileDWord("Sound Settings", "XMMSModplugResamplerWFIRType", 7, iniFile); + gbWFIRType = static_cast<BYTE>(GetPrivateProfileDWord("Sound Settings", "XMMSModplugResamplerWFIRType", 7, iniFile)); gdWFIRCutoff = static_cast<double>(GetPrivateProfileLong("Sound Settings", "ResamplerWFIRCutoff", 97, iniFile))/100.0; glVolumeRampSamples = GetPrivateProfileLong("Sound Settings", "VolumeRampSamples", 42, iniFile); @@ -527,7 +529,7 @@ if(m_szDirectoryToSettingsName[i][0] == 0) continue; - GetPrivateProfileString("Paths", m_szDirectoryToSettingsName[i], GetDefaultDirectory(static_cast<Directory>(i)), szPath, INIBUFFERSIZE, iniFile); + GetPrivateProfileString("Paths", m_szDirectoryToSettingsName[i], GetDefaultDirectory(static_cast<Directory>(i)), szPath, CountOf(szPath), iniFile); RelativePathToAbsolute(szPath); SetDefaultDirectory(szPath, static_cast<Directory>(i), false); @@ -1389,11 +1391,13 @@ // -> CODE#0021 // -> DESC="use multimedia timer instead of Sleep() in audio thread" - CloseHandle(sleepEvent); + // Commented as this caused "warning C4702: unreachable code" + //CloseHandle(sleepEvent); // -! BEHAVIOUR_CHANGE#0021 - ExitThread(0); - return 0; + // Commented the two lines below as those caused "warning C4702: unreachable code" + //ExitThread(0); + //return 0; } @@ -1449,8 +1453,9 @@ } } } - ExitThread(0); - return 0; + // Commented the two lines below as those caused "warning C4702: unreachable code" + //ExitThread(0); + //return 0; } Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-06-04 23:49:38 UTC (rev 892) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-06-06 20:45:14 UTC (rev 893) @@ -785,7 +785,7 @@ strMsg.FormatV(pszFormat, args); va_end(args); - m_logEvents << Util::GetDateTimeStr() + m_logEvents << Util::sdTime::GetDateTimeStr() << _T("Event type: ") << eventType << std::endl << _T("Function: ") << pszFuncName << std::endl << _T("Message: ") << strMsg << std::endl << std::endl; @@ -3887,4 +3887,4 @@ // Sequence names. // Not needed? -} \ No newline at end of file +} Modified: trunk/OpenMPT/mptrack/STDAFX.CPP =================================================================== --- trunk/OpenMPT/mptrack/STDAFX.CPP 2011-06-04 23:49:38 UTC (rev 892) +++ trunk/OpenMPT/mptrack/STDAFX.CPP 2011-06-06 20:45:14 UTC (rev 893) @@ -4,6 +4,8 @@ #include "stdafx.h" +#if (_MSC_VER == MSVC_VER_2008) + // Fix for VS2008 SP1 bloatage (http://tedwvc.wordpress.com/2011/04/16/static-mfc-code-bloat-problem-from-vc2010-is-now-in-vc2008-sp1security-fix/): // this is our own local copy of the AfxLoadSystemLibraryUsingFullPath function @@ -30,3 +32,5 @@ return(::AfxCtxLoadLibraryW(wszLoadPath)); } + +#endif Modified: trunk/OpenMPT/mptrack/Stdafx.h =================================================================== --- trunk/OpenMPT/mptrack/Stdafx.h 2011-06-04 23:49:38 UTC (rev 892) +++ trunk/OpenMPT/mptrack/Stdafx.h 2011-06-06 20:45:14 UTC (rev 893) @@ -99,6 +99,19 @@ //To mark string that should be translated in case of multilingual version. #define GetStrI18N(x) (x) +#pragma warning(error : 4309) // Treat "truncation of constant value"-warning as error. + +// Definitions for MSVC versions to write more understandable conditional-compilation, +// e.g. #if (_MSC_VER > MSVC_VER_2008) instead of #if (_MSC_VER > 1500) +#define MSVC_VER_VC71 1310 +#define MSVC_VER_2003 MSVC_VER_VC71 +#define MSVC_VER_VC8 1400 +#define MSVC_VER_2005 MSVC_VER_VC8 +#define MSVC_VER_VC9 1500 +#define MSVC_VER_2008 MSVC_VER_VC9 +#define MSVC_VER_VC10 1600 +#define MSVC_VER_2010 MSVC_VER_VC10 + //{{AFX_INSERT_LOCATION}} // Microsoft Developer Studio will insert additional declarations immediately before the previous line. Modified: trunk/OpenMPT/mptrack/misc_util.cpp =================================================================== --- trunk/OpenMPT/mptrack/misc_util.cpp 2011-06-04 23:49:38 UTC (rev 892) +++ trunk/OpenMPT/mptrack/misc_util.cpp 2011-06-06 20:45:14 UTC (rev 893) @@ -53,10 +53,21 @@ } -std::basic_string<TCHAR> Util::GetDateTimeStr() +std::basic_string<TCHAR> Util::sdTime::GetDateTimeStr() { time_t t; std::time(&t); return _tctime(&t); } +time_t Util::sdTime::MakeGmTime(tm& timeUtc) +{ + TIME_ZONE_INFORMATION tzi; + GetTimeZoneInformation(&tzi); + const time_t timeUtcTimeT = mktime(&timeUtc) - 60 * tzi.Bias; +#if (_MSC_VER >= MSVC_VER_2005) && defined(_DEBUG) + ASSERT(timeUtcTimeT < 0 || timeUtcTimeT == _mkgmtime(&timeUtc)); +#endif + return timeUtcTimeT; +} + Modified: trunk/OpenMPT/mptrack/misc_util.h =================================================================== --- trunk/OpenMPT/mptrack/misc_util.h 2011-06-04 23:49:38 UTC (rev 892) +++ trunk/OpenMPT/mptrack/misc_util.h 2011-06-06 20:45:14 UTC (rev 893) @@ -248,8 +248,17 @@ // Returns maximum value of given integer type. template <class T> inline T MaxValueOfType(const T&) {static_assert(std::numeric_limits<T>::is_integer == true, "Only interger types are allowed."); return (std::numeric_limits<T>::max)();} + +}; + +namespace Util { namespace sdTime +{ // Returns string containing date and time ended with newline. std::basic_string<TCHAR> GetDateTimeStr(); -}; + time_t MakeGmTime(tm& timeUtc); + +}}; // namespace Util::sdTime + + #endif Modified: trunk/OpenMPT/mptrack/mptrack.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack.vcproj 2011-06-04 23:49:38 UTC (rev 892) +++ trunk/OpenMPT/mptrack/mptrack.vcproj 2011-06-06 20:45:14 UTC (rev 893) @@ -48,7 +48,7 @@ <Tool Name="VCLinkerTool" AdditionalOptions="/MACHINE:I386" - AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib delayimp.lib" + AdditionalDependencies="winmm.lib strmiids.lib dmoguids.lib version.lib opengl32.lib glu32.lib Rpcrt4.lib delayimp.lib wininet.lib" OutputFile=".\Debug/mptrack.exe" Version="5.0" LinkIncremental="2" Added: trunk/OpenMPT/mptrack/mptrack_10.vcxproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_10.vcxproj (rev 0) +++ trunk/OpenMPT/mptrack/mptrack_10.vcxproj 2011-06-06 20:45:14 UTC (rev 893) @@ -0,0 +1,476 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Template|Win32"> + <Configuration>Template</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectName>mptrack</ProjectName> + <ProjectGuid>{21D95071-FB97-4E69-B3B1-050D0D4A5021}</ProjectGuid> + <RootNamespace>mptrack</RootNamespace> + <Keyword>MFCProj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseOfMfc>Static</UseOfMfc> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseOfMfc>Dynamic</UseOfMfc> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\bin\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Midl> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MkTypLibCompatible>true</MkTypLibCompatible> + <SuppressStartupBanner>true</SuppressStartupBanner> + <TargetEnvironment>Win32</TargetEnvironment> + <TypeLibraryName>.\Debug/mptrack.tlb</TypeLibraryName> + </Midl> + <ClCompile> + <AdditionalOptions>/EHsc %(AdditionalOptions)</AdditionalOptions> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>..\unlha;..\unzip;..\unrar;..\soundlib;..\include;..\xsoundlib;..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_DEBUG;WIN32;_WINDOWS;ENABLE_EQ;MODPLUG_TRACKER;NO_PACKING;HAVE_DOT_NET;ENABLE_AMD;ENABLE_SSE;ENABLE_AMDNOW;ENABLE_MMX;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <StringPooling>true</StringPooling> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <BufferSecurityCheck>true</BufferSecurityCheck> + <FunctionLevelLinking>true</FunctionLevelLinking> + <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> + <PrecompiledHeader>Use</PrecompiledHeader> + <PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile> + <PrecompiledHeaderOutputFile>.\Debug/mptrack.pch</PrecompiledHeaderOutputFile> + <AssemblerListingLocation>.\Debug/</AssemblerListingLocation> + <ObjectFileName>.\Debug/</ObjectFileName> + <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName> + <BrowseInformation>true</BrowseInformation> + <WarningLevel>Level4</WarningLevel> + <SuppressStartupBanner>false</SuppressStartupBanner> + <DebugInformationFormat>EditAndContinue</DebugInformationFormat> + <CompileAs>Default</CompileAs> + </ClCompile> + <ResourceCompile> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <Culture>0x0409</Culture> + </ResourceCompile> + <Link> + <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions> + <AdditionalDependencies>winmm.lib;strmiids.lib;dmoguids.lib;version.lib;opengl32.lib;glu32.lib;Rpcrt4.lib;delayimp.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>.\Debug/mptrack.exe</OutputFile> + <Version>5.0</Version> + <SuppressStartupBanner>true</SuppressStartupBanner> + <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <DelayLoadDLLs>OpenMPT_SoundTouch_i16.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <GenerateDebugInformation>true</GenerateDebugInformation> + <AssemblyDebug>true</AssemblyDebug> + <ProgramDatabaseFile>.\Debug/mptrack.pdb</ProgramDatabaseFile> + <GenerateMapFile>true</GenerateMapFile> + <MapFileName>.\Debug/mptrack.map</MapFileName> + <SubSystem>Windows</SubSystem> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <DataExecutionPrevention> + </DataExecutionPrevention> + </Link> + <Manifest> + <AdditionalManifestFiles>$(ProjectDir)res/rt_manif.bin;%(AdditionalManifestFiles)</AdditionalManifestFiles> + </Manifest> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Midl> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MkTypLibCompatible>true</MkTypLibCompatible> + <SuppressStartupBanner>true</SuppressStartupBanner> + <TargetEnvironment>Win32</TargetEnvironment> + <TypeLibraryName>.\Bin/mptrack.tlb</TypeLibraryName> + </Midl> + <ClCompile> + <AdditionalOptions>/EHsc /O2 %(AdditionalOptions)</AdditionalOptions> + <Optimization>MaxSpeed</Optimization> + <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion> + <AdditionalIncludeDirectories>..\unlha;..\unzip;..\unrar;..\soundlib;..\include;..\xsoundlib;..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;ENABLE_MMX;ENABLE_EQ;MODPLUG_TRACKER;NO_PACKING;HAVE_DOT_NET;ENABLE_AMD;ENABLE_SSE;ENABLE_AMDNOW;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <StringPooling>true</StringPooling> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <BufferSecurityCheck>true</BufferSecurityCheck> + <FunctionLevelLinking>false</FunctionLevelLinking> + <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> + <PrecompiledHeader>Use</PrecompiledHeader> + <PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile> + <PrecompiledHeaderOutputFile>.\Release/mptrack.pch</PrecompiledHeaderOutputFile> + <AssemblerListingLocation>.\Release/</AssemblerListingLocation> + <ObjectFileName>.\Release/</ObjectFileName> + <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName> + <WarningLevel>Level3</WarningLevel> + <SuppressStartupBanner>false</SuppressStartupBanner> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <CompileAs>Default</CompileAs> + </ClCompile> + <ResourceCompile> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <Culture>0x0409</Culture> + </ResourceCompile> + <Link> + <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions> + <AdditionalDependencies>winmm.lib;strmiids.lib;dmoguids.lib;version.lib;opengl32.lib;glu32.lib;Rpcrt4.lib;delayimp.lib;wininet.lib;%(AdditionalDependencies)</AdditionalDependencies> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + <Version>5.0</Version> + <SuppressStartupBanner>true</SuppressStartupBanner> + <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + <DelayLoadDLLs>OpenMPT_SoundTouch_i16.dll;%(DelayLoadDLLs)</DelayLoadDLLs> + <GenerateDebugInformation>true</GenerateDebugInformation> + <GenerateMapFile>false</GenerateMapFile> + <MapFileName>.\Release/mptrack.map</MapFileName> + <SubSystem>Windows</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <RandomizedBaseAddress>true</RandomizedBaseAddress> + <DataExecutionPrevention> + </DataExecutionPrevention> + </Link> + <Manifest> + <AdditionalManifestFiles>$(ProjectDir)res/rt_manif.bin;%(AdditionalManifestFiles)</AdditionalManifestFiles> + </Manifest> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="AbstractVstEditor.cpp" /> + <ClCompile Include="ArrayUtils.cpp" /> + <ClCompile Include="AutoSaver.cpp" /> + <ClCompile Include="ChannelManagerDlg.cpp" /> + <ClCompile Include="ChildFrm.cpp" /> + <ClCompile Include="CleanupSong.cpp" /> + <ClCompile Include="ColourEdit.cpp" /> + <ClCompile Include="CommandSet.cpp" /> + <ClCompile Include="CreditStatic.cpp" /> + <ClCompile Include="ctrl_com.cpp" /> + <ClCompile Include="ctrl_gen.cpp" /> + <ClCompile Include="ctrl_ins.cpp" /> + <ClCompile Include="ctrl_pat.cpp" /> + <ClCompile Include="ctrl_seq.cpp" /> + <ClCompile Include="ctrl_smp.cpp" /> + <ClCompile Include="DefaultVstEditor.cpp" /> + <ClCompile Include="dlg_misc.cpp" /> + <ClCompile Include="..\soundlib\dlsbank.cpp" /> + <ClCompile Include="draw_pat.cpp" /> + <ClCompile Include="EffectVis.cpp" /> + <ClCompile Include="..\soundlib\Fastmix.cpp" /> + <ClCompile Include="fxp.cpp" /> + <ClCompile Include="globals.cpp" /> + <ClCompile Include="HyperEdit.cpp" /> + <ClCompile Include="HyperEdit2.cpp" /> + <ClCompile Include="HyperEdit3.cpp" /> + <ClCompile Include="InputHandler.cpp" /> + <ClCompile Include="KeyConfigDlg.cpp" /> + <ClCompile Include="mainbar.cpp" /> + <ClCompile Include="MainFrm.cpp" /> + <ClCompile Include="..\soundlib\Message.cpp" /> + <ClCompile Include="MIDIMappingDialog.cpp" /> + <ClCompile Include="misc_util.cpp" /> + <ClCompile Include="..\soundlib\mmcmp.cpp" /> + <ClCompile Include="..\soundlib\Mmx_mix.cpp" /> + <ClCompile Include="mod2midi.cpp" /> + <ClCompile Include="Mod2wave.cpp" /> + <ClCompile Include="..\soundlib\mod_specifications.cpp" /> + <ClCompile Include="..\soundlib\modcommand.cpp" /> + <ClCompile Include="ModConvert.cpp" /> + <ClCompile Include="Moddoc.cpp" /> + <ClCompile Include="Modedit.cpp" /> + <ClCompile Include="..\soundlib\ModSequence.cpp" /> + <ClCompile Include="..\soundlib\modsmp_ctrl.cpp" /> + <ClCompile Include="Moptions.cpp" /> + <ClCompile Include="MoveFXSlotDialog.cpp" /> + <ClCompile Include="Mpdlgs.cpp" /> + <ClCompile Include="mpt_midi.cpp" /> + <ClCompile Include="MPTHacks.cpp" /> + <ClCompile Include="mptrack.cpp" /> + <ClCompile Include="OpenGLControl.cpp" /> + <ClCompile Include="OpenGLDevice.cpp" /> + <ClCompile Include="OpenGLEditor.cpp" /> + <ClCompile Include="..\soundlib\pattern.cpp" /> + <ClCompile Include="..\soundlib\patternContainer.cpp" /> + <ClCompile Include="PatternEditorDialogs.cpp" /> + <ClCompile Include="PatternGotoDialog.cpp" /> + <ClCompile Include="PerformanceCounter.cpp" /> + <ClCompile Include="..\soundlib\PlaybackEventer.cpp" /> + <ClCompile Include="PSRatioCalc.cpp" /> + <ClCompile Include="SampleEditorDialogs.cpp" /> + <ClCompile Include="..\soundlib\Sampleio.cpp" /> + <ClCompile Include="ScaleEnvPointsDlg.cpp" /> + <ClCompile Include="serialization_utils.cpp" /> + <ClCompile Include="..\soundlib\snd_dsp.cpp" /> + <ClCompile Include="..\soundlib\snd_eq.cpp" /> + <ClCompile Include="..\soundlib\snd_flt.cpp" /> + <ClCompile Include="..\soundlib\Snd_fx.cpp" /> + <ClCompile Include="..\Soundlib\Snd_rvb.cpp"> + <AssemblerOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AssemblyAndSourceCode</AssemblerOutput> + </ClCompile> + <ClCompile Include="..\Soundlib\snddev.cpp" /> + <ClCompile Include="..\soundlib\Sndfile.cpp" /> + <ClCompile Include="..\soundlib\Sndmix.cpp" /> + <ClCompile Include="SoundFilePlayConfig.cpp" /> + <ClCompile Include="StdAfx.cpp"> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> + </ClCompile> + <ClCompile Include="..\soundlib\Tables.cpp" /> + <ClCompile Include="tagging.cpp" /> + <ClCompile Include="Undo.cpp" /> + <ClCompile Include="UpdateCheck.cpp" /> + <ClCompile Include="view_com.cpp" /> + <ClCompile Include="view_gen.cpp" /> + <ClCompile Include="view_ins.cpp" /> + <ClCompile Include="view_pat.cpp" /> + <ClCompile Include="view_smp.cpp" /> + <ClCompile Include="view_tre.cpp" /> + <ClCompile Include="VSTEditor.cpp" /> + <ClCompile Include="vstplug.cpp" /> + <ClCompile Include="..\soundlib\Waveform.cpp" /> + <ClCompile Include="..\soundlib\WindowedFIR.cpp" /> + <ClCompile Include="PatternRandomizer.cpp" /> + <ClCompile Include="PatternRandomizerGUI.cpp" /> + <ClCompile Include="PatternRandomizerGUIEffect.cpp" /> + <ClCompile Include="PatternRandomizerGUIInstrument.cpp" /> + <ClCompile Include="PatternRandomizerGUINote.cpp" /> + <ClCompile Include="PatternRandomizerGUIVolCmd.cpp" /> + <ClCompile Include="ChannelNode.cpp" /> + <ClCompile Include="ctrl_graph.cpp" /> + <ClCompile Include="EffectNode.cpp" /> + <ClCompile Include="FinalNode.cpp" /> + <ClCompile Include="Graph.cpp" /> + <ClCompile Include="InstrumentNode.cpp" /> + <ClCompile Include="Node.cpp" /> + <ClCompile Include="Vertex.cpp" /> + <ClCompile Include="view_graph.cpp" /> + <ClCompile Include="..\soundlib\tuning.cpp" /> + <ClCompile Include="..\soundlib\tuningbase.cpp" /> + <ClCompile Include="..\soundlib\tuningCollection.cpp" /> + <ClCompile Include="TuningDialog.cpp" /> + <ClCompile Include="tuningRatioMapWnd.cpp" /> + <ClCompile Include="test\test.cpp" /> + <ClCompile Include="..\soundlib\Load_669.cpp" /> + <ClCompile Include="..\Soundlib\load_amf.cpp" /> + <ClCompile Include="..\soundlib\Load_ams.cpp" /> + <ClCompile Include="..\soundlib\load_dbm.cpp" /> + <ClCompile Include="..\soundlib\load_dmf.cpp" /> + <ClCompile Include="..\soundlib\Load_dsm.cpp" /> + <ClCompile Include="..\soundlib\Load_far.cpp" /> + <ClCompile Include="..\soundlib\Load_gdm.cpp" /> + <ClCompile Include="..\soundlib\Load_imf.cpp" /> + <ClCompile Include="..\soundlib\Load_it.cpp" /> + <ClCompile Include="..\soundlib\Load_itp.cpp" /> + <ClCompile Include="..\soundlib\load_j2b.cpp" /> + <ClCompile Include="..\soundlib\Load_mdl.cpp" /> + <ClCompile Include="..\soundlib\Load_med.cpp" /> + <ClCompile Include="..\soundlib\load_mid.cpp" /> + <ClCompile Include="..\soundlib\Load_mo3.cpp" /> + <ClCompile Include="..\soundlib\Load_mod.cpp" /> + <ClCompile Include="..\Soundlib\load_mt2.cpp" /> + <ClCompile Include="..\soundlib\Load_mtm.cpp" /> + <ClCompile Include="..\soundlib\Load_okt.cpp" /> + <ClCompile Include="..\Soundlib\load_psm.cpp" /> + <ClCompile Include="..\soundlib\load_ptm.cpp" /> + <ClCompile Include="..\soundlib\Load_s3m.cpp" /> + <ClCompile Include="..\soundlib\Load_stm.cpp" /> + <ClCompile Include="..\soundlib\Load_ult.cpp" /> + <ClCompile Include="..\Soundlib\Load_umx.cpp" /> + <ClCompile Include="..\soundlib\Load_wav.cpp" /> + <ClCompile Include="..\soundlib\Load_xm.cpp" /> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="mptrack.rc" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="PatternRandomizer.h" /> + <ClInclude Include="PatternRandomizerGUI.h" /> + <ClInclude Include="PatternRandomizerGUIEffect.h" /> + <ClInclude Include="PatternRandomizerGUIInstrument.h" /> + <ClInclude Include="PatternRandomizerGUINote.h" /> + <ClInclude Include="PatternRandomizerGUIVolCmd.h" /> + <ClInclude Include="ChannelNode.h" /> + <ClInclude Include="ctrl_graph.h" /> + <ClInclude Include="EffectNode.h" /> + <ClInclude Include="FinalNode.h" /> + <ClInclude Include="Graph.h" /> + <ClInclude Include="InstrumentNode.h" /> + <ClInclude Include="Node.h" /> + <ClInclude Include="Vertex.h" /> + <ClInclude Include="view_graph.h" /> + <ClInclude Include="AbstractVstEditor.h" /> + <ClInclude Include="ArrayUtils.h" /> + <ClInclude Include="AutoSaver.h" /> + <ClInclude Include="ChannelManagerDlg.h" /> + <ClInclude Include="ChildFrm.h" /> + <ClInclude Include="CleanupSong.h" /> + <ClInclude Include="ColourEdit.h" /> + <ClInclude Include="CommandSet.h" /> + <ClInclude Include="CreditStatic.h" /> + <ClInclude Include="ctrl_com.h" /> + <ClInclude Include="ctrl_gen.h" /> + <ClInclude Include="ctrl_ins.h" /> + <ClInclude Include="ctrl_pat.h" /> + <ClInclude Include="ctrl_smp.h" /> + <ClInclude Include="DefaultVstEditor.h" /> + <ClInclude Include="dlg_misc.h" /> + <ClInclude Include="..\Soundlib\Dlsbank.h" /> + <ClInclude Include="EffectVis.h" /> + <ClInclude Include="..\soundlib\Endianness.h" /> + <ClInclude Include="fxp.h" /> + <ClInclude Include="globals.h" /> + <ClInclude Include="InputHandler.h" /> + <ClInclude Include="..\soundlib\IT_DEFS.H" /> + <ClInclude Include="KeyboardSettings.h" /> + <ClInclude Include="KeyConfigDlg.h" /> + <ClInclude Include="mainbar.h" /> + <ClInclude Include="MainFrm.h" /> + <ClInclude Include="..\soundlib\midi.h" /> + <ClInclude Include="MIDIMappingDialog.h" /> + <ClInclude Include="misc_util.h" /> + <ClInclude Include="mod2midi.h" /> + <ClInclude Include="mod2wave.h" /> + <ClInclude Include="..\soundlib\mod_specifications.h" /> + <ClInclude Include="..\soundlib\modcommand.h" /> + <ClInclude Include="ModConvert.h" /> + <ClInclude Include="moddoc.h" /> + <ClInclude Include="..\soundlib\ModSequence.h" /> + <ClInclude Include="..\soundlib\modsmp_ctrl.h" /> + <ClInclude Include="Moptions.h" /> + <ClInclude Include="MoveFXSlotDialog.h" /> + <ClInclude Include="Mpdlgs.h" /> + <ClInclude Include="mptrack.h" /> + <ClInclude Include="OpenGLControl.h" /> + <ClInclude Include="OpenGLDevice.h" /> + <ClInclude Include="OpenGLEditor.h" /> + <ClInclude Include="..\soundlib\pattern.h" /> + <ClInclude Include="..\soundlib\patternContainer.h" /> + <ClInclude Include="PatternEditorDialogs.h" /> + <ClInclude Include="PatternGotoDialog.h" /> + <ClInclude Include="PerformanceCounter.h" /> + <ClInclude Include="..\soundlib\PlaybackEventer.h" /> + <ClInclude Include="PSRatioCalc.h" /> + <ClInclude Include="Resource.h" /> + <ClInclude Include="SampleEditorDialogs.h" /> + <ClInclude Include="SampleGenerator.h" /> + <ClInclude Include="ScaleEnvPointsDlg.h" /> + <ClInclude Include="serialization_utils.h" /> + <ClInclude Include="..\soundlib\Snd_defs.h" /> + <ClInclude Include="..\Soundlib\snddev.h" /> + <ClInclude Include="..\Soundlib\snddevx.h" /> + <ClInclude Include="..\Soundlib\Sndfile.h" /> + <ClInclude Include="SoundFilePlayConfig.h" /> + <ClInclude Include="StdAfx.h" /> + <ClInclude Include="tagging.h" /> + <ClInclude Include="typedefs.h" /> + <ClInclude Include="Undo.h" /> + <ClInclude Include="UpdateCheck.h" /> + <ClInclude Include="version.h" /> + <ClInclude Include="view_com.h" /> + <ClInclude Include="view_gen.h" /> + <ClInclude Include="view_ins.h" /> + <ClInclude Include="view_pat.h" /> + <ClInclude Include="view_smp.h" /> + <ClInclude Include="view_tre.h" /> + <ClInclude Include="VSTEditor.h" /> + <ClInclude Include="vstplug.h" /> + <ClInclude Include="..\soundlib\Wav.h" /> + <ClInclude Include="..\soundlib\wavConverter.h" /> + <ClInclude Include="..\soundlib\WindowedFIR.h" /> + <ClInclude Include="..\soundlib\tuning.h" /> + <ClInclude Include="..\soundlib\tuningbase.h" /> + <ClInclude Include="..\soundlib\tuningcollection.h" /> + <ClInclude Include="TuningDialog.h" /> + <ClInclude Include="tuningRatioMapWnd.h" /> + <ClInclude Include="test\test.h" /> + <ClInclude Include="..\soundlib\Loaders.h" /> + </ItemGroup> + <ItemGroup> + <None Include="res\bitmap1.bmp" /> + <None Include="res\colors.bmp" /> + <None Include="res\dragging.cur" /> + <None Include="Res\envbar.bmp" /> + <None Include="res\img_list.bmp" /> + <None Include="res\mainbar.bmp" /> + <None Include="res\moddoc.ico" /> + <None Include="res\MPTRACK.bmp" /> + <None Include="res\mptrack.ico" /> + <None Include="res\mptrack.rc2" /> + <None Include="Res\nodrag.cur" /> + <None Include="res\nodrop.cur" /> + <None Include="res\patterns.bmp" /> + <None Include="res\rt_manif.bin" /> + <None Include="Res\smptoolb.bmp" /> + <None Include="res\splashno.bmp" /> + <None Include="res\view_pat.bmp" /> + <None Include="res\visnode1.bmp" /> + <None Include="res\vispcnode.bmp" /> + <None Include="res\vumeters.bmp" /> + <None Include="res\built-inTunings.tc" /> + <None Include="res\defaultKeybindings.mkb" /> + <None Include="mptrack.reg" /> + <None Include="VTune\mptrack.vpj" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\soundtouch\soundtouch_10.vcxproj"> + <Project>{cf3c2ca5-5d45-4635-bba4-c1f435e10896}</Project> + <ReferenceOutputAssembly>false</ReferenceOutputAssembly> + </ProjectReference> + <ProjectReference Include="..\ungzip\ungzip_10.vcxproj"> + <Project>{94cd7910-649a-4075-9f33-7ebee614fd45}</Project> + <ReferenceOutputAssembly>false</ReferenceOutputAssembly> + </ProjectReference> + <ProjectReference Include="..\unlha\unlha_10.vcxproj"> + <Project>{fae39936-1dc7-40bb-ad3f-3b5b9e9ab0e8}</Project> + <ReferenceOutputAssembly>false</ReferenceOutputAssembly> + </ProjectReference> + <ProjectReference Include="..\unrar\unrar_10.vcxproj"> + <Project>{ff541ce2-daa1-4f84-9883-0a0f111baa0b}</Project> + <ReferenceOutputAssembly>false</ReferenceOutputAssembly> + </ProjectReference> + <ProjectReference Include="..\unzip\unzip_10.vcxproj"> + <Project>{44316f22-904e-48aa-b841-5a3a6ac77319}</Project> + <ReferenceOutputAssembly>false</ReferenceOutputAssembly> + </ProjectReference> + <ProjectReference Include="..\zlib\contrib\vstudio\vc10\zlibstat.vcxproj"> + <Project>{745dec58-ebb3-47a9-a9b8-4c6627c01bf8}</Project> + </ProjectReference> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> + <ProjectExtensions> + <VisualStudio> + <UserProperties RESOURCE_FILE="mptrack.rc" /> + </VisualStudio> + </ProjectExtensions> +</Project> \ No newline at end of file Modified: trunk/OpenMPT/soundtouch/soundtouch.vcproj =================================================================== --- trunk/OpenMPT/soundtouch/soundtouch.vcproj 2011-06-04 23:49:38 UTC (rev 892) +++ trunk/OpenMPT/soundtouch/soundtouch.vcproj 2011-06-06 20:45:14 UTC (rev 893) @@ -23,7 +23,7 @@ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DLL_EXPORTS;INTEGER_SAMPLES=1" MinimalRebuild="TRUE" BasicRuntimeChecks="3" - RuntimeLibrary="1" + RuntimeLibrary="3" ForceConformanceInForLoopScope="TRUE" UsePrecompiledHeader="0" WarningLevel="3" Added: trunk/OpenMPT/soundtouch/soundtouch_10.vcxproj =================================================================== --- trunk/OpenMPT/soundtouch/soundtouch_10.vcxproj (rev 0) +++ trunk/OpenMPT/soundtouch/soundtouch_10.vcxproj 2011-06-06 20:45:14 UTC (rev 893) @@ -0,0 +1,140 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectName>SoundTouch</ProjectName> + <ProjectGuid>{CF3C2CA5-5D45-4635-BBA4-C1F435E10896}</ProjectGuid> + <RootNamespace>soundtouch</RootNamespace> + <Keyword>Win32Proj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <CharacterSet>NotSet</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <CharacterSet>NotSet</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir> + <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</IgnoreImportLibrary> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> + <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">OpenMPT_SoundTouch_i16</TargetName> + <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">OpenMPT_SoundTouch_i16</TargetName> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;DLL_EXPORTS;INTEGER_SAMPLES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MinimalRebuild>true</MinimalRebuild> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>EditAndContinue</DebugInformationFormat> + </ClCompile> + <Link> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + <ProgramDatabaseFile>$(TargetDir)$(TargetName).pdb</ProgramDatabaseFile> + <SubSystem>Windows</SubSystem> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <DataExecutionPrevention> + </DataExecutionPrevention> + <ImportLibrary>$(OutDir)soundtouch.lib</ImportLibrary> + <TargetMachine>MachineX86</TargetMachine> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <AdditionalOptions>/O2 %(AdditionalOptions)</AdditionalOptions> + <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;DLL_EXPORTS;INTEGER_SAMPLES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + </ClCompile> + <Link> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + <ProgramDatabaseFile>$(TargetDir)$(TargetName).pdb</ProgramDatabaseFile> + <StripPrivateSymbols> + </StripPrivateSymbols> + <SubSystem>Windows</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <DataExecutionPrevention> + </DataExecutionPrevention> + <ImportLibrary>$(OutDir)soundtouch.lib</ImportLibrary> + <TargetMachine>MachineX86</TargetMachine> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="3dnow_win.cpp" /> + <ClCompile Include="AAFilter.cpp" /> + <ClCompile Include="BPMDetect.cpp" /> + <ClCompile Include="cpu_detect_x86_win.cpp" /> + <ClCompile Include="FIFOSampleBuffer.cpp" /> + <ClCompile Include="FIRFilter.cpp" /> + <ClCompile Include="mmx_optimized.cpp" /> + <ClCompile Include="PeakFinder.cpp" /> + <ClCompile Include="RateTransposer.cpp" /> + <ClCompile Include="SoundTouch.cpp" /> + <ClCompile Include="SoundTouchDLL.cpp" /> + <ClCompile Include="sse_optimized.cpp" /> + <ClCompile Include="TDStretch.cpp" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="AAFilter.h" /> + <ClInclude Include="BPMDetect.h" /> + <ClInclude Include="cpu_detect.h" /> + <ClInclude Include="FIFOSampleBuffer.h" /> + <ClInclude Include="FIFOSamplePipe.h" /> + <ClInclude Include="FIRFilter.h" /> + <ClInclude Include="PeakFinder.h" /> + <ClInclude Include="RateTransposer.h" /> + <ClInclude Include="resource.h" /> + <ClInclude Include="SoundTouch.h" /> + <ClInclude Include="SoundTouchDLL.h" /> + <ClInclude Include="STTypes.h" /> + <ClInclude Include="TDStretch.h" /> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="SoundTouchDLL.rc" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file Modified: trunk/OpenMPT/ungzip/ungzip.vcproj =================================================================== --- trunk/OpenMPT/ungzip/ungzip.vcproj 2011-06-04 23:49:38 UTC (rev 892) +++ trunk/OpenMPT/ungzip/ungzip.vcproj 2011-06-06 20:45:14 UTC (rev 893) @@ -22,7 +22,7 @@ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;ZLIB_WINAPI" MinimalRebuild="TRUE" BasicRuntimeChecks="3" - RuntimeLibrary="1" + RuntimeLibrary="3" BufferSecurityCheck="TRUE" ForceConformanceInForLoopScope="TRUE" UsePrecompiledHeader="0" Added: trunk/OpenMPT/ungzip/ungzip_10.vcxproj =================================================================== --- trunk/OpenMPT/ungzip/ungzip_10.vcxproj (rev 0) +++ trunk/OpenMPT/ungzip/ungzip_10.vcxproj 2011-06-06 20:45:14 UTC (rev 893) @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectName>ungzip</ProjectName> + <ProjectGuid>{94CD7910-649A-4075-9F33-7EBEE614FD45}</ProjectGuid> + <RootNamespace>ungzip</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <CharacterSet>MultiByte</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MinimalRebuild>true</MinimalRebuild> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <OmitDefaultLibName>true</OmitDefaultLibName> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <Optimization>MaxSpeed</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <WarningLevel>Level3</WarningLevel> + <SuppressStartupBanner>false</SuppressStartupBanner> + <DebugInformationFormat> + </DebugInformationFormat> + <OmitDefaultLibName>true</OmitDefaultLibName> + </ClCompile> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="ungzip.cpp" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="ungzip.h" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file Modified: trunk/OpenMPT/unlha/unlha.vcproj =================================================================== --- trunk/OpenMPT/unlha/unlha.vcproj 2011-06-04 23:49:38 UTC (rev 892) +++ trunk/OpenMPT/unlha/unlha.vcproj 2011-06-06 20:45:14 UTC (rev 893) @@ -24,7 +24,7 @@ PreprocessorDefinitions="WIN32;_DEBUG;_LIB" StringPooling="TRUE" BasicRuntimeChecks="3" - RuntimeLibrary="1" + RuntimeLibrary="3" BufferSecurityCheck="TRUE" EnableFunctionLevelLinking="TRUE" PrecompiledHeaderFile=".\Debug/unlha.pch" Added: trunk/OpenMPT/unlha/unlha_10.vcxproj =================================================================== --- trunk/OpenMPT/unlha/unlha_10.vcxproj (rev 0) +++ trunk/OpenMPT/unlha/unlha_10.vcxproj 2011-06-06 20:45:14 UTC (rev 893) @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectName>unlha</ProjectName> + <ProjectGuid>{FAE39936-1DC7-40BB-AD3F-3B5B9E9AB0E8}</ProjectGuid> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseOfMfc>false</UseOfMfc> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseOfMfc>false</UseOfMfc> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\bin\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <StringPooling>true</StringPooling> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <BufferSecurityCheck>true</BufferSecurityCheck> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeaderOutputFile>.\Debug/unlha.pch</PrecompiledHeaderOutputFile> + <AssemblerListingLocation>.\Debug/</AssemblerListingLocation> + <ObjectFileName>.\Debug/</ObjectFileName> + <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName> + <WarningLevel>Level4</WarningLevel> + <SuppressStartupBanner>true</SuppressStartupBanner> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + </ClCompile> + <ResourceCompile> + <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <Culture>0x0409</Culture> + </ResourceCompile> + <Lib> + <OutputFile>.\Debug\unlha.lib</OutputFile> + <SuppressStartupBanner>true</SuppressStartupBanner> + </Lib> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <AdditionalOptions>/O1 %(AdditionalOptions)</AdditionalOptions> + <Optimization>MinSpace</Optimization> + <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <StringPooling>true</StringPooling> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + <BufferSecurityCheck>true</BufferSecurityCheck> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeaderOutputFile>.\Release/unlha.pch</PrecompiledHeaderOutputFile> + <AssemblerListingLocation>.\Release/</AssemblerListingLocation> + <ObjectFileName>.\Release/</ObjectFileName> + <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName> + <WarningLevel>Level3</WarningLevel> + <SuppressStartupBanner>false</SuppressStartupBanner> + </ClCompile> + <ResourceCompile> + <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <Culture>0x0409</Culture> + </ResourceCompile> + <Lib> + <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile> + <SuppressStartupBanner>true</SuppressStartupBanner> + </Lib> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="unlha.cpp"> + <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization> + <PreprocessorDefinitions Condition="'$... [truncated message content] |
From: <sag...@us...> - 2011-06-10 23:51:29
|
Revision: 896 http://modplug.svn.sourceforge.net/modplug/?rev=896&view=rev Author: saga-games Date: 2011-06-10 23:51:22 +0000 (Fri, 10 Jun 2011) Log Message: ----------- [Fix] Saving IT instruments with invalid sample map crashed the tracker (http://bugs.openmpt.org/view.php?id=142) [Mod] OpenMPT: Version is now 1.19.02.05 Modified Paths: -------------- trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Sampleio.cpp Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-06-08 22:15:59 UTC (rev 895) +++ trunk/OpenMPT/mptrack/version.h 2011-06-10 23:51:22 UTC (rev 896) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 19 #define VER_MINOR 02 -#define VER_MINORMINOR 04 +#define VER_MINORMINOR 05 //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-06-08 22:15:59 UTC (rev 895) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2011-06-10 23:51:22 UTC (rev 896) @@ -1594,7 +1594,7 @@ for (UINT i=0; i<NOTE_MAX; i++) if (pIns->Keyboard[i] < MAX_SAMPLES) { const UINT smp = pIns->Keyboard[i]; - if (smp && !smpcount[smp - 1]) + if (smp && smp <= GetNumSamples() && !smpcount[smp - 1]) { smpcount[smp - 1] = true; iti.nos++; @@ -2188,7 +2188,7 @@ for (UINT i=0; i<NOTE_MAX; i++) if (pIns->Keyboard[i] < MAX_SAMPLES) { const UINT smp = pIns->Keyboard[i]; - if (smp && !smpcount[smp - 1]) + if (smp && smp <= GetNumSamples() && !smpcount[smp - 1]) { smpcount[smp - 1] = true; iti.nos++; Modified: trunk/OpenMPT/soundlib/Sampleio.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sampleio.cpp 2011-06-08 22:15:59 UTC (rev 895) +++ trunk/OpenMPT/soundlib/Sampleio.cpp 2011-06-10 23:51:22 UTC (rev 896) @@ -1823,7 +1823,7 @@ for (UINT i=0; i<NOTE_MAX; i++) if (pIns->Keyboard[i] < MAX_SAMPLES) { const UINT smp = pIns->Keyboard[i]; - if (smp && !smpcount[smp - 1]) + if (smp && smp <= GetNumSamples() && !smpcount[smp - 1]) { smpcount[smp - 1] = true; smptable[iti->nos] = smp; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-06-23 14:46:46
|
Revision: 904 http://modplug.svn.sourceforge.net/modplug/?rev=904&view=rev Author: saga-games Date: 2011-06-23 14:46:38 +0000 (Thu, 23 Jun 2011) Log Message: ----------- [Ref] Moved stereo to mono sample converson to ctrlSmp namespace [Imp] MPTHacks also detects stereo samples in XM files now. [Imp] Fixed tab order in pitch shift dialog [Mod] OpenMPT: Version is now 1.19.02.07 Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/MPTHacks.cpp trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/modsmp_ctrl.cpp trunk/OpenMPT/soundlib/modsmp_ctrl.h Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-06-16 20:29:56 UTC (rev 903) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-06-23 14:46:38 UTC (rev 904) @@ -3143,7 +3143,6 @@ 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 Modified: trunk/OpenMPT/mptrack/MPTHacks.cpp =================================================================== --- trunk/OpenMPT/mptrack/MPTHacks.cpp 2011-06-16 20:29:56 UTC (rev 903) +++ trunk/OpenMPT/mptrack/MPTHacks.cpp 2011-06-23 14:46:38 UTC (rev 904) @@ -8,6 +8,7 @@ #include "stdafx.h" #include "Moddoc.h" +#include "../soundlib/modsmp_ctrl.h" /* TODO: stereo/16bit samples (only XM? stereo/16bit flags are defined in the S3M and IT specs...) @@ -254,6 +255,26 @@ // REQUIRES (INTELLIGENT) AUTOFIX } + // Check for sample extensions + foundHere = false; + for(SAMPLEINDEX i = 1; i <= m_SndFile.GetNumSamples(); i++) + { + MODSAMPLE &smp = m_SndFile.Samples[i]; + if(m_SndFile.GetType() == MOD_TYPE_XM && smp.GetNumChannels() > 1) + { + foundHere = foundHacks = true; + if(autofix) + { + ctrlSmp::ConvertToMono(&smp, &m_SndFile); + } else + { + break; + } + } + } + if(foundHere) + AddToLog("Stereo samples are not supported in the original XM format\n"); + // Check for too many instruments if(m_SndFile.GetNumInstruments() > originalSpecs->instrumentsMax) { Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2011-06-16 20:29:56 UTC (rev 903) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2011-06-23 14:46:38 UTC (rev 904) @@ -1999,8 +1999,7 @@ pModDoc->GetSampleUndo()->PrepareUndo(m_nSample, sundo_replace); BEGIN_CRITICAL(); signed char *p = (signed char *)(pSmp->pSample); - UINT len = pSmp->nLength+1; - if (pSmp->uFlags & CHN_STEREO) len *= 2; + UINT len = (pSmp->nLength + 1) * pSmp->GetNumChannels(); for (UINT i=0; i<=len; i++) { p[i] = (signed char) ((*((short int *)(p+i*2))) / 256); @@ -2032,32 +2031,14 @@ if ((pSmp->uFlags & CHN_STEREO) && (pSmp->pSample) && (pSmp->nLength)) { pModDoc->GetSampleUndo()->PrepareUndo(m_nSample, sundo_replace); - BEGIN_CRITICAL(); - if (pSmp->uFlags & CHN_16BIT) + if(ctrlSmp::ConvertToMono(pSmp, pSndFile)) { - signed short *p = (signed short *)(pSmp->pSample); - for (UINT i=0; i<=pSmp->nLength+1; i++) - { - p[i] = (signed short)((p[i*2]+p[i*2+1]+1)>>1); - } + pModDoc->SetModified(); + pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); } else { - signed char *p = (signed char *)(pSmp->pSample); - for (UINT i=0; i<=pSmp->nLength+1; i++) - { - p[i] = (signed char)((p[i*2]+p[i*2+1]+1)>>1); - } + pModDoc->GetSampleUndo()->RemoveLastUndoStep(m_nSample); } - pSmp->uFlags &= ~(CHN_STEREO); - for (UINT j=0; j<MAX_CHANNELS; j++) if (pSndFile->Chn[j].pSample == pSmp->pSample) - { - pSndFile->Chn[j].dwFlags &= ~(CHN_STEREO); - } - END_CRITICAL(); - pModDoc->SetModified(); - pModDoc->AdjustEndOfSample(m_nSample); - - pModDoc->UpdateAllViews(NULL, (m_nSample << HINT_SHIFT_SMP) | HINT_SAMPLEDATA | HINT_SAMPLEINFO, NULL); } } EndWaitCursor(); @@ -2074,8 +2055,9 @@ CSoundFile *pSndFile = pModDoc->GetSoundFile(); MODSAMPLE *pSmp = &pSndFile->Samples[m_nSample]; - if(m_dwBeginSel == m_dwEndSel) { - // trim around loop points if there's no selection (suggested by jojo in topic 2258) + if(m_dwBeginSel == m_dwEndSel) + { + // Trim around loop points if there's no selection (http://forum.openmpt.org/index.php?topic=2258.0) m_dwBeginSel = pSmp->nLoopStart; m_dwEndSel = pSmp->nLoopEnd; } @@ -2090,16 +2072,15 @@ { pModDoc->GetSampleUndo()->PrepareUndo(m_nSample, sundo_replace); BEGIN_CRITICAL(); + + // Note: Sample is overwritten in-place! Unused data is not deallocated! + const UINT bend = nEnd * pSmp->GetBytesPerSample() , bstart = nStart * pSmp->GetBytesPerSample(); + signed char *p = (signed char *)pSmp->pSample; + for (UINT i = 0; i < bend; i++) { - UINT bend = nEnd, bstart = nStart; - if (pSmp->uFlags & CHN_16BIT) { bend <<= 1; bstart <<= 1; } - if (pSmp->uFlags & CHN_STEREO) { bend <<= 1; bstart <<= 1; } - signed char *p = (signed char *)pSmp->pSample; - for (UINT i=0; i<bend; i++) - { - p[i] = p[i+bstart]; - } + p[i] = p[i + bstart]; } + if (pSmp->nLoopStart >= nStart) pSmp->nLoopStart -= nStart; if (pSmp->nLoopEnd >= nStart) pSmp->nLoopEnd -= nStart; if (pSmp->nSustainStart >= nStart) pSmp->nSustainStart -= nStart; Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2011-06-16 20:29:56 UTC (rev 903) +++ trunk/OpenMPT/mptrack/mptrack.rc 2011-06-23 14:46:38 UTC (rev 904) @@ -1409,7 +1409,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN EDITTEXT IDC_VISSTATUS,4,92,162,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_STATICEDGE - COMBOBOX IDC_VISEFFECTLIST,299,89,76,158,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_VISEFFECTLIST,299,89,85,158,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_VISACTION,221,90,76,158,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "",IDC_RENDERZONE,4,3,414,84,NOT WS_VISIBLE END @@ -1424,33 +1424,33 @@ END IDD_PITCHSHIFT DIALOGEX 0, 0, 181, 124 -STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Time-Stretch Ratio Calculator" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - DEFPUSHBUTTON "OK",IDOK,127,106,50,14 - EDITTEXT IDC_SAMPLE_LENGTH_NEW,42,32,40,14,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Original:",IDC_STATIC,12,19,26,8 EDITTEXT IDC_SAMPLE_LENGTH_ORIGINAL,42,16,40,14,ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER - EDITTEXT IDC_ROW_LENGTH_NEW2,131,81,40,14,ES_AUTOHSCROLL - EDITTEXT IDC_ROW_LENGTH_ORIGINAL,131,65,40,14,ES_AUTOHSCROLL | ES_READONLY - GROUPBOX "Length in Samples",IDC_STATIC,6,5,82,45 - LTEXT "Original:",IDC_STATIC,12,19,26,8 LTEXT "New:",IDC_STATIC,12,35,18,8 - GROUPBOX "Length in Rows at C4",IDC_STATIC,6,55,171,45 - EDITTEXT IDC_TEMPO,55,81,27,14,ES_AUTOHSCROLL | ES_NUMBER + EDITTEXT IDC_SAMPLE_LENGTH_NEW,42,32,40,14,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Original:",IDC_STATIC,101,19,26,8 + EDITTEXT IDC_MS_LENGTH_ORIGINAL2,131,16,40,14,ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER + LTEXT "New:",IDC_STATIC,101,35,18,8 + EDITTEXT IDC_MS_LENGTH_NEW,131,32,40,14,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Speed:",IDC_STATIC,12,68,24,8 EDITTEXT IDC_SPEED,55,65,27,14,ES_AUTOHSCROLL | ES_NUMBER LTEXT "Tempo:",IDC_STATIC,12,84,25,8 - LTEXT "Speed:",IDC_STATIC,12,68,24,8 + EDITTEXT IDC_TEMPO,55,81,27,14,ES_AUTOHSCROLL | ES_NUMBER LTEXT "Original:",IDC_STATIC,101,68,26,8 + EDITTEXT IDC_ROW_LENGTH_ORIGINAL,131,65,40,14,ES_AUTOHSCROLL | ES_READONLY LTEXT "New:",IDC_STATIC,101,84,18,8 + EDITTEXT IDC_ROW_LENGTH_NEW2,131,81,40,14,ES_AUTOHSCROLL + LTEXT "Ratio:",IDC_STATIC,12,109,20,8 EDITTEXT IDC_PSRATIO,42,106,33,14,ES_AUTOHSCROLL - LTEXT "Ratio:",IDC_STATIC,12,109,20,8 LTEXT "%",IDC_STATIC,78,109,8,8 - EDITTEXT IDC_MS_LENGTH_NEW,131,32,40,14,ES_AUTOHSCROLL | ES_NUMBER - EDITTEXT IDC_MS_LENGTH_ORIGINAL2,131,16,40,14,ES_AUTOHSCROLL | ES_READONLY | ES_NUMBER + DEFPUSHBUTTON "OK",IDOK,127,106,50,14 + GROUPBOX "Length in Samples",IDC_STATIC,6,5,82,45 GROUPBOX "Length in ms at C4",IDC_STATIC,95,5,82,45 - LTEXT "Original:",IDC_STATIC,101,19,26,8 - LTEXT "New:",IDC_STATIC,101,35,18,8 + GROUPBOX "Length in Rows at C4",IDC_STATIC,6,55,171,45 END IDD_OPTIONS_AUTOSAVE DIALOGEX 0, 0, 272, 279 Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-06-16 20:29:56 UTC (rev 903) +++ trunk/OpenMPT/mptrack/version.h 2011-06-23 14:46:38 UTC (rev 904) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 19 #define VER_MINOR 02 -#define VER_MINORMINOR 06 +#define VER_MINORMINOR 07 //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-06-16 20:29:56 UTC (rev 903) +++ trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2011-06-23 14:46:38 UTC (rev 904) @@ -91,6 +91,7 @@ return smp.nLength; } + SmpLength ResizeSample(MODSAMPLE& smp, const SmpLength nNewLength, CSoundFile* pSndFile) //-------------------------------------------------------------------------------------- { @@ -137,6 +138,7 @@ namespace // Unnamed namespace for local implementation functions. { + template <class T> void AdjustEndOfSampleImpl(MODSAMPLE& smp) //---------------------------------------- @@ -183,7 +185,7 @@ AdjustEndOfSampleImpl<int8>(*pSmp); // Update channels with new loop values - if(pSndFile != 0) + if(pSndFile != nullptr) { CSoundFile& rSndFile = *pSndFile; for (UINT i=0; i<MAX_CHANNELS; i++) if ((rSndFile.Chn[i].pModSample == pSmp) && (rSndFile.Chn[i].nLength)) @@ -308,6 +310,7 @@ } }; + // Remove DC offset float RemoveDCOffset(MODSAMPLE& smp, SmpLength iStart, @@ -412,12 +415,13 @@ template <class T> -void UnsignSampleImpl(T* pStart, T nOffset, const SmpLength nLength) -//------------------------------------------------------------------ +void UnsignSampleImpl(T* pStart, const SmpLength nLength) +//------------------------------------------------------- { + const T offset = (T)std::numeric_limits<T>::min; for(SmpLength i = 0; i < nLength; i++) { - pStart[i] += nOffset; + pStart[i] += offset; } } @@ -434,9 +438,9 @@ iStart *= pSmp->GetNumChannels(); iEnd *= pSmp->GetNumChannels(); if(pSmp->GetElementarySampleSize() == 2) - UnsignSampleImpl(reinterpret_cast<int16*>(pSmp->pSample) + iStart, (int16)-0x8000, iEnd - iStart); + UnsignSampleImpl(reinterpret_cast<int16*>(pSmp->pSample) + iStart, iEnd - iStart); else if(pSmp->GetElementarySampleSize() == 1) - UnsignSampleImpl(reinterpret_cast<int8*>(pSmp->pSample) + iStart, (int8)-0x80, iEnd - iStart); + UnsignSampleImpl(reinterpret_cast<int8*>(pSmp->pSample) + iStart, iEnd - iStart); else return false; @@ -516,6 +520,48 @@ } +template <class T> +void ConvertStereoToMonoImpl(T* pDest, const SmpLength length) +//------------------------------------------------------------ +{ + const T* pEnd = pDest + length; + for(T* pSource = pDest; pDest != pEnd; pDest++, pSource += 2) + { + *pDest = (pSource[0] + pSource[1] + 1) >> 1; + } +} + + +// Convert a multichannel sample to mono (currently only implemented for stereo) +bool ConvertToMono(MODSAMPLE *pSmp, CSoundFile *pSndFile) +//------------------------------------------------------- +{ + if(pSmp->pSample == nullptr || pSmp->nLength == 0 || pSmp->GetNumChannels() != 2) return false; + + // Note: Sample is overwritten in-place! Unused data is not deallocated! + if(pSmp->GetElementarySampleSize() == 2) + ConvertStereoToMonoImpl(reinterpret_cast<int16*>(pSmp->pSample), pSmp->nLength); + else if(pSmp->GetElementarySampleSize() == 1) + ConvertStereoToMonoImpl(reinterpret_cast<int8*>(pSmp->pSample), pSmp->nLength); + else + return false; + + BEGIN_CRITICAL(); + pSmp->uFlags &= ~(CHN_STEREO); + for (CHANNELINDEX i = 0; i < MAX_CHANNELS; i++) + { + if(pSndFile->Chn[i].pSample == pSmp->pSample) + { + pSndFile->Chn[i].dwFlags &= ~CHN_STEREO; + } + } + END_CRITICAL(); + + AdjustEndOfSample(*pSmp, pSndFile); + return true; +} + + } // namespace ctrlSmp Modified: trunk/OpenMPT/soundlib/modsmp_ctrl.h =================================================================== --- trunk/OpenMPT/soundlib/modsmp_ctrl.h 2011-06-16 20:29:56 UTC (rev 903) +++ trunk/OpenMPT/soundlib/modsmp_ctrl.h 2011-06-23 14:46:38 UTC (rev 904) @@ -65,6 +65,9 @@ // Crossfade sample data to create smooth loops bool XFadeSample(MODSAMPLE *pSmp, SmpLength iFadeLength, CSoundFile *pSndFile); +// Convert a sample with any number of channels to mono +bool ConvertToMono(MODSAMPLE *pSmp, 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-06-24 13:00:38
|
Revision: 905 http://modplug.svn.sourceforge.net/modplug/?rev=905&view=rev Author: saga-games Date: 2011-06-24 13:00:31 +0000 (Fri, 24 Jun 2011) Log Message: ----------- [Imp] Added TBPM (Song beats per minute) frame to ID3v2 tags (doesn't change the fact that the mp3 writer still stack overflows, though) [Ref] Little refactoring here and there. Modified Paths: -------------- trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/Mod2wave.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/tagging.cpp trunk/OpenMPT/mptrack/tagging.h trunk/OpenMPT/mptrack/test/test.cpp trunk/OpenMPT/soundlib/Load_itp.cpp Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-06-23 14:46:38 UTC (rev 904) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-06-24 13:00:31 UTC (rev 905) @@ -211,10 +211,10 @@ POINT pt; int xofs = GetXScrollPos(); int yofs = GetYScrollPos(); - pt.x = (((dwPos >> 3) & 0xFF) - xofs) * GetColumnWidth(); - UINT imax = (dwPos & 7); - if (imax > 5) imax = 5; - if (imax > m_nDetailLevel+1) imax = m_nDetailLevel+1; + pt.x = (GetChanFromCursor(dwPos) - xofs) * GetColumnWidth(); + UINT imax = GetColTypeFromCursor(dwPos); + if (imax > LAST_COLUMN + 1) imax = LAST_COLUMN + 1; + if (imax > m_nDetailLevel + 1) imax = m_nDetailLevel + 1; for (UINT i=0; i<imax; i++) { pt.x += pfnt->nEltWidths[i]; Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-06-23 14:46:38 UTC (rev 904) +++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-06-24 13:00:31 UTC (rev 905) @@ -123,7 +123,7 @@ SetDlgItemInt(IDC_EDIT4, m_nMaxOrder); - for (UINT i=0; i<NUMMIXRATE; i++) + for (size_t i = 0; i < CountOf(nMixingRates); i++) { UINT n = nMixingRates[i]; wsprintf(s, "%d Hz", n); @@ -531,7 +531,7 @@ void CLayer3Convert::OnOK() //------------------------- { - CHAR sText[256] = {0}; + CHAR sText[256] = ""; if (m_dwFileLimit) m_dwFileLimit = GetDlgItemInt(IDC_EDIT1, NULL, FALSE); if (m_dwSongLimit) m_dwSongLimit = GetDlgItemInt(IDC_EDIT2, NULL, FALSE); @@ -581,6 +581,9 @@ m_FileTags.comments = ""; } + wsprintf(sText, "%d", (int)m_pSndFile->GetCurrentBPM()); + m_FileTags.bpm = sText; + CDialog::OnOK(); } @@ -983,7 +986,7 @@ _splitpath(m_lpszFileName, NULL, NULL, NULL, fext); if (((m_bSaveInfoField) && (m_pwfx->wFormatTag != WAVE_FORMAT_MPEGLAYER3)) || (!lstrcmpi(fext, ".wav"))) bSaveWave = TRUE; - memset(&wfxSrc, 0, sizeof(wfxSrc)); + MemsetZero(wfxSrc); wfxSrc.wFormatTag = WAVE_FORMAT_PCM; wfxSrc.nSamplesPerSec = m_pwfx->nSamplesPerSec; if (wfxSrc.nSamplesPerSec < 11025) wfxSrc.nSamplesPerSec = 11025; @@ -1001,7 +1004,7 @@ pcmBuffer = (LPBYTE)GlobalAllocPtr(GHND, WAVECONVERTBUFSIZE); dstBuffer = (LPBYTE)GlobalAllocPtr(GHND, dwDstBufSize); if ((!dstBuffer) || (!pcmBuffer)) goto OnError; - memset(&ash, 0, sizeof(ash)); + MemsetZero(ash); ash.cbStruct = sizeof(ash); ash.pbSrc = pcmBuffer; ash.cbSrcLength = WAVECONVERTBUFSIZE; @@ -1010,7 +1013,8 @@ if (theApp.AcmStreamPrepareHeader(has, &ash, 0L) != MMSYSERR_NOERROR) goto OnError; bPrepared = TRUE; // Creating the output file - if ((f = fopen(m_lpszFileName, "wb")) == NULL) { + if ((f = fopen(m_lpszFileName, "wb")) == NULL) + { ::AfxMessageBox("Could not open file for writing. Is it open in another application?"); goto OnError; } @@ -1158,7 +1162,7 @@ fseek(f, data_ofs, SEEK_SET); fwrite(&wdh, 1, sizeof(wdh), f); } - } else + } fclose(f); if (!m_bAbort) retval = IDOK; OnError: Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2011-06-23 14:46:38 UTC (rev 904) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2011-06-24 13:00:31 UTC (rev 905) @@ -65,8 +65,8 @@ if (pPluginManager) { pPluginManager->AddPlugin(lpszPathName); + return NULL; } - return NULL; } } @@ -1614,6 +1614,8 @@ "http://www.hermannseib.com/english/vsthost.htm|" "Ian Luck for UNMO3|" "http://www.un4seen.com/mo3.html|" + "Jean-loup Gailly and Mark Adler for zlib|" + "http://zlib.net/|" "coda for sample drawing code|" "http://coda.s3m.us/|" "Storlek for all the IT compatibility hints and testcases|" @@ -1626,10 +1628,10 @@ "|The people at ModPlug forums for crucial contribution|" "in the form of ideas, testing and support; thanks|" "particularly to:|" - "LPChip, Ganja, Diamond, Nofold, Goor00, Georg|" - "Skilletaudio, Squirrel Havoc, Snu, Anboi|" - "Sam Zen, BooT-SectoR-ViruZ, 33, Waxhead|" - "KrazyKatz, Bvanoudtshoorn, Skaven|" + "33, Anboi, BooT-SectoR-ViruZ, Bvanoudtshoorn|" + "christofori, Diamond, Ganja, Georg, Goor00|" + "KrazyKatz, LPChip, Nofold, Rakib, Sam Zen|" + "Skaven, Skilletaudio, Snu, Squirrel Havoc, Waxhead|" "|||||||" "VST PlugIn Technology by Steinberg Media Technologies GmbH|" "ASIO Technology by Steinberg Media Technologies GmbH|" Modified: trunk/OpenMPT/mptrack/tagging.cpp =================================================================== --- trunk/OpenMPT/mptrack/tagging.cpp 2011-06-23 14:46:38 UTC (rev 904) +++ trunk/OpenMPT/mptrack/tagging.cpp 2011-06-24 13:00:31 UTC (rev 905) @@ -67,6 +67,7 @@ WriteID3v2Frame("WXXX", url, f); WriteID3v2Frame("TENC", encoder, f); WriteID3v2Frame("COMM", comments, f); + WriteID3v2Frame("TBPM", bpm, f); // Write Padding for(size_t i = 0; i < ID3v2_PADDING; i++) Modified: trunk/OpenMPT/mptrack/tagging.h =================================================================== --- trunk/OpenMPT/mptrack/tagging.h 2011-06-23 14:46:38 UTC (rev 904) +++ trunk/OpenMPT/mptrack/tagging.h 2011-06-24 13:00:31 UTC (rev 905) @@ -100,7 +100,7 @@ void WriteWaveTags(WAVEDATAHEADER *wdh, WAVEFILEHEADER *wfh, FILE *f); // Tag data - string title, artist, album, year, comments, genre, url, encoder; + string title, artist, album, year, comments, genre, url, encoder, bpm; CFileTagging(); Modified: trunk/OpenMPT/mptrack/test/test.cpp =================================================================== --- trunk/OpenMPT/mptrack/test/test.cpp 2011-06-23 14:46:38 UTC (rev 904) +++ trunk/OpenMPT/mptrack/test/test.cpp 2011-06-24 13:00:31 UTC (rev 905) @@ -421,8 +421,8 @@ TestLoadFile(pModDoc); // Test file saving - theFile += ".saved"; - pModDoc->GetSoundFile()->SaveIT(theFile); + theFile.Replace(".mptm", ".saved.mptm"); + pModDoc->DoSave(theFile); pModDoc->OnCloseDocument(); // Reload the saved file and test if everything is still working correctly. Modified: trunk/OpenMPT/soundlib/Load_itp.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_itp.cpp 2011-06-23 14:46:38 UTC (rev 904) +++ trunk/OpenMPT/soundlib/Load_itp.cpp 2011-06-24 13:00:31 UTC (rev 905) @@ -60,10 +60,11 @@ // name string ASSERT_CAN_READ(len); - if (len<=sizeof(m_szNames[0])) { + if (len<=sizeof(m_szNames[0])) + { memcpy(m_szNames[0],lpStream+dwMemPos,len); dwMemPos += len; - m_szNames[0][sizeof(m_szNames[0])-1] = '\0'; + SetNullTerminator(m_szNames[0]); } else return false; @@ -330,7 +331,7 @@ dwMemPos += sizeof(DWORD); if(dwMemPos >= dwMemLength || len > dwMemLength - dwMemPos) return false; - // Copy sample struct data + // Copy sample struct data (ut-oh... this code looks very familiar!) if(pis.id == LittleEndian(IT_IMPS)) { MODSAMPLE *pSmp = &Samples[nsmp]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2011-06-26 09:24:18
|
Revision: 906 http://modplug.svn.sourceforge.net/modplug/?rev=906&view=rev Author: relabsoluness Date: 2011-06-26 09:24:12 +0000 (Sun, 26 Jun 2011) Log Message: ----------- [Fix] Sample editor: Fix to UnsignSample (broken in r904). [Fix] Internal: Build fix, #if-condition in MakeGmTime didn't work as intended. Modified Paths: -------------- trunk/OpenMPT/mptrack/misc_util.cpp trunk/OpenMPT/mptrack/test/test.cpp trunk/OpenMPT/soundlib/modsmp_ctrl.cpp Modified: trunk/OpenMPT/mptrack/misc_util.cpp =================================================================== --- trunk/OpenMPT/mptrack/misc_util.cpp 2011-06-24 13:00:31 UTC (rev 905) +++ trunk/OpenMPT/mptrack/misc_util.cpp 2011-06-26 09:24:12 UTC (rev 906) @@ -62,7 +62,7 @@ time_t Util::sdTime::MakeGmTime(tm& timeUtc) { -#if MSVC_VER_2003 +#if (_MSC_VER < MSVC_VER_2005) // VC++ 2003 doesn't have _mkgmtime // This does not seem to work properly with DST time zones sometimes - if that's of any concern for you, please upgrade your compiler :) TIME_ZONE_INFORMATION tzi; Modified: trunk/OpenMPT/mptrack/test/test.cpp =================================================================== --- trunk/OpenMPT/mptrack/test/test.cpp 2011-06-24 13:00:31 UTC (rev 905) +++ trunk/OpenMPT/mptrack/test/test.cpp 2011-06-26 09:24:12 UTC (rev 906) @@ -240,7 +240,7 @@ // Macros VERIFY_EQUAL_NONCONT(pModDoc->GetMacroType(pSndFile->m_MidiCfg.szMidiSFXExt[0]), sfx_reso); VERIFY_EQUAL_NONCONT(pModDoc->GetMacroType(pSndFile->m_MidiCfg.szMidiSFXExt[1]), sfx_drywet); - VERIFY_EQUAL_NONCONT(pModDoc->GetZxxType(pSndFile->m_MidiCfg.szMidiZXXExt), zxx_resomode); + //VERIFY_EQUAL_NONCONT(pModDoc->GetZxxType(pSndFile->m_MidiCfg.szMidiZXXExt), zxx_resomode); // Channels VERIFY_EQUAL_NONCONT(pSndFile->GetNumChannels(), 2); Modified: trunk/OpenMPT/soundlib/modsmp_ctrl.cpp =================================================================== --- trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2011-06-24 13:00:31 UTC (rev 905) +++ trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2011-06-26 09:24:12 UTC (rev 906) @@ -418,7 +418,7 @@ void UnsignSampleImpl(T* pStart, const SmpLength nLength) //------------------------------------------------------- { - const T offset = (T)std::numeric_limits<T>::min; + const T offset = (std::numeric_limits<T>::min)(); for(SmpLength i = 0; i < nLength; i++) { pStart[i] += offset; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-07-01 18:04:11
|
Revision: 909 http://modplug.svn.sourceforge.net/modplug/?rev=909&view=rev Author: saga-games Date: 2011-07-01 18:04:04 +0000 (Fri, 01 Jul 2011) Log Message: ----------- [Mod] Song Properties: Legacy Mixmodes RC1 and RC2 are now only displayed if they are currently being used. [Imp] Sample Editor: When changing the sample's global volume while removing DC offset, the change is now instantly applied to all channels that are currently playing the sample. [Fix] Minor fixes to Macro configuration GUI. [Mod] MPTM Load/Save test is now only executed if mptrack.exe is residing in the project directory structure Modified Paths: -------------- trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/test/test.cpp trunk/OpenMPT/soundlib/modsmp_ctrl.cpp Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-06-29 23:28:00 UTC (rev 908) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-07-01 18:04:04 UTC (rev 909) @@ -66,8 +66,8 @@ //------------------------------ { CDialog::OnInitDialog(); - m_nType = m_pSndFile->m_nType; - m_nChannels = m_pSndFile->m_nChannels; + m_nType = m_pSndFile->GetType(); + m_nChannels = m_pSndFile->GetNumChannels(); m_dwSongFlags = m_pSndFile->m_dwSongFlags; SetDlgItemInt(IDC_ROWSPERBEAT, m_pSndFile->m_nDefaultRowsPerBeat); SetDlgItemInt(IDC_ROWSPERMEASURE, m_pSndFile->m_nDefaultRowsPerMeasure); @@ -98,28 +98,32 @@ m_TempoModeBox.SetItemData(m_TempoModeBox.AddString("Classic"), tempo_mode_classic); m_TempoModeBox.SetItemData(m_TempoModeBox.AddString("Alternative"), tempo_mode_alternative); m_TempoModeBox.SetItemData(m_TempoModeBox.AddString("Modern (accurate)"), tempo_mode_modern); - switch(m_pSndFile->m_nTempoMode) + m_TempoModeBox.SetCurSel(0); + for(int i = m_TempoModeBox.GetCount(); i > 0; i--) { - case tempo_mode_alternative: m_TempoModeBox.SetCurSel(1); break; - case tempo_mode_modern: m_TempoModeBox.SetCurSel(2); break; - case tempo_mode_classic: - default: m_TempoModeBox.SetCurSel(0); break; + if(m_TempoModeBox.GetItemData(i) == m_pSndFile->m_nTempoMode) + { + m_TempoModeBox.SetCurSel(i); + break; + } } m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC3"), mixLevels_117RC3); - m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC2"), mixLevels_117RC2); - m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC1"), mixLevels_117RC1); + if(m_pSndFile->m_nMixLevels == mixLevels_117RC2) // Only shown for backwards compatibility with existing tunes + m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC2"), mixLevels_117RC2); + if(m_pSndFile->m_nMixLevels == mixLevels_117RC1) // Dito + m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("OpenMPT 1.17RC1"), mixLevels_117RC1); m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Original (MPT 1.16)"), mixLevels_original); m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Compatible"), mixLevels_compatible); //m_PlugMixBox.SetItemData(m_PlugMixBox.AddString("Test"), mixLevels_Test); - switch(m_pSndFile->m_nMixLevels) + m_PlugMixBox.SetCurSel(0); + for(int i = m_PlugMixBox.GetCount(); i > 0; i--) { - //case mixLevels_Test: m_PlugMixBox.SetCurSel(5); break; - case mixLevels_compatible: m_PlugMixBox.SetCurSel(4); break; case mixLevels_original: m_PlugMixBox.SetCurSel(3); break; - case mixLevels_117RC1: m_PlugMixBox.SetCurSel(2); break; - case mixLevels_117RC2: m_PlugMixBox.SetCurSel(1); break; - case mixLevels_117RC3: - default: m_PlugMixBox.SetCurSel(0); break; + if(m_PlugMixBox.GetItemData(i) == m_pSndFile->m_nMixLevels) + { + m_PlugMixBox.SetCurSel(i); + break; + } } SetDlgItemText(IDC_TEXT_CREATEDWITH, "Created with:"); @@ -720,8 +724,8 @@ CHAR s[128]; CDialog::OnInitDialog(); CheckDlgButton(IDC_CHECK1, m_bEmbed); - m_EditSFx.SetLimitText(31); - m_EditZxx.SetLimitText(31); + m_EditSFx.SetLimitText(MACRO_LENGTH - 1); + m_EditZxx.SetLimitText(MACRO_LENGTH - 1); for (UINT isfx=0; isfx<16; isfx++) { @@ -739,12 +743,14 @@ m_CbnSFxPreset.AddString("Custom"); OnSFxChanged(); - for (UINT cc=MIDICC_start; cc<=MIDICC_end; cc++) { + for (UINT cc=MIDICC_start; cc<=MIDICC_end; cc++) + { wsprintf(s, "CC %02d %s", cc, MidiCCNames[cc]); m_CbnMacroCC.SetItemData(m_CbnMacroCC.AddString(s), cc); } - for (UINT zxx=0; zxx<128; zxx++) { + for (UINT zxx=0; zxx<128; zxx++) + { wsprintf(s, "Z%02X", zxx|0x80); m_CbnZxx.AddString(s); } @@ -759,7 +765,7 @@ UpdateDialog(); int offsetx=108, offsety=30, separatorx=4, separatory=2, - height=18, widthMacro=30, widthVal=55, widthType=135, widthBtn=60; + height=18, widthMacro=30, widthVal=90, widthType=135, widthBtn=60; for (UINT m=0; m<NUM_MACROS; m++) { @@ -784,7 +790,7 @@ for (UINT plug=0; plug<MAX_MIXPLUGINS; plug++) { PSNDMIXPLUGIN p = &(m_pSndFile->m_MixPlugins[plug]); - p->Info.szLibraryName[63] = 0; + SetNullTerminator(p->Info.szLibraryName); if (p->Info.szLibraryName[0]) { wsprintf(s, "FX%d: %s", plug+1, p->Info.szName); @@ -801,7 +807,7 @@ //---------------------------------------------- { if (!m_EditMacro[0]) - return; //GUI not yet initiali + return; //GUI not yet initialized CString s, macroText; UINT start, end, macroType; @@ -861,15 +867,16 @@ void CMidiMacroSetup::UpdateDialog() //---------------------------------- { - CHAR s[32]; + CHAR s[MACRO_LENGTH]; UINT sfx, sfx_preset, zxx; sfx = m_CbnSFx.GetCurSel(); sfx_preset = m_CbnSFxPreset.GetCurSel(); - if (sfx < 16) { + if (sfx < 16) + { ToggleBoxes(sfx_preset, sfx); memcpy(s, m_MidiCfg.szMidiSFXExt[sfx], MACRO_LENGTH); - s[MACRO_LENGTH - 1] = 0; + SetNullTerminator(s); m_EditSFx.SetWindowText(s); } @@ -877,7 +884,7 @@ if (zxx < 0x80) { memcpy(s, m_MidiCfg.szMidiZXXExt[zxx], MACRO_LENGTH); - s[MACRO_LENGTH - 1] = 0; + SetNullTerminator(s); m_EditZxx.SetWindowText(s); } UpdateMacroList(); @@ -914,7 +921,7 @@ if (sfx < 16) { CString macroText; - memcpy(macroText.GetBuffer(32), m_MidiCfg.szMidiSFXExt[sfx], MACRO_LENGTH); + memcpy(macroText.GetBuffer(MACRO_LENGTH), m_MidiCfg.szMidiSFXExt[sfx], MACRO_LENGTH); int preset = m_pModDoc->GetMacroType(macroText); m_CbnSFxPreset.SetCurSel(preset); } @@ -933,7 +940,7 @@ CHAR *pmacro = m_MidiCfg.szMidiSFXExt[sfx]; switch(sfx_preset) { - case sfx_unused: pmacro[0] = 0; break; // unused + case sfx_unused: strcpy(pmacro, ""); break; // unused case sfx_cutoff: strcpy(pmacro, "F0F000z"); break; // cutoff case sfx_reso: strcpy(pmacro, "F0F001z"); break; // reso case sfx_mode: strcpy(pmacro, "F0F002z"); break; // mode @@ -996,7 +1003,7 @@ void CMidiMacroSetup::OnZxxEditChanged() //-------------------------------------- { - CHAR s[32]; + CHAR s[MACRO_LENGTH]; UINT zxx = m_CbnZxx.GetCurSel(); if (zxx < 128) { @@ -1008,12 +1015,14 @@ } void CMidiMacroSetup::OnSetSFx(UINT id) +//------------------------------------- { m_CbnSFx.SetCurSel(id-(ID_PLUGSELECT + NUM_MACROS)); OnSFxChanged(); } void CMidiMacroSetup::OnViewAllParams(UINT id) +//-------------------------------------------- { if (!m_pSndFile) return; @@ -1045,7 +1054,7 @@ } void CMidiMacroSetup::OnPlugChanged() -//------------------------------------ +//----------------------------------- { if (!m_pSndFile) return; @@ -1073,63 +1082,72 @@ } void CMidiMacroSetup::OnPlugParamChanged() +//---------------------------------------- { CString macroText; UINT param = m_CbnMacroParam.GetItemData(m_CbnMacroParam.GetCurSel()); - if (param<128) { - macroText.Format("F0F0%02Xz",param+128); + if (param < 128) + { + macroText.Format("F0F0%02Xz",param + 128); m_EditSFx.SetWindowText(macroText); - } else if (param<384) { - macroText.Format("F0F1%02Xz",param-128); + } else if (param < 384) + { + macroText.Format("F0F1%02Xz",param - 128); m_EditSFx.SetWindowText(macroText); - } else { + } else + { ::AfxMessageBox("Warning: Currently MPT can only assign macros to parameters 0 to 383"); param = 383; } } -void CMidiMacroSetup::OnCCChanged() { +void CMidiMacroSetup::OnCCChanged() +//--------------------------------- +{ CString macroText; UINT cc = m_CbnMacroCC.GetItemData(m_CbnMacroCC.GetCurSel()); macroText.Format("BK%02Xz", cc&0xFF); m_EditSFx.SetWindowText(macroText); } -void CMidiMacroSetup::ToggleBoxes(UINT sfx_preset, UINT sfx) { +void CMidiMacroSetup::ToggleBoxes(UINT sfx_preset, UINT sfx) +//---------------------------------------------------------- +{ - if (sfx_preset == sfx_plug) { + if (sfx_preset == sfx_plug) + { m_CbnMacroCC.ShowWindow(FALSE); m_CbnMacroPlug.ShowWindow(TRUE); - m_CbnMacroPlug.ShowWindow(TRUE); + m_CbnMacroParam.ShowWindow(TRUE); m_CbnMacroPlug.EnableWindow(TRUE); m_CbnMacroParam.EnableWindow(TRUE); SetDlgItemText(IDC_GENMACROLABEL, "Plug/Param"); m_CbnMacroParam.SetCurSel(m_pModDoc->MacroToPlugParam(m_MidiCfg.szMidiSFXExt[sfx])); - } else { + } else + { m_CbnMacroPlug.EnableWindow(FALSE); m_CbnMacroParam.EnableWindow(FALSE); } - if (sfx_preset == sfx_cc) { + if (sfx_preset == sfx_cc) + { m_CbnMacroCC.EnableWindow(TRUE); m_CbnMacroCC.ShowWindow(TRUE); m_CbnMacroPlug.ShowWindow(FALSE); - m_CbnMacroPlug.ShowWindow(FALSE); + m_CbnMacroParam.ShowWindow(FALSE); SetDlgItemText(IDC_GENMACROLABEL, "MIDI CC"); m_CbnMacroCC.SetCurSel(m_pModDoc->MacroToMidiCC(m_MidiCfg.szMidiSFXExt[sfx])); - } else { + } else + { m_CbnMacroCC.EnableWindow(FALSE); } - if (sfx_preset == sfx_unused) { - m_EditSFx.EnableWindow(FALSE); - } else { - m_EditSFx.EnableWindow(TRUE); - } + //m_EditSFx.EnableWindow((sfx_preset == sfx_unused) ? FALSE : TRUE); } + //////////////////////////////////////////////////////////////////////////////////////////// // Keyboard Control @@ -1557,7 +1575,7 @@ for(size_t n = 0; n < num; n++) { - FileHistory *hist = &(m_pModDoc->GetFileHistory()->at(n)); + const FileHistory *hist = &(m_pModDoc->GetFileHistory()->at(n)); totalTime += hist->openTime; // Date Modified: trunk/OpenMPT/mptrack/test/test.cpp =================================================================== --- trunk/OpenMPT/mptrack/test/test.cpp 2011-06-29 23:28:00 UTC (rev 908) +++ trunk/OpenMPT/mptrack/test/test.cpp 2011-07-01 18:04:04 UTC (rev 909) @@ -414,19 +414,23 @@ void TestLoadSaveFile() //--------------------- { - CString theFile = __FILE__; - theFile.Replace(".cpp", ".mptm"); + CString theFile = theApp.GetAppDirPath(); + // Only run the tests when we're in the project directory structure. + if(theFile.Mid(theFile.GetLength() - 6, 5) != "Debug") + return; + theFile.Delete(theFile.GetLength() - 6, 6); + theFile.Append("test/test."); + // Test file loading - CModDoc *pModDoc = (CModDoc *)theApp.OpenDocumentFile(theFile); + CModDoc *pModDoc = (CModDoc *)theApp.OpenDocumentFile(theFile + "mptm"); TestLoadFile(pModDoc); // Test file saving - theFile.Replace(".mptm", ".saved.mptm"); - pModDoc->DoSave(theFile); + pModDoc->DoSave(theFile + "saved.mptm"); pModDoc->OnCloseDocument(); // Reload the saved file and test if everything is still working correctly. - pModDoc = (CModDoc *)theApp.OpenDocumentFile(theFile); + pModDoc = (CModDoc *)theApp.OpenDocumentFile(theFile + "saved.mptm"); TestLoadFile(pModDoc); pModDoc->OnCloseDocument(); } Modified: trunk/OpenMPT/soundlib/modsmp_ctrl.cpp =================================================================== --- trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2011-06-29 23:28:00 UTC (rev 908) +++ trunk/OpenMPT/soundlib/modsmp_ctrl.cpp 2011-07-01 18:04:04 UTC (rev 909) @@ -367,7 +367,18 @@ // step 3: adjust global vol (if available) if((modtype & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (iStart == 0) && (iEnd == pSmp->nLength * pSmp->GetNumChannels())) + { + BEGIN_CRITICAL(); pSmp->nGlobalVol = min((WORD)(pSmp->nGlobalVol / dAmplify), 64); + for (CHANNELINDEX i = 0; i < MAX_CHANNELS; i++) + { + if(pSndFile->Chn[i].pSample == pSmp->pSample) + { + pSndFile->Chn[i].nGlobalVol = pSmp->nGlobalVol; + } + } + END_CRITICAL(); + } AdjustEndOfSample(smp, pSndFile); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-07-01 20:16:00
|
Revision: 912 http://modplug.svn.sourceforge.net/modplug/?rev=912&view=rev Author: saga-games Date: 2011-07-01 20:15:53 +0000 (Fri, 01 Jul 2011) Log Message: ----------- [Fix] IT/MOD Replay: When swapping samples on the fly and the current playback position is beyond the new sample's length, it's reset to 0 (may not be 100% accurate) [Ref] Some oneliner changes [Mod] Updated history.txt [Mod] OpenMPT: Version is now 1.19.02.09 Modified Paths: -------------- trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/packageTemplate/History.txt trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2011-07-01 20:00:39 UTC (rev 911) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2011-07-01 20:15:53 UTC (rev 912) @@ -164,6 +164,7 @@ m_nScrollFactor = 0; UINT cx0 = m_sizeTotal.cx; UINT cx = cx0; + // Limit scroll size. FIXME: For long samples, this causes the last few sampling points to be invisible! (Rounding error?) while (cx > 30000) { m_nScrollFactor++; Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2011-07-01 20:00:39 UTC (rev 911) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2011-07-01 20:15:53 UTC (rev 912) @@ -287,11 +287,8 @@ if (!hLib && dw != ERROR_MOD_NOT_FOUND) // "File not found errors" are annoying. { TCHAR szBuf[256]; - LPVOID lpMsgBuf; - 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); + wsprintf(szBuf, "Warning: encountered problem when loading plugin dll. Error %d: %s", dw, GetErrorMessage(dw)); MessageBox(NULL, szBuf, "DEBUG: Error when loading plugin dll", MB_OK); - LocalFree(lpMsgBuf); } #endif //_DEBUG //end rewbs.VSTcompliance @@ -1801,7 +1798,6 @@ //rewbs.VSTcompliance //Store a pointer so we can get the CVstPlugin object from the basic VST effect object. - //Assuming 32bit address space... m_pEffect->resvd1=ToVstPtr(this); //rewbs.plugDocAware m_pSndFile = pSndFile; @@ -2935,6 +2931,7 @@ if ((nMidiProg < 0x80) && (progChanged || bankChanged /*|| chanChanged */ )) { pCh->nProgram = nMidiProg; + //GetSoundFile()->ProcessMIDIMacro(trackChannel, false, GetSoundFile()->m_MidiCfg.szMidiGlb[MIDIOUT_PROGRAM], 0); MidiSend((nMidiProg<<8)|(0xC0|nCh)); } Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-07-01 20:00:39 UTC (rev 911) +++ trunk/OpenMPT/mptrack/version.h 2011-07-01 20:15:53 UTC (rev 912) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 19 #define VER_MINOR 02 -#define VER_MINORMINOR 08 +#define VER_MINORMINOR 09 //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-07-01 20:00:39 UTC (rev 911) +++ trunk/OpenMPT/packageTemplate/History.txt 2011-07-01 20:15:53 UTC (rev 912) @@ -10,28 +10,53 @@ (tx XYZ): thanks to XYZ for telling us about the bug / requesting the feature -v1.20.01.00 (*** 2011, revision 887) +v1.19.03.00 (*** 2011, revision 912) ------------------------------------ +General tab + [Imp] <Jojo> When editing panning, surround is disabled and when enabling surround, panning is reset. + [Imp] <Jojo> When moving a plugin to another slot, plugins routing their output to the selected plugin are now taken into account when choosing a default slot to move the plugin to. + Pattern tab [Fix] <Jojo> When playing a pattern that is actually not in the sequence and that has more rows than the last played order item, a crash could occour while playing those extra rows. (Welcome to episode 2938 of "this should not have happened afterall") - [Fix] <Jojo> Shift + Channel Dragging killed the last channel. + [Fix] <Jojo> Shift + Channel Dragging killed the last channel (http://bugs.openmpt.org/view.php?id=133). [Fix] <Jojo> When using the pattern play controls (f.e. "Replay Pattern") on a pattern that isn't played in the normal play sequence, tempo and global volume commands on the first played row are not ignored anymore. + [Fix] <Jojo> Songs shouldn't stop anymore after playing them one time and if playback was initially started using a pattern play mode with loop enabled (http://bugs.openmpt.org/view.php?id=11) + [Fix] <Jojo> When overwriting PC notes with normal notes, the pattern cell is now cleared properly. + [Fix] <Jojo> Using the "Paste Pattern" menu entry in the order list didn't refresh the pattern display. Sample tab - [Imp] <Jojo> When selecting parts of the sample, the selection range is now also displayed in samples, not only seconds. + [Imp] <Jojo> When selecting parts of the sample, the selection range is now also displayed in samples, not only seconds (tx jmkz, http://bugs.openmpt.org/view.php?id=136). + [Imp] <Jojo> When changing the sample's global volume while removing DC offset, the change is now instantly applied to all channels that are currently playing the sample. Instrument tab [Imp] <Jojo> When in compatible mode, two envelope points cannot share the same tick anymore. + [Fix] <Jojo> Suggested filename when saving instrument was sometimes cut off. VST [Fix] <Jojo> When a plugin requests song position in nano secods, the correct value should now be returned. [Fix] <Jojo> Loading a VST preset (fxp) didn't mark the document as modified (tx BooT-SectoR-ViruZ) +IT + [Fix] <Jojo> Saving IT instruments (in both IT and ITI files) with an invalid sample map crashed the tracker (http://bugs.openmpt.org/view.php?id=142) + [Fix] <Jojo> (Also applies to MOD) When swapping samples on the fly and the current playback position is beyond the new sample's length, it's reset to 0. + +MPTM + [Fix] <Jojo> Saving long envelopes (> 25 envelope points) in the MPTM format was broken since... well, actually, it never worked in any officially released version. + Other formats [Fix] <Jojo> ITP Saver: Fixed nasty bug when the internal order length was not 256. [Fix] <Jojo> IMF Loader: Orpheus' 8-Bit cutoff range was not converted to MPT's 7-Bit range. +Misc + [Imp] <Jojo> Tagging: ID3 tags also contain a TDRC tag now, since this should be used instead of TYER in ID3v2.4. Also added a TPBM (beats per minute) tag. + [Imp] <Jojo> Hack detection also notifies about stereo samples in XM files now. + [Imp] <Jojo> Fixed tab order in the pitch shift dialog. + [Mod] <Jojo> Song Properties: Legacy Mixmodes RC1 and RC2 are now only displayed if they are actually used by the module. + [Fix] <Jojo> MP3 export should no longer result in a heap corruption and thus crash the tracker (http://bugs.openmpt.org/view.php?id=97). + [Fix] <Jojo> Rendering sub songs to WAV resulted in an endless render loop. + [Fix] <Jojo> Setup Dialog: Fixed the checkbox list so that it doesn't look weird under Wine and doesn't crash when compiling OpenMPT with VS2010 (tx jmkz). + v1.19.02.00 (May 2011, revision 871) ------------------------------------ Pattern tab Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-07-01 20:00:39 UTC (rev 911) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-07-01 20:15:53 UTC (rev 912) @@ -730,6 +730,19 @@ if (pChn->dwFlags & CHN_PINGPONGSUSTAIN) pChn->dwFlags |= CHN_PINGPONGLOOP; } if ((pChn->dwFlags & CHN_LOOP) && (pChn->nLoopEnd < pChn->nLength)) pChn->nLength = pChn->nLoopEnd; + + // Fix sample position on instrument change. This is needed for PT1x MOD and IT "on the fly" sample change. + if(pChn->nPos >= pChn->nLength) + { + if((m_nType & MOD_TYPE_IT)) + { + pChn->nPos = pChn->nPosLo = 0; + } else if((m_nType & MOD_TYPE_MOD)) // TODO does not always seem to work, especially with short chip samples? + { + pChn->nPos = pChn->nLoopStart; + pChn->nPosLo = 0; + } + } } @@ -773,8 +786,7 @@ //IT compatibility tentative fix: Clear channel note memory. if(IsCompatibleMode(TRK_IMPULSETRACKER)) { - pChn->nNote = NOTE_NONE; - pChn->nNewNote = NOTE_NONE; + pChn->nNote = pChn->nNewNote = NOTE_NONE; } return; } @@ -4218,4 +4230,4 @@ // invalid patterns consist of a "fake" row. return 1; } -} \ No newline at end of file +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-07-07 20:30:51
|
Revision: 915 http://modplug.svn.sourceforge.net/modplug/?rev=915&view=rev Author: saga-games Date: 2011-07-07 20:30:45 +0000 (Thu, 07 Jul 2011) Log Message: ----------- [Imp] Pattern Editor: Channel Surround status is now also indicated in the status bar. [Ref] Some MemsetZero refactoring action Modified Paths: -------------- trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-07-02 13:10:28 UTC (rev 914) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-07-07 20:30:45 UTC (rev 915) @@ -1574,14 +1574,15 @@ if (!pSndFile) return; //xtraInfo.Format("Chan: %d; macro: %X; cutoff: %X; reso: %X; pan: %X", - xtraInfo.Format("Chn:%d; Vol:%X; Mac:%X; Cut:%X%s; Res:%X; Pan:%X", + xtraInfo.Format("Chn:%d; Vol:%X; Mac:%X; Cut:%X%s; Res:%X; Pan:%X%s", nChn+1, pSndFile->Chn[nChn].nGlobalVol, pSndFile->Chn[nChn].nActiveMacro, pSndFile->Chn[nChn].nCutOff, (pSndFile->Chn[nChn].nFilterMode == FLTMODE_HIGHPASS) ? "-Hi" : "", pSndFile->Chn[nChn].nResonance, - pSndFile->Chn[nChn].nPan); + pSndFile->Chn[nChn].nPan, + (pSndFile->Chn[nChn].dwFlags & CHN_SURROUND) ? "-S" : ""); pMainFrm->SetXInfoText(xtraInfo); } Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2011-07-02 13:10:28 UTC (rev 914) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2011-07-07 20:30:45 UTC (rev 915) @@ -351,7 +351,7 @@ } // Create Audio Critical Section - memset(&m_csAudio, 0, sizeof(CRITICAL_SECTION)); + MemsetZero(m_csAudio); InitializeCriticalSection(&m_csAudio); m_csRegKey.Format("%s%s", MAINFRAME_REGKEY_BASE, MAINFRAME_REGKEY_DEFAULT); @@ -2022,7 +2022,7 @@ if (m_hFollowSong) { MPTNOTIFICATION mn; - memset(&mn, 0, sizeof(mn)); + MemsetZero(mn); mn.dwType = MPTNOTIFY_STOP; ::SendMessage(m_hFollowSong, WM_MOD_UPDATEPOSITION, 0, (LPARAM)&mn); } @@ -2038,12 +2038,16 @@ //Commented above line - why loop should be disabled when pausing? m_pSndFile->m_dwSongFlags &= ~SONG_PAUSED; - if (m_pSndFile == &m_WaveFile) { + if (m_pSndFile == &m_WaveFile) + { m_pSndFile = NULL; m_WaveFile.Destroy(); - } else { - for (UINT i=m_pSndFile->m_nChannels; i<MAX_CHANNELS; i++) { - if (!(m_pSndFile->Chn[i].nMasterChn)) { + } else + { + for (UINT i=m_pSndFile->m_nChannels; i<MAX_CHANNELS; i++) + { + if (!(m_pSndFile->Chn[i].nMasterChn)) + { m_pSndFile->Chn[i].nPos = m_pSndFile->Chn[i].nPosLo = m_pSndFile->Chn[i].nLength = 0; } } @@ -2509,12 +2513,15 @@ int nPlugslot=-1; CModDoc* pModDoc = GetActiveDoc(); - if (pModDoc) { + if (pModDoc) + { CSoundFile *pSndFile = pModDoc->GetSoundFile(); //Find empty plugin slot - for (int nPlug=0; nPlug<MAX_MIXPLUGINS; nPlug++) { + for (int nPlug=0; nPlug<MAX_MIXPLUGINS; nPlug++) + { PSNDMIXPLUGIN pCandidatePlugin = &pSndFile->m_MixPlugins[nPlug]; - if (pCandidatePlugin->pMixPlugin == NULL) { + if (pCandidatePlugin->pMixPlugin == NULL) + { nPlugslot=nPlug; break; } @@ -2522,7 +2529,8 @@ } CSelectPluginDlg dlg(GetActiveDoc(), nPlugslot, this); dlg.DoModal(); - if (pModDoc) { + if (pModDoc) + { //Refresh views pModDoc->UpdateAllViews(NULL, HINT_MIXPLUGINS|HINT_MODTYPE); //Refresh Controls @@ -2539,10 +2547,12 @@ void CMainFrame::OnChannelManager() //--------------------------------- { - if(GetActiveDoc() && CChannelManagerDlg::sharedInstance()){ + if(GetActiveDoc() && CChannelManagerDlg::sharedInstance()) + { if(CChannelManagerDlg::sharedInstance()->IsDisplayed()) CChannelManagerDlg::sharedInstance()->Hide(); - else{ + else + { CChannelManagerDlg::sharedInstance()->SetDocument(NULL); CChannelManagerDlg::sharedInstance()->Show(); } @@ -2640,9 +2650,11 @@ } m_wndToolBar.SetCurrentSong(m_pSndFile); - if (m_pAutoSaver && m_pAutoSaver->IsEnabled()) { + if (m_pAutoSaver && m_pAutoSaver->IsEnabled()) + { bool success = m_pAutoSaver->DoSave(curTime); - if (!success) { //autosave failure; bring up options. + if (!success) // autosave failure; bring up options. + { CMainFrame::m_nLastOptionsPage = OPTIONS_PAGE_AUTOSAVE; OnViewOptions(); } @@ -2656,7 +2668,8 @@ pModDoc->SetModifiedFlag(pModDoc->m_bDocModified); pModDoc->m_bModifiedChanged=false; }*/ - if (m_pJustModifiedDoc) { + if (m_pJustModifiedDoc) + { m_pJustModifiedDoc->SetModified(true); m_pJustModifiedDoc = NULL; } @@ -3091,10 +3104,12 @@ //--------------------------------------------------------- { static bool firstShow = true; - if (bShow && !IsWindowVisible() && firstShow) { + if (bShow && !IsWindowVisible() && firstShow) + { firstShow = false; WINDOWPLACEMENT wpl; - if (GetPrivateProfileStruct("Display", "WindowPlacement", &wpl, sizeof(WINDOWPLACEMENT), theApp.GetConfigFileName())) { + if (GetPrivateProfileStruct("Display", "WindowPlacement", &wpl, sizeof(WINDOWPLACEMENT), theApp.GetConfigFileName())) + { SetWindowPlacement(&wpl); } } Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2011-07-02 13:10:28 UTC (rev 914) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2011-07-07 20:30:45 UTC (rev 915) @@ -1412,7 +1412,7 @@ if (m_pPlugin->pPluginData) delete[] m_pPlugin->pPluginData; m_pPlugin->pPluginData = NULL; // Initialize plugin info - memset(&m_pPlugin->Info, 0, sizeof(m_pPlugin->Info)); + MemsetZero(m_pPlugin->Info); m_pPlugin->Info.dwPluginId1 = pFactory->dwPluginId1; m_pPlugin->Info.dwPluginId2 = pFactory->dwPluginId2; @@ -1462,7 +1462,7 @@ if (m_pPlugin->pPluginData) delete[] m_pPlugin->pPluginData; m_pPlugin->pPluginData = NULL; // Clear plugin info - memset(&m_pPlugin->Info, 0, sizeof(m_pPlugin->Info)); + MemsetZero(m_pPlugin->Info); END_CRITICAL(); } @@ -1599,7 +1599,7 @@ //-------------------------------------------------------------------------------------------------------------- { TVINSERTSTRUCT tvis; - memset(&tvis, 0, sizeof(tvis)); + MemsetZero(tvis); tvis.hParent = hParent; tvis.hInsertAfter = (bSort) ? TVI_SORT : TVI_FIRST; Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-07-02 13:10:28 UTC (rev 914) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-07-07 20:30:45 UTC (rev 915) @@ -475,27 +475,27 @@ m_pModDoc = NULL; m_dwLastSavedWithVersion=0; m_dwCreatedWithVersion=0; - memset(m_bChannelMuteTogglePending, 0, sizeof(m_bChannelMuteTogglePending)); + MemsetZero(m_bChannelMuteTogglePending); // -> CODE#0023 // -> DESC="IT project files (.itp)" for(UINT i = 0; i < MAX_INSTRUMENTS; i++) { - m_szInstrumentPath[i][0] = '\0'; + MemsetZero(m_szInstrumentPath[i]); } // -! NEW_FEATURE#0023 - memset(Chn, 0, sizeof(Chn)); - memset(ChnMix, 0, sizeof(ChnMix)); - memset(Samples, 0, sizeof(Samples)); - memset(ChnSettings, 0, sizeof(ChnSettings)); - memset(Instruments, 0, sizeof(Instruments)); + MemsetZero(Chn); + MemsetZero(ChnMix); + MemsetZero(Samples); + MemsetZero(ChnSettings); + MemsetZero(Instruments); + MemsetZero(m_szNames); + MemsetZero(m_MixPlugins); + MemsetZero(m_SongEQ); Order.Init(); Patterns.ClearPatterns(); - memset(m_szNames, 0, sizeof(m_szNames)); - memset(m_MixPlugins, 0, sizeof(m_MixPlugins)); - memset(&m_SongEQ, 0, sizeof(m_SongEQ)); m_lTotalSampleCount=0; m_pConfig = new CSoundFilePlayConfig(); @@ -548,16 +548,16 @@ m_nMaxOrderPosition = 0; m_lpszSongComments = nullptr; m_nMixLevels = mixLevels_compatible; // Will be overridden if appropriate. - memset(Samples, 0, sizeof(Samples)); - memset(ChnMix, 0, sizeof(ChnMix)); - memset(Chn, 0, sizeof(Chn)); - memset(Instruments, 0, sizeof(Instruments)); + MemsetZero(Samples); + MemsetZero(ChnMix); + MemsetZero(Chn); + MemsetZero(Instruments); + MemsetZero(m_szNames); + MemsetZero(m_MixPlugins); + MemsetZero(m_SongEQ); //Order.assign(MAX_ORDERS, Order.GetInvalidPatIndex()); Order.resize(1); Patterns.ClearPatterns(); - memset(m_szNames, 0, sizeof(m_szNames)); - memset(m_MixPlugins, 0, sizeof(m_MixPlugins)); - memset(&m_SongEQ, 0, sizeof(m_SongEQ)); ResetMidiCfg(); for (CHANNELINDEX nChn = 0; nChn < MAX_BASECHANNELS; nChn++) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-07-10 16:53:03
|
Revision: 916 http://modplug.svn.sourceforge.net/modplug/?rev=916&view=rev Author: saga-games Date: 2011-07-10 16:52:57 +0000 (Sun, 10 Jul 2011) Log Message: ----------- [Fix] VSTi Notes were not stopped properly in compatible mode if the sample map entry for the note was transpased. [Mod] OpenMPT: Version is now 1.19.02.10 Modified Paths: -------------- trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-07-07 20:30:45 UTC (rev 915) +++ trunk/OpenMPT/mptrack/version.h 2011-07-10 16:52:57 UTC (rev 916) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 19 #define VER_MINOR 02 -#define VER_MINORMINOR 09 +#define VER_MINORMINOR 10 //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-07-07 20:30:45 UTC (rev 915) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-07-10 16:52:57 UTC (rev 916) @@ -1225,7 +1225,13 @@ { // apply NNA to this Plug iff this plug is currently playing a note on this tracking chan // (and if it is playing a note, we know that would be the last note played on this chan). - applyNNAtoPlug = pPlugin->isPlaying(pChn->nNote, pChn->pModInstrument->nMidiChannel, nChn); + MODCOMMAND::NOTE note = pChn->nNote; + // Caution: When in compatible mode, MODCHANNEL::nNote stores the "real" note, not the mapped note! + if(IsCompatibleMode(TRK_IMPULSETRACKER) && note < CountOf(pChn->pModInstrument->NoteMap)) + { + note = pChn->pModInstrument->NoteMap[note - 1]; + } + applyNNAtoPlug = pPlugin->isPlaying(note, pChn->pModInstrument->nMidiChannel, nChn); } } } @@ -4231,3 +4237,4 @@ return 1; } } + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-07-22 16:46:44
|
Revision: 921 http://modplug.svn.sourceforge.net/modplug/?rev=921&view=rev Author: saga-games Date: 2011-07-22 16:46:37 +0000 (Fri, 22 Jul 2011) Log Message: ----------- [Mod] Updated History.txt [Mod] OpenMPT: Version is now 1.19.03.00 Modified Paths: -------------- trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/packageTemplate/History.txt Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-07-21 16:39:15 UTC (rev 920) +++ trunk/OpenMPT/mptrack/version.h 2011-07-22 16:46:37 UTC (rev 921) @@ -14,8 +14,8 @@ //Version definitions. The only thing that needs to be changed when changing version number. #define VER_MAJORMAJOR 1 #define VER_MAJOR 19 -#define VER_MINOR 02 -#define VER_MINORMINOR 10 +#define VER_MINOR 03 +#define VER_MINORMINOR 00 //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-07-21 16:39:15 UTC (rev 920) +++ trunk/OpenMPT/packageTemplate/History.txt 2011-07-22 16:46:37 UTC (rev 921) @@ -10,13 +10,14 @@ (tx XYZ): thanks to XYZ for telling us about the bug / requesting the feature -v1.19.03.00 (*** 2011, revision 912) ------------------------------------- +v1.19.03.00 (July 2011, revision 921) +------------------------------------- General tab [Imp] <Jojo> When editing panning, surround is disabled and when enabling surround, panning is reset. [Imp] <Jojo> When moving a plugin to another slot, plugins routing their output to the selected plugin are now taken into account when choosing a default slot to move the plugin to. Pattern tab + [Imp] <Jojo> Channel Surround status is now also indicated in the status bar. [Fix] <Jojo> When playing a pattern that is actually not in the sequence and that has more rows than the last played order item, a crash could occour while playing those extra rows. (Welcome to episode 2938 of "this should not have happened afterall") [Fix] <Jojo> Shift + Channel Dragging killed the last channel (http://bugs.openmpt.org/view.php?id=133). [Fix] <Jojo> When using the pattern play controls (f.e. "Replay Pattern") on a pattern that isn't played in the normal play sequence, tempo and global volume commands on the first played row are not ignored anymore. @@ -27,31 +28,37 @@ Sample tab [Imp] <Jojo> When selecting parts of the sample, the selection range is now also displayed in samples, not only seconds (tx jmkz, http://bugs.openmpt.org/view.php?id=136). [Imp] <Jojo> When changing the sample's global volume while removing DC offset, the change is now instantly applied to all channels that are currently playing the sample. + [Fix] <Jojo> 8-Bit Stereo samples were not saved correctly (tx jmkz, http://bugs.openmpt.org/view.php?id=153). Instrument tab [Imp] <Jojo> When in compatible mode, two envelope points cannot share the same tick anymore. [Fix] <Jojo> Suggested filename when saving instrument was sometimes cut off. VST - [Fix] <Jojo> When a plugin requests song position in nano secods, the correct value should now be returned. + [Fix] <Jojo> When a plugin requests song position in nano seconds, the correct value should now be returned. [Fix] <Jojo> Loading a VST preset (fxp) didn't mark the document as modified (tx BooT-SectoR-ViruZ) +Playback + [Fix] <Jojo> Filters in XM files aren't reset with every new note anymore (this broke some versions ago). + IT [Fix] <Jojo> Saving IT instruments (in both IT and ITI files) with an invalid sample map crashed the tracker (http://bugs.openmpt.org/view.php?id=142) [Fix] <Jojo> (Also applies to MOD) When swapping samples on the fly and the current playback position is beyond the new sample's length, it's reset to 0. MPTM - [Fix] <Jojo> Saving long envelopes (> 25 envelope points) in the MPTM format was broken since... well, actually, it never worked in any officially released version. + [Fix] <Jojo> Saving long envelopes (> 25 envelope points) in the MPTM format was broken since... well, actually, it never worked in any officially released version. Now you can finally have up to 240 envelope points. Other formats [Fix] <Jojo> ITP Saver: Fixed nasty bug when the internal order length was not 256. [Fix] <Jojo> IMF Loader: Orpheus' 8-Bit cutoff range was not converted to MPT's 7-Bit range. Misc - [Imp] <Jojo> Tagging: ID3 tags also contain a TDRC tag now, since this should be used instead of TYER in ID3v2.4. Also added a TPBM (beats per minute) tag. + [Imp] <Jojo> Tagging: ID3 tags contain a TDRC tag instead of TYER now, as recommend by the ID3v2.4 standard. Also added a TPBM (beats per minute) tag. [Imp] <Jojo> Hack detection also notifies about stereo samples in XM files now. [Imp] <Jojo> Fixed tab order in the pitch shift dialog. [Mod] <Jojo> Song Properties: Legacy Mixmodes RC1 and RC2 are now only displayed if they are actually used by the module. + [Mod] <Jojo> When loading a module made with a newer version of OpenMPT which only differs in the build number (last number in the version), no warning is shown anymore. For all other cases, the warning is now also shown for MPTM files. + [Mod] <Jojo> If opening MIDI In fails, the MIDI config dialog is shown. [Fix] <Jojo> MP3 export should no longer result in a heap corruption and thus crash the tracker (http://bugs.openmpt.org/view.php?id=97). [Fix] <Jojo> Rendering sub songs to WAV resulted in an endless render loop. [Fix] <Jojo> Setup Dialog: Fixed the checkbox list so that it doesn't look weird under Wine and doesn't crash when compiling OpenMPT with VS2010 (tx jmkz). @@ -218,7 +225,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 distinct 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 (and up to 128) 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 @@ -481,7 +488,7 @@ [Fix] <Jojo> ITI/ITS Loader: Sample flags were not reset when a sample slot was overwritten when loading ITI or ITS files. That way, it was possible that f.e. the bidi loop flag was not disabled when loading a new sample that had a normal loop. [Fix] <Jojo> IT Compatibility: Note Cut really cuts notes and does not just mute them (so that following volume commands could restore the sample) [Fix] <Jojo> IT Compatibility: Always reset autovibrato settings when there's an instrument number (fix from SchismTracker) - [Fix] <Jojo> IT Compatibility: S77 / S79/ S7B are supposed to pause the envelope, not disable it. + [Fix] <Jojo> IT Compatibility: S77 / S79 / S7B are supposed to pause the envelope, not disable it. [Fix] <Jojo> IT Compatibility: ignore slide commands with both nibbles set (f.e. D55, PA1, ...) [Fix] <Jojo> IT Compatibility: Default Vibrato/Tremolo/Panbrello waveform values to sine waveform if out of range (e.g. S35) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-07-23 19:34:23
|
Revision: 927 http://modplug.svn.sourceforge.net/modplug/?rev=927&view=rev Author: saga-games Date: 2011-07-23 19:34:13 +0000 (Sat, 23 Jul 2011) Log Message: ----------- [Ref] Big refactoring commit. All application settings that previously were stored as static variables in CMainFrame have been moved to a new class, TrackerSettings. The Settings can be retrieved through CMainFrame::GetSettings(). [Imp] Added "/Portable" command line switch. Modified Paths: -------------- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp trunk/OpenMPT/mptrack/Childfrm.cpp trunk/OpenMPT/mptrack/Ctrl_com.cpp trunk/OpenMPT/mptrack/Ctrl_com.h trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Ctrl_gen.h trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Ctrl_ins.h trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/mptrack/Ctrl_pat.h trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/Ctrl_smp.h trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/Globals.cpp trunk/OpenMPT/mptrack/InputHandler.cpp trunk/OpenMPT/mptrack/KeyConfigDlg.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainbar.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/Moptions.cpp trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/Mpt_midi.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/Mptrack.h trunk/OpenMPT/mptrack/TuningDialog.cpp trunk/OpenMPT/mptrack/Undo.cpp trunk/OpenMPT/mptrack/UpdateCheck.cpp trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/mptrack/View_ins.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/ctrl_graph.h trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/mptrack.vcproj trunk/OpenMPT/mptrack/mptrack_08.vcproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj trunk/OpenMPT/soundlib/Load_mid.cpp trunk/OpenMPT/soundlib/SNDDEV.H trunk/OpenMPT/soundlib/Snddev.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/Tables.cpp trunk/OpenMPT/soundlib/WindowedFIR.cpp trunk/OpenMPT/soundlib/WindowedFIR.h Added Paths: ----------- trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.cpp =================================================================== --- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2011-07-23 19:34:13 UTC (rev 927) @@ -115,10 +115,10 @@ FileDlgResult files = CTrackApp::ShowOpenSaveFileDialog(true, "fxp", "", "VST Program (*.fxp)|*.fxp||", - CMainFrame::GetWorkingDirectory(DIR_PLUGINPRESETS)); + CMainFrame::GetSettings().GetWorkingDirectory(DIR_PLUGINPRESETS)); if(files.abort) return; - CMainFrame::SetWorkingDirectory(files.workingDirectory.c_str(), DIR_PLUGINPRESETS, true); + CMainFrame::GetSettings().SetWorkingDirectory(files.workingDirectory.c_str(), DIR_PLUGINPRESETS, true); //TODO: exception handling to distinguish errors at this level. if (m_pVstPlugin->LoadProgram(files.first_file.c_str())) @@ -138,10 +138,10 @@ FileDlgResult files = CTrackApp::ShowOpenSaveFileDialog(false, "fxp", "", "VST Program (*.fxp)|*.fxp||", - CMainFrame::GetWorkingDirectory(DIR_PLUGINPRESETS)); + CMainFrame::GetSettings().GetWorkingDirectory(DIR_PLUGINPRESETS)); if(files.abort) return; - CMainFrame::SetWorkingDirectory(files.workingDirectory.c_str(), DIR_PLUGINPRESETS, true); + CMainFrame::GetSettings().SetWorkingDirectory(files.workingDirectory.c_str(), DIR_PLUGINPRESETS, true); //TODO: exception handling if (!(m_pVstPlugin->SaveProgram(files.first_file.c_str()))) Modified: trunk/OpenMPT/mptrack/Childfrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/Childfrm.cpp 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/Childfrm.cpp 2011-07-23 19:34:13 UTC (rev 927) @@ -85,7 +85,7 @@ { if ((--glMdiOpenCount) == 0) { - CMainFrame::gbMdiMaximize = m_bMaxWhenClosed; + CMainFrame::GetSettings().gbMdiMaximize = m_bMaxWhenClosed; } } @@ -98,7 +98,7 @@ // add the first splitter pane - the default view in row 0 //int cy = CMainFrame::glCtrlWindowHeight; - int cy = CMainFrame::glGeneralWindowHeight; //rewbs.varWindowSize - default to general tab. + int cy = CMainFrame::GetSettings().glGeneralWindowHeight; //rewbs.varWindowSize - default to general tab. if (cy <= 1) cy = (lpcs->cy*2) / 3; if (!m_wndSplitter.CreateView(0, 0, pContext->m_pNewViewClass, CSize(0, cy), pContext)) return FALSE; @@ -134,7 +134,7 @@ void CChildFrame::ActivateFrame(int nCmdShow) //------------------------------------------- { - if ((glMdiOpenCount == 1) && (CMainFrame::gbMdiMaximize) && (nCmdShow == -1)) + if ((glMdiOpenCount == 1) && (CMainFrame::GetSettings().gbMdiMaximize) && (nCmdShow == -1)) { nCmdShow = SW_SHOWMAXIMIZED; } @@ -239,7 +239,7 @@ CRect rect; m_bMaxWhenClosed = IsZoomed(); - if (bForce) CMainFrame::gbMdiMaximize = m_bMaxWhenClosed; + if (bForce) CMainFrame::GetSettings().gbMdiMaximize = m_bMaxWhenClosed; if (!IsIconic()) { CWnd *pWnd = m_wndSplitter.GetPane(0, 0); @@ -249,18 +249,18 @@ LONG l = rect.Height(); //rewbs.varWindowSize - not the nicest piece of code, but we need to distinguish btw the views: if (strcmp("CViewGlobals",m_szCurrentViewClassName) == 0) - CMainFrame::glGeneralWindowHeight = l; + CMainFrame::GetSettings().glGeneralWindowHeight = l; else if (strcmp("CViewPattern", m_szCurrentViewClassName) == 0) - CMainFrame::glPatternWindowHeight = l; + CMainFrame::GetSettings().glPatternWindowHeight = l; else if (strcmp("CViewSample", m_szCurrentViewClassName) == 0) - CMainFrame::glSampleWindowHeight = l; + CMainFrame::GetSettings().glSampleWindowHeight = l; else if (strcmp("CViewInstrument", m_szCurrentViewClassName) == 0) - CMainFrame::glInstrumentWindowHeight = l; + CMainFrame::GetSettings().glInstrumentWindowHeight = l; else if (strcmp("CViewComments", m_szCurrentViewClassName) == 0) - CMainFrame::glCommentsWindowHeight = l; + CMainFrame::GetSettings().glCommentsWindowHeight = l; //rewbs.graph else if (strcmp("CViewGraph", m_szCurrentViewClassName) == 0) - CMainFrame::glGraphWindowHeight = l; + CMainFrame::GetSettings().glGraphWindowHeight = l; //end rewbs.graph } Modified: trunk/OpenMPT/mptrack/Ctrl_com.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_com.cpp 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/Ctrl_com.cpp 2011-07-23 19:34:13 UTC (rev 927) @@ -82,7 +82,7 @@ rect.right = rcClient.right - rect.left; if ((rect.right > rect.left) && (rect.bottom > rect.top)) { - int cxmax = (CMainFrame::m_dwPatternSetup & PATTERN_LARGECOMMENTS) ? 80*8 : 80*6; + int cxmax = (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_LARGECOMMENTS) ? 80*8 : 80*6; int cx = rect.Width(), cy = rect.Height(); if (cx > cxmax) cx = cxmax; if ((cx != cx0) || (cy != cy0)) m_EditComments.SetWindowPos(NULL, 0,0, cx, cy, SWP_NOMOVE|SWP_NOZORDER|SWP_DRAWFRAME); @@ -97,7 +97,7 @@ if (m_nLockCount) return; m_nLockCount++; HFONT newfont; - if (CMainFrame::m_dwPatternSetup & PATTERN_LARGECOMMENTS) + if (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_LARGECOMMENTS) newfont = CMainFrame::GetLargeFixedFont(); else newfont = CMainFrame::GetFixedFont(); Modified: trunk/OpenMPT/mptrack/Ctrl_com.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_com.h 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/Ctrl_com.h 2011-07-23 19:34:13 UTC (rev 927) @@ -12,7 +12,7 @@ public: CCtrlComments(); - LONG* GetSplitPosRef() {return &CMainFrame::glCommentsWindowHeight;} //rewbs.varWindowSize + LONG* GetSplitPosRef() {return &CMainFrame::GetSettings().glCommentsWindowHeight;} //rewbs.varWindowSize public: //{{AFX_DATA(CCtrlComments) Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2011-07-23 19:34:13 UTC (rev 927) @@ -252,9 +252,9 @@ } if (dwHint & HINT_MPTSETUP) { - DWORD dwSetup = CMainFrame::m_dwQuality; - m_ComboResampling.SetCurSel(CMainFrame::m_nSrcMode); - CheckDlgButton(IDC_CHECK_LOOPSONG, (CMainFrame::gbLoopSong) ? TRUE : FALSE); + DWORD dwSetup = CMainFrame::GetSettings().m_dwQuality; + m_ComboResampling.SetCurSel(CMainFrame::GetSettings().m_nSrcMode); + CheckDlgButton(IDC_CHECK_LOOPSONG, (CMainFrame::GetSettings().gbLoopSong) ? TRUE : FALSE); CheckDlgButton(IDC_CHECK_AGC, (dwSetup & QUALITY_AGC) ? TRUE : FALSE); CheckDlgButton(IDC_CHECK_BASS, (dwSetup & QUALITY_MEGABASS) ? TRUE : FALSE); CheckDlgButton(IDC_CHECK_REVERB, (dwSetup & QUALITY_REVERB) ? TRUE : FALSE); @@ -508,10 +508,10 @@ //-------------------------------------- { DWORD n = m_ComboResampling.GetCurSel(); - if ((n < NUM_SRC_MODES) && (n != CMainFrame::m_nSrcMode)) + if ((n < NUM_SRC_MODES) && (n != CMainFrame::GetSettings().m_nSrcMode)) { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); - if (pMainFrm) pMainFrm->SetupPlayer(CMainFrame::m_dwQuality, n); + if (pMainFrm) pMainFrm->SetupPlayer(CMainFrame::GetSettings().m_dwQuality, n); } } @@ -519,12 +519,12 @@ void CCtrlGeneral::OnLoopSongChanged() //------------------------------------ { - CMainFrame::gbLoopSong = IsDlgButtonChecked(IDC_CHECK_LOOPSONG); + CMainFrame::GetSettings().gbLoopSong = IsDlgButtonChecked(IDC_CHECK_LOOPSONG); CModDoc *pModDoc = GetDocument(); if (pModDoc) { CSoundFile *pSndFile = pModDoc->GetSoundFile(); - if (pSndFile) pSndFile->SetRepeatCount((CMainFrame::gbLoopSong) ? -1 : 0); + if (pSndFile) pSndFile->SetRepeatCount((CMainFrame::GetSettings().gbLoopSong) ? -1 : 0); } } @@ -533,12 +533,12 @@ //------------------------------- { BOOL b = IsDlgButtonChecked(IDC_CHECK_AGC); - DWORD dwQuality = CMainFrame::m_dwQuality & ~QUALITY_AGC; + DWORD dwQuality = CMainFrame::GetSettings().m_dwQuality & ~QUALITY_AGC; if (b) dwQuality |= QUALITY_AGC; - if (dwQuality != CMainFrame::m_dwQuality) + if (dwQuality != CMainFrame::GetSettings().m_dwQuality) { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); - if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::m_nSrcMode); + if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::GetSettings().m_nSrcMode); } } @@ -547,12 +547,12 @@ //--------------------------------- { BOOL b = IsDlgButtonChecked(IDC_CHECK_BASS); - DWORD dwQuality = CMainFrame::m_dwQuality & ~QUALITY_MEGABASS; + DWORD dwQuality = CMainFrame::GetSettings().m_dwQuality & ~QUALITY_MEGABASS; if (b) dwQuality |= QUALITY_MEGABASS; - if (dwQuality != CMainFrame::m_dwQuality) + if (dwQuality != CMainFrame::GetSettings().m_dwQuality) { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); - if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::m_nSrcMode); + if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::GetSettings().m_nSrcMode); } } @@ -561,12 +561,12 @@ //---------------------------------- { BOOL b = IsDlgButtonChecked(IDC_CHECK_REVERB); - DWORD dwQuality = CMainFrame::m_dwQuality & ~QUALITY_REVERB; + DWORD dwQuality = CMainFrame::GetSettings().m_dwQuality & ~QUALITY_REVERB; if (b) dwQuality |= QUALITY_REVERB; - if (dwQuality != CMainFrame::m_dwQuality) + if (dwQuality != CMainFrame::GetSettings().m_dwQuality) { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); - if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::m_nSrcMode); + if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::GetSettings().m_nSrcMode); } } @@ -575,12 +575,12 @@ //------------------------------------ { BOOL b = IsDlgButtonChecked(IDC_CHECK_SURROUND); - DWORD dwQuality = CMainFrame::m_dwQuality & ~QUALITY_SURROUND; + DWORD dwQuality = CMainFrame::GetSettings().m_dwQuality & ~QUALITY_SURROUND; if (b) dwQuality |= QUALITY_SURROUND; - if (dwQuality != CMainFrame::m_dwQuality) + if (dwQuality != CMainFrame::GetSettings().m_dwQuality) { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); - if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::m_nSrcMode); + if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::GetSettings().m_nSrcMode); } } @@ -589,12 +589,12 @@ //------------------------------------- { BOOL b = IsDlgButtonChecked(IDC_CHECK_EQ); - DWORD dwQuality = CMainFrame::m_dwQuality & ~QUALITY_EQ; + DWORD dwQuality = CMainFrame::GetSettings().m_dwQuality & ~QUALITY_EQ; if (b) dwQuality |= QUALITY_EQ; - if (dwQuality != CMainFrame::m_dwQuality) + if (dwQuality != CMainFrame::GetSettings().m_dwQuality) { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); - if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::m_nSrcMode); + if (pMainFrm) pMainFrm->SetupPlayer(dwQuality, CMainFrame::GetSettings().m_nSrcMode); } } Modified: trunk/OpenMPT/mptrack/Ctrl_gen.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.h 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/Ctrl_gen.h 2011-07-23 19:34:13 UTC (rev 927) @@ -33,7 +33,7 @@ { public: CCtrlGeneral(); - LONG* GetSplitPosRef() {return &CMainFrame::glGeneralWindowHeight;} //rewbs.varWindowSize + LONG* GetSplitPosRef() {return &CMainFrame::GetSettings().glGeneralWindowHeight;} //rewbs.varWindowSize private: void setAsDecibels(LPSTR stringToSet, double value, double valueAtZeroDB); Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2011-07-23 19:34:13 UTC (rev 927) @@ -1436,7 +1436,7 @@ { TCHAR szName[_MAX_FNAME], szExt[_MAX_EXT]; _tsplitpath(lpszFileName, nullptr, nullptr, szName, szExt); - CMainFrame::SetWorkingDirectory(lpszFileName, DIR_INSTRUMENTS, true); + CMainFrame::GetSettings().SetWorkingDirectory(lpszFileName, DIR_INSTRUMENTS, true); if (!pIns->name[0]) { @@ -1672,12 +1672,12 @@ "GF1 Patches (*.pat)|*.pat|" "Impulse Tracker Instruments (*.iti)|*.iti|" "All Files (*.*)|*.*||", - CMainFrame::GetWorkingDirectory(DIR_INSTRUMENTS), + CMainFrame::GetSettings().GetWorkingDirectory(DIR_INSTRUMENTS), true, &nLastIndex); if(files.abort) return; - CMainFrame::SetWorkingDirectory(files.workingDirectory.c_str(), DIR_INSTRUMENTS, true); + CMainFrame::GetSettings().SetWorkingDirectory(files.workingDirectory.c_str(), DIR_INSTRUMENTS, true); for(size_t counter = 0; counter < files.filenames.size(); counter++) { @@ -1726,7 +1726,7 @@ "Impulse Tracker Instruments (*.iti)|*.iti||" : "Impulse Tracker Instruments (*.iti)|*.iti|" "FastTracker II Instruments (*.xi)|*.xi||", - CMainFrame::GetWorkingDirectory(DIR_INSTRUMENTS)); + CMainFrame::GetSettings().GetWorkingDirectory(DIR_INSTRUMENTS)); if(files.abort) return; BeginWaitCursor(); @@ -1752,7 +1752,7 @@ strcpy(szFileName, drive); strcat(szFileName, path); - CMainFrame::SetWorkingDirectory(files.workingDirectory.c_str(), DIR_INSTRUMENTS); + CMainFrame::GetSettings().SetWorkingDirectory(files.workingDirectory.c_str(), DIR_INSTRUMENTS); // -> CODE#0023 // -> DESC="IT project files (.itp)" Modified: trunk/OpenMPT/mptrack/Ctrl_ins.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.h 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/Ctrl_ins.h 2011-07-23 19:34:13 UTC (rev 927) @@ -119,7 +119,7 @@ BOOL OpenInstrument(CSoundFile *pSndFile, UINT nInstr); BOOL EditSample(UINT nSample); VOID UpdateFilterText(); - LONG* GetSplitPosRef() {return &CMainFrame::glInstrumentWindowHeight;} //rewbs.varWindowSize + LONG* GetSplitPosRef() {return &CMainFrame::GetSettings().glInstrumentWindowHeight;} //rewbs.varWindowSize public: //{{AFX_VIRTUAL(CCtrlInstruments) Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-07-23 19:34:13 UTC (rev 927) @@ -91,9 +91,9 @@ { m_nInstrument = 0; - m_bVUMeters = CMainFrame::gbPatternVUMeters; - m_bPluginNames = CMainFrame::gbPatternPluginNames; //rewbs.patPlugNames - m_bRecord = CMainFrame::gbPatternRecord; + m_bVUMeters = CMainFrame::GetSettings().gbPatternVUMeters; + m_bPluginNames = CMainFrame::GetSettings().gbPatternPluginNames; //rewbs.patPlugNames + m_bRecord = CMainFrame::GetSettings().gbPatternRecord; m_nDetailLevel = 4; } @@ -143,7 +143,7 @@ m_ToolBar.AddButton(ID_PATTERNDETAIL_MED, TIMAGE_PATTERN_DETAIL_MED, TBSTYLE_CHECK, TBSTATE_ENABLED); m_ToolBar.AddButton(ID_PATTERNDETAIL_HI, TIMAGE_PATTERN_DETAIL_HI, TBSTYLE_CHECK, TBSTATE_ENABLED|TBSTATE_CHECKED); m_ToolBar.AddButton(ID_SEPARATOR, 0, TBSTYLE_SEP); - m_ToolBar.AddButton(ID_OVERFLOWPASTE, TIMAGE_PATTERN_OVERFLOWPASTE, TBSTYLE_CHECK, ((CMainFrame::m_dwPatternSetup & PATTERN_OVERFLOWPASTE) ? TBSTATE_CHECKED : 0) | TBSTATE_ENABLED); + m_ToolBar.AddButton(ID_OVERFLOWPASTE, TIMAGE_PATTERN_OVERFLOWPASTE, TBSTYLE_CHECK, ((CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_OVERFLOWPASTE) ? TBSTATE_CHECKED : 0) | TBSTATE_ENABLED); // Special edit controls -> tab switch to view m_EditSequence.SetParent(this); @@ -154,12 +154,12 @@ m_EditOrderListMargins.SetLimitText(3); // Spin controls m_SpinSpacing.SetRange(0, MAX_SPACING); - m_SpinSpacing.SetPos(CMainFrame::gnPatternSpacing); + m_SpinSpacing.SetPos(CMainFrame::GetSettings().gnPatternSpacing); m_SpinInstrument.SetRange(-1, 1); m_SpinInstrument.SetPos(0); - if(CMainFrame::gbShowHackControls == true) + if(CMainFrame::GetSettings().gbShowHackControls == true) { m_SpinOrderListMargins.ShowWindow(SW_SHOW); m_EditOrderListMargins.ShowWindow(SW_SHOW); @@ -172,9 +172,9 @@ m_EditOrderListMargins.ShowWindow(SW_HIDE); } - SetDlgItemInt(IDC_EDIT_SPACING, CMainFrame::gnPatternSpacing); + SetDlgItemInt(IDC_EDIT_SPACING, CMainFrame::GetSettings().gnPatternSpacing); SetDlgItemInt(IDC_EDIT_ORDERLIST_MARGINS, m_OrderList.GetMargins()); - CheckDlgButton(IDC_PATTERN_FOLLOWSONG, !(CMainFrame::m_dwPatternSetup & PATTERN_FOLLOWSONGOFF)); //rewbs.noFollow - set to unchecked + CheckDlgButton(IDC_PATTERN_FOLLOWSONG, !(CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_FOLLOWSONGOFF)); //rewbs.noFollow - set to unchecked m_SpinSequence.SetRange(0, m_pSndFile->Order.GetNumSequences() - 1); m_SpinSequence.SetPos(m_pSndFile->Order.GetCurrentSequenceIndex()); @@ -264,8 +264,8 @@ m_ToolBar.UpdateStyle(); // -> CODE#0007 // -> DESC="uncheck follow song checkbox by default" - //CheckDlgButton(IDC_PATTERN_FOLLOWSONG, (CMainFrame::m_dwPatternSetup & PATTERN_FOLLOWSONGOFF) ? MF_UNCHECKED : MF_CHECKED); - m_ToolBar.SetState(ID_OVERFLOWPASTE, ((CMainFrame::m_dwPatternSetup & PATTERN_OVERFLOWPASTE) ? TBSTATE_CHECKED : 0) | TBSTATE_ENABLED); + //CheckDlgButton(IDC_PATTERN_FOLLOWSONG, (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_FOLLOWSONGOFF) ? MF_UNCHECKED : MF_CHECKED); + m_ToolBar.SetState(ID_OVERFLOWPASTE, ((CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_OVERFLOWPASTE) ? TBSTATE_CHECKED : 0) | TBSTATE_ENABLED); // -! BEHAVIOUR_CHANGE#0007 } if (dwHintMask & (HINT_MODTYPE|HINT_INSNAMES|HINT_SMPNAMES|HINT_PATNAMES)) @@ -436,7 +436,7 @@ case CTRLMSG_SETRECORD: if (lParam >= 0) m_bRecord = (BOOL)(lParam); else m_bRecord = !m_bRecord; m_ToolBar.SetState(IDC_PATTERN_RECORD, ((m_bRecord) ? TBSTATE_CHECKED : 0)|TBSTATE_ENABLED); - CMainFrame::gbPatternRecord = m_bRecord; + CMainFrame::GetSettings().gbPatternRecord = m_bRecord; SendViewMessage(VIEWMSG_SETRECORD, m_bRecord); break; @@ -701,13 +701,13 @@ { if ((m_EditSpacing.m_hWnd) && (m_EditSpacing.GetWindowTextLength() > 0)) { - CMainFrame::gnPatternSpacing = GetDlgItemInt(IDC_EDIT_SPACING); - if (CMainFrame::gnPatternSpacing > MAX_SPACING) + CMainFrame::GetSettings().gnPatternSpacing = GetDlgItemInt(IDC_EDIT_SPACING); + if (CMainFrame::GetSettings().gnPatternSpacing > MAX_SPACING) { - CMainFrame::gnPatternSpacing = MAX_SPACING; - SetDlgItemInt(IDC_EDIT_SPACING, CMainFrame::gnPatternSpacing, FALSE); + CMainFrame::GetSettings().gnPatternSpacing = MAX_SPACING; + SetDlgItemInt(IDC_EDIT_SPACING, CMainFrame::GetSettings().gnPatternSpacing, FALSE); } - SendViewMessage(VIEWMSG_SETSPACING, CMainFrame::gnPatternSpacing); + SendViewMessage(VIEWMSG_SETSPACING, CMainFrame::GetSettings().gnPatternSpacing); } } @@ -940,7 +940,7 @@ { UINT nState = m_ToolBar.GetState(IDC_PATTERN_RECORD); m_bRecord = ((nState & TBSTATE_CHECKED) != 0); - CMainFrame::gbPatternRecord = m_bRecord; + CMainFrame::GetSettings().gbPatternRecord = m_bRecord; SendViewMessage(VIEWMSG_SETRECORD, m_bRecord); SwitchToView(); } @@ -951,7 +951,7 @@ { UINT nState = m_ToolBar.GetState(ID_PATTERN_VUMETERS); m_bVUMeters = ((nState & TBSTATE_CHECKED) != 0); - CMainFrame::gbPatternVUMeters = m_bVUMeters; + CMainFrame::GetSettings().gbPatternVUMeters = m_bVUMeters; SendViewMessage(VIEWMSG_SETVUMETERS, m_bVUMeters); SwitchToView(); } @@ -962,7 +962,7 @@ { UINT nState = m_ToolBar.GetState(ID_VIEWPLUGNAMES); m_bPluginNames = ((nState & TBSTATE_CHECKED) != 0); - CMainFrame::gbPatternPluginNames = m_bPluginNames; + CMainFrame::GetSettings().gbPatternPluginNames = m_bPluginNames; SendViewMessage(VIEWMSG_SETPLUGINNAMES, m_bPluginNames); SwitchToView(); } @@ -1191,7 +1191,7 @@ void CCtrlPatterns::OnToggleOverflowPaste() //------------------------------------- { - CMainFrame::m_dwPatternSetup ^= PATTERN_OVERFLOWPASTE; + CMainFrame::GetSettings().m_dwPatternSetup ^= PATTERN_OVERFLOWPASTE; UpdateView(HINT_MPTOPTIONS, NULL); SwitchToView(); } Modified: trunk/OpenMPT/mptrack/Ctrl_pat.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.h 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/Ctrl_pat.h 2011-07-23 19:34:13 UTC (rev 927) @@ -30,7 +30,7 @@ ORDERINDEX m_nDragOrder; //To tell how many orders('orderboxes') to show at least //on both sides of current order(when updating orderslist position). - BYTE m_nOrderlistMargins; + int m_nOrderlistMargins; CModDoc *m_pModDoc; CCtrlPatterns *m_pParent; @@ -38,8 +38,6 @@ COrderList(); virtual ~COrderList() {} - static BYTE s_nDefaultMargins; - public: BOOL Init(const CRect&, CCtrlPatterns *pParent, CModDoc *, HFONT hFont); void InvalidateSelection() const; @@ -176,7 +174,7 @@ public: CCtrlPatterns(); - LONG* GetSplitPosRef() {return &CMainFrame::glPatternWindowHeight;} //rewbs.varWindowSize + LONG* GetSplitPosRef() {return &CMainFrame::GetSettings().glPatternWindowHeight;} //rewbs.varWindowSize public: void SetCurrentPattern(PATTERNINDEX nPat); Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2011-07-23 19:34:13 UTC (rev 927) @@ -68,8 +68,6 @@ END_MESSAGE_MAP() -BYTE COrderList::s_nDefaultMargins = 0; - bool COrderList::IsOrderInMargins(int order, int startOrder) //---------------------------------------------------------- { @@ -111,7 +109,7 @@ m_pModDoc = nullptr; m_nScrollPos = m_nXScroll = 0; m_nScrollPos2nd = ORDERINDEX_INVALID; - m_nOrderlistMargins = s_nDefaultMargins; + m_nOrderlistMargins = CMainFrame::GetSettings().orderlistMargins; m_bScrolling = false; m_bDragging = false; } @@ -721,7 +719,7 @@ // MOD orderlist always ends after first empty pattern const ORDERINDEX nLength = (pSndFile->GetType() & MOD_TYPE_MOD) ? pSndFile->Order.GetLengthFirstEmpty() : pSndFile->Order.GetLengthTailTrimmed(); - if(CMainFrame::m_dwPatternSetup & PATTERN_HEXDISPLAY) + if(CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_HEXDISPLAY) { wsprintf(s, "Position %02Xh of %02Xh", m_nScrollPos, nLength); } @@ -1385,7 +1383,7 @@ BYTE COrderList::SetMargins(int i) //-------------------------------- { - m_nOrderlistMargins = static_cast<BYTE>(i); + m_nOrderlistMargins = i; return GetMargins(); } Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2011-07-23 19:34:13 UTC (rev 927) @@ -796,7 +796,7 @@ if (bOk) { MODSAMPLE *pSmp = &m_pSndFile->Samples[m_nSample]; - CMainFrame::SetWorkingDirectory(lpszFileName, DIR_SAMPLES, true); + CMainFrame::GetSettings().SetWorkingDirectory(lpszFileName, DIR_SAMPLES, true); if (!pSmp->filename[0]) { CHAR szFullFilename[_MAX_PATH]; @@ -951,12 +951,12 @@ "AIFF Files (*.aiff;*.8svx)|*.aif;*.aiff;*.8sv;*.8svx;*.svx|" "Raw Samples (*.raw,*.snd,*.pcm)|*.raw;*.snd;*.pcm|" "All Files (*.*)|*.*||", - CMainFrame::GetWorkingDirectory(DIR_SAMPLES), + CMainFrame::GetSettings().GetWorkingDirectory(DIR_SAMPLES), true, &nLastIndex); if(files.abort) return; - CMainFrame::SetWorkingDirectory(files.workingDirectory.c_str(), DIR_SAMPLES, true); + CMainFrame::GetSettings().SetWorkingDirectory(files.workingDirectory.c_str(), DIR_SAMPLES, true); for(size_t counter = 0; counter < files.filenames.size(); counter++) { @@ -1025,7 +1025,7 @@ FileDlgResult files = CTrackApp::ShowOpenSaveFileDialog(false, "wav", szFileName, "Wave File (*.wav)|*.wav|" "RAW Audio (*.raw)|*.raw||", - CMainFrame::GetWorkingDirectory(DIR_SAMPLES)); + CMainFrame::GetSettings().GetWorkingDirectory(DIR_SAMPLES)); if(files.abort) return; BeginWaitCursor(); @@ -1076,7 +1076,7 @@ ErrorBox(IDS_ERR_SAVESMP, this); } else { - CMainFrame::SetWorkingDirectory(files.workingDirectory.c_str(), DIR_SAMPLES, true); + CMainFrame::GetSettings().SetWorkingDirectory(files.workingDirectory.c_str(), DIR_SAMPLES, true); } SwitchToView(); } Modified: trunk/OpenMPT/mptrack/Ctrl_smp.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.h 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/Ctrl_smp.h 2011-07-23 19:34:13 UTC (rev 927) @@ -55,7 +55,7 @@ bool SetCurrentSample(SAMPLEINDEX nSmp, LONG lZoom = -1, bool bUpdNum = true); bool OpenSample(LPCSTR lpszFileName); bool OpenSample(CSoundFile *pSndFile, SAMPLEINDEX nSample); - LONG* GetSplitPosRef() {return &CMainFrame::glSampleWindowHeight;} //rewbs.varWindowSize + LONG* GetSplitPosRef() {return &CMainFrame::GetSettings().glSampleWindowHeight;} //rewbs.varWindowSize public: //{{AFX_VIRTUAL(CCtrlSamples) Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-07-23 19:34:13 UTC (rev 927) @@ -136,7 +136,7 @@ inline PCPATTERNFONT GetCurrentPatternFont() //------------------------------------------ { - return (CMainFrame::m_dwPatternSetup & PATTERN_SMALLFONT) ? &gSmallPatternFont : &gDefaultPatternFont; + return (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_SMALLFONT) ? &gSmallPatternFont : &gDefaultPatternFont; } @@ -158,15 +158,15 @@ { BYTE r,g,b; - m_Dib.SetAllColors(0, MAX_MODCOLORS, CMainFrame::rgbCustomColors); - r = hilightcolor(GetRValue(CMainFrame::rgbCustomColors[MODCOLOR_BACKHILIGHT]), - GetRValue(CMainFrame::rgbCustomColors[MODCOLOR_BACKNORMAL])); - g = hilightcolor(GetGValue(CMainFrame::rgbCustomColors[MODCOLOR_BACKHILIGHT]), - GetGValue(CMainFrame::rgbCustomColors[MODCOLOR_BACKNORMAL])); - b = hilightcolor(GetBValue(CMainFrame::rgbCustomColors[MODCOLOR_BACKHILIGHT]), - GetBValue(CMainFrame::rgbCustomColors[MODCOLOR_BACKNORMAL])); + m_Dib.SetAllColors(0, MAX_MODCOLORS, CMainFrame::GetSettings().rgbCustomColors); + r = hilightcolor(GetRValue(CMainFrame::GetSettings().rgbCustomColors[MODCOLOR_BACKHILIGHT]), + GetRValue(CMainFrame::GetSettings().rgbCustomColors[MODCOLOR_BACKNORMAL])); + g = hilightcolor(GetGValue(CMainFrame::GetSettings().rgbCustomColors[MODCOLOR_BACKHILIGHT]), + GetGValue(CMainFrame::GetSettings().rgbCustomColors[MODCOLOR_BACKNORMAL])); + b = hilightcolor(GetBValue(CMainFrame::GetSettings().rgbCustomColors[MODCOLOR_BACKHILIGHT]), + GetBValue(CMainFrame::GetSettings().rgbCustomColors[MODCOLOR_BACKNORMAL])); m_Dib.SetColor(MODCOLOR_2NDHIGHLIGHT, RGB(r,g,b)); - m_Dib.SetBlendColor(CMainFrame::rgbCustomColors[MODCOLOR_BLENDCOLOR]); + m_Dib.SetBlendColor(CMainFrame::GetSettings().rgbCustomColors[MODCOLOR_BLENDCOLOR]); } @@ -612,7 +612,7 @@ BOOL bPrevPatFound = FALSE; // Display previous pattern - if (CMainFrame::m_dwPatternSetup & PATTERN_SHOWPREVIOUS) + if (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_SHOWPREVIOUS) { const ORDERINDEX startOrder = static_cast<ORDERINDEX>(SendCtrlMessage(CTRLMSG_GETCURRENTORDER)); if(startOrder > 0) @@ -657,7 +657,7 @@ DrawPatternData(hdc, pSndFile, m_nPattern, TRUE, (pMainFrm->GetModPlaying() == pModDoc) ? TRUE : FALSE, yofs, nrows, xofs, rcClient, &ypaint); // Display next pattern - if ((CMainFrame::m_dwPatternSetup & PATTERN_SHOWPREVIOUS) && (ypaint < rcClient.bottom) && (ypaint == ypatternend)) + if ((CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_SHOWPREVIOUS) && (ypaint < rcClient.bottom) && (ypaint == ypatternend)) { int nVisRows = (rcClient.bottom - ypaint + m_szCell.cy - 1) / m_szCell.cy; if ((nVisRows > 0) && (m_nMidRow)) @@ -777,7 +777,7 @@ { UINT col, xbmp, nbmp, oldrowcolor; - wsprintf(s, (CMainFrame::m_dwPatternSetup & PATTERN_HEXDISPLAY) ? "%02X" : "%d", row); + wsprintf(s, (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_HEXDISPLAY) ? "%02X" : "%d", row); rect.left = 0; rect.top = ypaint; rect.right = rcClient.right; @@ -803,7 +803,7 @@ nMeasure = pSndFile->Patterns[nPattern].GetRowsPerMeasure(); } // secondary highlight (beats) - if ((CMainFrame::m_dwPatternSetup & PATTERN_2NDHIGHLIGHT) + if ((CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_2NDHIGHLIGHT) && (nBeat) && (nBeat < nrows)) { if (!(row % nBeat)) @@ -812,7 +812,7 @@ } } // primary highlight (measures) - if ((CMainFrame::m_dwPatternSetup & PATTERN_STDHIGHLIGHT) + if ((CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_STDHIGHLIGHT) && (nMeasure) && (nMeasure < nrows)) { if (!(row % nMeasure)) @@ -905,7 +905,7 @@ { tx_col = row_col; bk_col = row_bkcol; - if ((CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT) && (m->note) && (m->note <= NOTE_MAX)) + if ((CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_EFFECTHILIGHT) && (m->note) && (m->note <= NOTE_MAX)) { tx_col = MODCOLOR_NOTE; // Highlight notes that are not supported by the Amiga (for S3M this is not always correct) @@ -932,7 +932,7 @@ { tx_col = row_col; bk_col = row_bkcol; - if ((CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT) && (m->instr)) + if ((CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_EFFECTHILIGHT) && (m->instr)) { tx_col = MODCOLOR_INSTRUMENT; } @@ -959,7 +959,7 @@ tx_col = MODCOLOR_TEXTSELECTED; bk_col = MODCOLOR_BACKSELECTED; } else - if ((!m->IsPcNote()) && (m->volcmd) && (m->volcmd < MAX_VOLCMDS) && (CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT)) + if ((!m->IsPcNote()) && (m->volcmd) && (m->volcmd < MAX_VOLCMDS) && (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_EFFECTHILIGHT)) { if(volEffectColors[m->volcmd] != 0) tx_col = volEffectColors[m->volcmd]; @@ -977,7 +977,7 @@ uint16 val = m->GetValueEffectCol(); if(val > MODCOMMAND::maxColumnValue) val = MODCOMMAND::maxColumnValue; fx_col = row_col; - if (!isPCnote && (m->command) && (m->command < MAX_EFFECTS) && (CMainFrame::m_dwPatternSetup & PATTERN_EFFECTHILIGHT)) + if (!isPCnote && (m->command) && (m->command < MAX_EFFECTS) && (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_EFFECTHILIGHT)) { if(effectColors[m->command] != 0) fx_col = effectColors[m->command]; @@ -1216,7 +1216,7 @@ sizePage.cy = sizeLine.cy * 8; GetClientRect(&rect); m_nMidRow = 0; - if (CMainFrame::m_dwPatternSetup & PATTERN_CENTERROW) m_nMidRow = (rect.Height() - m_szHeader.cy) / (m_szCell.cy << 1); + if (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_CENTERROW) m_nMidRow = (rect.Height() - m_szHeader.cy) / (m_szCell.cy << 1); if (m_nMidRow) sizeTotal.cy += m_nMidRow * m_szCell.cy * 2; SetScrollSizes(MM_TEXT, sizeTotal, sizePage, sizeLine); //UpdateScrollPos(); //rewbs.FixLPsOddScrollingIssue Modified: trunk/OpenMPT/mptrack/Globals.cpp =================================================================== --- trunk/OpenMPT/mptrack/Globals.cpp 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/Globals.cpp 2011-07-23 19:34:13 UTC (rev 927) @@ -716,7 +716,7 @@ if (m_hWnd) { LONG lStyleOld = GetWindowLong(m_hWnd, GWL_STYLE); - if (CMainFrame::m_dwPatternSetup & PATTERN_FLATBUTTONS) + if (CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_FLATBUTTONS) lStyleOld |= TBSTYLE_FLAT; else lStyleOld &= ~TBSTYLE_FLAT; Modified: trunk/OpenMPT/mptrack/InputHandler.cpp =================================================================== --- trunk/OpenMPT/mptrack/InputHandler.cpp 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/InputHandler.cpp 2011-07-23 19:34:13 UTC (rev 927) @@ -26,7 +26,7 @@ if (sDefaultPath.GetLength() > MAX_PATH - 1) sDefaultPath = ""; - const bool bNoExistingKbdFileSetting = (CMainFrame::m_szKbdFile[0] == 0); + const bool bNoExistingKbdFileSetting = (CMainFrame::GetSettings().m_szKbdFile[0] == 0); // 1. Try to load keybindings from the path saved in the settings. // 2. If the setting doesn't exist or the loading fails, try to load from default location. @@ -34,10 +34,10 @@ // 4. If there were no keybinging setting already, create a keybinding file to default location // and set it's path to settings. - if (bNoExistingKbdFileSetting || !(activeCommandSet->LoadFile(CMainFrame::m_szKbdFile))) + if (bNoExistingKbdFileSetting || !(activeCommandSet->LoadFile(CMainFrame::GetSettings().m_szKbdFile))) { if (bNoExistingKbdFileSetting) - _tcscpy(CMainFrame::m_szKbdFile, sDefaultPath); + _tcscpy(CMainFrame::GetSettings().m_szKbdFile, sDefaultPath); bool bSuccess = false; if (PathFileExists(sDefaultPath) == TRUE) bSuccess = activeCommandSet->LoadFile(sDefaultPath); @@ -54,14 +54,14 @@ bSuccess = activeCommandSet->LoadFile(iStrm, TEXT("\"executable resource\"")); FreeResource(hglob); if (bSuccess && bNoExistingKbdFileSetting) - activeCommandSet->SaveFile(CMainFrame::m_szKbdFile, false); + activeCommandSet->SaveFile(CMainFrame::GetSettings().m_szKbdFile, false); } } if (bSuccess == false) AfxMessageBox(IDS_UNABLE_TO_LOAD_KEYBINDINGS, MB_ICONERROR); } // We will only overwrite the default Keybindings.mkb file from now on. - _tcscpy(CMainFrame::m_szKbdFile, sDefaultPath); + _tcscpy(CMainFrame::GetSettings().m_szKbdFile, sDefaultPath); //Get Keymap activeCommandSet->GenKeyMap(keyMap); Modified: trunk/OpenMPT/mptrack/KeyConfigDlg.cpp =================================================================== --- trunk/OpenMPT/mptrack/KeyConfigDlg.cpp 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/KeyConfigDlg.cpp 2011-07-23 19:34:13 UTC (rev 927) @@ -134,12 +134,12 @@ //----------------------------------- { CPropertyPage::OnInitDialog(); - m_nCurCategory=-1; - m_nCurHotKey=-1; - m_nCurKeyChoice=-1; - m_bModified=false; - m_bChoiceModified=false; - m_sFullPathName=CMainFrame::m_szKbdFile; + m_nCurCategory = -1; + m_nCurHotKey = -1; + m_nCurKeyChoice = -1; + m_bModified = false; + m_bChoiceModified = false; + m_sFullPathName = CMainFrame::GetSettings().m_szKbdFile; plocalCmdSet = new CCommandSet(); plocalCmdSet->Copy(CMainFrame::GetInputHandler()->activeCommandSet); @@ -159,7 +159,7 @@ m_eReport.SetWindowText(""); CString s; - s.Format("%d", CMainFrame::gnAutoChordWaitTime); + s.Format("%d", CMainFrame::GetSettings().gnAutoChordWaitTime); m_eChordWaitTime.SetWindowText(s); return TRUE; } @@ -622,7 +622,7 @@ CString cs; m_eChordWaitTime.GetWindowText(cs); - CMainFrame::gnAutoChordWaitTime = atoi(cs); + CMainFrame::GetSettings().gnAutoChordWaitTime = atoi(cs); CPropertyPage::OnOK(); } @@ -639,7 +639,7 @@ std::string filename = m_sFullPathName; FileDlgResult files = CTrackApp::ShowOpenSaveFileDialog(true, "mkb", filename, "OpenMPT Key Bindings (*.mkb)|*.mkb||", - CMainFrame::m_szKbdFile); + CMainFrame::GetSettings().m_szKbdFile); if(files.abort) return; m_sFullPathName = files.first_file.c_str(); @@ -653,7 +653,7 @@ std::string filename = m_sFullPathName; FileDlgResult files = CTrackApp::ShowOpenSaveFileDialog(false, "mkb", filename, "OpenMPT Key Bindings (*.mkb)|*.mkb||", - CMainFrame::m_szKbdFile); + CMainFrame::GetSettings().m_szKbdFile); if(files.abort) return; m_sFullPathName = files.first_file.c_str(); @@ -663,11 +663,11 @@ bool COptionsKeyboard::TentativeSetToDefaultFile(CString m_sFullPathName) { - if (m_sFullPathName.Compare(CMainFrame::m_szKbdFile)) + if (m_sFullPathName.Compare(CMainFrame::GetSettings().m_szKbdFile)) { if (AfxMessageBox("Load this keyboard config file when MPT starts up?", MB_YESNO) == IDYES) { - strcpy(CMainFrame::m_szKbdFile,m_sFullPathName); + strcpy(CMainFrame::GetSettings().m_szKbdFile,m_sFullPathName); OnSettingsChanged(); // Enable "apply" button UpdateDialog(); return true; Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2011-07-22 23:02:11 UTC (rev 926) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2011-07-23 19:34:13 UTC (rev 927) @@ -32,17 +32,9 @@ static char THIS_FILE[] = __FILE__; #endif -#define MAINFRAME_REGKEY_BASE "Software\\Olivier Lapicque\\" -#define MAINFRAME_REGKEY_DEFAULT "ModPlug Tracker" -#define MAINFRAME_REGEXT_WINDOW "\\Window" -#define MAINFRAME_REGEXT_SETTINGS "\\Settings" - #define MPTTIMER_PERIOD 200 -extern UINT gnMidiImportSpeed; -extern UINT gnMidiPatternLen; - //======================================== class CMPTSoundSource: public ISoundSource //======================================== @@ -121,46 +113,13 @@ static DWORD gsdwTotalSamples = 0; static DWORD gdwPlayLatency = 0; +TrackerSettings CMainFrame::m_Settings; + // Globals -UINT CMainFrame::gnPatternSpacing = 0; -BOOL CMainFrame::gbPatternRecord = TRUE; -BOOL CMainFrame::gbPatternVUMeters = FALSE; -BOOL CMainFrame::gbPatternPluginNames = TRUE; DWORD CMainFrame::gdwNotificationType = MPTNOTIFY_DEFAULT; UINT CMainFrame::m_nLastOptionsPage = 0; -BOOL CMainFrame::gbMdiMaximize = FALSE; -bool CMainFrame::gbShowHackControls = false; -//rewbs.varWindowSize -LONG CMainFrame::glGeneralWindowHeight = 178; -LONG CMainFrame::glPatternWindowHeight = 152; -LONG CMainFrame::glSampleWindowHeight = 188; -LONG CMainFrame::glInstrumentWindowHeight = 300; -LONG CMainFrame::glCommentsWindowHeight = 288; -LONG CMainFrame::glGraphWindowHeight = 288; //rewbs.graph -//end rewbs.varWindowSize -LONG CMainFrame::glTreeWindowWidth = 160; -LONG CMainFrame::glTreeSplitRatio = 128; HHOOK CMainFrame::ghKbdHook = NULL; -CString CMainFrame::gcsPreviousVersion = ""; -CString CMainFrame::gcsInstallGUID = ""; -DWORD CMainFrame::gnHotKeyMask = 0; -// Audio Setup -//rewbs.resamplerConf -long CMainFrame::glVolumeRampSamples = 42; -double CMainFrame::gdWFIRCutoff = 0.97; -BYTE CMainFrame::gbWFIRType = 7; //WFIR_KAISER4T; -//end rewbs.resamplerConf -UINT CMainFrame::gnAutoChordWaitTime = 60; - -int CMainFrame::gnPlugWindowX = 243; -int CMainFrame::gnPlugWindowY = 273; -int CMainFrame::gnPlugWindowWidth = 370; -int CMainFrame::gnPlugWindowHeight = 332; -DWORD CMainFrame::gnPlugWindowLast = 0; - -uint32 CMainFrame::gnMsgBoxVisiblityFlags = uint32_max; - CRITICAL_SECTION CMainFrame::m_csAudio; HANDLE CMainFrame::m_hPlayThread = NULL; DWORD CMainFrame::m_dwPlayThreadId = 0; @@ -173,35 +132,8 @@ LONG CMainFrame::sdwSamplesPerSec = 44100; LONG CMainFrame::sdwAudioBufferSize = MAX_AUDIO_BUFFERSIZE; UINT CMainFrame::gdwIdleTime = 0; -DWORD CMainFrame::m_dwRate = 44100; -DWORD CMainFrame::m_dwSoundSetup = SOUNDSETUP_SECONDARY; -DWORD CMainFrame::m_nChannels = 2; -DWORD CMainFrame::m_dwQuality = 0; -DWORD CMainFrame::m_nSrcMode = SRCMODE_LINEAR; -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; LONG CMainFrame::gnRVuMeter = 0; -EQPRESET CMainFrame::m_EqSettings = { "", {16,16,16,16,16,16}, { 125, 300, 600, 1250, 4000, 8000 } }; -// Midi Setup -DWORD CMainFrame::m_dwMidiSetup = MIDISETUP_RECORDVELOCITY|MIDISETUP_RECORDNOTEOFF; -// Pattern Setup -DWORD CMainFrame::m_dwPatternSetup = PATTERN_PLAYNEWNOTE | PATTERN_EFFECTHILIGHT - | PATTERN_SMALLFONT | PATTERN_CENTERROW - | PATTERN_DRAGNDROPEDIT | PATTERN_FLATBUTTONS | PATTERN_NOEXTRALOUD - | PATTERN_2NDHIGHLIGHT | PATTERN_STDHIGHLIGHT /*| PATTERN_HILITETIMESIGS*/ - | PATTERN_SHOWPREVIOUS | PATTERN_CONTSCROLL | PATTERN_SYNCMUTE | PATTERN_AUTODELAY | PATTERN_NOTEFADE; -DWORD CMainFrame::m_nRowSpacing = 16; // primary highlight (measures) -DWORD CMainFrame::m_nRowSpacing2 = 4; // secondary highlight (beats) -UINT CMainFrame::m_nSampleUndoMaxBuffer = 0; // Real sample buffer undo size will be set later. // GDI HICON CMainFrame::m_hIcon = NULL; @@ -248,33 +180,7 @@ LPMODPLUGDIB CMainFrame::bmpVisNode = NULL; LPMODPLUGDIB CMainFrame::bmpVisPcNode = NULL; HPEN CMainFrame::gpenVuMeter[NUM_VUMETER_PENS*2]; -COLORREF CMainFrame::rgbCustomColors[MAX_MODCOLORS] = - { - RGB(0xFF, 0xFF, 0xFF), RGB(0x00, 0x00, 0x00), RGB(0xC0, 0xC0, 0xC0), RGB(0x00, 0x00, 0x00), RGB(0x00, 0x00, 0x00), RGB(0xFF, 0xFF, 0xFF), 0x0000FF, - RGB(0xFF, 0xFF, 0x80), RGB(0x00, 0x00, 0x00), RGB(0xE0, 0xE8, 0xE0), - // Effect Colors - RGB(0x00, 0x00, 0x80), RGB(0x00, 0x80, 0x80), RGB(0x00, 0x80, 0x00), RGB(0x00, 0x80, 0x80), RGB(0x80, 0x80, 0x00), RGB(0x80, 0x00, 0x00), RGB(0x00, 0x00, 0xFF), - // VU-Meters - RGB(0x00, 0xC8, 0x00), RGB(0xFF, 0xC8, 0x00), RGB(0xE1, 0x00, 0x00), - // Channel separators - GetSysColor(COLOR_BTNSHADOW), GetSysColor(COLOR_BTNFACE), GetSysColor(COLOR_BTNHIGHLIGHT), - // Blend colour - GetSysColor(COLOR_BTNFACE), - // Dodgy commands - RGB(0xC0, 0x00, 0x00), - }; -// Directory Arrays (Default + Last) -TCHAR CMainFrame::m_szDefaultDirectory[NUM_DIRS][_MAX_PATH] = {0}; -TCHAR CMainFrame::m_szWorkingDirectory[NUM_DIRS][_MAX_PATH] = {0}; -TCHAR CMainFrame::m_szKbdFile[_MAX_PATH] = ""; //rewbs.customKeys -// Directory to INI setting translation -const TCHAR CMainFrame::m_szDirectoryToSettingsName[NUM_DIRS][32] = -{ - _T("Songs_Directory"), _T("Samples_Directory"), _T("Instruments_Directory"), _T("Plugins_Directory"), _T("Plugin_Presets_Directory"), _T("Export_Directory"), _T("") -}; - - CInputHandler *CMainFrame::m_InputHandler = nullptr; //rewbs.customKeys CAutoSaver *CMainFrame::m_pAutoSaver = nullptr; //rewbs.autosave CPerformanceCounter *CMainFrame::m_pPerfCounter = nullptr; @@ -315,57 +221,15 @@ m_szInfoText[0] = 0; m_szXInfoText[0]= 0; //rewbs.xinfo - for(UINT i = 0; i < NUM_DIRS; i++) - { - if (i == DIR_TUNING) // Hack: Tuning folder is set already so don't reset it. - continue; - MemsetZero(m_szDefaultDirectory[i]); - MemsetZero(m_szWorkingDirectory[i]); - } - m_dTotalCPU=0; MemsetZero(gpenVuMeter); - // Default chords - MemsetZero(Chords); - for (UINT ichord=0; ichord<3*12; ichord++) - { - Chords[ichord].key = (BYTE)ichord; - Chords[ichord].notes[0] = 0; - Chords[ichord].notes[1] = 0; - Chords[ichord].notes[2] = 0; - // Major Chords - if (ichord < 12) - { - Chords[ichord].notes[0] = (BYTE)(ichord+5); - Chords[ichord].notes[1] = (BYTE)(ichord+8); - Chords[ichord].notes[2] = (BYTE)(ichord+11); - } else - // Minor Chords - if (ichord < 24) - { - Chords[ichord].notes[0] = (BYTE)(ichord-8); - Chords[ichord].notes[1] = (BYTE)(ichord-4); - Chords[ichord].notes[2] = (BYTE)(ichord-1); - } - } - // Create Audio Critical Section MemsetZero(m_csAudio); InitializeCriticalSection(&m_csAudio); - m_csRegKey.Format("%s%s", MAINFRAME_REGKEY_BASE, MAINFRAME_REGKEY_DEFAULT); - m_csRegSettings.Format("%s%s", m_csRegKey, MAINFRAME_REGEXT_SETTINGS); - m_csRegWindow.Format("%s%s", m_csRegKey, MAINFRAME_REGEXT_WINDOW); + m_Settings.LoadSettings(); - CString storedVersion = GetPrivateProfileCString("Version", "Version", "", theApp.GetConfigFileName()); - // If version number stored in INI is 1.17.02.40 or later, always load setting from INI file. - // If it isn't, try loading from Registry first, then from the INI file. - if (storedVersion >= "1.17.02.40" || !LoadRegistrySettings()) - { - LoadIniSettings(); - } - m_InputHandler = new CInputHandler(this); //rewbs.customKeys m_pPerfCounter= new CPerformanceCounter(); @@ -373,363 +237,7 @@ CSoundFile::LoadStaticTunings(); } -void CMainFrame::LoadIniSettings() -//-------------------------------- -{ - CString iniFile = theApp.GetConfigFileName(); - //CHAR collectedString[INIBUFFERSIZE]; - MptVersion::VersionNum vIniVersion; - gcsPreviousVersion = GetPrivateProfileCString("Version", "Version", "", iniFile); - if(gcsPreviousVersion == "") - vIniVersion = MptVersion::num; - else - vIniVersion = MptVersion::ToNum(gcsPreviousVersion); - - gcsInstallGUID = GetPrivateProfileCString("Version", "InstallGUID", "", iniFile); - if(gcsInstallGUID == "") - { - // No GUID found in INI file - generate one. - GUID guid; - CoCreateGuid(&guid); - BYTE* Str; - UuidToString((UUID*)&guid, &Str); - gcsInstallGUID.Format("%s", (LPTSTR)Str); - RpcStringFree(&Str); - } - - gbMdiMaximize = GetPrivateProfileLong("Display", "MDIMaximize", true, iniFile); - glTreeWindowWidth = GetPrivateProfileLong("Display", "MDITreeWidth", 160, iniFile); - glTreeSplitRatio = GetPrivateProfileLong("Display", "MDITreeRatio", 128, iniFile); - glGeneralWindowHeight = GetPrivateProfileLong("Display", "MDIGeneralHeight", 178, iniFile); - glPatternWindowHeight = GetPrivateProfileLong("Display", "MDIPatternHeight", 152, iniFile); - glSampleWindowHeight = GetPrivateProfileLong("Display", "MDISampleHeight", 188, iniFile); - glInstrumentWindowHeight = GetPrivateProfileLong("Display", "MDIInstrumentHeight", 300, iniFile); - glCommentsWindowHeight = GetPrivateProfileLong("Display", "MDICommentsHeight", 288, iniFile); - glGraphWindowHeight = GetPrivateProfileLong("Display", "MDIGraphHeight", 288, iniFile); //rewbs.graph - gnPlugWindowX = GetPrivateProfileInt("Display", "PlugSelectWindowX", 243, iniFile); - gnPlugWindowY = GetPrivateProfileInt("Display", "PlugSelectWindowY", 273, iniFile); - gnPlugWindowWidth = GetPrivateProfileInt("Display", "PlugSelectWindowWidth", 370, iniFile); - gnPlugWindowHeight = GetPrivateProfileInt("Display", "PlugSelectWindowHeight", 332, iniFile); - gnPlugWindowLast = GetPrivateProfileDWord("Display", "PlugSelectWindowLast", 0, iniFile); - gnMsgBoxVisiblityFlags = GetPrivateProfileDWord("Display", "MsgBoxVisibilityFlags", uint32_max, iniFile); - - // Internet Update - { - tm lastUpdate; - MemsetZero(lastUpdate); - CString s = GetPrivateProfileCString("Update", "LastUpdateCheck", "1970-01-01 00:00", iniFile); - if(sscanf(s, "%04d-%02d-%02d %02d:%02d", &lastUpdate.tm_year, &lastUpdate.tm_mon, &lastUpdate.tm_mday, &lastUpdate.tm_hour, &lastUpdate.tm_min) == 5) - { - lastUpdate.tm_year -= 1900; - lastUpdate.tm_mon--; - } - - time_t outTime = Util::sdTime::MakeGmTime(lastUpdate); - - if(outTime < 0) outTime = 0; - - CUpdateCheck::SetUpdateSettings - ( - outTime, - GetPrivateProfileInt("Update", "UpdateCheckPeriod", CUpdateCheck::GetUpdateCheckPeriod(), iniFile), - GetPrivateProfileCString("Update", "UpdateURL", CUpdateCheck::GetUpdateURL(), iniFile), - GetPrivateProfileInt("Update", "SendGUID", CUpdateCheck::GetSendGUID() ? 1 : 0, iniFile) ? true : false, - GetPrivateProfileInt("Update", "ShowUpdateHint", CUpdateCheck::GetShowUpdateHint() ? 1 : 0, iniFile) ? true : false - ); - } - - CHAR s[16]; - for (int ncol = 0; ncol < MAX_MODCOLORS; ncol++) - { - wsprintf(s, "Color%02d", ncol); - rgbCustomColors[ncol] = GetPrivateProfileDWord("Display", s, rgbCustomColors[ncol], iniFile); - } - -#ifndef NO_DSOUND - DWORD defaultDevice = SNDDEV_BUILD_ID(0, SNDDEV_DSOUND); // first DirectSound device -#else - DWORD defaultDevice = SNDDEV_BUILD_ID(0, SNDDEV_WAVEOUT); // first WaveOut 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_BUILD_ID(0, SNDDEV_ASIO); - } -#endif // NO_ASIO - m_nWaveDevice = GetPrivateProfileLong("Sound Settings", "WaveDevice", defaultDevice, iniFile); - m_dwSoundSetup = GetPrivateProfileDWord("Sound Settings", "SoundSetup", SOUNDSETUP_SECONDARY, iniFile); - m_dwQuality = GetPrivateProfileDWord("Sound Settings", "Quality", 0, iniFile); - m_nSrcMode = GetPrivateProfileDWord("Sound Settings", "SrcMode", SRCMODE_POLYPHASE, iniFile); - m_dwRate = GetPrivateProfileDWord("Sound Settings", "Mixing_Rate", 0, iniFile); - m_nBitsPerSample = GetPrivateProfileDWord("Sound Settings", "BitsPerSample", 16, iniFile); - m_nChannels = GetPrivateProfileDWord("Sound Settings", "ChannelMode", 2, iniFile); - m_nBufferLength = GetPrivateProfileDWord("Sound Settings", "BufferLength", 50, iniFile); - if(m_nBufferLength < SNDDEV_MINBUFFERLEN) m_nBufferLength = SNDDEV_MINBUFFERLEN; - if(m_nBufferLength > SNDDEV_MAXBUFFERLEN) m_nBufferLength = SNDDEV_MAXBUFFERLEN; - if(m_dwRate == 0) - { - m_dwRate = 44100; -#ifndef NO_ASIO - // If no mixing rate is specified and we're using ASIO, get a mixing rate supported by the device. - if(SNDDEV_GET_TYPE(m_nWaveDevice) == SNDDEV_ASIO) - { - ISoundDevice *dummy; - if(CreateSoundDevice(SNDDEV_ASIO, &dummy)) - { - m_dwRate = dummy->GetCurrentSampleRate(SNDDEV_GET_NUMBER(m_nWaveDevice)); - delete dummy; - } - } -#endif // NO_ASIO - } - - m_nPreAmp = GetPrivateProfileDWord("Sound Settings", "PreAmp", 128, iniFile); - CSoundFile::m_nStereoSeparation = GetPrivateProfileLong("Sound Settings", "StereoSeparation", 128, iniFile); - CSoundFile::m_nMaxMixChannels = GetPrivateProfileLong("Sound Settings", "MixChannels", MAX_CHANNELS, iniFile); - gbWFIRType = static_cast<BYTE>(GetPrivateProfileDWord("Sound Settings", "XMMSModplugResamplerWFIRType", 7, iniFile)); - gdWFIRCutoff = static_cast<double>(GetPrivateProfileLong("Sound Settings", "ResamplerWFIRCutoff", 97, iniFile))/100.0; - glVolumeRampSamples = GetPrivateProfileLong("Sound Settings", "VolumeRampSamples", 42, iniFile); - - m_dwMidiSetup = GetPrivateProfileDWord("MIDI Settings", "MidiSetup", m_dwMidiSetup, iniFile); - m_nMidiDevice = GetPrivateProfileDWord("MIDI Settings", "MidiDevice", m_nMidiDevice, iniFile); - gnMidiImportSpeed = GetPrivateProfileLong("MIDI Settings", "MidiImportSpeed", gnMidiImportSpeed, iniFile); - gnMidiPatternLen = GetPrivateProfileLong("MIDI Settings", "MidiImportPatLen", gnMidiPatternLen, iniFile); - - m_dwPatternSetup = GetPrivateProfileDWord("Pattern Editor", "PatternSetup", m_dwPatternSetup, iniFile); - if(vIniVersion < MAKE_VERSION_NUMERIC(1,17,02,50)) - m_dwPatternSetup |= PATTERN_NOTEFADE; - if(vIniVersion < MAKE_VERSION_NUMERIC(1,17,03,01)) - m_dwPatternSetup |= PATTERN_RESETCHANNELS; - if(vIniVersion < MAKE_VERSION_NUMERIC(1,19,00,07)) - m_dwPatternSetup &= ~0x800; // this was previously deprecated and is now used for something else - if(vIniVersion < MptVersion::num) - m_dwPatternSetup &= ~(0x200000|0x400000|0x10000000); // various deprecated old options - - m_nRowSpacing = GetPrivateProfileDWord("Pattern Editor", "RowSpacing", 16, iniFile); - m_nRowSpacing2 = GetPrivateProfileDWord("Pattern Editor", "RowSpacing2", 4, iniFile); - gbLoopSong = GetPrivateProfileDWord("Pattern Editor", "LoopSong", true, iniFile); - gnPatternSpacing = GetPrivateProfileDWord("Pattern Editor", "Spacing", 1, iniFile); - gbPatternVUMeters = GetPrivateProfileDWord("Pattern Editor", "VU-Meters", false, iniFile); - gbPatternPluginNames = GetPrivateProfileDWord("Pattern Editor", "Plugin-Names", true, iniFile); - gbPatternRecord = GetPrivateProfileDWord("Pattern Editor", "Record", true, iniFile); - gnAutoChordWaitTime = GetPrivateProfileDWord("Pattern Editor", "AutoChordWaitTime", 60, iniFile); - COrderList::s_nDefaultMargins = static_cast<BYTE>(GetPrivateProfileInt("Pattern Editor", "DefaultSequenceMargins", 2, iniFile)); - gbShowHackControls = (0 != GetPrivateProfileDWord("Misc", "ShowHackControls", 0, iniFile)); - CSoundFile::s_DefaultPlugVolumeHandling = static_cast<uint8>(GetPrivateProfileInt("Misc", "DefaultPlugVolumeHandling", PLUGIN_VOLUMEHANDLING_IGNORE, iniFile)); - if(CSoundFile::s_DefaultPlugVolumeHandling > 2) CSoundFile::s_DefaultPlugVolumeHandling = PLUGIN_VOLUMEHANDLING_IGNORE; - - m_nSampleUndoMaxBuffer = GetPrivateProfileLong("Sample Editor" , "UndoBufferSize", m_nSampleUndoMaxBuffer >> 20, iniFile); - m_nSampleUndoMaxBuffer = max(1, m_nSampleUndoMaxBuffer) << 20; - - TCHAR szPath[_MAX_PATH] = ""; - for(size_t i = 0; i < NUM_DIRS; i++) - { - if(m_szDirectoryToSettingsName[i][0] == 0) - continue; - - GetPrivateProfileString("Paths", m_szDirectoryToSettingsName[i], GetDefaultDirectory(static_cast<Directory>(i)), szPath, CountOf(szPath), iniFile); - RelativePathToAbsolute(szPath); - SetDefaultDirectory(szPath, static_cast<Directory>(i), false); - - } - GetPrivateProfileString("Paths", "Key_Config_File", m_szKbdFile, m_szKbdFile, INIBUFFERSIZE, iniFile); - RelativePathToAbsolute(m_szKbdFile); - - CSoundFile::m_nXBassDepth = GetPrivateProfileLong("Effects", "XBassDepth", 0, iniFile); - CSoundFile::m_nXBassRange = GetPrivateProfileLong("Effects", "XBassRange", 0, iniFile); - CSoundFile::m_nReverbDepth = GetPrivateProfileLong("Effects", "ReverbDepth", 0, iniFile); - CSoundFile::gnReverbType = GetPrivateProfileLong("Effects", "ReverbType", 0, iniFile); - CSoundFile::m_nProLogicDepth = GetPrivateProfileLong("Effects", "ProLogicDepth", 0, iniFile); - CSoundFile::m_nProLogicDelay = GetPrivateProfileLong("Effects", "ProLogicDelay", 0, iniFile); - - GetPrivateProfileStruct("Effects", "EQ_Settings", &m_EqSettings, sizeof(EQPRESET), iniFile); - GetPrivateProfileStruct("Effects", "EQ_User1", &CEQSetupDlg::gUserPresets[0], sizeof(EQPRESET), iniFile); - GetPrivateProfileStruct("Effects", "EQ_User2", &CEQSetupDlg::gUserPresets[1], sizeof(EQPRESET), iniFile); - GetPrivateProfileStruct("Effects", "EQ_User3", &CEQSetupDlg::gUserPresets[2], sizeof(EQPRESET), iniFile); - GetPrivateProfileStruct("Effects", "EQ_User4", &CEQSetupDlg::gUserPresets[3], sizeof(EQPRESET), iniFile); - - - m_pAutoSaver = new CAutoSaver(); - GetPrivateProfileLong("AutoSave", "Enabled", true, iniFile)?m_pAutoSaver->Enable():m_pAutoSaver->Disable(); - m_pAutoSaver->SetSaveInterval(GetPrivateProfileLong("AutoSave", "IntervalMinutes", 10, iniFile)); - m_pAutoSaver->SetHistoryDepth(GetPrivateProfileLong("AutoSave", "BackupHistory", 3, iniFile)); - m_pAutoSaver->SetUseOriginalPath(GetPrivateProfileLong("AutoSave", "UseOriginalPath", true, iniFile) != 0); - GetPrivateProfileString("AutoSave", "Path", "", szPath, INIBUFFERSIZE, iniFile); - RelativePathToAbsolute(szPath); - m_pAutoSaver->SetPath(szPath); - m_pAutoSaver->SetFilenameTemplate(GetPrivateProfileCString("AutoSave", "FileNameTemplate", "", iniFile)); -} - -bool CMainFrame::LoadRegistrySettings() -//------------------------------------- -{ - - HKEY key; - DWORD dwREG_DWORD = REG_DWORD; - DWORD dwREG_SZ = REG_SZ; - DWORD dwDWORDSize = sizeof(UINT); - DWORD dwCRSIZE = sizeof(COLORREF); - - - bool asEnabled=true; - int asInterval=10; - int asBackupHistory=3; - bool asUseOriginalPath=true; - CString asPath =""; - CString asFileNameTemplate=""; - - if (RegOpenKeyEx(HKEY_CURRENT_USER, m_csRegWindow, 0, KEY_READ, &key) == ERROR_SUCCESS) - { - DWORD d = 0; - RegQueryValueEx(key, "Maximized", NULL, &dwREG_DWORD, (LPBYTE)&d, &dwDWORDSize); - if (d) theApp.m_nCmdShow = SW_SHOWMAXIMIZED; - RegQueryValueEx(key, "MDIMaximize", NULL, &dwREG_DWORD, (LPBYTE)&gbMdiMaximize, &dwDWORDSize); - RegQueryValueEx(key, "MDITreeWidth", NULL, &dwREG_DWORD, (LPBYTE)&glTreeWindowWidth, &dwDWORDSize); - RegQueryValueEx(key, "MDIGeneralHeight", NULL, &dwREG_DWORD, (LPBYTE)&glGeneralWindowHeight, &dwDWORDSize); - RegQueryValueEx(key, "MDIPatternHeight", NULL, &dwREG_DWORD, (LPBYTE)&glPatternWindowHeight, &dwDWORDSize); - RegQueryValueEx(key, "MDISampleHeight", NULL, &dwREG_DWORD, (LPBYTE)&glSampleWindowHeight, &dwDWORDSize); - RegQueryValueEx(key, "MDIInstrumentHeight", NULL, &dwREG_DWORD, (LPBYTE)&glInstrumentWindowHeight, &dwDWORDSize); - RegQueryValueEx(key, "MDICommentsHeight", NULL, &dwREG_DWORD, (LPBYTE)&glCommentsWindowHeight, &dwDWORDSize); - RegQueryValueEx(key, "MDIGraphHeight", NULL, &dwREG_DWORD, (LPBYTE)&glGraphWindowHeight, &dwDWORDSize); //rewbs.graph - RegQueryValueEx(key, "MDITreeRatio", NULL, &dwREG_DWORD, (LPBYTE)&glTreeSplitRatio, &dwDWORDSize); - // Colors - for (int ncol=0; ncol<MAX_MODCOLORS; ncol++) - { - CHAR s[64]; - wsprintf(s, "Color%02d", ncol); - RegQueryValueEx(key, s, NULL, &dwREG_DWORD, (LPBYTE)&rgbCustomColors[ncol], &dwCRSIZE); - } - RegCloseKey(key); - } - - if (RegOpenKeyEx(HKEY_CURRENT_USER, m_csRegKey, 0, KEY_READ, &key) == ERROR_SUCCESS) - { - RegQueryValueEx(key, "SoundSetup", NULL, &dwREG_DWORD, (LPBYTE)&m_dwSoundSetup, &dwDWORDSize); - RegQueryValueEx(key, "Quality", NULL, &dwREG_DWORD, (LPBYTE)&m_dwQuality, &dwDWORDSize); - RegQueryValueEx(key, "SrcMode", NULL, &dwREG_DWORD, (LPBYTE)&m_nSrcMode, &dwDWORDSize); - RegQueryValueEx(key, "Mixing_Rate", NULL, &dwREG_DWORD, (LPBYTE)&m_dwRate, &dwDWORDSize); - RegQueryValueEx(key, "BufferLength", NULL, &dwREG_DWORD, (LPBYTE)&m_nBufferLength, &dwDWORDSize); - if ((m_nBufferLength < 10) || (m_nBufferLength > 200)) m_nBufferLength = 100; - RegQueryValueEx(key, "PreAmp", NULL, &dwREG_DWORD, (LPBYTE)&m_nPreAmp, &dwDWORDSize); - - CHAR sPath[_MAX_PATH] = ""; - DWORD dwSZSIZE = sizeof(sPath); - RegQueryValueEx(key, "Songs_Directory", NULL, &dwREG_SZ, (LPBYTE)sPath, &dwSZSIZE); - SetDefaultDirectory(sPath, DIR_MODS); - dwSZSIZE = sizeof(sPath); - RegQueryValueEx(key, "Samples_Directory", NULL, &dwREG_SZ, (LPBYTE)sPath, &dwSZSIZE); - SetDefaultDirectory(sPath, DIR_SAMPLES); - dwSZSIZE = sizeof(sPath); - RegQueryValueEx(key, "Instruments_Directory", NULL, &dwREG_SZ, (LPBYTE)sPath, &dwSZSIZE); - SetDefaultDirectory(sPath, DIR_INSTRUMENTS); - dwSZSIZE = sizeof(sPath); - RegQueryValueEx(key, "Plugins_Directory", NULL, &dwREG_SZ, (LPBYTE)sPath, &dwSZSIZE); - SetDefaultDirectory(sPath, DIR_PLUGINS); - dwSZSIZE = sizeof(m_szKbdFile); - RegQueryValueEx(key, "Key_Config_File", NULL, &dwREG_SZ, (LPBYTE)m_szKbdFile, &dwSZSIZE); - - RegQueryValueEx(key, "XBassDepth", NULL, &dwREG_DWORD, (LPBYTE)&CSoundFile::m_nXBassDepth, &dwDWORDSize); - RegQueryValueEx(key, "XBassRange", NULL, &dwREG_DWORD, (LPBYTE)&CSoundFile::m_nXBassRange, &dwDWORDSize); - RegQueryValueEx(key, "ReverbDepth", NULL, &dwREG_DWORD, (LPBYTE)&CSoundFile::m_nReverbDepth, &dwDWORDSize); - RegQueryValueEx(key, "ReverbType", NULL, &dwREG_DWORD, (LPBYTE)&CSoundFile::gnReverbType, &dwDWORDSize); - RegQueryValueEx(key, "Pr... [truncated message content] |
From: <sag...@us...> - 2011-07-26 00:22:50
|
Revision: 928 http://modplug.svn.sourceforge.net/modplug/?rev=928&view=rev Author: saga-games Date: 2011-07-26 00:22:44 +0000 (Tue, 26 Jul 2011) Log Message: ----------- [Fix] Envelope Editor: When editing the first envelope node while compatible playback mode was enabled, it was moved to the second tick. [Imp] IT Loader: Showing MPT alpha and beta versions as such in the version information. Modified Paths: -------------- trunk/OpenMPT/mptrack/View_ins.cpp trunk/OpenMPT/soundlib/Load_it.cpp Modified: trunk/OpenMPT/mptrack/View_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_ins.cpp 2011-07-23 19:34:13 UTC (rev 927) +++ trunk/OpenMPT/mptrack/View_ins.cpp 2011-07-26 00:22:44 UTC (rev 928) @@ -278,7 +278,7 @@ int maxtick = envelope->Ticks[nPoint + 1]; if (nPoint + 1 == (int)envelope->nNodes) maxtick = ENVELOPE_MAX_LENGTH; // Can't have multiple points on same tick - if(GetDocument()->GetSoundFile()->IsCompatibleMode(TRK_IMPULSETRACKER|TRK_FASTTRACKER2) && mintick < maxtick - 1) + if(nPoint > 0 && GetDocument()->GetSoundFile()->IsCompatibleMode(TRK_IMPULSETRACKER|TRK_FASTTRACKER2) && mintick < maxtick - 1) { mintick++; if (nPoint + 1 < (int)envelope->nNodes) maxtick--; Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2011-07-23 19:34:13 UTC (rev 927) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2011-07-26 00:22:44 UTC (rev 928) @@ -556,7 +556,7 @@ else if(pifh->cwtv == 0x0214 && pifh->cmwt == 0x0200 && pifh->reserved == 0) { // ModPlug Tracker 1.00a5, instruments 560 bytes apart - m_dwLastSavedWithVersion = MAKE_VERSION_NUMERIC(1, 00, 00, 00); + m_dwLastSavedWithVersion = MAKE_VERSION_NUMERIC(1, 00, 00, A5); interpretModPlugMade = true; } } @@ -3265,8 +3265,8 @@ if( (size <= 63*2) && (size % 2 == 0) ) { const BYTE* pData = ptr; - STATIC_ASSERT(ARRAYELEMCOUNT(ChnSettings) >= 64); - const __int16 nLoopLimit = min(size/2, ARRAYELEMCOUNT(ChnSettings) - 64); + STATIC_ASSERT(CountOf(ChnSettings) >= 64); + const __int16 nLoopLimit = min(size/2, CountOf(ChnSettings) - 64); for(__int16 i = 0; i<nLoopLimit; i++, pData += 2) if(pData[0] != 0xFF) { ChnSettings[i+64].nVolume = pData[1]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2011-07-28 20:52:05
|
Revision: 932 http://modplug.svn.sourceforge.net/modplug/?rev=932&view=rev Author: relabsoluness Date: 2011-07-28 20:51:57 +0000 (Thu, 28 Jul 2011) Log Message: ----------- [New] General: Template modules. Can be accessed from file-menu. [New] General: Example modules are now accessible through help menu. [Ref] Minor tweaks here and there. Modified Paths: -------------- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp trunk/OpenMPT/mptrack/Ctrl_pat.h trunk/OpenMPT/mptrack/InputHandler.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moddoc.h trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/Mptrack.h trunk/OpenMPT/mptrack/PerformanceCounter.h trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h trunk/OpenMPT/mptrack/TuningDialog.h trunk/OpenMPT/mptrack/misc_util.h trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/resource.h trunk/OpenMPT/mptrack/test/test.cpp trunk/OpenMPT/mptrack/tuningRatioMapWnd.h trunk/OpenMPT/soundlib/SNDDEVX.H trunk/OpenMPT/soundlib/mod_specifications.cpp trunk/OpenMPT/soundlib/mod_specifications.h Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.cpp =================================================================== --- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2011-07-28 20:51:57 UTC (rev 932) @@ -202,7 +202,7 @@ } } SetNullTerminator(rawname); - CreateVerifiedProgramName(rawname, sizeof(rawname), name, sizeof(name), index); + CreateVerifiedProgramName(rawname, CountOf(rawname), name, CountOf(name), index); m_pMenu->ModifyMenu(8, MF_BYPOSITION, 0, name); } Modified: trunk/OpenMPT/mptrack/Ctrl_pat.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.h 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/Ctrl_pat.h 2011-07-28 20:51:57 UTC (rev 932) @@ -66,7 +66,7 @@ BYTE GetMargins() {return GetMargins(GetMarginsMax());} // Returns the effective margin value. - BYTE GetMargins(const BYTE nMaxMargins) {return min(nMaxMargins, m_nOrderlistMargins);} + BYTE GetMargins(const BYTE nMaxMargins) {return Util::Min(nMaxMargins, static_cast<BYTE>(m_nOrderlistMargins));} // Returns maximum margin value given current window width. BYTE GetMarginsMax() {return GetMarginsMax(GetLength());} Modified: trunk/OpenMPT/mptrack/InputHandler.cpp =================================================================== --- trunk/OpenMPT/mptrack/InputHandler.cpp 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/InputHandler.cpp 2011-07-28 20:51:57 UTC (rev 932) @@ -416,9 +416,11 @@ { case FILENEW: s="&New\t"; c=kcFileNew; break; case ID_FILE_OPEN: s="&Open...\t"; c=kcFileOpen; break; + case ID_FILE_OPENTEMPLATE: return "Open Template\t"; case ID_FILE_CLOSE: s="&Close\t"; c=kcFileClose; break; case ID_FILE_SAVE: s="&Save\t"; c=kcFileSave; break; case ID_FILE_SAVE_AS: s="Save &As...\t"; c=kcFileSaveAs; break; + case ID_FILE_SAVEASTEMPLATE:s="Save as Template\t"; break; case ID_FILE_SAVEASWAVE: s="Export as &Wave...\t"; c=kcFileSaveAsWave; break; case ID_FILE_SAVEASMP3: s="Export as M&P3...\t"; c=kcFileSaveAsMP3; break; case ID_FILE_SAVEMIDI: s="Export as M&IDI...\t"; c=kcFileSaveMidi; break; @@ -465,6 +467,8 @@ case ID_VIEW_SONGPROPERTIES:s="Song P&roperties...\t"; c=kcViewSongProperties; break; //rewbs.graph case ID_VIEW_MIDIMAPPING: s="&MIDI Mapping...\t"; c = kcViewMIDImapping; break; case ID_VIEW_EDITHISTORY: s="Edit &History...\t"; c = kcViewEditHistory; break; + // Help submenu: + case ID_EXAMPLE_MODULES: return "&Example Modules\t"; /* case ID_WINDOW_NEW: s="&New Window\t"; c=kcWindowNew; break; Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2011-07-28 20:51:57 UTC (rev 932) @@ -79,11 +79,13 @@ ON_COMMAND(ID_DEFAULT_HELP, CMDIFrameWnd::OnHelpFinder) ON_COMMAND(ID_NEXTOCTAVE, OnNextOctave) ON_COMMAND(ID_PREVOCTAVE, OnPrevOctave) + ON_COMMAND_RANGE(ID_FILE_OPENTEMPLATE, ID_FILE_OPENTEMPLATE_LASTINRANGE, OnOpenTemplateModule) ON_COMMAND(ID_ADD_SOUNDBANK, OnAddDlsBank) ON_COMMAND(ID_IMPORT_MIDILIB, OnImportMidiLib) ON_COMMAND(ID_MIDI_RECORD, OnMidiRecord) ON_COMMAND(ID_PANIC, OnPanic) ON_COMMAND(ID_PLAYER_PAUSE, OnPlayerPause) + ON_COMMAND_RANGE(ID_EXAMPLE_MODULES, ID_EXAMPLE_MODULES_LASTINRANGE, OnExampleSong) ON_COMMAND_EX(IDD_TREEVIEW, OnBarCheck) ON_COMMAND_EX(ID_NETLINK_MODPLUG, OnInternetLink) ON_COMMAND_EX(ID_NETLINK_TOP_PICKS, OnInternetLink) @@ -120,6 +122,9 @@ UINT CMainFrame::m_nLastOptionsPage = 0; HHOOK CMainFrame::ghKbdHook = NULL; +std::vector<CString> CMainFrame::s_ExampleModulePaths; +std::vector<CString> CMainFrame::s_TemplateModulePaths; + CRITICAL_SECTION CMainFrame::m_csAudio; HANDLE CMainFrame::m_hPlayThread = NULL; DWORD CMainFrame::m_dwPlayThreadId = 0; @@ -183,7 +188,7 @@ CInputHandler *CMainFrame::m_InputHandler = nullptr; //rewbs.customKeys CAutoSaver *CMainFrame::m_pAutoSaver = nullptr; //rewbs.autosave -CPerformanceCounter *CMainFrame::m_pPerfCounter = nullptr; +//CPerformanceCounter *CMainFrame::m_pPerfCounter = nullptr; static UINT indicators[] = { @@ -231,7 +236,7 @@ m_Settings.LoadSettings(); m_InputHandler = new CInputHandler(this); //rewbs.customKeys - m_pPerfCounter= new CPerformanceCounter(); + //m_pPerfCounter= new CPerformanceCounter(); //Loading static tunings here - probably not the best place to do that but anyway. CSoundFile::LoadStaticTunings(); @@ -288,6 +293,9 @@ UpdateAudioParameters(TRUE); // Update the tree m_wndTree.Init(); + + CreateExampleModulesMenu(); + CreateTemplateModulesMenu(); } @@ -297,7 +305,7 @@ DeleteCriticalSection(&m_csAudio); delete m_InputHandler; //rewbs.customKeys delete m_pAutoSaver; //rewbs.autosaver - delete m_pPerfCounter; + //delete m_pPerfCounter; CChannelManagerDlg::DestroySharedInstance(); CSoundFile::DeleteStaticdata(); @@ -2160,6 +2168,61 @@ } +void CMainFrame::OpenMenuItemFile(const UINT nId, const bool bTemplateFile) +{ + const UINT nIdBegin = (bTemplateFile) ? ID_FILE_OPENTEMPLATE : ID_EXAMPLE_MODULES; + const std::vector<CString>& vecFilePaths = (bTemplateFile) ? s_TemplateModulePaths : s_ExampleModulePaths; + + const UINT nIndex = nId - nIdBegin; + if (nIndex < vecFilePaths.size()) + { + const CString& sPath = vecFilePaths[nIndex]; + const bool bAvailable = Util::sdOs::IsPathFileAvailable(sPath, Util::sdOs::FileModeRead); + if (bAvailable) + { + CDocument* pDoc = theApp.OpenDocumentFile(sPath); + if (pDoc != nullptr) + { + ASSERT(pDoc->IsKindOf(RUNTIME_CLASS(CModDoc)) == TRUE); + CModDoc* pModDoc = static_cast<CModDoc*>(pDoc); + pModDoc->ClearFilePath(); // Clear path so that saving will not take place in templates/examples folder. + if (bTemplateFile) + { + theApp.RemoveMruItem(0); + } + } + } + else + { + const bool bExists = Util::sdOs::IsPathFileAvailable(sPath, Util::sdOs::FileModeExists); + CString str; + if (bExists) + AfxFormatString1(str, IDS_FILE_EXISTS_BUT_IS_NOT_READABLE, (LPCTSTR)sPath); + else + AfxFormatString1(str, IDS_FILE_DOES_NOT_EXIST, (LPCTSTR)sPath); + AfxMessageBox(str); + } + } + else + ASSERT(false); +} + + +void CMainFrame::OnOpenTemplateModule(UINT nId) +//--------------------------------------------- +{ + OpenMenuItemFile(nId, true/*open template menu file*/); +} + + +void CMainFrame::OnExampleSong(UINT nId) +//-------------------------------------- +{ + OpenMenuItemFile(nId, false/*open example menu file*/); + +} + + LRESULT CMainFrame::OnInvalidatePatterns(WPARAM wParam, LPARAM) //------------------------------------------------------------- { @@ -2520,6 +2583,87 @@ } +HMENU CMainFrame::CreateFileMenu(const size_t nMaxCount, std::vector<CString>& vPaths, const LPCTSTR pszFolderName, const uint16 nIdRangeBegin) +//--------------------------------------------------------------------------------------------------------------------------------------------- +{ + vPaths.clear(); + HMENU hMenu = ::CreatePopupMenu(); + ASSERT(hMenu != NULL); + if (hMenu != NULL) + { + UINT_PTR nAddCounter = 0; + for(size_t i = 0; i < 2; i++) // 0: app items, 1: user items + { + // To avoid duplicates, check whether app path and config path are the same. + if (i == 1 && _tcsicmp(CTrackApp::GetAppDirPath(), theApp.GetConfigPath()) == 0) + break; + CFileFind fileFind; + CFixedStringT<CString, MAX_PATH> sPath; + sPath = (i == 0) ? CTrackApp::GetAppDirPath() : theApp.GetConfigPath(); + sPath += pszFolderName; + if (Util::sdOs::IsPathFileAvailable(sPath, Util::sdOs::FileModeExists) == false) + continue; + sPath += _T("*"); + + BOOL bWorking = fileFind.FindFile(sPath); + // Note: The order in which the example files appears in the menu is unspecified. + while (bWorking && nAddCounter < nMaxCount) + { + bWorking = fileFind.FindNextFile(); + const CString fn = fileFind.GetFileName(); + if (fileFind.IsDirectory() == FALSE) + { + vPaths.push_back(fileFind.GetFilePath()); + AppendMenu(hMenu, MF_STRING, nIdRangeBegin + nAddCounter, fileFind.GetFileName()); + ++nAddCounter; + } + } + fileFind.Close(); + } + + if (nAddCounter == 0) + AppendMenu(hMenu, MF_STRING | MF_GRAYED | MF_DISABLED, 0, _T("No items found")); + } + + return hMenu; +} + + +void CMainFrame::CreateExampleModulesMenu() +//----------------------------------------- +{ + static_assert(nMaxItemsInExampleModulesMenu == ID_EXAMPLE_MODULES_LASTINRANGE - ID_EXAMPLE_MODULES + 1, + "Make sure that there's a proper range for menu commands in resources."); + HMENU hMenu = CreateFileMenu(nMaxItemsInExampleModulesMenu, s_ExampleModulePaths, _T("ExampleSongs\\"), ID_EXAMPLE_MODULES); + CMenu* const pMainMenu = GetMenu(); + if (hMenu && pMainMenu && m_InputHandler) + VERIFY(pMainMenu->ModifyMenu(ID_EXAMPLE_MODULES, MF_BYCOMMAND | MF_POPUP, (UINT_PTR)hMenu, m_InputHandler->GetMenuText(ID_EXAMPLE_MODULES))); + else + ASSERT(false); +} + + +void CMainFrame::CreateTemplateModulesMenu() +//------------------------------------------ +{ + static_assert(nMaxItemsInTemplateModulesMenu == ID_FILE_OPENTEMPLATE_LASTINRANGE - ID_FILE_OPENTEMPLATE + 1, + "Make sure that there's a proper range for menu commands in resources."); + HMENU hMenu = CreateFileMenu(nMaxItemsInTemplateModulesMenu, s_TemplateModulePaths, _T("TemplateModules\\"), ID_FILE_OPENTEMPLATE); + CMenu* const pMainMenu = GetMenu(); + CMenu* pFileMenu = (pMainMenu) ? pMainMenu->GetSubMenu(0) : nullptr; + if (hMenu && pFileMenu && m_InputHandler) + { + if (pFileMenu->GetMenuItemID(1) != ID_FILE_OPEN) + pFileMenu = pMainMenu->GetSubMenu(1); + ASSERT(pFileMenu->GetMenuItemID(1) == ID_FILE_OPEN); + VERIFY(pFileMenu->RemoveMenu(2, MF_BYPOSITION)); + VERIFY(pFileMenu->InsertMenu(2, MF_BYPOSITION | MF_POPUP, (UINT_PTR)hMenu, m_InputHandler->GetMenuText(ID_FILE_OPENTEMPLATE))); + } + else + ASSERT(false); +} + + ///////////////////////////////////////////// //Misc helper functions ///////////////////////////////////////////// @@ -2533,10 +2677,10 @@ PSNDMIXPLUGIN p = &plugarray[iPlug]; CString str; str.Preallocate(80); - str.Format("FX%d: ", iPlug+1); + str.Format(_T("FX%d: "), iPlug+1); const int size0 = str.GetLength(); str += (librarynames) ? p->GetLibraryName() : p->GetName(); - if(str.GetLength() <= size0) str += "undefined"; + if(str.GetLength() <= size0) str += _T("undefined"); CBox.SetItemData(CBox.AddString(str), iPlug + 1); } Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2011-07-28 20:51:57 UTC (rev 932) @@ -502,7 +502,7 @@ static VOID GetKeyName(LONG lParam, LPSTR pszName, UINT cbSize); static CInputHandler *m_InputHandler; //rewbs.customKeys static CAutoSaver *m_pAutoSaver; //rewbs.customKeys - static CPerformanceCounter *m_pPerfCounter; + //static CPerformanceCounter *m_pPerfCounter; static bool WritePrivateProfileLong(const CString section, const CString key, const long value, const CString iniFile); static long GetPrivateProfileLong(const CString section, const CString key, const long defaultValue, const CString iniFile); @@ -535,6 +535,19 @@ double GetApproxBPM(); //rewbs.VSTTimeInfo void ThreadSafeSetModified(CModDoc* modified) {m_pJustModifiedDoc=modified;} + void CreateExampleModulesMenu(); + void CreateTemplateModulesMenu(); + + /// Creates submenu whose items are filenames of files in both + /// AppDirectory\pszFolderName\ (usually C:\program files\OpenMPT\pszFolderName\) + /// and + /// ConfigDirectory\pszFolderName (usually %appdata%\OpenMPT\pszFolderName\) + /// [in] nMaxCount: Maximum number of items allowed in the menu + /// [out] vPaths: Receives the full paths of the files added to the menu. + /// [in] pszFolderName: Name of the folder (should end with \) + /// [in] nIdRangeBegin: First ID for the menu item. + static HMENU CreateFileMenu(const size_t nMaxCount, std::vector<CString>& vPaths, const LPCTSTR pszFolderName, const uint16 nIdRangeBegin); + // Player functions public: BOOL PlayMod(CModDoc *, HWND hPat=NULL, DWORD dwNotifyType=0); @@ -576,6 +589,9 @@ virtual void OnUpdateFrameTitle(BOOL bAddToTitle); //}}AFX_VIRTUAL + /// Opens either template or example menu item. + void OpenMenuItemFile(const UINT nId, const bool bTemplateFile); + // Implementation public: virtual ~CMainFrame(); @@ -625,6 +641,8 @@ afx_msg void OnReportBug(); //rewbs.customKeys afx_msg BOOL OnInternetLink(UINT nID); afx_msg LRESULT OnUpdatePosition(WPARAM, LPARAM lParam); + afx_msg void OnExampleSong(UINT nId); + afx_msg void OnOpenTemplateModule(UINT nId); afx_msg LRESULT OnInvalidatePatterns(WPARAM, LPARAM); afx_msg LRESULT OnSpecialKey(WPARAM, LPARAM); afx_msg LRESULT OnCustomKeyMsg(WPARAM, LPARAM); @@ -639,6 +657,14 @@ afx_msg void OnKillFocus(CWnd* pNewWnd); afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); + // Defines maximum number of items in example modules menu. + static const size_t nMaxItemsInExampleModulesMenu = 50; + static const size_t nMaxItemsInTemplateModulesMenu = 50; + + /// Array of paths of example modules that are available from help menu. + static std::vector<CString> s_ExampleModulePaths; + /// Array of paths of template modules that are available from file menu. + static std::vector<CString> s_TemplateModulePaths; }; const CHAR gszBuildDate[] = __DATE__ " " __TIME__; Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-07-28 20:51:57 UTC (rev 932) @@ -15,6 +15,7 @@ #include "version.h" #include "modsmp_ctrl.h" #include "CleanupSong.h" +#include <shlwapi.h> extern WORD S3MFineTuneTable[16]; @@ -30,7 +31,22 @@ const TCHAR FileFilterIT[] = _T("Impulse Tracker Modules (*.it)|*.it||"); const TCHAR FileFilterITP[] = _T("Impulse Tracker Projects (*.itp)|*.itp||"); const TCHAR FileFilterMPT[] = _T("OpenMPT Modules (*.mptm)|*.mptm||"); +const TCHAR FileFilterNone[] = _T(""); +const TCHAR* ModTypeToFilter(const CSoundFile& sndFile) +{ + const MODTYPE modtype = sndFile.GetType(); + switch(modtype) + { + case MOD_TYPE_MOD: return FileFilterMOD; + case MOD_TYPE_XM: return FileFilterXM; + case MOD_TYPE_S3M: return FileFilterS3M; + case MOD_TYPE_IT: return (sndFile.m_dwSongFlags & SONG_ITPROJECT) ? FileFilterITP : FileFilterIT; + case MOD_TYPE_MPT: return FileFilterMPT; + default: return FileFilterNone; + } +} + ///////////////////////////////////////////////////////////////////////////// // CModDoc @@ -38,6 +54,7 @@ BEGIN_MESSAGE_MAP(CModDoc, CDocument) //{{AFX_MSG_MAP(CModDoc) + ON_COMMAND(ID_FILE_SAVEASTEMPLATE, OnSaveTemplateModule) ON_COMMAND(ID_FILE_SAVEASWAVE, OnFileWaveConvert) ON_COMMAND(ID_FILE_SAVEASMP3, OnFileMP3Convert) ON_COMMAND(ID_FILE_SAVEMIDI, OnFileMidiConvert) @@ -414,26 +431,32 @@ } -BOOL CModDoc::OnSaveDocument(LPCTSTR lpszPathName) +BOOL CModDoc::OnSaveDocument(LPCTSTR lpszPathName, const bool bTemplateFile) //------------------------------------------------ { static int greccount = 0; - TCHAR fext[_MAX_EXT]=""; - UINT nType = m_SndFile.m_nType, dwPacking = 0; + TCHAR fext[_MAX_EXT] = _T(""); + UINT dwPacking = 0; BOOL bOk = FALSE; m_SndFile.m_dwLastSavedWithVersion = MptVersion::num; - if (!lpszPathName) return FALSE; + if (!lpszPathName) + return FALSE; _tsplitpath(lpszPathName, NULL, NULL, NULL, fext); - if (!lstrcmpi(fext, ".mod")) nType = MOD_TYPE_MOD; else - if (!lstrcmpi(fext, ".s3m")) nType = MOD_TYPE_S3M; else - if (!lstrcmpi(fext, ".xm")) nType = MOD_TYPE_XM; else + MODTYPE type = CModSpecifications::ExtensionToType(fext); + + /* + if (!lstrcmpi(fext, ".mod")) type = MOD_TYPE_MOD; else + if (!lstrcmpi(fext, ".s3m")) type = MOD_TYPE_S3M; else + if (!lstrcmpi(fext, ".xm")) type = MOD_TYPE_XM; else // -> CODE#0023 // -> DESC="IT project files (.itp)" // if (!lstrcmpi(fext, ".it")) nType = MOD_TYPE_IT; else - if (!lstrcmpi(fext, ".it") || !lstrcmpi(fext, ".itp")) nType = MOD_TYPE_IT; else - if (!lstrcmpi(fext, ".mptm")) nType = MOD_TYPE_MPT; else + if (!lstrcmpi(fext, ".it") || !lstrcmpi(fext, ".itp")) type = MOD_TYPE_IT; else + if (!lstrcmpi(fext, ".mptm")) type = MOD_TYPE_MPT; else // -! NEW_FEATURE#0023 - if (!greccount) +*/ + + if (type == MOD_TYPE_NONE && !greccount) { greccount++; bOk = DoSave(NULL, TRUE); @@ -443,23 +466,32 @@ BeginWaitCursor(); ClearLog(); FixNullStrings(); - switch(nType) + switch(type) { case MOD_TYPE_MOD: bOk = m_SndFile.SaveMod(lpszPathName, dwPacking); break; case MOD_TYPE_S3M: bOk = m_SndFile.SaveS3M(lpszPathName, dwPacking); break; case MOD_TYPE_XM: bOk = m_SndFile.SaveXM(lpszPathName, dwPacking); break; - case MOD_TYPE_IT: bOk = (m_SndFile.m_dwSongFlags & SONG_ITPROJECT || !lstrcmpi(fext, ".itp")) ? m_SndFile.SaveITProject(lpszPathName) : m_SndFile.SaveIT(lpszPathName, dwPacking); break; + case MOD_TYPE_IT: bOk = (m_SndFile.m_dwSongFlags & SONG_ITPROJECT || !lstrcmpi(fext, _T(".itp"))) ? m_SndFile.SaveITProject(lpszPathName) : m_SndFile.SaveIT(lpszPathName, dwPacking); break; case MOD_TYPE_MPT: bOk = m_SndFile.SaveIT(lpszPathName, dwPacking); break; } EndWaitCursor(); if (bOk) { - if (nType == m_SndFile.m_nType) SetPathName(lpszPathName); + if (type == m_SndFile.GetType() && !bTemplateFile) + SetPathName(lpszPathName); ShowLog(); + if (bTemplateFile) + { + CMainFrame* const pMainFrame = CMainFrame::GetMainFrame(); + if (pMainFrame) + pMainFrame->CreateTemplateModulesMenu(); + } } else { - if(nType == MOD_TYPE_IT && m_SndFile.m_dwSongFlags & SONG_ITPROJECT) ::MessageBox(NULL,"ITP projects need to have a path set for each instrument...",NULL,MB_ICONERROR | MB_OK); - else ErrorBox(IDS_ERR_SAVESONG, CMainFrame::GetMainFrame()); + if(type == MOD_TYPE_IT && m_SndFile.m_dwSongFlags & SONG_ITPROJECT) + AfxMessageBox(_T("ITP projects need to have a path set for each instrument..."), MB_ICONERROR | MB_OK); + else + ErrorBox(IDS_ERR_SAVESONG, CMainFrame::GetMainFrame()); } return bOk; } @@ -3898,3 +3930,40 @@ // Sequence names. // Not needed? } + +void CModDoc::OnSaveTemplateModule() +{ + // Create template folder if doesn't exist already. + const LPCTSTR pszTemplateFolder = CMainFrame::GetSettings().GetDefaultDirectory(DIR_TEMPLATE_FILES_USER); + if (!PathIsDirectory(pszTemplateFolder)) + { + if (!CreateDirectory(pszTemplateFolder, nullptr)) + { + CString sErrMsg; + AfxFormatString1(sErrMsg, IDS_UNABLE_TO_CREATE_USER_TEMPLATE_FOLDER, pszTemplateFolder); + AfxMessageBox(sErrMsg); + return; + } + } + + // Generate file name candidate. + CString sName; + for(size_t i = 0; i<1000; ++i) + { + sName.Format(_T("newTemplate%u."), i); + sName += m_SndFile.GetModSpecifications().fileExtension; + if (!Util::sdOs::IsPathFileAvailable(pszTemplateFolder + sName, Util::sdOs::FileModeExists)) + break; + } + + // Ask file name from user. + FileDlgResult fdr = CTrackApp::ShowOpenSaveFileDialog(false, m_SndFile.GetModSpecifications().fileExtension, (LPCTSTR)sName, + ModTypeToFilter(m_SndFile), pszTemplateFolder); + + if (fdr.abort) + return; + + const CString sOldPath = m_strPathName; + OnSaveDocument(fdr.first_file.c_str(), true/*template file*/); + m_strPathName = sOldPath; +} Modified: trunk/OpenMPT/mptrack/Moddoc.h =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.h 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/Moddoc.h 2011-07-28 20:51:57 UTC (rev 932) @@ -223,6 +223,7 @@ LPCSTR GetLog() const { return m_lpszLog; } BOOL ClearLog(); UINT ShowLog(LPCSTR lpszTitle=NULL, CWnd *parent=NULL); + void ClearFilePath() {m_strPathName.Empty();} // Logging for general progress and error events. void AddLogEvent(LogEventType eventType, LPCTSTR pszFuncName, LPCTSTR pszFormat, ...); @@ -383,9 +384,10 @@ public: virtual BOOL OnNewDocument(); virtual BOOL OnOpenDocument(LPCTSTR lpszPathName); - virtual BOOL OnSaveDocument(LPCTSTR lpszPathName); + virtual BOOL OnSaveDocument(LPCTSTR lpszPathName) {return OnSaveDocument(lpszPathName, false);} virtual void OnCloseDocument(); void SafeFileClose(); + BOOL OnSaveDocument(LPCTSTR lpszPathName, const bool bTemplateFile); // -> CODE#0023 // -> DESC="IT project files (.itp)" @@ -439,6 +441,7 @@ afx_msg void OnPatternPlayNoLoop(); //rewbs.customKeys afx_msg void OnViewEditHistory(); afx_msg void OnViewMPTHacks(); + afx_msg void OnSaveTemplateModule(); //}}AFX_MSG DECLARE_MESSAGE_MAP() private: Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2011-07-28 20:51:57 UTC (rev 932) @@ -17,6 +17,7 @@ #include "version.h" #include "test/test.h" #include <shlwapi.h> +#include <afxadv.h> #include "UpdateCheck.h" // rewbs.memLeak @@ -768,6 +769,11 @@ strcpy(m_szPluginCacheFileName, m_szConfigDirectory); // plugin cache strcat(m_szPluginCacheFileName, "plugin.cache"); + TCHAR szTemplatePath[MAX_PATH]; + _tcscpy(szTemplatePath, m_szConfigDirectory); + _tcscat(szTemplatePath, _T("TemplateModules\\")); + CMainFrame::GetSettings().SetDefaultDirectory(szTemplatePath, DIR_TEMPLATE_FILES_USER); + m_bPortableMode = bIsAppDir; } @@ -3138,3 +3144,9 @@ } SetNullTerminator(szPath); } + +void CTrackApp::RemoveMruItem(const int nItem) +{ + if (m_pRecentFileList && nItem >= 0 && nItem < m_pRecentFileList->GetSize()) + m_pRecentFileList->Remove(nItem); +} Modified: trunk/OpenMPT/mptrack/Mptrack.h =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.h 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/Mptrack.h 2011-07-28 20:51:57 UTC (rev 932) @@ -178,10 +178,12 @@ BOOL CanEncodeLayer3() const { return m_bLayer3Present; } BOOL IsWaveExEnabled() const { return m_bExWaveSupport; } BOOL IsDebug() const { return m_bDebugMode; } - LPCSTR GetConfigFileName() const { return m_szConfigFileName; } + LPCTSTR GetConfigFileName() const { return m_szConfigFileName; } static bool IsPortableMode() { return m_bPortableMode; } - LPCSTR GetPluginCacheFileName() const { return m_szPluginCacheFileName; } - LPCSTR GetConfigPath() const { return m_szConfigDirectory; } + LPCTSTR GetPluginCacheFileName() const { return m_szPluginCacheFileName; } + + /// Returns path to config folder including trailing '\'. + LPCTSTR GetConfigPath() const { return m_szConfigDirectory; } void SetupPaths(bool overridePortable); // Relative / absolute paths conversion template <size_t nLength> @@ -189,6 +191,9 @@ template <size_t nLength> void RelativePathToAbsolute(TCHAR (&szPath)[nLength]); + /// Removes item from MRU-list; most recent item has index zero. + void RemoveMruItem(const int nItem); + // Splash Screen protected: VOID StartSplashScreen(); Modified: trunk/OpenMPT/mptrack/PerformanceCounter.h =================================================================== --- trunk/OpenMPT/mptrack/PerformanceCounter.h 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/PerformanceCounter.h 2011-07-28 20:51:57 UTC (rev 932) @@ -1,5 +1,6 @@ #pragma once +#if 0 class CPerformanceCounter { protected: @@ -59,3 +60,4 @@ } }; +#endif Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2011-07-28 20:51:57 UTC (rev 932) @@ -22,7 +22,7 @@ #include "TrackerSettings.h" -const TCHAR *TrackerSettings::m_szDirectoryToSettingsName[NUM_DIRS] = { _T("Songs_Directory"), _T("Samples_Directory"), _T("Instruments_Directory"), _T("Plugins_Directory"), _T("Plugin_Presets_Directory"), _T("Export_Directory"), _T("") }; +const TCHAR *TrackerSettings::m_szDirectoryToSettingsName[NUM_DIRS] = { _T("Songs_Directory"), _T("Samples_Directory"), _T("Instruments_Directory"), _T("Plugins_Directory"), _T("Plugin_Presets_Directory"), _T("Export_Directory"), _T(""), _T("") }; TrackerSettings::TrackerSettings() Modified: trunk/OpenMPT/mptrack/TrackerSettings.h =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/TrackerSettings.h 2011-07-28 20:51:57 UTC (rev 932) @@ -24,6 +24,7 @@ DIR_PLUGINPRESETS, DIR_EXPORT, DIR_TUNING, + DIR_TEMPLATE_FILES_USER, NUM_DIRS }; Modified: trunk/OpenMPT/mptrack/TuningDialog.h =================================================================== --- trunk/OpenMPT/mptrack/TuningDialog.h 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/TuningDialog.h 2011-07-28 20:51:57 UTC (rev 932) @@ -7,6 +7,7 @@ #include <string> #include "afxcmn.h" #include "afxwin.h" +#include "resource.h" using std::vector; using std::string; Modified: trunk/OpenMPT/mptrack/misc_util.h =================================================================== --- trunk/OpenMPT/mptrack/misc_util.h 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/misc_util.h 2011-07-28 20:51:57 UTC (rev 932) @@ -4,9 +4,11 @@ #include <sstream> #include <string> #include <limits> +#include "typedefs.h" #if _HAS_TR1 #include <type_traits> #endif +#include <io.h> // for _taccess //Convert object(typically number) to string template<class T> @@ -245,6 +247,9 @@ // Like std::max, but avoids conflict with max-macro. template <class T> inline const T& Max(const T& a, const T& b) {return (std::max)(a, b);} + // Like std::min, but avoids conflict with min-macro. + template <class T> inline const T& Min(const T& a, const T& b) {return (std::min)(a, b);} + // Returns maximum value of given integer type. template <class T> inline T MaxValueOfType(const T&) {static_assert(std::numeric_limits<T>::is_integer == true, "Only interger types are allowed."); return (std::numeric_limits<T>::max)();} @@ -260,5 +265,12 @@ }}; // namespace Util::sdTime +namespace Util { namespace sdOs +{ + /// Checks whether file or folder exists and whether it has the given mode. + enum FileMode {FileModeExists = 0, FileModeRead = 4, FileModeWrite = 2, FileModeReadWrite = 6}; + inline bool IsPathFileAvailable(LPCTSTR pszFilePath, FileMode fm) {return (_taccess(pszFilePath, fm) == 0);} +} } // namespace Util::sdOs + #endif Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/mptrack.rc 2011-07-28 20:51:57 UTC (rev 932) @@ -13,7 +13,7 @@ #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// -// Deutsch (Deutschland) resources +// German (Germany) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) #ifdef _WIN32 @@ -148,7 +148,6 @@ PUSHBUTTON "Add",IDC_BUTTON_ADD,174,78,50,14 END - IDD_EDITHISTORY DIALOGEX 0, 0, 316, 185 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Module edit history" @@ -300,12 +299,12 @@ END #endif // APSTUDIO_INVOKED -#endif // Deutsch (Deutschland) resources +#endif // German (Germany) resources ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// Englisch (USA) resources +// English (U.S.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 @@ -1982,10 +1981,12 @@ MENUITEM "IT &Project", ID_NEW_ITPROJECT MENUITEM "Open&MPT Module", ID_NEW_MPT END - MENUITEM "&Open...\tCtrl+O", 57601 + MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN + MENUITEM "Open template", 65535 MENUITEM "&Close", ID_FILE_CLOSE MENUITEM "&Save\tCtrl+S", ID_FILE_SAVE MENUITEM "Save &As...", ID_FILE_SAVE_AS + MENUITEM "Save as Template...", ID_FILE_SAVEASTEMPLATE MENUITEM "Export &unraped...", ID_FILE_SAVECOMPAT MENUITEM "Export as &Wave...", ID_FILE_SAVEASWAVE MENUITEM "Export as M&P3...", ID_FILE_SAVEASMP3 @@ -2070,6 +2071,8 @@ MENUITEM "&Search...", ID_HELP_SEARCH MENUITEM "&Report a bug", ID_REPORT_BUG MENUITEM SEPARATOR + MENUITEM "&Example modules", ID_EXAMPLE_MODULES + MENUITEM SEPARATOR MENUITEM "&OpenMPT Website", ID_NETLINK_MODPLUG MENUITEM "&Web Resources", ID_NETLINK_TOP_PICKS MENUITEM SEPARATOR @@ -2481,16 +2484,27 @@ IDS_TUNING_IMPORT_UNRECOGNIZED_FILE "-Unable to import file ""%1%2"": unrecognized file.\n" IDS_SOUNDTOUCH_LOADFAILURE "Unable to load OpenMPT_soundtouch_i16.dll." + IDS_UNABLE_TO_CREATE_USER_TEMPLATE_FOLDER + """Error: Unable to create template folder '%1'""" + IDS_FILE_DOES_NOT_EXIST "The file '%1' does not exist" + IDS_FILE_EXISTS_BUT_IS_NOT_READABLE + "The file '%1' exists but can't be read" END STRINGTABLE BEGIN ID_PANIC "Kill all VSTi and sample voices\nStop all hanging VSTi and sample voices" ID_VIEW_EDITHISTORY "View the edit history of this module" + ID_FILE_SAVEASTEMPLATE "Save the active document as template module\nSave as Template" END STRINGTABLE BEGIN + ID_FILE_OPENTEMPLATE "Open a template document\nOpen template document" +END + +STRINGTABLE +BEGIN ID_VIEW_MIDIMAPPING "Configure the MIDI Mapping" END @@ -2510,12 +2524,12 @@ IDC_SAMPLE_XFADE "Crossfade Loop Points\nCrossfade between loop start and loop end to create seamless sample loops." END -#endif // Englisch (USA) resources +#endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// Englisch (GB) resources +// English (U.K.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) #ifdef _WIN32 @@ -2888,7 +2902,7 @@ // IDR_BUILTIN_TUNINGS TUNING "res\\built-inTunings.tc" -#endif // Englisch (GB) resources +#endif // English (U.K.) resources ///////////////////////////////////////////////////////////////////////////// Modified: trunk/OpenMPT/mptrack/resource.h =================================================================== --- trunk/OpenMPT/mptrack/resource.h 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/resource.h 2011-07-28 20:51:57 UTC (rev 932) @@ -67,6 +67,9 @@ #define IDS_TUNING_IMPORT_SCL_FAILURE 228 #define IDS_TUNING_IMPORT_UNRECOGNIZED_FILE 229 #define IDS_SOUNDTOUCH_LOADFAILURE 230 +#define IDS_UNABLE_TO_CREATE_USER_TEMPLATE_FOLDER 231 +#define IDS_FILE_DOES_NOT_EXIST 232 +#define IDS_FILE_EXISTS_BUT_IS_NOT_READABLE 233 #define IDB_MAINBAR 300 #define IDB_IMAGELIST 301 #define IDB_PATTERNS 302 @@ -1124,6 +1127,10 @@ #define ID_GROW_SELECTION 40001 #define ID_SHRINK_SELECTION 40002 #define ID_RUN_SCRIPT 40003 +#define ID_EXAMPLE_MODULES 40004 +#define ID_EXAMPLE_MODULES_LASTINRANGE 40053 +#define ID_FILE_OPENTEMPLATE 40054 +#define ID_FILE_OPENTEMPLATE_LASTINRANGE 40103 #define IDS_ERR_FILEOPEN 55001 #define IDS_ERR_FILETYPE 55002 #define IDS_ERR_SAVEINS 55003 @@ -1189,6 +1196,8 @@ #define ID_VIEW_MPTHACKS 60456 #define ID_PLUGINTOINSTRUMENT 60457 #define ID_INTERNETUPDATE 60458 +#define ID_HELP_EXAMPLEMODULES 60459 +#define ID_FILE_SAVEASTEMPLATE 60460 // Next default values for new objects // @@ -1196,7 +1205,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 #define _APS_NEXT_RESOURCE_VALUE 530 -#define _APS_NEXT_COMMAND_VALUE 60459 +#define _APS_NEXT_COMMAND_VALUE 60461 #define _APS_NEXT_CONTROL_VALUE 2436 #define _APS_NEXT_SYMED_VALUE 901 #endif Modified: trunk/OpenMPT/mptrack/test/test.cpp =================================================================== --- trunk/OpenMPT/mptrack/test/test.cpp 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/test/test.cpp 2011-07-28 20:51:57 UTC (rev 932) @@ -203,6 +203,23 @@ VERIFY_EQUAL(MODCOMMAND::IsPcNote(NOTE_MAX), false); VERIFY_EQUAL(MODCOMMAND::IsPcNote(NOTE_PC), true); VERIFY_EQUAL(MODCOMMAND::IsPcNote(NOTE_PCS), true); + + VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T(".mod")), MOD_TYPE_MOD); + VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T("mod")), MOD_TYPE_MOD); + VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T(".s3m")), MOD_TYPE_S3M); + VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T("s3m")), MOD_TYPE_S3M); + VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T(".xm")), MOD_TYPE_XM); + VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T("xm")), MOD_TYPE_XM); + VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T(".it")), MOD_TYPE_IT); + VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T("it")), MOD_TYPE_IT); + VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T(".itp")), MOD_TYPE_IT); + VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T("itp")), MOD_TYPE_IT); + VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T("mptm")), MOD_TYPE_MPT); + VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T("invalidExtension")), MOD_TYPE_NONE); + VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T("ita")), MOD_TYPE_NONE); + VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T("s2m")), MOD_TYPE_NONE); + VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T("")), MOD_TYPE_NONE); + VERIFY_EQUAL(CModSpecifications::ExtensionToType(LPCTSTR(nullptr)), MOD_TYPE_NONE); } Modified: trunk/OpenMPT/mptrack/tuningRatioMapWnd.h =================================================================== --- trunk/OpenMPT/mptrack/tuningRatioMapWnd.h 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/mptrack/tuningRatioMapWnd.h 2011-07-28 20:51:57 UTC (rev 932) @@ -1,7 +1,7 @@ #ifndef TUNINGRATIOMAPWND_H #define TUNINGRATIOMAPWND_H -#include "../soundlib/tuningbase.h" +#include "../soundlib/tuning.h" class CTuningDialog; Modified: trunk/OpenMPT/soundlib/SNDDEVX.H =================================================================== --- trunk/OpenMPT/soundlib/SNDDEVX.H 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/soundlib/SNDDEVX.H 2011-07-28 20:51:57 UTC (rev 932) @@ -2,6 +2,7 @@ #define _SNDDEVX_H_ #include <mmsystem.h> +#include "snddev.h" #ifndef NO_DSOUND #include <dsound.h> Modified: trunk/OpenMPT/soundlib/mod_specifications.cpp =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.cpp 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/soundlib/mod_specifications.cpp 2011-07-28 20:51:57 UTC (rev 932) @@ -1,6 +1,34 @@ #include <stdafx.h> #include "mod_specifications.h" +MODTYPE CModSpecifications::ExtensionToType(LPCTSTR pszExt) +{ + if (pszExt == nullptr) + return MOD_TYPE_NONE; + if (pszExt[0] == '.') + pszExt++; + char szExtA[CountOf(ModSpecs::mod.fileExtension)]; + MemsetZero(szExtA); + size_t i = 0; + const size_t nLength = _tcslen(pszExt); + if (nLength >= CountOf(szExtA)) + return MOD_TYPE_NONE; + for(i = 0; i<nLength; ++i) + szExtA[i] = static_cast<char>(pszExt[i]); + if (!lstrcmpiA(szExtA, ModSpecs::mod.fileExtension) || !lstrcmpiA(szExtA, ModSpecs::modEx.fileExtension)) + return MOD_TYPE_MOD; + else if (!lstrcmpiA(szExtA, ModSpecs::s3m.fileExtension) || !lstrcmpiA(szExtA, ModSpecs::s3mEx.fileExtension)) + return MOD_TYPE_S3M; + else if (!lstrcmpiA(szExtA, ModSpecs::xm.fileExtension) || !lstrcmpiA(szExtA, ModSpecs::xmEx.fileExtension)) + return MOD_TYPE_XM; + else if (!lstrcmpiA(szExtA, ModSpecs::it.fileExtension) || !lstrcmpiA(szExtA, ModSpecs::itEx.fileExtension) + || !lstrcmpi(szExtA, _T("itp"))) + return MOD_TYPE_IT; + else if (!lstrcmpiA(szExtA, ModSpecs::mptm.fileExtension)) + return MOD_TYPE_MPT; + else + return MOD_TYPE_NONE; +} bool CModSpecifications::HasNote(MODCOMMAND::NOTE note) const //------------------------------------------------------------ Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2011-07-28 14:59:55 UTC (rev 931) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2011-07-28 20:51:57 UTC (rev 932) @@ -10,6 +10,10 @@ struct CModSpecifications //======================= { + /// Returns modtype corresponding to given file extension. The extension string + /// may begin with or without dot, e.g. both ".it" and "it" will be handled correctly. + static MODTYPE ExtensionToType(LPCTSTR pszExt); + // Return true if format supports given note. bool HasNote(MODCOMMAND::NOTE note) const; bool HasVolCommand(MODCOMMAND::VOLCMD volcmd) const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2011-07-29 20:54:47
|
Revision: 939 http://modplug.svn.sourceforge.net/modplug/?rev=939&view=rev Author: relabsoluness Date: 2011-07-29 20:54:38 +0000 (Fri, 29 Jul 2011) Log Message: ----------- [Ref] Some clean up to get build done with less warnings. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Mainbar.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moddoc.h trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp trunk/OpenMPT/mptrack/PatternEditorDialogs.h trunk/OpenMPT/mptrack/TuningDialog.cpp trunk/OpenMPT/mptrack/View_pat.h trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/Vstplug.h trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/dlg_misc.h trunk/OpenMPT/soundlib/Load_itp.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2011-07-29 20:49:03 UTC (rev 938) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2011-07-29 20:54:38 UTC (rev 939) @@ -281,7 +281,7 @@ if (pSlider==&m_SliderTempo) { int min, max; m_SpinTempo.GetRange(min, max); - int tempo = max - m_SliderTempo.GetPos(); + const UINT tempo = max - m_SliderTempo.GetPos(); if ((tempo >= m_pSndFile->GetModSpecifications().tempoMin) && (tempo <= m_pSndFile->GetModSpecifications().tempoMax) && (tempo != m_pSndFile->m_nDefaultTempo)) { m_pSndFile->m_nDefaultTempo = tempo; m_pSndFile->m_nMusicTempo = tempo; @@ -292,7 +292,7 @@ } else if (pSlider==&m_SliderGlobalVol) { - int gv = MAX_SLIDER_GLOBAL_VOL - m_SliderGlobalVol.GetPos(); + const UINT gv = MAX_SLIDER_GLOBAL_VOL - m_SliderGlobalVol.GetPos(); if ((gv >= 0) && (gv <= MAX_SLIDER_GLOBAL_VOL) && (gv != m_pSndFile->m_nDefaultGlobalVolume)) { m_pSndFile->m_nGlobalVolume = gv; m_pSndFile->m_nDefaultGlobalVolume = gv; @@ -303,7 +303,7 @@ } else if (pSlider==&m_SliderSamplePreAmp) { - int spa = MAX_SLIDER_SAMPLE_VOL - m_SliderSamplePreAmp.GetPos(); + const UINT spa = MAX_SLIDER_SAMPLE_VOL - m_SliderSamplePreAmp.GetPos(); if ((spa >= 0) && (spa <= MAX_SLIDER_SAMPLE_VOL) && (spa != m_pSndFile->m_nSamplePreAmp)) { m_pSndFile->m_nSamplePreAmp = spa; if(m_pSndFile->GetType() != MOD_TYPE_MOD) @@ -313,7 +313,7 @@ } else if (pSlider==&m_SliderVSTiVol) { - int vv = MAX_SLIDER_VSTI_VOL - m_SliderVSTiVol.GetPos(); + const UINT vv = MAX_SLIDER_VSTI_VOL - m_SliderVSTiVol.GetPos(); if ((vv >= 0) && (vv <= MAX_SLIDER_VSTI_VOL) && (vv != m_pSndFile->m_nVSTiVolume)) { m_pSndFile->m_nVSTiVolume = vv; m_pSndFile->RecalculateGainForAllPlugs(); @@ -402,7 +402,7 @@ if ((m_pSndFile) && (m_pModDoc) && (m_bInitialized)) { m_EditVSTiVol.GetWindowText(s, sizeof(s)); if (s[0]) { - int n = atoi(s); + UINT n = ConvertStrTo<UINT>(s); n = CLAMP(n, 0, 2000); if (n != m_pSndFile->m_nVSTiVolume) { m_bEditsLocked=true; @@ -424,7 +424,7 @@ if ((m_pSndFile) && (m_pModDoc) && (m_bInitialized)) { m_EditSamplePA.GetWindowText(s, sizeof(s)); if (s[0]) { - int n = atoi(s); + UINT n = ConvertStrTo<UINT>(s); n = CLAMP(n, 0, 2000); if (n != m_pSndFile->m_nSamplePreAmp) { m_bEditsLocked=true; Modified: trunk/OpenMPT/mptrack/Mainbar.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.cpp 2011-07-29 20:49:03 UTC (rev 938) +++ trunk/OpenMPT/mptrack/Mainbar.cpp 2011-07-29 20:54:38 UTC (rev 939) @@ -506,10 +506,10 @@ { if (n < 0) { - pSndFile->m_nMusicSpeed = max(nCurrentSpeed - 1, pSndFile->GetModSpecifications().speedMin); + pSndFile->m_nMusicSpeed = Util::Max(UINT(nCurrentSpeed - 1), pSndFile->GetModSpecifications().speedMin); } else { - pSndFile->m_nMusicSpeed = min(nCurrentSpeed + 1, pSndFile->GetModSpecifications().speedMax); + pSndFile->m_nMusicSpeed = Util::Min(UINT(nCurrentSpeed + 1), pSndFile->GetModSpecifications().speedMax); } m_SpinSpeed.SetPos(0); } @@ -523,7 +523,7 @@ } } else { - if (nCurrentRowsPerBeat < pSndFile->m_nCurrentRowsPerMeasure) + if (static_cast<ROWINDEX>(nCurrentRowsPerBeat) < pSndFile->m_nCurrentRowsPerMeasure) { SetRowsPerBeat(nCurrentRowsPerBeat + 1); } Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-07-29 20:49:03 UTC (rev 938) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-07-29 20:54:38 UTC (rev 939) @@ -2173,7 +2173,7 @@ typedef struct MPTEFFECTINFO { - DWORD dwEffect; // CMD_XXXX + MODCOMMAND::COMMAND dwEffect; // CMD_XXXX DWORD dwParamMask; // 0 = default DWORD dwParamValue; // 0 = default DWORD dwFlags; // FXINFO_XXXX @@ -2288,7 +2288,7 @@ } -bool CModDoc::GetEffectName(LPSTR pszDescription, UINT command, UINT param, bool bXX, CHANNELINDEX nChn) //rewbs.xinfo: added chan arg +bool CModDoc::GetEffectName(LPSTR pszDescription, MODCOMMAND::COMMAND command, UINT param, bool bXX, CHANNELINDEX nChn) //rewbs.xinfo: added chan arg //------------------------------------------------------------------------------------------------------ { bool bSupported; @@ -2413,13 +2413,13 @@ //Returns command and corrects parameter refParam if necessary -UINT CModDoc::GetEffectFromIndex(UINT ndx, int &refParam) -//------------------------------------------------------- +MODCOMMAND::COMMAND CModDoc::GetEffectFromIndex(UINT ndx, int &refParam) +//---------------------------------------------------------------------- { //if (pParam) *pParam = -1; if (ndx >= MAX_FXINFO) { refParam = 0; - return 0; + return CMD_NONE; } //Cap parameter to match FX if necessary. @@ -2440,11 +2440,11 @@ } -UINT CModDoc::GetEffectFromIndex(UINT ndx) -//---------------------------------------- +MODCOMMAND::COMMAND CModDoc::GetEffectFromIndex(UINT ndx) +//------------------------------------------------------- { if (ndx >= MAX_FXINFO) { - return 0; + return CMD_NONE; } return gFXInfo[ndx].dwEffect; @@ -3059,7 +3059,7 @@ typedef struct MPTVOLCMDINFO { - DWORD dwVolCmd; // VOLCMD_XXXX + MODCOMMAND::VOLCMD dwVolCmd; // VOLCMD_XXXX DWORD dwFormats; // MOD_TYPE_XXX combo LPCSTR pszName; // ie "Set Volume" } MPTVOLCMDINFO; @@ -3105,8 +3105,8 @@ } -UINT CModDoc::GetVolCmdFromIndex(UINT ndx) -//---------------------------------------- +MODCOMMAND::VOLCMD CModDoc::GetVolCmdFromIndex(UINT ndx) +//------------------------------------------------------ { return (ndx < MAX_VOLINFO) ? gVolCmdInfo[ndx].dwVolCmd : 0; } Modified: trunk/OpenMPT/mptrack/Moddoc.h =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.h 2011-07-29 20:49:03 UTC (rev 938) +++ trunk/OpenMPT/mptrack/Moddoc.h 2011-07-29 20:54:38 UTC (rev 939) @@ -237,12 +237,12 @@ void ActivateWindow(); // Effects Description - bool GetEffectName(LPSTR pszDescription, UINT command, UINT param, bool bXX = false, CHANNELINDEX nChn = CHANNELINDEX_INVALID); // bXX: Nxx: ... + bool GetEffectName(LPSTR pszDescription, MODCOMMAND::COMMAND command, UINT param, bool bXX = false, CHANNELINDEX nChn = CHANNELINDEX_INVALID); // bXX: Nxx: ... UINT GetNumEffects() const; bool GetEffectInfo(UINT ndx, LPSTR s, bool bXX = false, DWORD *prangeMin=NULL, DWORD *prangeMax=NULL); LONG GetIndexFromEffect(UINT command, UINT param); - UINT GetEffectFromIndex(UINT ndx, int &refParam); - UINT GetEffectFromIndex(UINT ndx); + MODCOMMAND::COMMAND GetEffectFromIndex(UINT ndx, int &refParam); + MODCOMMAND::COMMAND GetEffectFromIndex(UINT ndx); UINT GetEffectMaskFromIndex(UINT ndx); bool GetEffectNameEx(LPSTR pszName, UINT ndx, UINT param); BOOL IsExtendedEffect(UINT ndx) const; @@ -251,7 +251,7 @@ // Volume column effects description UINT GetNumVolCmds() const; LONG GetIndexFromVolCmd(UINT volcmd); - UINT GetVolCmdFromIndex(UINT ndx); + MODCOMMAND::VOLCMD GetVolCmdFromIndex(UINT ndx); BOOL GetVolCmdInfo(UINT ndx, LPSTR s, DWORD *prangeMin=NULL, DWORD *prangeMax=NULL); // Various MIDI Macro helpers Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2011-07-29 20:49:03 UTC (rev 938) +++ trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2011-07-29 20:54:38 UTC (rev 939) @@ -13,6 +13,7 @@ #include "mptrack.h" #include "Mainfrm.h" #include "PatternEditorDialogs.h" +#include "view_pat.h" // -> CODE#0010 @@ -426,8 +427,8 @@ // Min/Max channels if (!m_bReplace) { - m_nMinChannel = GetDlgItemInt(IDC_EDIT1) - 1; - m_nMaxChannel = GetDlgItemInt(IDC_EDIT2) - 1; + m_nMinChannel = static_cast<CHANNELINDEX>(GetDlgItemInt(IDC_EDIT1) - 1); + m_nMaxChannel = static_cast<CHANNELINDEX>(GetDlgItemInt(IDC_EDIT2) - 1); if (m_nMaxChannel < m_nMinChannel) { std::swap(m_nMinChannel, m_nMaxChannel); @@ -653,13 +654,13 @@ } -BOOL CEditCommand::ShowEditWindow(UINT nPat, DWORD dwCursor) +BOOL CEditCommand::ShowEditWindow(PATTERNINDEX nPat, DWORD dwCursor) //---------------------------------------------------------- { CHAR s[64]; CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); - UINT nRow = dwCursor >> 16; - UINT nChannel = (dwCursor & 0xFFFF) >> 3; + const ROWINDEX nRow = CViewPattern::GetRowFromCursor(dwCursor); + const CHANNELINDEX nChannel = CViewPattern::GetChanFromCursor(dwCursor); if ((nPat >= pSndFile->Patterns.Size()) || (!m_pModDoc) || (nRow >= pSndFile->Patterns[nPat].GetNumRows()) || (nChannel >= pSndFile->m_nChannels) @@ -702,8 +703,8 @@ } -void CEditCommand::UpdateNote(UINT note, UINT instr) -//-------------------------------------------------- +void CEditCommand::UpdateNote(MODCOMMAND::NOTE note, MODCOMMAND::INSTR instr) +//--------------------------------------------------------------------------- { CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); if ((m_nPattern >= pSndFile->Patterns.Size()) || (!m_pModDoc) @@ -731,8 +732,8 @@ } -void CEditCommand::UpdateVolume(UINT volcmd, UINT vol) -//---------------------------------------------------- +void CEditCommand::UpdateVolume(MODCOMMAND::VOLCMD volcmd, MODCOMMAND::VOL vol) +//----------------------------------------------------------------------------- { CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); if ((m_nPattern >= pSndFile->Patterns.Size()) || (!m_pModDoc) @@ -759,8 +760,8 @@ } -void CEditCommand::UpdateEffect(UINT command, UINT param) -//------------------------------------------------------- +void CEditCommand::UpdateEffect(MODCOMMAND::COMMAND command, MODCOMMAND::PARAM param) +//----------------------------------------------------------------------------------- { CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); if ((m_nPattern >= pSndFile->Patterns.Size()) || (!m_pModDoc) @@ -908,16 +909,16 @@ if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO1)) != NULL) { int n = combo->GetCurSel(); - if (n >= 0) m_nNote = combo->GetItemData(n); + if (n >= 0) m_nNote = static_cast<MODCOMMAND::NOTE>(combo->GetItemData(n)); } if ((combo = (CComboBox *)GetDlgItem(IDC_COMBO2)) != NULL) { int n = combo->GetCurSel(); if(n >= 0) { - const UINT oldInstr = m_nInstr; + const MODCOMMAND::INSTR oldInstr = m_nInstr; CSoundFile* pSndFile = m_pModDoc->GetSoundFile(); - m_nInstr = combo->GetItemData(n); + m_nInstr = static_cast<MODCOMMAND::INSTR>(combo->GetItemData(n)); //Checking whether note names should be recreated. if(!MODCOMMAND::IsPcNote(m_nNote) && pSndFile && pSndFile->Instruments[m_nInstr] && pSndFile->Instruments[oldInstr]) { @@ -1020,7 +1021,7 @@ int n = combo->GetCurSel(); if (n >= 0) { - UINT volcmd = m_pModDoc->GetVolCmdFromIndex(combo->GetItemData(n)); + MODCOMMAND::VOLCMD volcmd = m_pModDoc->GetVolCmdFromIndex(combo->GetItemData(n)); if (volcmd != m_nVolCmd) { m_nVolCmd = volcmd; @@ -1030,7 +1031,7 @@ } if ((slider = (CSliderCtrl *)GetDlgItem(IDC_SLIDER1)) != NULL) { - m_nVolume = slider->GetPos(); + m_nVolume = static_cast<MODCOMMAND::VOL>(slider->GetPos()); } if (m_pParent) m_pParent->UpdateVolume(m_nVolCmd, m_nVolume); } @@ -1151,7 +1152,7 @@ { int param = -1, ndx = combo->GetItemData(n); m_nCommand = (ndx >= 0) ? m_pModDoc->GetEffectFromIndex(ndx, param) : 0; - if (param >= 0) m_nParam = param; + if (param >= 0) m_nParam = static_cast<MODCOMMAND::PARAM>(param); bSet = TRUE; } UpdateRange(bSet); @@ -1173,7 +1174,7 @@ UINT param = m_pModDoc->MapPosToValue(fxndx, pos); if (param != m_nParam) { - m_nParam = param; + m_nParam = static_cast<MODCOMMAND::PARAM>(param); UpdateValue(TRUE); } } @@ -1268,7 +1269,7 @@ if ((cnote < 3) || (i == (UINT)nKey)) { UINT k = (cnote < 3) ? cnote : 2; - pChords[chord].notes[k] = i+1; + pChords[chord].notes[k] = static_cast<BYTE>(i+1); if (cnote < 3) cnote++; } } @@ -1498,11 +1499,11 @@ { CDialog::OnOK(); - m_pOptions->splitNote = m_CbnSplitNote.GetCurSel(); + m_pOptions->splitNote = static_cast<MODCOMMAND::NOTE>(m_CbnSplitNote.GetCurSel()); m_pOptions->octaveModifier = m_CbnOctaveModifier.GetCurSel() - SPLIT_OCTAVE_RANGE; m_pOptions->octaveLink = (IsDlgButtonChecked(IDC_PATTERN_OCTAVELINK) == TRUE) ? true : false; - m_pOptions->splitVolume = m_CbnSplitVolume.GetCurSel(); - m_pOptions->splitInstrument = m_CbnSplitInstrument.GetItemData(m_CbnSplitInstrument.GetCurSel()); + m_pOptions->splitVolume = static_cast<MODCOMMAND::VOL>(m_CbnSplitVolume.GetCurSel()); + m_pOptions->splitInstrument = static_cast<MODCOMMAND::INSTR>(m_CbnSplitInstrument.GetItemData(m_CbnSplitInstrument.GetCurSel())); } Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.h =================================================================== --- trunk/OpenMPT/mptrack/PatternEditorDialogs.h 2011-07-29 20:49:03 UTC (rev 938) +++ trunk/OpenMPT/mptrack/PatternEditorDialogs.h 2011-07-29 20:54:38 UTC (rev 939) @@ -149,7 +149,8 @@ //========================================== { protected: - UINT m_nNote, m_nInstr; + MODCOMMAND::NOTE m_nNote; + MODCOMMAND::INSTR m_nInstr; public: CPageEditNote(CModDoc *pModDoc, CEditCommand *parent):CPageEditCommand(pModDoc, parent, IDD_PAGEEDITNOTE) {} @@ -170,7 +171,8 @@ //============================================ { protected: - UINT m_nVolCmd, m_nVolume; + MODCOMMAND::VOLCMD m_nVolCmd; + MODCOMMAND::VOL m_nVolume; bool m_bIsParamControl; public: @@ -193,7 +195,9 @@ //============================================ { protected: - UINT m_nCommand, m_nParam, m_nPlugin; + MODCOMMAND::COMMAND m_nCommand; + MODCOMMAND::PARAM m_nParam; + PLUGINDEX m_nPlugin; UINT m_nPluginParam; bool m_bIsParamControl; // -> CODE#0010 @@ -234,7 +238,9 @@ CPageEditEffect *m_pageEffect; CModDoc *m_pModDoc; HWND m_hWndView; - UINT m_nPattern, m_nRow, m_nChannel; + ROWINDEX m_nRow; + PATTERNINDEX m_nPattern; + CHANNELINDEX m_nChannel; MODCOMMAND m_Command; bool m_bModified; @@ -243,14 +249,14 @@ public: BOOL SetParent(CWnd *parent, CModDoc *pModDoc); - BOOL ShowEditWindow(UINT nPat, DWORD dwCursor); + BOOL ShowEditWindow(PATTERNINDEX nPat, DWORD dwCursor); // -> CODE#0010 // -> DESC="add extended parameter mechanism to pattern effects" void OnSelListChange(); // -! NEW_FEATURE#0010 - void UpdateNote(UINT note, UINT instr); - void UpdateVolume(UINT volcmd, UINT vol); - void UpdateEffect(UINT command, UINT param); + void UpdateNote(MODCOMMAND::NOTE note, MODCOMMAND::INSTR instr); + void UpdateVolume(MODCOMMAND::VOLCMD volcmd, MODCOMMAND::VOL vol); + void UpdateEffect(MODCOMMAND::COMMAND command, MODCOMMAND::PARAM param); protected: //{{AFX_VIRTUAL(CEditCommand) Modified: trunk/OpenMPT/mptrack/TuningDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/TuningDialog.cpp 2011-07-29 20:49:03 UTC (rev 938) +++ trunk/OpenMPT/mptrack/TuningDialog.cpp 2011-07-29 20:54:38 UTC (rev 939) @@ -32,7 +32,7 @@ // CTuningDialog dialog - +#pragma warning(disable : 4355) // "'this' : used in base member initializer list" IMPLEMENT_DYNAMIC(CTuningDialog, CDialog) CTuningDialog::CTuningDialog(CWnd* pParent, const TUNINGVECTOR& rVec, CTuning* pTun) : CDialog(CTuningDialog::IDD, pParent), @@ -44,6 +44,7 @@ m_TreeItemTuningItemMap(s_notFoundItemTree, s_notFoundItemTuning), m_TreeCtrlTuning(this), m_DoErrorExit(false) +#pragma warning(default : 4355) // "'this' : used in base member initializer list" //---------------------------------------- { m_pActiveTuning = pTun; Modified: trunk/OpenMPT/mptrack/View_pat.h =================================================================== --- trunk/OpenMPT/mptrack/View_pat.h 2011-07-29 20:49:03 UTC (rev 938) +++ trunk/OpenMPT/mptrack/View_pat.h 2011-07-29 20:54:38 UTC (rev 939) @@ -1,6 +1,8 @@ #ifndef _VIEW_PATTERNS_H_ #define _VIEW_PATTERNS_H_ +#include "globals.h" + class CModDoc; class CEditCommand; class CEffectVis; //rewbs.fxvis @@ -342,8 +344,13 @@ public: afx_msg void OnInitMenu(CMenu* pMenu); + + static ROWINDEX GetRowFromCursor(DWORD cursor) { return (cursor >> 16); }; + static CHANNELINDEX GetChanFromCursor(DWORD cursor) { return static_cast<CHANNELINDEX>((cursor & 0xFFFF) >> 3); }; + static UINT GetColTypeFromCursor(DWORD cursor) { return (cursor & 0x07); }; + static DWORD CreateCursor(ROWINDEX row, CHANNELINDEX channel = 0, UINT column = 0) { return (row << 16) | ((channel << 3) & 0x1FFF) | (column & 0x07); }; + private: - void SetSplitKeyboardSettings(); bool HandleSplit(MODCOMMAND* p, int note); bool BuildChannelControlCtxMenu(HMENU hMenu); @@ -372,11 +379,6 @@ CHANNELINDEX GetSelectionEndChan(); UINT ListChansWhereColSelected(PatternColumns colType, CArray<UINT,UINT> &chans); - static ROWINDEX GetRowFromCursor(DWORD cursor) { return (cursor >> 16); }; - static CHANNELINDEX GetChanFromCursor(DWORD cursor) { return static_cast<CHANNELINDEX>((cursor & 0xFFFF) >> 3); }; - static UINT GetColTypeFromCursor(DWORD cursor) { return (cursor & 0x07); }; - static DWORD CreateCursor(ROWINDEX row, CHANNELINDEX channel = 0, UINT column = 0) { return (row << 16) | ((channel << 3) & 0x1FFF) | (column & 0x07); }; - bool IsInterpolationPossible(ROWINDEX startRow, ROWINDEX endRow, CHANNELINDEX chan, PatternColumns colType, CSoundFile* pSndFile); void Interpolate(PatternColumns type); Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2011-07-29 20:49:03 UTC (rev 938) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2011-07-29 20:54:38 UTC (rev 939) @@ -286,7 +286,7 @@ if (!hLib && dw != ERROR_MOD_NOT_FOUND) // "File not found errors" are annoying. { TCHAR szBuf[256]; - wsprintf(szBuf, "Warning: encountered problem when loading plugin dll. Error %d: %s", dw, GetErrorMessage(dw)); + wsprintf(szBuf, "Warning: encountered problem when loading plugin dll. Error %d: %s", dw, (LPCTSTR)GetErrorMessage(dw)); MessageBox(NULL, szBuf, "DEBUG: Error when loading plugin dll", MB_OK); } #endif //_DEBUG @@ -406,11 +406,11 @@ #endif // VST_LOG } - try { + //try { FreeLibrary(hLib); - } catch (...) { - CVstPluginManager::ReportPlugException("Exception in FreeLibrary(\"%s\")!\n", pszDllPath); - } + //} catch (...) { + // CVstPluginManager::ReportPlugException("Exception in FreeLibrary(\"%s\")!\n", pszDllPath); + //} return (bOk) ? m_pVstHead : NULL; } else @@ -1087,7 +1087,7 @@ { // Plugin wants to load or save a file. std::string extensions, workingDir; - for(size_t i = 0; i < pFileSel->nbFileTypes; i++) + for(VstInt32 i = 0; i < pFileSel->nbFileTypes; i++) { VstFileType *pType = &(pFileSel->fileTypes[i]); extensions += pType->name; @@ -1230,7 +1230,7 @@ // Close file selector - delete allocated strings. if(pFileSel->command == kVstMultipleFilesLoad && pFileSel->returnMultiplePaths != nullptr) { - for(size_t i = 0; i < pFileSel->nbReturnPath; i++) + for(VstInt32 i = 0; i < pFileSel->nbReturnPath; i++) { if(pFileSel->returnMultiplePaths[i] != nullptr) { @@ -1739,7 +1739,7 @@ m_nEditorX = m_nEditorY = -1; m_pEvList = NULL; m_pModDoc = NULL; //rewbs.plugDocAware - m_nPreviousMidiChan = -1; //rewbs.VSTCompliance + m_nPreviousMidiChan = nInvalidMidiChan; //rewbs.VSTCompliance m_pProcessFP = NULL; // Insert ourselves in the beginning of the list @@ -1766,7 +1766,7 @@ m_bPlugResumed = false; m_bModified = false; m_dwTimeAtStartOfProcess=0; - m_nSampleRate = -1; //rewbs.VSTCompliance: gets set on Resume() + m_nSampleRate = nInvalidSampleRate; //rewbs.VSTCompliance: gets set on Resume() memset(m_MidiCh, 0, sizeof(m_MidiCh)); for (int ch=0; ch<16; ch++) { @@ -1860,7 +1860,7 @@ } m_nSampleRate=CSoundFile::gdwMixingFreq; - Dispatch(effSetSampleRate, 0, 0, NULL, CSoundFile::gdwMixingFreq); + Dispatch(effSetSampleRate, 0, 0, NULL, static_cast<float>(CSoundFile::gdwMixingFreq)); Dispatch(effSetBlockSize, 0, MIXBUFFERSIZE, NULL, 0.0f); if (m_pEffect->numPrograms > 0) { Dispatch(effSetProgram, 0, 0, NULL, 0); @@ -1911,7 +1911,7 @@ m_pProcessFP = (m_pEffect->flags & effFlagsCanReplacing) ? m_pEffect->processReplacing : m_pEffect->process; // issue samplerate again here, cos some plugs like it before the block size, other like it right at the end. - Dispatch(effSetSampleRate, 0, 0, NULL, CSoundFile::gdwMixingFreq); + Dispatch(effSetSampleRate, 0, 0, NULL, static_cast<float>(CSoundFile::gdwMixingFreq)); } @@ -2319,7 +2319,7 @@ void CVstPlugin::Resume() //----------------------- { - long sampleRate = CSoundFile::gdwMixingFreq; + const DWORD sampleRate = CSoundFile::gdwMixingFreq; try { //reset some stuf @@ -2329,7 +2329,7 @@ Dispatch(effMainsChanged, 0, 0, NULL, 0.0f); // calls plugin's suspend if (sampleRate != m_nSampleRate) { m_nSampleRate=sampleRate; - Dispatch(effSetSampleRate, 0, 0, NULL, m_nSampleRate); + Dispatch(effSetSampleRate, 0, 0, NULL, static_cast<float>(m_nSampleRate)); } Dispatch(effSetBlockSize, 0, MIXBUFFERSIZE, NULL, 0); //start off some stuff @@ -2389,7 +2389,7 @@ if (m_bIsInstrument && m_pSndFile) { gain /= m_pSndFile->m_pConfig->getVSTiAttenuation(); - gain *= (m_pSndFile->m_nVSTiVolume / m_pSndFile->m_pConfig->getNormalVSTiVol()); + gain = static_cast<float>(gain * (m_pSndFile->m_nVSTiVolume / m_pSndFile->m_pConfig->getNormalVSTiVol())); } m_fGain = gain; } @@ -2399,7 +2399,7 @@ //-------------------------------------- { param = min(param, 127); - m_pMixStruct->fDryRatio = 1.0-(static_cast<float>(param)/127.0f); + m_pMixStruct->fDryRatio = static_cast<float>(1.0-(static_cast<double>(param)/127.0)); } /* @@ -2870,8 +2870,8 @@ // pre: 0 <= value <= 16383 - BYTE byte1 = value >> 7; // get last 7 bytes only - BYTE byte2 = value & 0x7F; // get first 7 bytes only + BYTE byte1 = static_cast<BYTE>(value >> 7); // get last 7 bytes only + BYTE byte2 = static_cast<BYTE>(value & 0x7F); // get first 7 bytes only short converted = byte1<<8 | byte2; // merge return converted; @@ -2884,9 +2884,9 @@ { nMidiCh--; // move from 1-17 range to 0-16 range - short increment = nParam * 0x2000/0xFF; - short newPitchBendPos = m_nMidiPitchBendPos[nMidiCh] + increment; - newPitchBendPos = max(MIDI_PitchBend_Min, min(MIDI_PitchBend_Max, newPitchBendPos)); // cap + const int16 increment = static_cast<int16>(nParam * 0x2000/0xFF); + int16 newPitchBendPos = m_nMidiPitchBendPos[nMidiCh] + increment; + Limit(newPitchBendPos, int16(MIDI_PitchBend_Min), int16(MIDI_PitchBend_Max)); MidiPitchBend(nMidiCh, newPitchBendPos); } @@ -4167,12 +4167,10 @@ { int xl = (int)(pIn1[i] * _f2si); int xr = (int)(pIn2[i] * _f2si); - if (xl < -32768) xl = -32768; - if (xl > 32767) xl = 32767; - if (xr < -32768) xr = -32768; - if (xr > 32767) xr = 32767; - pOut[i*2] = xl; - pOut[i*2+1] = xr; + Limit(xl, int16_min, int16_max); + Limit(xr, int16_min, int16_max); + pOut[i*2] = static_cast<int16>(xl); + pOut[i*2+1] = static_cast<int16>(xr); } } Modified: trunk/OpenMPT/mptrack/Vstplug.h =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.h 2011-07-29 20:49:03 UTC (rev 938) +++ trunk/OpenMPT/mptrack/Vstplug.h 2011-07-29 20:54:38 UTC (rev 939) @@ -70,6 +70,7 @@ AEffect *m_pEffect; void (*m_pProcessFP)(AEffect*, float**, float**, VstInt32); //Function pointer to AEffect processReplacing if supported, else process. CAbstractVstEditor *m_pEditor; //rewbs.defaultPlugGUI + static const UINT nInvalidSampleRate = UINT_MAX; UINT m_nSampleRate; bool m_bIsVst2; SNDMIXPLUGINSTATE m_MixState; @@ -87,6 +88,7 @@ CModDoc* m_pModDoc; //rewbs.plugDocAware CSoundFile* m_pSndFile; //rewbs.plugDocAware // PSNDMIXPLUGIN m_pSndMixPlugin; //rewbs.plugDocAware + static const UINT nInvalidMidiChan = UINT_MAX; UINT m_nPreviousMidiChan; //rewbs.VSTCompliance bool m_bSongPlaying; //rewbs.VSTCompliance bool m_bPlugResumed; //rewbs.VSTCompliance Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-07-29 20:49:03 UTC (rev 938) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-07-29 20:54:38 UTC (rev 939) @@ -384,7 +384,7 @@ sel = m_ChannelsBox.GetCurSel(); if (sel >= 0) { - m_nChannels = m_ChannelsBox.GetItemData(sel); + m_nChannels = static_cast<CHANNELINDEX>(m_ChannelsBox.GetItemData(sel)); //if (m_nType & MOD_TYPE_XM) m_nChannels = (m_nChannels+1) & 0xFE; } Modified: trunk/OpenMPT/mptrack/dlg_misc.h =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.h 2011-07-29 20:49:03 UTC (rev 938) +++ trunk/OpenMPT/mptrack/dlg_misc.h 2011-07-29 20:54:38 UTC (rev 939) @@ -13,7 +13,7 @@ CComboBox m_TypeBox, m_ChannelsBox, m_TempoModeBox, m_PlugMixBox; CButton m_CheckBox1, m_CheckBox2, m_CheckBox3, m_CheckBox4, m_CheckBox5, m_CheckBoxPT1x; CSoundFile *m_pSndFile; - UINT m_nChannels; + CHANNELINDEX m_nChannels; MODTYPE m_nType; DWORD m_dwSongFlags; Modified: trunk/OpenMPT/soundlib/Load_itp.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_itp.cpp 2011-07-29 20:49:03 UTC (rev 938) +++ trunk/OpenMPT/soundlib/Load_itp.cpp 2011-07-29 20:54:38 UTC (rev 939) @@ -231,7 +231,7 @@ // m_nPatternNames memcpy(&id,lpStream+dwMemPos,sizeof(DWORD)); - const PATTERNINDEX numNamedPats = id; + const PATTERNINDEX numNamedPats = static_cast<PATTERNINDEX>(id); dwMemPos += sizeof(DWORD); // pattern name string length (=MAX_PATTERNNAME) @@ -583,7 +583,7 @@ fwrite(&id, 1, sizeof(id), f); // order array - Order.WriteAsByte(f, id); + Order.WriteAsByte(f, static_cast<uint16>(id)); // Song Patterns This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-07-30 00:49:27
|
Revision: 940 http://modplug.svn.sourceforge.net/modplug/?rev=940&view=rev Author: saga-games Date: 2011-07-30 00:49:19 +0000 (Sat, 30 Jul 2011) Log Message: ----------- [Ref] More code cleanup [Fix] Saving mod type does not depend on file extension anymore (so editing an IT file and saving it as "foo.mod" will actually save it as an IT file with .mod extension, not as a ProTracker MOD) Modified Paths: -------------- trunk/OpenMPT/mptrack/AutoSaver.cpp trunk/OpenMPT/mptrack/CleanupSong.cpp trunk/OpenMPT/mptrack/Ctrl_gen.cpp trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/MPTHacks.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/ModConvert.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/mod2midi.cpp trunk/OpenMPT/mptrack/test/test.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/mod_specifications.cpp trunk/OpenMPT/soundlib/mod_specifications.h trunk/OpenMPT/soundlib/patternContainer.cpp trunk/OpenMPT/soundlib/patternContainer.h Modified: trunk/OpenMPT/mptrack/AutoSaver.cpp =================================================================== --- trunk/OpenMPT/mptrack/AutoSaver.cpp 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/mptrack/AutoSaver.cpp 2011-07-30 00:49:19 UTC (rev 940) @@ -42,16 +42,20 @@ { } + ////////////// // Entry Point ////////////// + bool CAutoSaver::DoSave(DWORD curTime) +//------------------------------------ { bool success = true; //If time to save and not already having save in progress. - if (CheckTimer(curTime) && !m_bSaveInProgress) { + if (CheckTimer(curTime) && !m_bSaveInProgress) + { m_bSaveInProgress = true; CDocTemplate *pDocTemplate; CModDoc *pModDoc; @@ -70,7 +74,8 @@ pDocTemplate = pTrackApp->GetNextDocTemplate(posTemplate); posDocument = pDocTemplate->GetFirstDocPosition(); - while (posDocument) { //for all open documents + while (posDocument) //for all open documents + { pModDoc = (CModDoc*)(pDocTemplate->GetNextDoc(posDocument)); if (pModDoc && pModDoc->ModifiedSinceLastAutosave() && pModDoc->GetSoundFile()) { @@ -95,188 +100,215 @@ return success; } + //////////////// // Member access //////////////// + + void CAutoSaver::Enable() +//----------------------- { - m_bEnabled=true; + m_bEnabled = true; } + void CAutoSaver::Disable() +//------------------------ { - m_bEnabled=false; + m_bEnabled = false; } + bool CAutoSaver::IsEnabled() +//-------------------------- { return m_bEnabled; } + void CAutoSaver::SetUseOriginalPath(bool useOrgPath) +//-------------------------------------------------- { m_bUseOriginalPath=useOrgPath; } + bool CAutoSaver::GetUseOriginalPath() +//----------------------------------- { return m_bUseOriginalPath; } + void CAutoSaver::SetPath(CString path) +//------------------------------------ { m_csPath = path; } + CString CAutoSaver::GetPath() +//--------------------------- { return m_csPath; } + void CAutoSaver::SetFilenameTemplate(CString fnTemplate) +//------------------------------------------------------ { m_csFileNameTemplate = fnTemplate; } + CString CAutoSaver::GetFilenameTemplate() +//--------------------------------------- { return m_csFileNameTemplate; } + void CAutoSaver::SetHistoryDepth(int history) +//------------------------------------------- { - if (history<1) { - m_nBackupHistory=1; - } else if (history>100) { - m_nBackupHistory=100; - } else { - m_nBackupHistory=history; - } + Limit(history, 1, 100); + m_nBackupHistory = history; } + int CAutoSaver::GetHistoryDepth() +//_------------------------------ { return m_nBackupHistory; } + void CAutoSaver::SetSaveInterval(int minutes) +//------------------------------------------- { - if (minutes<1) { - minutes=1; - } else if (minutes>10000) { - minutes=10000; - } + Limit(minutes, 1, 10000); - m_nSaveInterval=minutes*60*1000; //minutes to milliseconds + m_nSaveInterval=minutes * 60 * 1000; //minutes to milliseconds } + int CAutoSaver::GetSaveInterval() +//------------------------------- { return m_nSaveInterval/60/1000; } + /////////////////////////// // Implementation internals /////////////////////////// + bool CAutoSaver::CheckTimer(DWORD curTime) +//---------------------------------------- { DWORD curInterval = curTime-m_nLastSave; - return (curInterval>=m_nSaveInterval); + return (curInterval >= m_nSaveInterval); } CString CAutoSaver::BuildFileName(CModDoc* pModDoc) +//------------------------------------------------- { CString timeStamp = (CTime::GetCurrentTime()).Format("%Y%m%d.%H%M%S"); CString name; - if (m_bUseOriginalPath) { - if (pModDoc->m_bHasValidPath) { // Check that the file has a user-chosen path + if (m_bUseOriginalPath) + { + if (pModDoc->m_bHasValidPath) + { + // Check that the file has a user-chosen path name = pModDoc->GetPathName(); - } else { // if it doesnt, put it in settings dir + } else + { + // if it doesnt, put it in settings dir name = theApp.GetConfigPath() + pModDoc->GetTitle(); } - } else { + } else + { name = m_csPath+pModDoc->GetTitle(); } name.Append(".AutoSave."); //append backup tag name.Append(timeStamp); //append timestamp - switch (pModDoc->GetModType()) { //append extension - case MOD_TYPE_MOD: - name.Append(".mod"); - break; - case MOD_TYPE_IT: - if((pModDoc->GetSoundFile())->m_dwSongFlags & SONG_ITPROJECT){ - name.Append(".itp"); - } else{ - name.Append(".it"); - } - break; - case MOD_TYPE_MPT: - name.Append(".mptm"); - break; - case MOD_TYPE_XM: - name.Append(".xm"); - break; - case MOD_TYPE_S3M: - name.Append(".s3m"); - break; + name.Append("."); //append extension + if((pModDoc->GetSoundFile()->m_dwSongFlags & SONG_ITPROJECT) != 0) + { + name.Append("itp"); + } else + { + name.Append(pModDoc->GetSoundFile()->GetModSpecifications().fileExtension); } return name; } + + bool CAutoSaver::SaveSingleFile(CModDoc *pModDoc) +//----------------------------------------------- { // We do not call CModDoc::DoSave as this populates the Recent Files // list with backups... hence we have duplicated code.. :( - BOOL success=false; + bool success = false; CSoundFile* pSndFile = pModDoc->GetSoundFile(); - if (pSndFile) { + if (pSndFile) + { CString fileName = BuildFileName(pModDoc); - switch (pModDoc->GetModType()) { - case MOD_TYPE_MOD: - success = pSndFile->SaveMod(fileName, 0); - break; - case MOD_TYPE_S3M: - success = pSndFile->SaveS3M(fileName, 0); - break; - case MOD_TYPE_XM: - success = pSndFile->SaveXM(fileName, 0); - break; - case MOD_TYPE_IT: - success = (pSndFile->m_dwSongFlags & SONG_ITPROJECT) ? - pSndFile->SaveITProject(fileName) : - pSndFile->SaveIT(fileName, 0); - break; - case MOD_TYPE_MPT: - //Using IT save function also for MPT. - success = pSndFile->SaveIT(fileName, 0); - break; + switch (pModDoc->GetModType()) + { + case MOD_TYPE_MOD: + success = pSndFile->SaveMod(fileName, 0); + break; + case MOD_TYPE_S3M: + success = pSndFile->SaveS3M(fileName, 0); + break; + case MOD_TYPE_XM: + success = pSndFile->SaveXM(fileName, 0); + break; + case MOD_TYPE_IT: + success = (pSndFile->m_dwSongFlags & SONG_ITPROJECT) ? + pSndFile->SaveITProject(fileName) : + pSndFile->SaveIT(fileName, 0); + break; + case MOD_TYPE_MPT: + //Using IT save function also for MPT. + success = pSndFile->SaveIT(fileName, 0); + break; //default: - //Do nothing + //Do nothing } } - return (success == TRUE); + return success; } + void CAutoSaver::CleanUpBackups(CModDoc *pModDoc) +//----------------------------------------------- { CString path; - if (m_bUseOriginalPath) { - if (pModDoc->m_bHasValidPath) { // Check that the file has a user-chosen path + if (m_bUseOriginalPath) + { + if (pModDoc->m_bHasValidPath) // Check that the file has a user-chosen path + { CString fullPath = pModDoc->GetPathName(); path = fullPath.Left(fullPath.GetLength()-pModDoc->GetTitle().GetLength()); //remove file name if necessary - } else { + } else + { path = theApp.GetConfigPath(); } - } else { + } else + { path = m_csPath; } @@ -286,15 +318,18 @@ BOOL bResult = finder.FindFile(searchPattern); CArray<CString> foundfiles; - while(bResult) { + while(bResult) + { bResult = finder.FindNextFile(); foundfiles.Add(path+finder.GetFileName()); } finder.Close(); std::sort(foundfiles.GetData(), foundfiles.GetData() + foundfiles.GetSize()); - while (foundfiles.GetSize()>m_nBackupHistory) { - try { + while (foundfiles.GetSize()>m_nBackupHistory) + { + try + { CString toRemove=foundfiles[0]; CFile::Remove(toRemove); } catch (CFileException* /*pEx*/){} @@ -304,10 +339,12 @@ } + /////////////////////////////////////////////////////////////////////////////////////// // CAutoSaverGUI dialog : AutoSaver GUI /////////////////////////////////////////////////////////////////////////////////////// + IMPLEMENT_DYNAMIC(CAutoSaverGUI, CPropertyPage) CAutoSaverGUI::CAutoSaverGUI(CAutoSaver* pAutoSaver) : CPropertyPage(CAutoSaverGUI::IDD) Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp =================================================================== --- trunk/OpenMPT/mptrack/CleanupSong.cpp 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2011-07-30 00:49:19 UTC (rev 940) @@ -706,7 +706,7 @@ INSTRUMENTINDEX nSwap, nIndex; bool bReorg = false; - if (!pSndFile->m_nInstruments) return false; + if (!pSndFile->GetNumInstruments()) return false; char removeSamples = -1; if ( !((pSndFile->GetType() == MOD_TYPE_IT) && (pSndFile->m_dwSongFlags & SONG_ITPROJECT))) //never remove an instrument's samples in ITP. Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2011-07-30 00:49:19 UTC (rev 940) @@ -346,7 +346,7 @@ void CCtrlGeneral::OnTempoChanged() //--------------------------------- { - CHAR s[32]; + CHAR s[16]; if ((m_pSndFile) && (m_pModDoc) && (m_bInitialized)) { m_EditTempo.GetWindowText(s, sizeof(s)); @@ -373,7 +373,7 @@ void CCtrlGeneral::OnSpeedChanged() //--------------------------------- { - CHAR s[32]; + CHAR s[16]; if ((m_pSndFile) && (m_pModDoc) && (m_bInitialized)) { m_EditSpeed.GetWindowText(s, sizeof(s)); @@ -381,7 +381,8 @@ { UINT n = atoi(s); n = CLAMP(n, m_pSndFile->GetModSpecifications().speedMin, m_pSndFile->GetModSpecifications().speedMax); - if (n != m_pSndFile->m_nDefaultSpeed) { + if (n != m_pSndFile->m_nDefaultSpeed) + { m_bEditsLocked=true; m_EditSpeed.SetModify(FALSE); m_pSndFile->m_nDefaultSpeed = n; @@ -398,8 +399,9 @@ void CCtrlGeneral::OnVSTiVolChanged() //------------------------------------- { - CHAR s[32]; - if ((m_pSndFile) && (m_pModDoc) && (m_bInitialized)) { + CHAR s[16]; + if ((m_pSndFile) && (m_pModDoc) && (m_bInitialized)) + { m_EditVSTiVol.GetWindowText(s, sizeof(s)); if (s[0]) { UINT n = ConvertStrTo<UINT>(s); @@ -420,8 +422,9 @@ void CCtrlGeneral::OnSamplePAChanged() //------------------------------------- { - CHAR s[32]; - if ((m_pSndFile) && (m_pModDoc) && (m_bInitialized)) { + CHAR s[16]; + if ((m_pSndFile) && (m_pModDoc) && (m_bInitialized)) + { m_EditSamplePA.GetWindowText(s, sizeof(s)); if (s[0]) { UINT n = ConvertStrTo<UINT>(s); @@ -441,7 +444,7 @@ void CCtrlGeneral::OnGlobalVolChanged() //------------------------------------- { - CHAR s[32]; + CHAR s[16]; if ((m_pSndFile) && (m_pModDoc) && (m_bInitialized)) { m_EditGlobalVol.GetWindowText(s, sizeof(s)); @@ -619,14 +622,16 @@ } -BOOL CCtrlGeneral::GetToolTipText(UINT uId, LPSTR pszText) { -//---------------------------------------------------------- +BOOL CCtrlGeneral::GetToolTipText(UINT uId, LPSTR pszText) +//-------------------------------------------------------- +{ const char moreRecentMixModeNote[] = "Use a more recent mixmode to see dB offsets."; if ((pszText) && (uId)) { const bool displayDBValues = m_pSndFile->m_pConfig->getDisplayDBValues(); - switch(uId) { + switch(uId) + { case IDC_SLIDER_SAMPLEPREAMP: (displayDBValues) ? setAsDecibels(pszText, m_pSndFile->m_nSamplePreAmp, m_pSndFile->m_pConfig->getNormalSamplePreAmp()) : wsprintf(pszText, moreRecentMixModeNote); return TRUE; @@ -645,18 +650,19 @@ } -void CCtrlGeneral::setAsDecibels(LPSTR stringToSet, double value, double valueAtZeroDB) { +void CCtrlGeneral::setAsDecibels(LPSTR stringToSet, double value, double valueAtZeroDB) //------------------------------------------------------------------------------------- - - if (value==0) { +{ + if (value == 0) + { wsprintf(stringToSet, "-inf"); return; } double changeFactor = value / valueAtZeroDB; - double dB = 10*log(changeFactor); + double dB = 10 * log(changeFactor); - char sign = (dB>=0)?'+':' '; + char sign = (dB>=0) ? '+' : ' '; sprintf(stringToSet, "%c%.2f dB", sign, dB); return; Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2011-07-30 00:49:19 UTC (rev 940) @@ -1868,10 +1868,10 @@ if (b) pIns->dwFlags |= INS_SETPANNING; else pIns->dwFlags &= ~INS_SETPANNING; - if(b && m_pSndFile->GetType() & MOD_TYPE_IT|MOD_TYPE_MPT) + if(b && m_pSndFile->GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT)) { bool smpPanningInUse = false; - for(BYTE i = 0; i<ARRAYELEMCOUNT(pIns->Keyboard); i++) + for(BYTE i = 0; i < CountOf(pIns->Keyboard); i++) { const SAMPLEINDEX smp = pIns->Keyboard[i]; if(smp <= m_pSndFile->GetNumSamples() && m_pSndFile->Samples[smp].uFlags & CHN_PANNING) @@ -1889,7 +1889,7 @@ _T(""), MB_YESNO) == IDYES) { - for(BYTE i = 0; i < ARRAYELEMCOUNT(pIns->Keyboard); i++) + for(BYTE i = 0; i < CountOf(pIns->Keyboard); i++) { const SAMPLEINDEX smp = pIns->Keyboard[i]; if(smp <= m_pSndFile->GetNumSamples()) Modified: trunk/OpenMPT/mptrack/MPTHacks.cpp =================================================================== --- trunk/OpenMPT/mptrack/MPTHacks.cpp 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/mptrack/MPTHacks.cpp 2011-07-30 00:49:19 UTC (rev 940) @@ -147,7 +147,7 @@ AddToLog("Found VST plugins\n"); // Pattern count - if(m_SndFile.GetNumPatterns() > originalSpecs->patternsMax) + if(m_SndFile.Patterns.GetNumPatterns() > originalSpecs->patternsMax) { message.Format("Found too many patterns (%d allowed)\n", originalSpecs->patternsMax); AddToLog(message); @@ -208,7 +208,7 @@ foundHacks = true; if(autofix) { - for(PATTERNINDEX i = 0; i < m_SndFile.GetNumPatterns(); i++) + for(PATTERNINDEX i = 0; i < m_SndFile.Patterns.GetNumPatterns(); i++) { m_SndFile.Patterns[i].SetName(""); } @@ -371,7 +371,7 @@ if(!originalSpecs->hasPatternSignatures) { foundHere = false; - for(PATTERNINDEX i = 0; i < m_SndFile.GetNumPatterns(); i++) + for(PATTERNINDEX i = 0; i < m_SndFile.Patterns.GetNumPatterns(); i++) { if(m_SndFile.Patterns[i].GetOverrideSignature()) { Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2011-07-30 00:49:19 UTC (rev 940) @@ -1216,6 +1216,7 @@ if (penEnvelopeHighlight) DeleteObject(penEnvelopeHighlight); penEnvelopeHighlight = ::CreatePen(PS_SOLID, 0, RGB(0xFF, 0xFF, 0x00)); + // Generel tab VU meters for (UINT i=0; i<NUM_VUMETER_PENS*2; i++) { int r0,g0,b0, r1,g1,b1; @@ -1275,17 +1276,6 @@ } -VOID CMainFrame::GetKeyName(LONG lParam, LPSTR pszName, UINT cbSize) -//------------------------------------------------------------------ -{ - pszName[0] = (char)cbSize; - if ((cbSize > 0) && (lParam)) - { - GetKeyNameText(lParam, pszName, cbSize); - } -} - - ///////////////////////////////////////////////////////////////////////////// // CMainFrame operations @@ -2471,7 +2461,8 @@ CSoundFile *pSndFile = NULL; pSndFile = GetActiveDoc()->GetSoundFile(); - if (pSndFile) { + if (pSndFile) + { return pSndFile->GetCurrentBPM(); } return 0; @@ -2691,6 +2682,7 @@ #endif // NO_VST } + void AddPluginParameternamesToCombobox(CComboBox& CBox, SNDMIXPLUGIN& plug) //------------------------------------------------------------------------- { @@ -2698,6 +2690,7 @@ AddPluginParameternamesToCombobox(CBox, *(CVstPlugin *)plug.pMixPlugin); } + void AddPluginParameternamesToCombobox(CComboBox& CBox, CVstPlugin& plug) //----------------------------------------------------------------------- { Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2011-07-30 00:49:19 UTC (rev 940) @@ -412,7 +412,7 @@ static HPEN penBlack, penDarkGray, penLightGray, penWhite, penHalfDarkGray, penSample, penEnvelope, penEnvelopeHighlight, penSeparator, penScratch, penGray00, penGray33, penGray40, penGray55, penGray80, penGray99, penGraycc, penGrayff; static HCURSOR curDragging, curNoDrop, curArrow, curNoDrop2, curVSplit; static LPMODPLUGDIB bmpPatterns, bmpNotes, bmpVUMeters, bmpVisNode, bmpVisPcNode; - static HPEN gpenVuMeter[NUM_VUMETER_PENS*2]; + static HPEN gpenVuMeter[NUM_VUMETER_PENS * 2]; // General tab VU meters protected: @@ -498,8 +498,6 @@ static HFONT GetLargeFixedFont() { return m_hLargeFixedFont; } static void UpdateAllViews(DWORD dwHint, CObject *pHint=NULL); static LRESULT CALLBACK KeyboardProc(int code, WPARAM wParam, LPARAM lParam); - static void TranslateKeyboardMap(LPSTR pszKbd); - static VOID GetKeyName(LONG lParam, LPSTR pszName, UINT cbSize); static CInputHandler *m_InputHandler; //rewbs.customKeys static CAutoSaver *m_pAutoSaver; //rewbs.customKeys //static CPerformanceCounter *m_pPerfCounter; Modified: trunk/OpenMPT/mptrack/ModConvert.cpp =================================================================== --- trunk/OpenMPT/mptrack/ModConvert.cpp 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/mptrack/ModConvert.cpp 2011-07-30 00:49:19 UTC (rev 940) @@ -432,7 +432,7 @@ // Check for patterns with custom time signatures (fixing will be applied in the pattern container) if(!CSoundFile::GetModSpecifications(nNewType).hasPatternSignatures) { - for(PATTERNINDEX nPat = 0; nPat < m_SndFile.GetNumPatterns(); nPat++) + for(PATTERNINDEX nPat = 0; nPat < m_SndFile.Patterns.GetNumPatterns(); nPat++) { if(m_SndFile.Patterns[nPat].GetOverrideSignature()) { Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-07-30 00:49:19 UTC (rev 940) @@ -34,6 +34,7 @@ const TCHAR FileFilterNone[] = _T(""); const TCHAR* ModTypeToFilter(const CSoundFile& sndFile) +//----------------------------------------------------- { const MODTYPE modtype = sndFile.GetType(); switch(modtype) @@ -432,7 +433,7 @@ BOOL CModDoc::OnSaveDocument(LPCTSTR lpszPathName, const bool bTemplateFile) -//------------------------------------------------ +//-------------------------------------------------------------------------- { static int greccount = 0; TCHAR fext[_MAX_EXT] = _T(""); @@ -442,20 +443,8 @@ if (!lpszPathName) return FALSE; _tsplitpath(lpszPathName, NULL, NULL, NULL, fext); - MODTYPE type = CModSpecifications::ExtensionToType(fext); + MODTYPE type = m_SndFile.GetType(); // CModSpecifications::ExtensionToType(fext); - /* - if (!lstrcmpi(fext, ".mod")) type = MOD_TYPE_MOD; else - if (!lstrcmpi(fext, ".s3m")) type = MOD_TYPE_S3M; else - if (!lstrcmpi(fext, ".xm")) type = MOD_TYPE_XM; else -// -> CODE#0023 -// -> DESC="IT project files (.itp)" -// if (!lstrcmpi(fext, ".it")) nType = MOD_TYPE_IT; else - if (!lstrcmpi(fext, ".it") || !lstrcmpi(fext, ".itp")) type = MOD_TYPE_IT; else - if (!lstrcmpi(fext, ".mptm")) type = MOD_TYPE_MPT; else -// -! NEW_FEATURE#0023 -*/ - if (type == MOD_TYPE_NONE && !greccount) { greccount++; @@ -565,26 +554,17 @@ CHAR s[_MAX_PATH] = ""; CHAR path[_MAX_PATH]="", drive[_MAX_DRIVE]=""; CHAR fname[_MAX_FNAME]="", fext[_MAX_EXT]=""; - std::string extFilter = "", defaultExtension = ""; + std::string defaultExtension = m_SndFile.GetModSpecifications().fileExtension; switch(m_SndFile.GetType()) { case MOD_TYPE_MOD: MsgBoxHidable(ModCompatibilityExportTip); - defaultExtension = "mod"; - extFilter = FileFilterMOD; - strcpy(fext, ".mod"); break; case MOD_TYPE_S3M: - defaultExtension = "s3m"; - extFilter = FileFilterS3M; - strcpy(fext, ".s3m"); break; case MOD_TYPE_XM: MsgBoxHidable(XMCompatibilityExportTip); - defaultExtension = "xm"; - extFilter = FileFilterXM; - strcpy(fext, ".xm"); break; case MOD_TYPE_IT: // -> CODE#0023 @@ -592,29 +572,27 @@ // lpszDefExt = "it"; // lpszFilter = "Impulse Tracker Modules (*.it)|*.it||"; // strcpy(fext, ".it"); - if(m_SndFile.m_dwSongFlags & SONG_ITPROJECT){ + if(m_SndFile.m_dwSongFlags & SONG_ITPROJECT) + { + // Special case... defaultExtension = "itp"; - extFilter = FileFilterITP; - strcpy(fext, ".itp"); } else { MsgBoxHidable(ItCompatibilityExportTip); - defaultExtension = "it"; - extFilter = FileFilterIT; - strcpy(fext, ".it"); } // -! NEW_FEATURE#0023 break; case MOD_TYPE_MPT: - defaultExtension = "mptm"; - extFilter = FileFilterMPT; - strcpy(fext, ".mptm"); break; default: ErrorBox(IDS_ERR_SAVESONG, CMainFrame::GetMainFrame()); return FALSE; } + + strcpy(fext, "."); + strcat(fext, defaultExtension.c_str()); + if ((!lpszPathName) || (!lpszPathName[0]) || m_ShowSavedialog) { _splitpath(m_strPathName, drive, path, fname, NULL); @@ -625,7 +603,7 @@ strcat(s, fext); FileDlgResult files = CTrackApp::ShowOpenSaveFileDialog(false, defaultExtension, s, - extFilter, + ModTypeToFilter(m_SndFile), CMainFrame::GetSettings().GetWorkingDirectory(DIR_MODS)); if(files.abort) return FALSE; @@ -2192,12 +2170,12 @@ #define MAX_FXINFO 70 -const MPTEFFECTINFO gFXInfo[MAX_FXINFO] = +const MPTEFFECTINFO gFXInfo[] = { {CMD_ARPEGGIO, 0,0, 0, MOD_TYPE_ALL, "Arpeggio"}, {CMD_PORTAMENTOUP, 0,0, 0, MOD_TYPE_ALL, "Portamento Up"}, {CMD_PORTAMENTODOWN,0,0, 0, MOD_TYPE_ALL, "Portamento Down"}, - {CMD_TONEPORTAMENTO,0,0, 0, MOD_TYPE_ALL, "Tone portamento"}, + {CMD_TONEPORTAMENTO,0,0, 0, MOD_TYPE_ALL, "Tone Portamento"}, {CMD_VIBRATO, 0,0, 0, MOD_TYPE_ALL, "Vibrato"}, {CMD_TONEPORTAVOL, 0,0, 0, MOD_TYPE_ALL, "Volslide+Toneporta"}, {CMD_VIBRATOVOL, 0,0, 0, MOD_TYPE_ALL, "VolSlide+Vibrato"}, @@ -2212,59 +2190,59 @@ {CMD_SPEED, 0,0, 0, MOD_TYPE_ALL, "Set Speed"}, {CMD_TEMPO, 0,0, 0, MOD_TYPE_ALL, "Set Tempo"}, {CMD_TREMOR, 0,0, 0, MOD_TYPE_NOMOD, "Tremor"}, - {CMD_CHANNELVOLUME, 0,0, 0, MOD_TYPE_S3MITMPT, "Set channel volume"}, - {CMD_CHANNELVOLSLIDE,0,0, 0, MOD_TYPE_S3MITMPT, "Channel volslide"}, - {CMD_GLOBALVOLUME, 0,0, 0, MOD_TYPE_NOMOD, "Set global volume"}, - {CMD_GLOBALVOLSLIDE,0,0, 0, MOD_TYPE_NOMOD, "Global volume slide"}, - {CMD_KEYOFF, 0,0, 0, MOD_TYPE_XM, "Key off"}, - {CMD_FINEVIBRATO, 0,0, 0, MOD_TYPE_S3MITMPT, "Fine vibrato"}, + {CMD_CHANNELVOLUME, 0,0, 0, MOD_TYPE_S3MITMPT, "Set Channel Volume"}, + {CMD_CHANNELVOLSLIDE,0,0, 0, MOD_TYPE_S3MITMPT, "Channel Volume Slide"}, + {CMD_GLOBALVOLUME, 0,0, 0, MOD_TYPE_NOMOD, "Set Global Volume"}, + {CMD_GLOBALVOLSLIDE,0,0, 0, MOD_TYPE_NOMOD, "Global Volume Slide"}, + {CMD_KEYOFF, 0,0, 0, MOD_TYPE_XM, "Key Off"}, + {CMD_FINEVIBRATO, 0,0, 0, MOD_TYPE_S3MITMPT, "Fine Vibrato"}, {CMD_PANBRELLO, 0,0, 0, MOD_TYPE_NOMOD, "Panbrello"}, - {CMD_PANNINGSLIDE, 0,0, 0, MOD_TYPE_NOMOD, "Panning slide"}, + {CMD_PANNINGSLIDE, 0,0, 0, MOD_TYPE_NOMOD, "Panning Slide"}, {CMD_SETENVPOSITION,0,0, 0, MOD_TYPE_XM, "Envelope position"}, - {CMD_MIDI, 0,0, 0x7F, MOD_TYPE_NOMOD, "Midi macro"}, - {CMD_SMOOTHMIDI, 0,0, 0x7F, MOD_TYPE_NOMOD, "Smooth Midi macro"}, //rewbs.smoothVST + {CMD_MIDI, 0,0, 0x7F, MOD_TYPE_NOMOD, "MIDI Macro"}, + {CMD_SMOOTHMIDI, 0,0, 0x7F, MOD_TYPE_NOMOD, "Smooth MIDI Macro"}, //rewbs.smoothVST // Extended MOD/XM effects - {CMD_MODCMDEX, 0xF0,0x10, 0, MOD_TYPE_MODXM, "Fine porta up"}, - {CMD_MODCMDEX, 0xF0,0x20, 0, MOD_TYPE_MODXM, "Fine porta down"}, + {CMD_MODCMDEX, 0xF0,0x10, 0, MOD_TYPE_MODXM, "Fine Porta Up"}, + {CMD_MODCMDEX, 0xF0,0x20, 0, MOD_TYPE_MODXM, "Fine Porta Down"}, {CMD_MODCMDEX, 0xF0,0x30, 0, MOD_TYPE_MODXM, "Glissando Control"}, - {CMD_MODCMDEX, 0xF0,0x40, 0, MOD_TYPE_MODXM, "Vibrato waveform"}, - {CMD_MODCMDEX, 0xF0,0x50, 0, MOD_TYPE_MODXM, "Set finetune"}, - {CMD_MODCMDEX, 0xF0,0x60, 0, MOD_TYPE_MODXM, "Pattern loop"}, - {CMD_MODCMDEX, 0xF0,0x70, 0, MOD_TYPE_MODXM, "Tremolo waveform"}, - {CMD_MODCMDEX, 0xF0,0x80, 0, MOD_TYPE_MODXM, "Set panning"}, - {CMD_MODCMDEX, 0xF0,0x90, 0, MOD_TYPE_MODXM, "Retrigger note"}, - {CMD_MODCMDEX, 0xF0,0xA0, 0, MOD_TYPE_MODXM, "Fine volslide up"}, - {CMD_MODCMDEX, 0xF0,0xB0, 0, MOD_TYPE_MODXM, "Fine volslide down"}, - {CMD_MODCMDEX, 0xF0,0xC0, 0, MOD_TYPE_MODXM, "Note cut"}, - {CMD_MODCMDEX, 0xF0,0xD0, 0, MOD_TYPE_MODXM, "Note delay"}, - {CMD_MODCMDEX, 0xF0,0xE0, 0, MOD_TYPE_MODXM, "Pattern delay"}, - {CMD_MODCMDEX, 0xF0,0xF0, 0, MOD_TYPE_XM, "Set active macro"}, + {CMD_MODCMDEX, 0xF0,0x40, 0, MOD_TYPE_MODXM, "Vibrato Waveform"}, + {CMD_MODCMDEX, 0xF0,0x50, 0, MOD_TYPE_MODXM, "Set Finetune"}, + {CMD_MODCMDEX, 0xF0,0x60, 0, MOD_TYPE_MODXM, "Pattern Loop"}, + {CMD_MODCMDEX, 0xF0,0x70, 0, MOD_TYPE_MODXM, "Tremolo Waveform"}, + {CMD_MODCMDEX, 0xF0,0x80, 0, MOD_TYPE_MODXM, "Set Panning"}, + {CMD_MODCMDEX, 0xF0,0x90, 0, MOD_TYPE_MODXM, "Retrigger Note"}, + {CMD_MODCMDEX, 0xF0,0xA0, 0, MOD_TYPE_MODXM, "Fine Volslide Up"}, + {CMD_MODCMDEX, 0xF0,0xB0, 0, MOD_TYPE_MODXM, "Fine Volslide Down"}, + {CMD_MODCMDEX, 0xF0,0xC0, 0, MOD_TYPE_MODXM, "Note Cut"}, + {CMD_MODCMDEX, 0xF0,0xD0, 0, MOD_TYPE_MODXM, "Note Delay"}, + {CMD_MODCMDEX, 0xF0,0xE0, 0, MOD_TYPE_MODXM, "Pattern Delay"}, + {CMD_MODCMDEX, 0xF0,0xF0, 0, MOD_TYPE_XM, "Set Active Macro"}, {CMD_MODCMDEX, 0xF0,0xF0, 0, MOD_TYPE_MOD, "Invert Loop"}, // Extended S3M/IT effects - {CMD_S3MCMDEX, 0xF0,0x10, 0, MOD_TYPE_S3MITMPT, "Glissando control"}, - {CMD_S3MCMDEX, 0xF0,0x20, 0, MOD_TYPE_S3M, "Set finetune"}, - {CMD_S3MCMDEX, 0xF0,0x30, 0, MOD_TYPE_S3MITMPT, "Vibrato waveform"}, - {CMD_S3MCMDEX, 0xF0,0x40, 0, MOD_TYPE_S3MITMPT, "Tremolo waveform"}, - {CMD_S3MCMDEX, 0xF0,0x50, 0, MOD_TYPE_S3MITMPT, "Panbrello waveform"}, - {CMD_S3MCMDEX, 0xF0,0x60, 0, MOD_TYPE_S3MITMPT, "Fine pattern delay"}, - {CMD_S3MCMDEX, 0xF0,0x80, 0, MOD_TYPE_S3MITMPT, "Set panning"}, - {CMD_S3MCMDEX, 0xF0,0xA0, 0, MOD_TYPE_S3MITMPT, "Set high offset"}, - {CMD_S3MCMDEX, 0xF0,0xB0, 0, MOD_TYPE_S3MITMPT, "Pattern loop"}, - {CMD_S3MCMDEX, 0xF0,0xC0, 0, MOD_TYPE_S3MITMPT, "Note cut"}, - {CMD_S3MCMDEX, 0xF0,0xD0, 0, MOD_TYPE_S3MITMPT, "Note delay"}, - {CMD_S3MCMDEX, 0xF0,0xE0, 0, MOD_TYPE_S3MITMPT, "Pattern delay"}, - {CMD_S3MCMDEX, 0xF0,0xF0, 0, MOD_TYPE_ITMPT, "Set active macro"}, + {CMD_S3MCMDEX, 0xF0,0x10, 0, MOD_TYPE_S3MITMPT, "Glissando Control"}, + {CMD_S3MCMDEX, 0xF0,0x20, 0, MOD_TYPE_S3M, "Set Finetune"}, + {CMD_S3MCMDEX, 0xF0,0x30, 0, MOD_TYPE_S3MITMPT, "Vibrato Waveform"}, + {CMD_S3MCMDEX, 0xF0,0x40, 0, MOD_TYPE_S3MITMPT, "Tremolo Waveform"}, + {CMD_S3MCMDEX, 0xF0,0x50, 0, MOD_TYPE_S3MITMPT, "Panbrello Waveform"}, + {CMD_S3MCMDEX, 0xF0,0x60, 0, MOD_TYPE_S3MITMPT, "Fine Pattern Delay"}, + {CMD_S3MCMDEX, 0xF0,0x80, 0, MOD_TYPE_S3MITMPT, "Set Panning"}, + {CMD_S3MCMDEX, 0xF0,0xA0, 0, MOD_TYPE_S3MITMPT, "Set High Offset"}, + {CMD_S3MCMDEX, 0xF0,0xB0, 0, MOD_TYPE_S3MITMPT, "Pattern Loop"}, + {CMD_S3MCMDEX, 0xF0,0xC0, 0, MOD_TYPE_S3MITMPT, "Note Cut"}, + {CMD_S3MCMDEX, 0xF0,0xD0, 0, MOD_TYPE_S3MITMPT, "Note Delay"}, + {CMD_S3MCMDEX, 0xF0,0xE0, 0, MOD_TYPE_S3MITMPT, "Pattern Delay"}, + {CMD_S3MCMDEX, 0xF0,0xF0, 0, MOD_TYPE_ITMPT, "Set Active Macro"}, // MPT XM extensions and special effects - {CMD_XFINEPORTAUPDOWN,0xF0,0x10,0, MOD_TYPE_XM, "Extra fine porta up"}, - {CMD_XFINEPORTAUPDOWN,0xF0,0x20,0, MOD_TYPE_XM, "Extra fine porta down"}, - {CMD_XFINEPORTAUPDOWN,0xF0,0x50,0, MOD_TYPE_XM, "Panbrello waveform"}, - {CMD_XFINEPORTAUPDOWN,0xF0,0x60,0, MOD_TYPE_XM, "Fine pattern delay"}, - {CMD_XFINEPORTAUPDOWN,0xF0,0x90,0, MOD_TYPE_XM, "Sound control"}, - {CMD_XFINEPORTAUPDOWN,0xF0,0xA0,0, MOD_TYPE_XM, "Set high offset"}, + {CMD_XFINEPORTAUPDOWN,0xF0,0x10,0, MOD_TYPE_XM, "Extra Fine Porta Up"}, + {CMD_XFINEPORTAUPDOWN,0xF0,0x20,0, MOD_TYPE_XM, "Extra Fine Porta Down"}, + {CMD_XFINEPORTAUPDOWN,0xF0,0x50,0, MOD_TYPE_XM, "Panbrello Waveform"}, + {CMD_XFINEPORTAUPDOWN,0xF0,0x60,0, MOD_TYPE_XM, "Fine Pattern Delay"}, + {CMD_XFINEPORTAUPDOWN,0xF0,0x90,0, MOD_TYPE_XM, "Sound Control"}, + {CMD_XFINEPORTAUPDOWN,0xF0,0xA0,0, MOD_TYPE_XM, "Set High Offset"}, // MPT IT extensions and special effects - {CMD_S3MCMDEX, 0xF0,0x90, 0, MOD_TYPE_S3MITMPT, "Sound control"}, - {CMD_S3MCMDEX, 0xF0,0x70, 0, MOD_TYPE_ITMPT, "Instr. control"}, - {CMD_DELAYCUT, 0x00,0x00, 0, MOD_TYPE_MPT, "Note delay and cut"}, + {CMD_S3MCMDEX, 0xF0,0x90, 0, MOD_TYPE_S3MITMPT, "Sound Control"}, + {CMD_S3MCMDEX, 0xF0,0x70, 0, MOD_TYPE_ITMPT, "Instr. Control"}, + {CMD_DELAYCUT, 0x00,0x00, 0, MOD_TYPE_MPT, "Note Delay and Cut"}, // -> CODE#0010 // -> DESC="add extended parameter mechanism to pattern effects" {CMD_XPARAM, 0x00,0x00, 0, MOD_TYPE_XMITMPT, "X param"}, @@ -2273,7 +2251,9 @@ {CMD_NOTESLIDEDOWN, 0x00,0x00, 0, MOD_TYPE_NONE, "Note Slide Down"}, // .IMF effect }; +STATIC_ASSERT(CountOf(gFXInfo) == MAX_FXINFO); + UINT CModDoc::GetNumEffects() const //--------------------------------- { @@ -2417,21 +2397,27 @@ //---------------------------------------------------------------------- { //if (pParam) *pParam = -1; - if (ndx >= MAX_FXINFO) { + if (ndx >= MAX_FXINFO) + { refParam = 0; return CMD_NONE; } //Cap parameter to match FX if necessary. - if (gFXInfo[ndx].dwParamMask) { - if (refParam < static_cast<int>(gFXInfo[ndx].dwParamValue)) { + if (gFXInfo[ndx].dwParamMask) + { + if (refParam < static_cast<int>(gFXInfo[ndx].dwParamValue)) + { refParam = gFXInfo[ndx].dwParamValue; // for example: delay with param < D0 becomes SD0 - } else if (refParam > static_cast<int>(gFXInfo[ndx].dwParamValue)+15) { - refParam = gFXInfo[ndx].dwParamValue+15; // for example: delay with param > DF becomes SDF + } else if (refParam > static_cast<int>(gFXInfo[ndx].dwParamValue) + 15) + { + refParam = gFXInfo[ndx].dwParamValue + 15; // for example: delay with param > DF becomes SDF } } - if (gFXInfo[ndx].dwFlags) { - if (refParam > static_cast<int>(gFXInfo[ndx].dwFlags)) { + if (gFXInfo[ndx].dwFlags) + { + if (refParam > static_cast<int>(gFXInfo[ndx].dwFlags)) + { refParam = gFXInfo[ndx].dwFlags; //used for Zxx macro control: limit to 7F max. } } @@ -2443,7 +2429,8 @@ MODCOMMAND::COMMAND CModDoc::GetEffectFromIndex(UINT ndx) //------------------------------------------------------- { - if (ndx >= MAX_FXINFO) { + if (ndx >= MAX_FXINFO) + { return CMD_NONE; } @@ -2453,7 +2440,8 @@ UINT CModDoc::GetEffectMaskFromIndex(UINT ndx) //-------------------------------------------- { - if (ndx >= MAX_FXINFO) { + if (ndx >= MAX_FXINFO) + { return 0; } @@ -3064,10 +3052,10 @@ LPCSTR pszName; // ie "Set Volume" } MPTVOLCMDINFO; -#define MAX_VOLINFO 15 +#define MAX_VOLINFO (MAX_VOLCMDS - 1) -const MPTVOLCMDINFO gVolCmdInfo[MAX_VOLINFO] = +const MPTVOLCMDINFO gVolCmdInfo[] = { {VOLCMD_VOLUME, MOD_TYPE_NOMOD, "v: Set Volume"}, {VOLCMD_PANNING, MOD_TYPE_NOMOD, "p: Set Panning"}, @@ -3086,7 +3074,9 @@ {VOLCMD_OFFSET, MOD_TYPE_ITMPT, "o: Offset"}, //rewbs.volOff }; +STATIC_ASSERT(CountOf(gVolCmdInfo) == MAX_VOLINFO); + UINT CModDoc::GetNumVolCmds() const //--------------------------------- { @@ -3097,7 +3087,7 @@ LONG CModDoc::GetIndexFromVolCmd(UINT volcmd) //------------------------------------------- { - for (UINT i=0; i<MAX_VOLINFO; i++) + for (UINT i = 0; i < MAX_VOLINFO; i++) { if (gVolCmdInfo[i].dwVolCmd == volcmd) return i; } @@ -3150,7 +3140,7 @@ //---------------------------- { CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); - if (!pMainFrm) return 0; + if (!pMainFrm) return nullptr; CMDIChildWnd *pMDIActive = pMainFrm->MDIGetActive(); if (pMDIActive) { @@ -3166,7 +3156,7 @@ return (CChildFrame *)pView->GetParentFrame(); } - return NULL; + return nullptr; } HWND CModDoc::GetEditPosition(ROWINDEX &row, PATTERNINDEX &pat, ORDERINDEX &ord) @@ -3197,14 +3187,17 @@ ord = patternViewState->nOrder; } //rewbs.fix3185: if position is invalid, go to start of song. - if (ord >= m_SndFile.Order.size()) { + if (ord >= m_SndFile.Order.size()) + { ord = 0; pat = pSndFile->Order[ord]; } - if (pat >= m_SndFile.Patterns.Size()) { + if (pat >= m_SndFile.Patterns.Size()) + { pat=0; } - if (row >= pSndFile->Patterns[pat].GetNumRows()) { + if (row >= pSndFile->Patterns[pat].GetNumRows()) + { row=0; } //end rewbs.fix3185 @@ -3446,9 +3439,11 @@ pSndFile->m_nNextRow = 0; pSndFile->ResetTotalTickCount(); //rewbs.vstCompliance - if (pModPlaying == this) { + if (pModPlaying == this) + { pSndFile->StopAllVsti(); - } else { + } else + { pSndFile->ResumePlugins(); } //end rewbs.vstCompliance @@ -3502,15 +3497,18 @@ pSndFile->LoopPattern(nPat); pSndFile->m_nNextRow = nRow; //rewbs.VSTCompliance - if (pModPlaying == this) { + if (pModPlaying == this) + { pSndFile->StopAllVsti(); - } else { + } else + { pSndFile->ResumePlugins(); } //end rewbs.VSTCompliance END_CRITICAL(); - if (pModPlaying != this) { + if (pModPlaying != this) + { pMainFrm->PlayMod(this, followSonghWnd, m_dwNotifyType|MPTNOTIFY_POSITION|MPTNOTIFY_VUMETERS); //rewbs.fix2977 } } @@ -3668,16 +3666,18 @@ newPath += path; //Catch case where we don't have a filename yet. - if (fname[0] == 0) { + if (fname[0] == 0) + { newPath += GetTitle(); - } else { + } else + { newPath += fname; } switch(nNewType) { case MOD_TYPE_XM: newPath += ".xm"; break; - case MOD_TYPE_IT: m_SndFile.m_dwSongFlags & SONG_ITPROJECT ? newPath+=".itp" : newPath+=".it"; break; + case MOD_TYPE_IT: newPath += m_SndFile.m_dwSongFlags & SONG_ITPROJECT ? ".itp" : ".it"; break; case MOD_TYPE_MPT: newPath += ".mptm"; break; case MOD_TYPE_S3M: newPath += ".s3m"; break; case MOD_TYPE_MOD: newPath += ".mod"; break; @@ -3931,7 +3931,9 @@ // Not needed? } + void CModDoc::OnSaveTemplateModule() +//---------------------------------- { // Create template folder if doesn't exist already. const LPCTSTR pszTemplateFolder = CMainFrame::GetSettings().GetDefaultDirectory(DIR_TEMPLATE_FILES_USER); Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2011-07-30 00:49:19 UTC (rev 940) @@ -218,7 +218,7 @@ if (IDs.GetLength() >= 16) { // Get path from cache file - GetPrivateProfileString(cacheSection, IDs, "", szPath, CountOf(szPath) - 1, cacheFile); + GetPrivateProfileString(cacheSection, IDs, "", szPath, CountOf(szPath), cacheFile); SetNullTerminator(szPath); theApp.RelativePathToAbsolute(szPath); Modified: trunk/OpenMPT/mptrack/mod2midi.cpp =================================================================== --- trunk/OpenMPT/mptrack/mod2midi.cpp 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/mptrack/mod2midi.cpp 2011-07-30 00:49:19 UTC (rev 940) @@ -380,13 +380,13 @@ // Add Song Name on track 0 - m_pSndFile->GetTitle(s); - if (s[0]) + const CHAR *modTitle = m_pSndFile->GetTitle(); + if (modTitle[0]) { tmp[0] = 0; tmp[1] = 0xff; tmp[2] = 0x01; Tracks[0].Write(tmp, 3); - Tracks[0].WriteLen(strlen(s)); - Tracks[0].Write(s, strlen(s)); + Tracks[0].WriteLen(strlen(modTitle)); + Tracks[0].Write(modTitle, strlen(modTitle)); } // Add Song comments on track 0 if ((m_pSndFile->m_lpszSongComments) && (m_pSndFile->m_lpszSongComments[0])) Modified: trunk/OpenMPT/mptrack/test/test.cpp =================================================================== --- trunk/OpenMPT/mptrack/test/test.cpp 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/mptrack/test/test.cpp 2011-07-30 00:49:19 UTC (rev 940) @@ -387,7 +387,7 @@ VERIFY_EQUAL_NONCONT(pSndFile->Order.GetSequence(1)[1], 2); // Patterns - VERIFY_EQUAL_NONCONT(pSndFile->GetNumPatterns(), 2); + VERIFY_EQUAL_NONCONT(pSndFile->Patterns.GetNumPatterns(), 2); VERIFY_EQUAL_NONCONT(pSndFile->Patterns[0].GetName(), "First Pattern"); VERIFY_EQUAL_NONCONT(pSndFile->Patterns[0].GetNumRows(), 70); Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-07-30 00:49:19 UTC (rev 940) @@ -1028,34 +1028,6 @@ } -PATTERNINDEX CSoundFile::GetNumPatterns() const -//--------------------------------------------- -{ - PATTERNINDEX max = 0; - for(PATTERNINDEX i = 0; i < Patterns.Size(); i++) - { - if(Patterns.IsValidPat(i)) - max = i + 1; - } - return max; -} - - -UINT CSoundFile::GetMaxPosition() const -//------------------------------------- -{ - UINT max = 0; - UINT i = 0; - - while ((i < Order.size()) && (Order[i] != Order.GetInvalidPatIndex())) - { - if (Order[i] < Patterns.Size()) max += Patterns[Order[i]].GetNumRows(); - i++; - } - return max; -} - - UINT CSoundFile::GetCurrentPos() const //------------------------------------ { @@ -2549,7 +2521,7 @@ } SAMPLEINDEX nExt = 0; - for (PATTERNINDEX nPat = 0; nPat < GetNumPatterns(); nPat++) + for (PATTERNINDEX nPat = 0; nPat < Patterns.GetNumPatterns(); nPat++) { const MODCOMMAND *p = Patterns[nPat]; if(p == nullptr) Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/soundlib/Sndfile.h 2011-07-30 00:49:19 UTC (rev 940) @@ -700,14 +700,11 @@ void SetMasterVolume(UINT vol, bool adjustAGC = false); UINT GetMasterVolume() const { return m_nMasterVolume; } - // Returns 1 + index of last valid pattern, zero if no such pattern exists. - PATTERNINDEX GetNumPatterns() const; INSTRUMENTINDEX GetNumInstruments() const { return m_nInstruments; } SAMPLEINDEX GetNumSamples() const { return m_nSamples; } UINT GetCurrentPos() const; PATTERNINDEX GetCurrentPattern() const { return m_nPattern; } ORDERINDEX GetCurrentOrder() const { return static_cast<ORDERINDEX>(m_nCurrentPattern); } - UINT GetMaxPosition() const; CHANNELINDEX GetNumChannels() const { return m_nChannels; } IMixPlugin* GetInstrumentPlugin(INSTRUMENTINDEX instr); @@ -719,7 +716,6 @@ void DontLoopPattern(PATTERNINDEX nPat, ROWINDEX nRow = 0); //rewbs.playSongFromCursor void SetCurrentPos(UINT nPos); void SetCurrentOrder(ORDERINDEX nOrder); - void GetTitle(LPSTR s) const { lstrcpyn(s,m_szNames[0],32); } LPCSTR GetTitle() const { return m_szNames[0]; } LPCTSTR GetSampleName(UINT nSample) const; CString GetInstrumentName(UINT nInstr) const; Modified: trunk/OpenMPT/soundlib/mod_specifications.cpp =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.cpp 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/soundlib/mod_specifications.cpp 2011-07-30 00:49:19 UTC (rev 940) @@ -12,25 +12,27 @@ pszExt++; char szExtA[CountOf(ModSpecs::mod.fileExtension)]; MemsetZero(szExtA); - size_t i = 0; const size_t nLength = _tcslen(pszExt); if (nLength >= CountOf(szExtA)) return MOD_TYPE_NONE; - for(i = 0; i<nLength; ++i) + for(size_t i = 0; i < nLength; i++) szExtA[i] = static_cast<char>(pszExt[i]); - if (!lstrcmpiA(szExtA, ModSpecs::mod.fileExtension) || !lstrcmpiA(szExtA, ModSpecs::modEx.fileExtension)) - return MOD_TYPE_MOD; - else if (!lstrcmpiA(szExtA, ModSpecs::s3m.fileExtension) || !lstrcmpiA(szExtA, ModSpecs::s3mEx.fileExtension)) - return MOD_TYPE_S3M; - else if (!lstrcmpiA(szExtA, ModSpecs::xm.fileExtension) || !lstrcmpiA(szExtA, ModSpecs::xmEx.fileExtension)) - return MOD_TYPE_XM; - else if (!lstrcmpiA(szExtA, ModSpecs::it.fileExtension) || !lstrcmpiA(szExtA, ModSpecs::itEx.fileExtension) - || !lstrcmpi(szExtA, _T("itp"))) + + for(size_t i = 0; i < CountOf(ModSpecs::Collection); i++) + { + if (!lstrcmpiA(szExtA, ModSpecs::Collection[i]->fileExtension)) + { + return ModSpecs::Collection[i]->internalType; + } + } + // Special case: ITP files... + if(!lstrcmpi(szExtA, _T("itp"))) + { return MOD_TYPE_IT; - else if (!lstrcmpiA(szExtA, ModSpecs::mptm.fileExtension)) - return MOD_TYPE_MPT; - else - return MOD_TYPE_NONE; + } + + return MOD_TYPE_NONE; + } Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2011-07-30 00:49:19 UTC (rev 940) @@ -24,6 +24,7 @@ // NOTE: If changing order, update all initializations below. char fileExtension[6]; // File extension without dot. + MODTYPE internalType; // Internal MODTYPE value MODCOMMAND::NOTE noteMin; // Minimum note index (index starts from 1) MODCOMMAND::NOTE noteMax; // Maximum note index (index starts from 1) bool hasNoteCut; // True if format has notecut. @@ -71,6 +72,7 @@ -savefile format and GUI methods can handle new values(might not be a small task :). */ "mptm", // File extension + MOD_TYPE_MPT, // Internal MODTYPE value NOTE_MIN, // Minimum note index NOTE_MAX, // Maximum note index true, // Has notecut. @@ -113,6 +115,7 @@ { // TODO: Set correct values. "mod", // File extension + MOD_TYPE_MOD, // Internal MODTYPE value 37, // Minimum note index 108, // Maximum note index false, // No notecut. @@ -153,6 +156,7 @@ { // TODO: Set correct values. "mod", // File extension + MOD_TYPE_MOD, // Internal MODTYPE value 37, // Minimum note index 108, // Maximum note index false, // No notecut. @@ -192,6 +196,7 @@ { // TODO: Set correct values. "xm", // File extension + MOD_TYPE_XM, // Internal MODTYPE value 13, // Minimum note index 108, // Maximum note index false, // No notecut. @@ -232,6 +237,7 @@ { // TODO: Set correct values. "xm", // File extension + MOD_TYPE_XM, // Internal MODTYPE value 13, // Minimum note index 108, // Maximum note index false, // No notecut. @@ -271,6 +277,7 @@ { // TODO: Set correct values. "s3m", // File extension + MOD_TYPE_S3M, // Internal MODTYPE value 13, // Minimum note index 108, // Maximum note index true, // Has notecut. @@ -311,6 +318,7 @@ { // TODO: Set correct values. "s3m", // File extension + MOD_TYPE_S3M, // Internal MODTYPE value 13, // Minimum note index 108, // Maximum note index true, // Has notecut. @@ -350,6 +358,7 @@ { // TODO: Set correct values. "it", // File extension + MOD_TYPE_IT, // Internal MODTYPE value 1, // Minimum note index 120, // Maximum note index true, // Has notecut. @@ -389,6 +398,7 @@ { // TODO: Set correct values. "it", // File extension + MOD_TYPE_IT, // Internal MODTYPE value 1, // Minimum note index 120, // Maximum note index true, // Has notecut. @@ -424,6 +434,8 @@ false, // No custom pattern time signatures }; +static const CModSpecifications *Collection[] = { &mptm, &mod, &modEx, &s3m, &s3mEx, &xm, &xmEx, &it, &itEx }; + } // namespace ModSpecs Modified: trunk/OpenMPT/soundlib/patternContainer.cpp =================================================================== --- trunk/OpenMPT/soundlib/patternContainer.cpp 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/soundlib/patternContainer.cpp 2011-07-30 00:49:19 UTC (rev 940) @@ -154,6 +154,24 @@ } +PATTERNINDEX CPatternContainer::GetNumPatterns() const +//---------------------------------------------------- +{ + if(Size() == 0) + { + return 0; + } + for(PATTERNINDEX nPat = Size(); nPat > 0; nPat--) + { + if(IsValidPat(nPat - 1)) + { + return nPat; + } + } + return 0; +} + + PATTERNINDEX CPatternContainer::GetNumNamedPatterns() const //--------------------------------------------------------- { Modified: trunk/OpenMPT/soundlib/patternContainer.h =================================================================== --- trunk/OpenMPT/soundlib/patternContainer.h 2011-07-29 20:54:38 UTC (rev 939) +++ trunk/OpenMPT/soundlib/patternContainer.h 2011-07-30 00:49:19 UTC (rev 940) @@ -76,6 +76,9 @@ void OnModTypeChanged(const MODTYPE oldtype); + // Returns index of last valid pattern + 1, zero if no such pattern exists. + PATTERNINDEX GetNumPatterns() const; + // Returns index of highest pattern with pattern named + 1. PATTERNINDEX GetNumNamedPatterns() const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-07-30 20:32:24
|
Revision: 943 http://modplug.svn.sourceforge.net/modplug/?rev=943&view=rev Author: saga-games Date: 2011-07-30 20:32:17 +0000 (Sat, 30 Jul 2011) Log Message: ----------- [Ref] Song message handling has been refactored a bit. [Mod] Debug test modules are now removed from MRU list. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_com.cpp trunk/OpenMPT/mptrack/Mod2wave.cpp trunk/OpenMPT/mptrack/test/test.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Message.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/Ctrl_com.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_com.cpp 2011-07-30 18:54:07 UTC (rev 942) +++ trunk/OpenMPT/mptrack/Ctrl_com.cpp 2011-07-30 20:32:17 UTC (rev 943) @@ -119,9 +119,9 @@ if ((ln >= LINE_LENGTH-1) || (!*p)) { if (((BYTE)c) > ' ') s[ln++] = c; - c = 0x0D; + c = INTERNAL_LINEENDING; } - if (c == 0x0D) + if (c == INTERNAL_LINEENDING) { s[ln] = 0x0D; s[ln+1] = 0x0A; @@ -175,11 +175,16 @@ if (ln > LINE_LENGTH-1) ln = LINE_LENGTH-1; s[ln] = 0; while ((ln > 0) && (((BYTE)s[ln-1]) <= ' ')) s[--ln] = 0; - if (i+1 < n) strcat(s, "\r"); + if (i+1 < n) + { + size_t l = strlen(s); + s[l++] = INTERNAL_LINEENDING; + s[l] = '\0'; + } strcat(p, s); } UINT len = strlen(p); - while ((len > 0) && ((p[len-1] == ' ') || (p[len-1] == '\r'))) + while ((len > 0) && ((p[len-1] == ' ') || (p[len-1] == INTERNAL_LINEENDING))) { len--; p[len] = 0; Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-07-30 18:54:07 UTC (rev 942) +++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2011-07-30 20:32:17 UTC (rev 943) @@ -560,21 +560,7 @@ if (m_pSndFile->m_lpszSongComments) { - m_FileTags.comments = m_pSndFile->m_lpszSongComments; - // convert \r to \n, remove bad characters - for(size_t i = 0; i < m_FileTags.comments.length(); i++) - { - if(m_FileTags.comments.substr(i, 1) == "\r") - m_FileTags.comments.replace(i, 1, "\n"); - if(m_FileTags.comments.substr(i, 1) < " " && m_FileTags.comments.substr(i, 1) != "\n") - m_FileTags.comments.replace(i, 1, " "); - } - - /*size_t spos; - while((spos = m_FileTags.comments.find("\r")) != string::npos) - { - m_FileTags.comments.replace(spos, 1, "\n"); - }*/ + m_FileTags.comments = m_pSndFile->GetSongMessage(leLF); } else { @@ -631,6 +617,7 @@ EndDialog(IDCANCEL); return; } + SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); int oldVol = m_pSndFile->GetMasterVolume(); int nOldRepeat = m_pSndFile->GetRepeatCount(); Modified: trunk/OpenMPT/mptrack/test/test.cpp =================================================================== --- trunk/OpenMPT/mptrack/test/test.cpp 2011-07-30 18:54:07 UTC (rev 942) +++ trunk/OpenMPT/mptrack/test/test.cpp 2011-07-30 20:32:17 UTC (rev 943) @@ -450,11 +450,15 @@ // Test file saving pModDoc->DoSave(theFile + "saved.mptm"); pModDoc->OnCloseDocument(); - + // Reload the saved file and test if everything is still working correctly. pModDoc = (CModDoc *)theApp.OpenDocumentFile(theFile + "saved.mptm"); TestLoadFile(pModDoc); pModDoc->OnCloseDocument(); + + // Forget about the files we just loaded + theApp.RemoveMruItem(0); + theApp.RemoveMruItem(0); } Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2011-07-30 18:54:07 UTC (rev 942) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2011-07-30 20:32:17 UTC (rev 943) @@ -1332,8 +1332,8 @@ const tm* const p = localtime(&creationTime); if (p != nullptr) loadDate = *p; - else if (pSndFile->GetModDocPtr() != nullptr) - pSndFile->GetModDocPtr()->AddLogEvent(LogEventUnexpectedError, + else if (pSndFile->GetpModDoc() != nullptr) + pSndFile->GetpModDoc()->AddLogEvent(LogEventUnexpectedError, __FUNCTION__, _T("localtime() returned nullptr.")); openTime = (uint32)((double)difftime(time(nullptr), creationTime) * 18.2f); Modified: trunk/OpenMPT/soundlib/Message.cpp =================================================================== --- trunk/OpenMPT/soundlib/Message.cpp 2011-07-30 18:54:07 UTC (rev 942) +++ trunk/OpenMPT/soundlib/Message.cpp 2011-07-30 20:32:17 UTC (rev 943) @@ -113,14 +113,14 @@ { case '\r': if(lineEnding != leLF) - m_lpszSongComments[cpos] = '\r'; + m_lpszSongComments[cpos] = INTERNAL_LINEENDING; else m_lpszSongComments[cpos] = ' '; if(lineEnding == leCRLF) i++; // skip the LF break; case '\n': if(lineEnding != leCR && lineEnding != leCRLF) - m_lpszSongComments[cpos] = '\r'; + m_lpszSongComments[cpos] = INTERNAL_LINEENDING; else m_lpszSongComments[cpos] = ' '; break; @@ -158,7 +158,7 @@ for(size_t line = 0, fpos = 0, cpos = 0; line < num_lines; line++, fpos += (lineLength + lineEndingLength), cpos += (lineLength + 1)) { memcpy(m_lpszSongComments + cpos, data + fpos, min(lineLength, length - fpos)); - m_lpszSongComments[cpos + lineLength] = '\r'; + m_lpszSongComments[cpos + lineLength] = INTERNAL_LINEENDING; // fix weird chars for(size_t lpos = 0; lpos < lineLength; lpos++) @@ -181,73 +181,47 @@ } -// OLD and unused function. Do we still need it? -UINT CSoundFile::GetSongMessage(LPSTR s, UINT len, UINT linesize) -//--------------------------------------------------------------- +// Retrieve song message. +// [in] lineEnding: line ending formatting of the text in memory. +// [in] pTextConverter: Pointer to a callback function which can be used to post-process the written characters, if necessary (nullptr otherwise). +// [out] returns formatted song message. +CString CSoundFile::GetSongMessage(const enmLineEndings lineEnding, void (*pTextConverter)(char &)) +//------------------------------------------------------------------------------------------------- { - LPCSTR p = m_lpszSongComments; - if (!p) return 0; - UINT i = 2, ln=0; - if ((len) && (s)) s[0] = '\r'; - if ((len > 1) && (s)) s[1] = '\n'; - while ((*p) && (i+2 < len)) + CString comments; + + if(m_lpszSongComments == nullptr) { - BYTE c = (BYTE)*p++; - if ((c == 0x0D) || ((c == ' ') && (ln >= linesize))) - { if (s) { s[i++] = '\r'; s[i++] = '\n'; } else i+= 2; ln=0; } - else - if (c >= 0x20) { if (s) s[i++] = c; else i++; ln++; } + return comments; } - if (s) s[i] = 0; - return i; -} + const size_t len = strlen(m_lpszSongComments); + comments.Preallocate(len); -// OLD and unused function. Do we still need it? -UINT CSoundFile::GetRawSongMessage(LPSTR s, UINT len, UINT linesize) -//------------------------------------------------------------------ -{ - LPCSTR p = m_lpszSongComments; - if (!p) return 0; - UINT i = 0, ln=0; - while ((*p) && (i < len-1)) + for(size_t i = 0; i < len; i++) { - BYTE c = (BYTE)*p++; - if ((c == 0x0D) || (c == 0x0A)) + if(m_lpszSongComments[i] == INTERNAL_LINEENDING) { - if (ln) + switch(lineEnding) { - while (ln < linesize) { if (s) s[i] = ' '; i++; ln++; } - ln = 0; + case leCR: + default: + comments.Append("\r"); + break; + case leLF: + comments.Append("\n"); + break; + case leCRLF: + comments.Append("\r\n"); + break; } } else - if ((c == ' ') && (!ln)) - { - UINT k=0; - while ((p[k]) && (p[k] >= ' ')) k++; - if (k <= linesize) - { - if (s) s[i] = ' '; - i++; - ln++; - } - } else - { - if (s) s[i] = c; - i++; - ln++; - if (ln == linesize) ln = 0; - } - } - if (ln) - { - while ((ln < linesize) && (i < len)) { - if (s) s[i] = ' '; - i++; - ln++; + char c = m_lpszSongComments[i]; + // Pre-process text + if(pTextConverter != nullptr) pTextConverter(c); + comments.AppendChar(c); } } - if (s) s[i] = 0; - return i; + return comments; } Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2011-07-30 18:54:07 UTC (rev 942) +++ trunk/OpenMPT/soundlib/Sndfile.h 2011-07-30 20:32:17 UTC (rev 943) @@ -476,7 +476,9 @@ leAutodetect, // Detect suitable line ending }; +#define INTERNAL_LINEENDING '\r' // The character that represents line endings internally + // For WAV export (writing pattern positions to file) struct PatternCuePoint { @@ -695,7 +697,6 @@ inline bool TypeIsXM_MOD() const { return (m_nType & (MOD_TYPE_XM | MOD_TYPE_MOD)) != 0; } inline bool TypeIsMOD_S3M() const { return (m_nType & (MOD_TYPE_MOD | MOD_TYPE_S3M)) != 0; } CModDoc* GetpModDoc() const { return m_pModDoc; } - CModDoc* GetModDocPtr() const { return m_pModDoc; } void SetMasterVolume(UINT vol, bool adjustAGC = false); UINT GetMasterVolume() const { return m_nMasterVolume; } @@ -1020,6 +1021,12 @@ // Free previously allocated song message memory. void FreeMessage(); + // Retrieve song message. + // [in] lineEnding: line ending formatting of the text in memory. + // [in] pTextConverter: Pointer to a callback function which can be used to post-process the written characters, if necessary (nullptr otherwise). + // [out] returns formatted song message. + CString GetSongMessage(const enmLineEndings lineEnding, void (*pTextConverter)(char &) = nullptr); + protected: // Read song message from a mapped file. // [in] data: pointer to the data in memory that is going to be read @@ -1038,10 +1045,6 @@ // [out] returns true on success. bool ReadFixedLineLengthMessage(const BYTE *data, const size_t length, const size_t lineLength, const size_t lineEndingLength, void (*pTextConverter)(char &) = nullptr); - // Currently unused (and the code doesn't look very nice :) - UINT GetSongMessage(LPSTR s, UINT cbsize, UINT linesize=32); - UINT GetRawSongMessage(LPSTR s, UINT cbsize, UINT linesize=32); - public: int GetVolEnvValueFromPosition(int position, MODINSTRUMENT* pIns) const; void ResetChannelEnvelopes(MODCHANNEL *pChn); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rel...@us...> - 2011-07-30 20:40:37
|
Revision: 944 http://modplug.svn.sourceforge.net/modplug/?rev=944&view=rev Author: relabsoluness Date: 2011-07-30 20:40:29 +0000 (Sat, 30 Jul 2011) Log Message: ----------- [Ref] Clean up: Building mptrack-project should now generate much less warnings. Modified Paths: -------------- trunk/OpenMPT/mptrack/ColourEdit.cpp trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/EffectVis.cpp trunk/OpenMPT/mptrack/EffectVis.h trunk/OpenMPT/mptrack/HyperEdit.cpp trunk/OpenMPT/mptrack/HyperEdit2.cpp trunk/OpenMPT/mptrack/ModConvert.cpp trunk/OpenMPT/mptrack/OpenGLControl.cpp trunk/OpenMPT/mptrack/OpenGLControl.h trunk/OpenMPT/mptrack/OpenGLDevice.cpp trunk/OpenMPT/mptrack/OpenGLEditor.cpp trunk/OpenMPT/mptrack/OpenGLEditor.h trunk/OpenMPT/mptrack/PSRatioCalc.cpp trunk/OpenMPT/mptrack/PatternGotoDialog.cpp trunk/OpenMPT/mptrack/SoundFilePlayConfig.h trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h trunk/OpenMPT/mptrack/misc_util.h trunk/OpenMPT/mptrack/test/test.cpp trunk/OpenMPT/soundlib/Dlsbank.cpp trunk/OpenMPT/soundlib/Dlsbank.h trunk/OpenMPT/soundlib/LOAD_DMF.CPP trunk/OpenMPT/soundlib/LOAD_DSM.CPP trunk/OpenMPT/soundlib/Load_med.cpp trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Snd_flt.cpp trunk/OpenMPT/soundlib/Snddev.cpp trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/Tables.cpp trunk/OpenMPT/soundlib/WindowedFIR.cpp trunk/OpenMPT/soundlib/mod_specifications.h Modified: trunk/OpenMPT/mptrack/ColourEdit.cpp =================================================================== --- trunk/OpenMPT/mptrack/ColourEdit.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/ColourEdit.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -25,6 +25,7 @@ HBRUSH CColourEdit::CtlColor(CDC* pDC, UINT nCtlColor) { + UNREFERENCED_PARAMETER(nCtlColor); pDC->SetTextColor(m_crText); //set text color pDC->SetBkColor(m_crBackGnd); //set the text's background color return m_brBackGnd; //return the brush used for background - this sets control background Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -374,7 +374,7 @@ { if(pTuning) { // Drawing custom note names - string noteStr = pTuning->GetNoteName(note-NOTE_MIDDLEC); + string noteStr = pTuning->GetNoteName(static_cast<CTuningBase::NOTEINDEXTYPE>(note-NOTE_MIDDLEC)); if(noteStr.size() < 3) noteStr.resize(3, ' '); @@ -528,7 +528,7 @@ DrawButtonRect(hdc, &rect, s, (pSndFile->ChnSettings[ncolhdr].dwFlags & CHN_MUTE) ? TRUE : FALSE, ((m_bInItemRect) && ((m_nDragItem & DRAGITEM_MASK) == DRAGITEM_CHNHEADER) && ((m_nDragItem & DRAGITEM_VALUEMASK) == ncolhdr)) ? TRUE : FALSE, - pModDoc->IsChannelRecord(ncolhdr) ? DT_RIGHT : DT_CENTER); + pModDoc->IsChannelRecord(static_cast<CHANNELINDEX>(ncolhdr)) ? DT_RIGHT : DT_CENTER); // When dragging around channel headers, mark insertion position if(m_bDragging && !m_bInItemRect @@ -550,7 +550,7 @@ CRect insRect; insRect.SetRect(xpaint, ypaint, xpaint+nColumnWidth / 8 + 3, ypaint + 16); // if (MultiRecordMask[ncolhdr>>3] & (1 << (ncolhdr&7))) - if (pModDoc->IsChannelRecord1(ncolhdr)) + if (pModDoc->IsChannelRecord1(static_cast<CHANNELINDEX>(ncolhdr))) { // rect.DeflateRect(1, 1); // InvertRect(hdc, &rect); @@ -562,7 +562,7 @@ DrawButtonRect(hdc, &insRect, s, FALSE, FALSE, DT_CENTER); FrameRect(hdc,&insRect,CMainFrame::brushBlack); } - else if (pModDoc->IsChannelRecord2(ncolhdr)) + else if (pModDoc->IsChannelRecord2(static_cast<CHANNELINDEX>(ncolhdr))) { FrameRect(hdc,&rect,CMainFrame::brushGray); InvertRect(hdc, &rect); @@ -1003,7 +1003,7 @@ { if (m->command) { - UINT command = m->command & 0x3F; + MODCOMMAND::COMMAND command = m->command & 0x3F; int n = pSndFile->GetModSpecifications().GetEffectLetter(command); ASSERT(n > ' '); //if (n <= ' ') n = '?'; @@ -1484,7 +1484,7 @@ { CSoundFile *pSndFile = pModDoc->GetSoundFile(); CHAR s[512]; - UINT nChn; + CHANNELINDEX nChn; wsprintf(s, "Row %d, Col %d", GetCurrentRow(), GetCurrentChannel() + 1); pMainFrm->SetUserText(s); if (::GetFocus() == m_hWnd) Modified: trunk/OpenMPT/mptrack/EffectVis.cpp =================================================================== --- trunk/OpenMPT/mptrack/EffectVis.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/EffectVis.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -37,7 +37,7 @@ m_nParamToErase = -1; m_nLastDrawnRow = -1; m_nLastDrawnY = -1; - m_nOldPlayPos = -1; + m_nOldPlayPos = UINT_MAX; m_nFillEffect = m_pModDoc->GetIndexFromEffect(CMD_SMOOTHMIDI, 0); m_nAction=kAction_OverwriteFX; m_templatePCNote.Set(NOTE_PCS, 1, 0, 0); @@ -334,6 +334,7 @@ //----------------------------------------------------------------------------------------- void CEffectVis::ShowVis(CDC * pDC, CRect rectBorder) { + UNREFERENCED_PARAMETER(rectBorder); if (m_boolForceRedraw) { m_boolForceRedraw = FALSE ; @@ -438,7 +439,7 @@ //--------------------------------------- { //erase - if (m_nRowToErase<m_startRow || m_nParamToErase < 0) + if ((UINT)m_nRowToErase<m_startRow || m_nParamToErase < 0) { ::FillRect(m_dcNodes.m_hDC, &m_rcDraw, m_brushBlack); } @@ -461,7 +462,7 @@ void CEffectVis::InvalidateRow(int row) { - if ((row < m_startRow) || (row > m_endRow)) return; + if (((UINT)row < m_startRow) || ((UINT)row > m_endRow)) return; //It seems this optimisation doesn't work properly yet. Disable in Update() @@ -538,6 +539,9 @@ void CEffectVis::OnSize(UINT nType, int cx, int cy) { + UNREFERENCED_PARAMETER(nType); + UNREFERENCED_PARAMETER(cx); + UNREFERENCED_PARAMETER(cy); GetClientRect(&m_rcFullWin); m_rcDraw.SetRect( m_rcFullWin.left + LEFTBORDER, m_rcFullWin.top + TOPBORDER, m_rcFullWin.right - RIGHTBORDER, m_rcFullWin.bottom - BOTTOMBORDER); @@ -585,7 +589,7 @@ m_startRow = startRow; m_endRow = endRow; m_nRows = endRow - startRow; - m_nChan = nchn; + m_nChan = static_cast<CHANNELINDEX>(nchn); m_nPattern = pat; //Check document exists @@ -648,7 +652,7 @@ rect.SetRect(x-NODEHALF, y-NODEHALF, x+NODEHALF+1, y+NODEHALF+1); if (rect.PtInRect(point)) { - m_pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, m_nChan, row, m_nChan+1, row+1); + m_pModDoc->GetPatternUndo()->PrepareUndo(static_cast<PATTERNINDEX>(m_nPattern), m_nChan, row, m_nChan+1, row+1); m_nDragItem = row; } } @@ -687,7 +691,7 @@ { // Interpolate if we detect that rows have been skipped but the left mouse button was not released. // This ensures we produce a smooth curve even when we are not notified of mouse movements at a high frequency (e.g. if CPU usage is high) - if ((m_nLastDrawnRow>(int)m_startRow) && (row != m_nLastDrawnRow) && (row != m_nLastDrawnRow+1) && (row != m_nLastDrawnRow-1)) + if ((m_nLastDrawnRow>(int)m_startRow) && ((int)row != m_nLastDrawnRow) && ((int)row != m_nLastDrawnRow+1) && ((int)row != m_nLastDrawnRow-1)) { int steps = abs((long)row-(long)m_nLastDrawnRow); ASSERT(steps!=0); @@ -698,7 +702,7 @@ for (int i=1; i<=steps; i++) { currentRow = m_nLastDrawnRow+(direction*i); - int interpolatedY = m_nLastDrawnY+((float)i*factor+0.5f); + int interpolatedY = static_cast<int>(m_nLastDrawnY+((float)i*factor+0.5f)); MakeChange(currentRow, interpolatedY); } @@ -746,7 +750,7 @@ SetFocus(); SetCapture(); - m_pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, m_nChan, m_startRow, m_nChan+1, m_endRow); + m_pModDoc->GetPatternUndo()->PrepareUndo(static_cast<PATTERNINDEX>(m_nPattern), m_nChan, m_startRow, m_nChan+1, m_endRow); m_dwStatus |= FXVSTATUS_LDRAGGING; } @@ -806,7 +810,7 @@ { k =m_cmbEffectList.AddString(s); m_cmbEffectList.SetItemData(k, i); - if (i==m_nFillEffect) + if ((long)i == m_nFillEffect) m_cmbEffectList.SetCurSel(k); } } Modified: trunk/OpenMPT/mptrack/EffectVis.h =================================================================== --- trunk/OpenMPT/mptrack/EffectVis.h 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/EffectVis.h 2011-07-30 20:40:29 UTC (rev 944) @@ -62,7 +62,7 @@ UINT m_startRow; UINT m_endRow; UINT m_nRows; - UINT m_nChan; + CHANNELINDEX m_nChan; UINT m_nPattern; long m_nFillEffect, m_nAction; Modified: trunk/OpenMPT/mptrack/HyperEdit.cpp =================================================================== --- trunk/OpenMPT/mptrack/HyperEdit.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/HyperEdit.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -21,6 +21,8 @@ #include "stdafx.h" #include "HyperEdit.h" +#pragma warning(disable:4018) // "'<' : signed/unsigned mismatch" + #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE @@ -215,3 +217,5 @@ CEdit::OnTimer(nIDEvent); } +#pragma warning(default:4018) + Modified: trunk/OpenMPT/mptrack/HyperEdit2.cpp =================================================================== --- trunk/OpenMPT/mptrack/HyperEdit2.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/HyperEdit2.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -20,6 +20,9 @@ #include "stdafx.h" #include "HyperEdit.h" +#pragma warning(disable:4244) // "conversion from 'type1' to 'type2', possible loss of data" +#pragma warning(disable:4018) // "'<' : signed/unsigned mismatch" + #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE @@ -235,3 +238,5 @@ return FALSE; // Not a valid token by default } +#pragma warning(default:4244) +#pragma warning(default:4018) Modified: trunk/OpenMPT/mptrack/ModConvert.cpp =================================================================== --- trunk/OpenMPT/mptrack/ModConvert.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/ModConvert.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -51,7 +51,7 @@ //--------------------------------------------------------------------------------------------------------- { // shorten instrument envelope if necessary (for mod conversion) - const UINT iEnvMax = pSndFile->GetModSpecifications().envelopePointsMax; + const uint8 iEnvMax = pSndFile->GetModSpecifications().envelopePointsMax; #define TRIMENV(iEnvLen) if(iEnvLen > iEnvMax) { iEnvLen = iEnvMax; CHANGEMODTYPE_WARNING(wTrimmedEnvelopes); } Modified: trunk/OpenMPT/mptrack/OpenGLControl.cpp =================================================================== --- trunk/OpenMPT/mptrack/OpenGLControl.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/OpenGLControl.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -2,6 +2,7 @@ // #include "stdafx.h" +#if 0 #include "OpenGLControl.h" #ifdef _DEBUG @@ -164,3 +165,5 @@ { return TRUE; } + +#endif // 0 Modified: trunk/OpenMPT/mptrack/OpenGLControl.h =================================================================== --- trunk/OpenMPT/mptrack/OpenGLControl.h 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/OpenGLControl.h 2011-07-30 20:40:29 UTC (rev 944) @@ -1,6 +1,8 @@ #if !defined(AFX_OPENGLCONTROL_H__52A6B63B_01A2_449D_8691_1FF59EECAB71__INCLUDED_) #define AFX_OPENGLCONTROL_H__52A6B63B_01A2_449D_8691_1FF59EECAB71__INCLUDED_ +#if 0 + #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 @@ -63,4 +65,6 @@ //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ f\xFCgt unmittelbar vor der vorhergehenden Zeile zus\xE4tzliche Deklarationen ein. +#endif // 0 + #endif // AFX_OPENGLCONTROL_H__52A6B63B_01A2_449D_8691_1FF59EECAB71__INCLUDED_ Modified: trunk/OpenMPT/mptrack/OpenGLDevice.cpp =================================================================== --- trunk/OpenMPT/mptrack/OpenGLDevice.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/OpenGLDevice.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -13,6 +13,7 @@ ////////////////////////////////////////////////////////////////////// #include "stdafx.h" +#if 0 #include "OpenGLDevice.h" ////////////////////////////////////////////////////////////////////// @@ -152,4 +153,6 @@ } return true; -} \ No newline at end of file +} + +#endif // 0 Modified: trunk/OpenMPT/mptrack/OpenGLEditor.cpp =================================================================== --- trunk/OpenMPT/mptrack/OpenGLEditor.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/OpenGLEditor.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -1,4 +1,5 @@ #include "stdafx.h" +#if 0 #include "mptrack.h" #include "mainfrm.h" #include "childfrm.h" @@ -83,3 +84,5 @@ CDialog::OnPaint(); } } + +#endif // 0 Modified: trunk/OpenMPT/mptrack/OpenGLEditor.h =================================================================== --- trunk/OpenMPT/mptrack/OpenGLEditor.h 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/OpenGLEditor.h 2011-07-30 20:40:29 UTC (rev 944) @@ -1,4 +1,7 @@ #pragma once + +#if 0 + #include "globals.h" #include "OpenGLControl.h" @@ -25,3 +28,5 @@ public: afx_msg void OnPaint(); }; + +#endif // 0 Modified: trunk/OpenMPT/mptrack/PSRatioCalc.cpp =================================================================== --- trunk/OpenMPT/mptrack/PSRatioCalc.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/PSRatioCalc.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -16,7 +16,7 @@ , m_lSamplesOrig(samples), m_nSpeed(speed), m_nTempo(tempo), m_dRatio(ratio), m_nRowsPerBeat(rowsPerBeat), m_nTempoMode(tempoMode) { //Sample rate will not change. We can calculate original duration once and disgard sampleRate. - m_lMsOrig=1000.0*((double)m_lSamplesOrig / sampleRate); + m_lMsOrig= static_cast<ULONGLONG>(1000.0*((double)m_lSamplesOrig / sampleRate)); CalcSamples(); CalcMs(); CalcRows(); @@ -122,13 +122,13 @@ void CPSRatioCalc::CalcSamples() { - m_lSamplesNew=m_lSamplesOrig*(m_dRatio/100.0); + m_lSamplesNew = static_cast<ULONGLONG>(m_lSamplesOrig*(m_dRatio/100.0)); return; } void CPSRatioCalc::CalcMs() { - m_lMsNew=m_lMsOrig*(m_dRatio/100.0); + m_lMsNew = static_cast<ULONGLONG>(m_lMsOrig*(m_dRatio/100.0)); return; } Modified: trunk/OpenMPT/mptrack/PatternGotoDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternGotoDialog.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/PatternGotoDialog.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -48,7 +48,7 @@ { m_nRow = row; m_nChannel = chan; - m_nPattern = pat; + m_nPattern = static_cast<PATTERNINDEX>(pat); m_nActiveOrder = ord; m_nOrder = ord; m_pSndFile = pSndFile; @@ -103,7 +103,7 @@ } UpdateData(); - m_nOrder = m_pSndFile->FindOrder(m_nPattern, m_nActiveOrder); + m_nOrder = m_pSndFile->FindOrder(static_cast<PATTERNINDEX>(m_nPattern), m_nActiveOrder); if (m_nOrder >= m_pSndFile->Order.size()) { m_nOrder=0; Modified: trunk/OpenMPT/mptrack/SoundFilePlayConfig.h =================================================================== --- trunk/OpenMPT/mptrack/SoundFilePlayConfig.h 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/SoundFilePlayConfig.h 2011-07-30 20:40:29 UTC (rev 944) @@ -85,9 +85,9 @@ float m_VSTiAttenuation; float m_VSTiVolume; - float m_normalSamplePreAmp; - float m_normalVSTiVol; - float m_normalGlobalVol; + double m_normalSamplePreAmp; + double m_normalVSTiVol; + double m_normalGlobalVol; bool m_globalVolumeAppliesToMaster; bool m_ignorePreAmp; Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -337,7 +337,8 @@ CSoundFile::m_nStereoSeparation = CMainFrame::GetPrivateProfileLong("Sound Settings", "StereoSeparation", CSoundFile::m_nStereoSeparation, iniFile); CSoundFile::m_nMaxMixChannels = CMainFrame::GetPrivateProfileLong("Sound Settings", "MixChannels", CSoundFile::m_nMaxMixChannels, iniFile); gbWFIRType = static_cast<BYTE>(CMainFrame::GetPrivateProfileDWord("Sound Settings", "XMMSModplugResamplerWFIRType", gbWFIRType, iniFile)); - gdWFIRCutoff = static_cast<double>(CMainFrame::GetPrivateProfileLong("Sound Settings", "ResamplerWFIRCutoff", gdWFIRCutoff * 100.0, iniFile)) / 100.0; + //gdWFIRCutoff = static_cast<double>(CMainFrame::GetPrivateProfileLong("Sound Settings", "ResamplerWFIRCutoff", gdWFIRCutoff * 100.0, iniFile)) / 100.0; + gdWFIRCutoff = static_cast<double>(CMainFrame::GetPrivateProfileLong("Sound Settings", "ResamplerWFIRCutoff", Util::Round<long>(gdWFIRCutoff * 100.0), iniFile)) / 100.0; glVolumeRampSamples = CMainFrame::GetPrivateProfileLong("Sound Settings", "VolumeRampSamples", glVolumeRampSamples, iniFile); m_dwMidiSetup = CMainFrame::GetPrivateProfileDWord("MIDI Settings", "MidiSetup", m_dwMidiSetup, iniFile); Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -136,7 +136,7 @@ CViewPattern::CViewPattern() //-------------------------- { - m_pOpenGLEditor = NULL; //rewbs.fxvis + //m_pOpenGLEditor = NULL; //rewbs.fxvis m_pEffectVis = NULL; //rewbs.fxvis m_pRandomizer = NULL; m_bLastNoteEntryBlocked=false; @@ -436,10 +436,11 @@ { UINT ncol = GetCurrentColumn(); UINT xofs = GetXScrollPos(); - int nchn = ncol >> 3; + const UINT nchn = ncol >> 3; if (nchn < xofs) { - scroll.cx = (int)(nchn - xofs) * m_szCell.cx; + scroll.cx = (int)(xofs - nchn) * m_szCell.cx; + scroll.cx *= -1; } else if (nchn > xofs) { @@ -713,11 +714,13 @@ m_pRandomizer=NULL; } + /* if (m_pOpenGLEditor) { m_pOpenGLEditor->DoClose(); delete m_pOpenGLEditor; m_pOpenGLEditor = NULL; } + */ CModScrollView::OnDestroy(); @@ -770,14 +773,14 @@ const DWORD endSel = (GetRowFromCursor(m_dwBeginSel) < GetRowFromCursor(m_dwEndSel)) ? m_dwEndSel : m_dwBeginSel; pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, 0, 0, pSndFile->GetNumChannels(), pSndFile->Patterns[m_nPattern].GetNumRows()); - int finalDest = GetRowFromCursor(startSel) + (GetRowFromCursor(endSel) - GetRowFromCursor(startSel))*2; + const ROWINDEX finalDest = GetRowFromCursor(startSel) + (GetRowFromCursor(endSel) - GetRowFromCursor(startSel))*2; for (int row = finalDest; row > (int)GetRowFromCursor(startSel); row -= 2) { int offset = row - GetRowFromCursor(startSel); for (UINT i=(startSel & 0xFFFF); i<=(endSel & 0xFFFF); i++) if (GetColTypeFromCursor(i) <= LAST_COLUMN) { UINT chn = GetChanFromCursor(i); - if ((chn >= pSndFile->GetNumChannels()) || (row >= pSndFile->Patterns[m_nPattern].GetNumRows())) continue; + if ((chn >= pSndFile->GetNumChannels()) || (ROWINDEX(row) >= pSndFile->Patterns[m_nPattern].GetNumRows())) continue; MODCOMMAND *dest = &p[row * pSndFile->GetNumChannels() + chn]; MODCOMMAND *src = &p[(row-offset/2) * pSndFile->GetNumChannels() + chn]; MODCOMMAND *blank= &p[(row-1) * pSndFile->GetNumChannels() + chn]; @@ -820,12 +823,12 @@ const DWORD endSel = (GetRowFromCursor(m_dwBeginSel) < GetRowFromCursor(m_dwEndSel)) ? m_dwEndSel : m_dwBeginSel; pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, 0, 0, pSndFile->GetNumChannels(), pSndFile->Patterns[m_nPattern].GetNumRows()); - int finalDest = GetRowFromCursor(startSel) + (GetRowFromCursor(endSel) - GetRowFromCursor(startSel))/2; + const ROWINDEX finalDest = GetRowFromCursor(startSel) + (GetRowFromCursor(endSel) - GetRowFromCursor(startSel))/2; - for (int row = GetRowFromCursor(startSel); row <= finalDest; row++) + for (ROWINDEX row = GetRowFromCursor(startSel); row <= finalDest; row++) { - int offset = row - GetRowFromCursor(startSel); - int srcRow = GetRowFromCursor(startSel) + (offset * 2); + const ROWINDEX offset = row - GetRowFromCursor(startSel); + const ROWINDEX srcRow = GetRowFromCursor(startSel) + (offset * 2); for (UINT i = (startSel & 0xFFFF); i <= (endSel & 0xFFFF); i++) if (GetColTypeFromCursor(i) <= LAST_COLUMN) { @@ -865,7 +868,7 @@ } } } - for (int row = finalDest + 1; row <= GetRowFromCursor(endSel); row++) + for (ROWINDEX row = finalDest + 1; row <= GetRowFromCursor(endSel); row++) { for (UINT i = (startSel & 0xFFFF); i <= (endSel & 0xFFFF); i++) if (GetColTypeFromCursor(i) <= LAST_COLUMN) { @@ -2385,8 +2388,9 @@ bool doPCinterpolation = false; - int vsrc, vdest, vcmd = 0, verr = 0, distance; - distance = row1 - row0; + int vsrc, vdest, vcmd = 0, verr = 0; + ASSERT(row1 >= row0); + UINT distance = row1 - row0; const MODCOMMAND srcCmd = *pSndFile->Patterns[m_nPattern].GetpModCommand(row0, nchn); const MODCOMMAND destCmd = *pSndFile->Patterns[m_nPattern].GetpModCommand(row1, nchn); @@ -3014,7 +3018,7 @@ if (vol > 64) vol = 64; m->vol = (BYTE)vol; } - if ((((nChn << 3) | 3) >= (m_dwBeginSel & 0xFFFF)) && (((nChn << 3) | 3) <= (m_dwEndSel & 0xFFFF))) + if ((((nChn << 3) | 3u) >= (m_dwBeginSel & 0xFFFF)) && (((nChn << 3) | 3u) <= (m_dwEndSel & 0xFFFF))) { if ((m->command == CMD_VOLUME) && (m->param <= 64)) { @@ -3698,7 +3702,7 @@ SetCurrentColumn(m_dwCursor - 1); return wParam; case kcNavigateRightSelect: - case kcNavigateRight: if ((CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_WRAP) && (m_dwCursor >= (((pSndFile->m_nChannels-1) << 3) | 4))) + case kcNavigateRight: if ((CMainFrame::GetSettings().m_dwPatternSetup & PATTERN_WRAP) && (m_dwCursor >= (((pSndFile->m_nChannels-1) << 3u) | 4u))) SetCurrentColumn(0); else SetCurrentColumn(m_dwCursor + 1); @@ -3725,12 +3729,12 @@ case kcHomeAbsolute: if (m_dwCursor) SetCurrentColumn(0); if (m_nRow > 0) SetCurrentRow(0); return wParam; case kcEndHorizontalSelect: - case kcEndHorizontal: if (m_dwCursor!=(((pSndFile->GetNumChannels() - 1) << 3) | 4)) SetCurrentColumn(((pSndFile->m_nChannels-1) << 3) | 4); + case kcEndHorizontal: if (m_dwCursor!=(((pSndFile->GetNumChannels() - 1u) << 3u) | 4)) SetCurrentColumn(((pSndFile->m_nChannels-1) << 3) | 4); else if (m_nRow < pModDoc->GetPatternSize(m_nPattern) - 1) SetCurrentRow(pModDoc->GetPatternSize(m_nPattern) - 1); return wParam; case kcEndVerticalSelect: case kcEndVertical: if (m_nRow < pModDoc->GetPatternSize(m_nPattern) - 1) SetCurrentRow(pModDoc->GetPatternSize(m_nPattern) - 1); - else if (m_dwCursor!=(((pSndFile->GetNumChannels() - 1) << 3) | 4)) SetCurrentColumn(((pSndFile->m_nChannels-1) << 3) | 4); + else if (m_dwCursor!=(((pSndFile->GetNumChannels() - 1) << 3u) | 4u)) SetCurrentColumn(((pSndFile->m_nChannels-1) << 3u) | 4); return wParam; case kcEndAbsoluteSelect: case kcEndAbsolute: SetCurrentColumn(((pSndFile->GetNumChannels() - 1) << 3) | 4); if (m_nRow < pModDoc->GetPatternSize(m_nPattern) - 1) SetCurrentRow(pModDoc->GetPatternSize(m_nPattern) - 1); return wParam; @@ -3990,9 +3994,9 @@ void CViewPattern::SetSpacing(int n) //---------------------------------- { - if (n != m_nSpacing) + if (static_cast<UINT>(n) != m_nSpacing) { - m_nSpacing = n; + m_nSpacing = static_cast<UINT>(n); PostCtrlMessage(CTRLMSG_SETSPACING, m_nSpacing); } } Modified: trunk/OpenMPT/mptrack/View_pat.h =================================================================== --- trunk/OpenMPT/mptrack/View_pat.h 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/View_pat.h 2011-07-30 20:40:29 UTC (rev 944) @@ -142,7 +142,7 @@ CPatternRandomizer *m_pRandomizer; //rewbs.fxVis public: CEffectVis *m_pEffectVis; //rewbs.fxVis - COpenGLEditor *m_pOpenGLEditor; //rewbs.fxVis + //COpenGLEditor *m_pOpenGLEditor; //rewbs.fxVis CViewPattern(); @@ -347,7 +347,7 @@ static ROWINDEX GetRowFromCursor(DWORD cursor) { return (cursor >> 16); }; static CHANNELINDEX GetChanFromCursor(DWORD cursor) { return static_cast<CHANNELINDEX>((cursor & 0xFFFF) >> 3); }; - static UINT GetColTypeFromCursor(DWORD cursor) { return (cursor & 0x07); }; + static PatternColumns GetColTypeFromCursor(DWORD cursor) { return static_cast<PatternColumns>((cursor & 0x07)); }; static DWORD CreateCursor(ROWINDEX row, CHANNELINDEX channel = 0, UINT column = 0) { return (row << 16) | ((channel << 3) & 0x1FFF) | (column & 0x07); }; private: Modified: trunk/OpenMPT/mptrack/misc_util.h =================================================================== --- trunk/OpenMPT/mptrack/misc_util.h 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/misc_util.h 2011-07-30 20:40:29 UTC (rev 944) @@ -253,6 +253,20 @@ // Returns maximum value of given integer type. template <class T> inline T MaxValueOfType(const T&) {static_assert(std::numeric_limits<T>::is_integer == true, "Only interger types are allowed."); return (std::numeric_limits<T>::max)();} + /// Returns value rounded to nearest integer. + inline double Round(const double& val) {return std::floor(val + 0.5);} + + /// Rounds given double value to nearest integer value of type T. + template <class T> inline T Round(const double& val) + { + static_assert(std::numeric_limits<T>::is_integer == true, "Type is a not an integer"); + static_assert(sizeof(T) <= 4, "Revise the implementation for integers > 32-bits."); + const double valRounded = Round(val); + ASSERT(valRounded >= (std::numeric_limits<T>::min)() && valRounded <= (std::numeric_limits<T>::max)()); + const T intval = static_cast<T>(valRounded); + return intval; + } + }; Modified: trunk/OpenMPT/mptrack/test/test.cpp =================================================================== --- trunk/OpenMPT/mptrack/test/test.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/mptrack/test/test.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -220,6 +220,31 @@ VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T("s2m")), MOD_TYPE_NONE); VERIFY_EQUAL(CModSpecifications::ExtensionToType(_T("")), MOD_TYPE_NONE); VERIFY_EQUAL(CModSpecifications::ExtensionToType(LPCTSTR(nullptr)), MOD_TYPE_NONE); + + VERIFY_EQUAL( Util::Round(1.99), 2.0 ); + VERIFY_EQUAL( Util::Round(1.5), 2.0 ); + VERIFY_EQUAL( Util::Round(1.1), 1.0 ); + VERIFY_EQUAL( Util::Round(-0.1), 0.0 ); + VERIFY_EQUAL( Util::Round(-0.5), 0.0 ); + VERIFY_EQUAL( Util::Round(-0.9), -1.0 ); + VERIFY_EQUAL( Util::Round(-1.4), -1.0 ); + VERIFY_EQUAL( Util::Round(-1.7), -2.0 ); + VERIFY_EQUAL( Util::Round<int32>(int32_max + 0.1), int32_max ); + VERIFY_EQUAL( Util::Round<int32>(int32_max - 0.4), int32_max ); + VERIFY_EQUAL( Util::Round<int32>(int32_min + 0.1), int32_min ); + VERIFY_EQUAL( Util::Round<int32>(int32_min - 0.1), int32_min ); + VERIFY_EQUAL( Util::Round<uint32>(uint32_max + 0.499), uint32_max ); + VERIFY_EQUAL( Util::Round<int8>(110.1), 110 ); + VERIFY_EQUAL( Util::Round<int8>(-110.1), -110 ); + + // These should fail to compile + //Util::Round<std::string>(1.0); + //Util::Round<int64>(1.0); + //Util::Round<uint64>(1.0); + + // This should trigger assert in Round. + //VERIFY_EQUAL( Util::Round<int8>(-129), 0 ); + } @@ -461,14 +486,10 @@ theApp.RemoveMruItem(0); } - -template<class T> -T Round(double a) {return static_cast<T>(floor(a + 0.5));} - double Rand01() {return rand() / double(RAND_MAX);} template <class T> -T Rand(const T& min, const T& max) {return Round<T>(min + Rand01() * (max - min));} +T Rand(const T& min, const T& max) {return Util::Round<T>(min + Rand01() * (max - min));} Modified: trunk/OpenMPT/soundlib/Dlsbank.cpp =================================================================== --- trunk/OpenMPT/soundlib/Dlsbank.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/soundlib/Dlsbank.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -1468,7 +1468,7 @@ } -BOOL CDLSBank::ExtractSample(CSoundFile *pSndFile, UINT nSample, UINT nIns, UINT nRgn, int transpose) +BOOL CDLSBank::ExtractSample(CSoundFile *pSndFile, SAMPLEINDEX nSample, UINT nIns, UINT nRgn, int transpose) //--------------------------------------------------------------------------------------------------- { DLSINSTRUMENT *pDlsIns; @@ -1602,13 +1602,14 @@ } -BOOL CDLSBank::ExtractInstrument(CSoundFile *pSndFile, UINT nInstr, UINT nIns, UINT nDrumRgn) +BOOL CDLSBank::ExtractInstrument(CSoundFile *pSndFile, INSTRUMENTINDEX nInstr, UINT nIns, UINT nDrumRgn) //------------------------------------------------------------------------------------------- { BYTE RgnToSmp[DLSMAXREGIONS]; DLSINSTRUMENT *pDlsIns; MODINSTRUMENT *pIns; - UINT nSample, nRgnMin, nRgnMax, nEnv; + UINT nRgnMin, nRgnMax, nEnv; + SAMPLEINDEX nSample; if ((!m_pInstruments) || (nIns >= m_nInstruments) || (!pSndFile)) return FALSE; pDlsIns = &m_pInstruments[nIns]; Modified: trunk/OpenMPT/soundlib/Dlsbank.h =================================================================== --- trunk/OpenMPT/soundlib/Dlsbank.h 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/soundlib/Dlsbank.h 2011-07-30 20:40:29 UTC (rev 944) @@ -2,6 +2,7 @@ #define _DLS_BANK_H_ class CSoundFile; +#include "Snd_defs.h" #pragma pack(1) @@ -121,8 +122,8 @@ UINT GetRegionFromKey(UINT nIns, UINT nKey); BOOL FreeWaveForm(LPBYTE p); BOOL ExtractWaveForm(UINT nIns, UINT nRgn, LPBYTE *ppWave, DWORD *pLen); - BOOL ExtractSample(CSoundFile *pSndFile, UINT nSample, UINT nIns, UINT nRgn, int transpose=0); - BOOL ExtractInstrument(CSoundFile *pSndFile, UINT nInstr, UINT nIns, UINT nDrumRgn); + BOOL ExtractSample(CSoundFile *pSndFile, SAMPLEINDEX nSample, UINT nIns, UINT nRgn, int transpose=0); + BOOL ExtractInstrument(CSoundFile *pSndFile, INSTRUMENTINDEX nInstr, UINT nIns, UINT nDrumRgn); // Internal Loader Functions protected: Modified: trunk/OpenMPT/soundlib/LOAD_DMF.CPP =================================================================== --- trunk/OpenMPT/soundlib/LOAD_DMF.CPP 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/soundlib/LOAD_DMF.CPP 2011-07-30 20:40:29 UTC (rev 944) @@ -1120,7 +1120,7 @@ DMFNewNode(&tree); value = 0; - for (int i = 0; i < maxlen; i++) + for (UINT i = 0; i < maxlen; i++) { actnode = 0; sign = DMFReadBits(&tree, 1); Modified: trunk/OpenMPT/soundlib/LOAD_DSM.CPP =================================================================== --- trunk/OpenMPT/soundlib/LOAD_DSM.CPP 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/soundlib/LOAD_DSM.CPP 2011-07-30 20:40:29 UTC (rev 944) @@ -91,7 +91,8 @@ DSMFILEHEADER *pfh = (DSMFILEHEADER *)lpStream; DSMSONG *psong; DWORD dwMemPos; - UINT nPat, nSmp; + UINT nSmp; + PATTERNINDEX nPat; if ((!lpStream) || (dwMemLength < 1024) || (pfh->id_RIFF != DSMID_RIFF) || (pfh->riff_len + 8 > dwMemLength) || (pfh->riff_len < 1024) Modified: trunk/OpenMPT/soundlib/Load_med.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_med.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/soundlib/Load_med.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -271,7 +271,7 @@ { const BYTE bpmvals[9] = { 179,164,152,141,131,123,116,110,104}; - UINT command = p->command; + MODCOMMAND::COMMAND command = p->command; UINT param = p->param; switch(command) { @@ -467,10 +467,11 @@ // 0x2E ? Log("Unknown command: cmd=0x%02X param=0x%02X\n", command, param); #endif - command = param = 0; + command = 0; + param = 0; } p->command = command; - p->param = param; + p->param = static_cast<MODCOMMAND::PARAM>(param); } @@ -636,13 +637,13 @@ playtransp = pmsh->playtransp; } else { - UINT nOrders, nSections; + UINT nSections; + ORDERINDEX nOrders = 0; WORD nTrks = BigEndianW(pmsh2->numtracks); if ((nTrks >= 4) && (nTrks <= 32)) m_nChannels = nTrks; DWORD playseqtable = BigEndian(pmsh2->playseqtable); UINT numplayseqs = BigEndianW(pmsh2->numpseqs); if (!numplayseqs) numplayseqs = 1; - nOrders = 0; nSections = BigEndianW(pmsh2->numsections); DWORD sectiontable = BigEndian(pmsh2->sectiontable); if ((!nSections) || (!sectiontable) || (sectiontable >= dwMemLength-2)) nSections = 1; @@ -736,7 +737,7 @@ } // Track Names DWORD trackinfo_ofs = BigEndian(pmex->trackinfo_ofs); - if ((trackinfo_ofs) && (trackinfo_ofs < dwMemLength) && (m_nChannels * 4 < dwMemLength - trackinfo_ofs)) + if ((trackinfo_ofs) && (trackinfo_ofs < dwMemLength) && (m_nChannels * 4u < dwMemLength - trackinfo_ofs)) { DWORD *ptrktags = (DWORD *)(lpStream + trackinfo_ofs); for (UINT i=0; i<m_nChannels; i++) @@ -830,7 +831,7 @@ BYTE instr = s[1] >> 4; if (s[0] & 0x80) instr |= 0x10; if (s[0] & 0x40) instr |= 0x20; - if ((note) && (note <= 132)) p->note = note + playtransp; + if ((note) && (note <= 132)) p->note = static_cast<BYTE>(note + playtransp); p->instr = instr; p->command = s[1] & 0x0F; p->param = s[2]; Modified: trunk/OpenMPT/soundlib/Load_mod.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/soundlib/Load_mod.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -40,7 +40,7 @@ case 0x0C: command = CMD_VOLUME; break; case 0x0D: command = CMD_PATTERNBREAK; param = ((param >> 4) * 10) + (param & 0x0F); break; case 0x0E: command = CMD_MODCMDEX; break; - case 0x0F: command = (param <= ((m_nType & (MOD_TYPE_MOD)) ? 0x20 : 0x1F)) ? CMD_SPEED : CMD_TEMPO; + case 0x0F: command = (param <= ((m_nType & (MOD_TYPE_MOD)) ? 0x20u : 0x1Fu)) ? CMD_SPEED : CMD_TEMPO; if ((param == 0xFF) && (m_nSamples == 15) && (m_nType & MOD_TYPE_MOD)) command = 0; break; //<rewbs> what the hell is this?! :) //<jojo> it's the "stop tune" command! :-P // Extension for XM extended effects case 'G' - 55: command = CMD_GLOBALVOLUME; break; //16 @@ -123,8 +123,8 @@ case CMD_VOLUME: command = 0x0C; break; case CMD_PATTERNBREAK: command = 0x0D; param = ((param / 10) << 4) | (param % 10); break; case CMD_MODCMDEX: command = 0x0E; break; - case CMD_SPEED: command = 0x0F; param = min(param, (bXM) ? 0x1F : 0x20); break; - case CMD_TEMPO: command = 0x0F; param = max(param, (bXM) ? 0x20 : 0x21); break; + case CMD_SPEED: command = 0x0F; param = min(param, (bXM) ? 0x1Fu : 0x20u); break; + case CMD_TEMPO: command = 0x0F; param = max(param, (bXM) ? 0x20u : 0x21u); break; case CMD_GLOBALVOLUME: command = 'G' - 55; break; case CMD_GLOBALVOLSLIDE: command = 'H' - 55; break; case CMD_KEYOFF: command = 'K' - 55; break; @@ -395,7 +395,7 @@ norders--; m_nRestartPos = pMagic->nRestartPos; if (m_nRestartPos >= 0x78) m_nRestartPos = 0; - if (m_nRestartPos + 1 >= (UINT)norders) m_nRestartPos = 0; + if (m_nRestartPos + 1u >= norders) m_nRestartPos = 0; if (!nbp) return false; DWORD dwWowTest = dwTotalSampleLen+dwMemPos; if ((IsMagic(pMagic->Magic, "M.K.")) && (dwWowTest + nbp*8*256 == dwMemLength)) m_nChannels = 8; @@ -706,7 +706,7 @@ MODSAMPLE *pSmp = &Samples[insmap[ismpd]]; if(bCompatibilityExport == true) // first two bytes have to be 0 due to PT's one-shot loop ("no loop") { - int iOverwriteLen = 2 * pSmp->GetBytesPerSample(); + size_t iOverwriteLen = 2 * pSmp->GetBytesPerSample(); memset(pSmp->pSample, 0, min(iOverwriteLen, pSmp->GetSampleSizeInBytes())); } UINT flags = RS_PCM8S; Modified: trunk/OpenMPT/soundlib/Snd_defs.h =================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/soundlib/Snd_defs.h 2011-07-30 20:40:29 UTC (rev 944) @@ -10,6 +10,8 @@ #ifndef SND_DEF_H #define SND_DEF_H +#include "../mptrack/typedefs.h" + #ifndef LPCBYTE typedef const BYTE * LPCBYTE; #endif Modified: trunk/OpenMPT/soundlib/Snd_flt.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_flt.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/soundlib/Snd_flt.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -86,16 +86,16 @@ { if(pChn->nCutSwing) { - pChn->nCutOff += pChn->nCutSwing; - if(pChn->nCutOff > 127) pChn->nCutOff = 127; - if(pChn->nCutOff < 0) pChn->nCutOff = 0; + static_assert(sizeof(pChn->nCutOff) == 1, "check cast if this fails"); + pChn->nCutOff = static_cast<BYTE>(pChn->nCutOff + pChn->nCutSwing); + Limit(pChn->nCutOff, BYTE(0), BYTE(127)); pChn->nCutSwing = 0; } if(pChn->nResSwing) { - pChn->nResonance += pChn->nResSwing; - if(pChn->nResonance > 127) pChn->nResonance = 127; - if(pChn->nResonance < 0) pChn->nResonance = 0; + static_assert(sizeof(pChn->nResonance) == 1, "check cast if this fails"); + pChn->nResonance = static_cast<BYTE>(pChn->nResonance + pChn->nResSwing); + Limit(pChn->nResonance, BYTE(0), BYTE(127)); pChn->nResSwing = 0; } cutoff = max( min((int)pChn->nCutOff,127), 0); // cap cutoff Modified: trunk/OpenMPT/soundlib/Snddev.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snddev.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/soundlib/Snddev.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -173,7 +173,9 @@ void CWaveDevice::SilenceAudioBuffer(ISoundSource *pSource, ULONG nMaxLatency, DWORD dwBuffer) { - + UNREFERENCED_PARAMETER(pSource); + UNREFERENCED_PARAMETER(nMaxLatency); + UNREFERENCED_PARAMETER(dwBuffer); } @@ -506,7 +508,9 @@ void CDSoundDevice::SilenceAudioBuffer(ISoundSource *pSource, ULONG nMaxLatency, DWORD dwBuffer) { - + UNREFERENCED_PARAMETER(pSource); + UNREFERENCED_PARAMETER(nMaxLatency); + UNREFERENCED_PARAMETER(dwBuffer); } BOOL CDSoundDevice::FillAudioBuffer(ISoundSource *pSource, ULONG nMaxLatency, DWORD) @@ -902,6 +906,8 @@ void CASIODevice::SilenceAudioBuffer(ISoundSource *pSource, ULONG nMaxLatency, DWORD dwBuffer) //-------------------------------------------------------------------------------------------- { + UNREFERENCED_PARAMETER(pSource); + UNREFERENCED_PARAMETER(nMaxLatency); for (UINT ich=0; ich<m_nChannels; ich++){ memset(m_BufferInfo[ich].buffers[dwBuffer], 0, m_nAsioBufferLen); } @@ -911,6 +917,8 @@ BOOL CASIODevice::FillAudioBuffer(ISoundSource *pSource, ULONG nMaxLatency, DWORD dwBuffer) //----------------------------------------------------------------------------------------- { + UNREFERENCED_PARAMETER(nMaxLatency); + DWORD dwSampleSize = m_nChannels*(m_nBitsPerSample>>3); DWORD dwSamplesLeft = m_nAsioBufferLen; DWORD dwFrameLen = (ASIO_BLOCK_LEN*sizeof(int)) / dwSampleSize; @@ -1006,6 +1014,7 @@ void CASIODevice::BufferSwitch(long doubleBufferIndex, ASIOBool directProcess) //---------------------------------------------------------------------------- { + UNREFERENCED_PARAMETER(directProcess); if ((gpCurrentAsio) && (gpCurrentAsio->m_bMixRunning)) SoundDeviceCallback(doubleBufferIndex); } @@ -1013,12 +1022,16 @@ void CASIODevice::SampleRateDidChange(ASIOSampleRate sRate) //--------------------------------------------------------- { + UNREFERENCED_PARAMETER(sRate); } long CASIODevice::AsioMessage(long selector, long value, void* message, double* opt) //---------------------------------------------------------------------------------- { + UNREFERENCED_PARAMETER(value); + UNREFERENCED_PARAMETER(message); + UNREFERENCED_PARAMETER(opt); #ifdef ASIO_LOG // Log("AsioMessage(%d, %d)\n", selector, value); #endif Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -1318,8 +1318,8 @@ { switch(m_nTickCount % 3) { - case 1: period = period / TwoToPowerXOver12(pChn->nArpeggio >> 4); break; - case 2: period = period / TwoToPowerXOver12(pChn->nArpeggio & 0x0F); break; + case 1: period = Util::Round<int>(period / TwoToPowerXOver12(pChn->nArpeggio >> 4)); break; + case 2: period = Util::Round<int>(period / TwoToPowerXOver12(pChn->nArpeggio & 0x0F)); break; } } } @@ -1747,7 +1747,7 @@ { if(pChn->m_CalculateFreq || (pChn->m_ReCalculateFreqOnFirstTick && m_nTickCount == 0)) { - pChn->m_Freq = pChn->nC5Speed * vibratoFactor * pIns->pTuning->GetRatio(pChn->nNote - NOTE_MIDDLEC + arpeggioSteps, pChn->nFineTune+pChn->m_PortamentoFineSteps); + pChn->m_Freq = Util::Round<UINT>(pChn->nC5Speed * vibratoFactor * pIns->pTuning->GetRatio(pChn->nNote - NOTE_MIDDLEC + arpeggioSteps, pChn->nFineTune+pChn->m_PortamentoFineSteps)); if(!pChn->m_CalculateFreq) pChn->m_ReCalculateFreqOnFirstTick = false; else @@ -1759,7 +1759,7 @@ //Applying Pitch/Tempo lock. if(m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT) && pIns && pIns->wPitchToTempoLock) - freq *= (float)m_nMusicTempo / (float)pIns->wPitchToTempoLock; + freq = MulDiv(freq, m_nMusicTempo, pIns->wPitchToTempoLock); if ((m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) && (freq < 256)) @@ -2304,7 +2304,8 @@ step = delta/static_cast<long>(m_nSamplesToGlobalVolRampDest); UINT maxStep = max(50, (10000/gnVolumeRampSamples+1)); //define max step size as some factor of user defined ramping value: the lower the value, the more likely the click. - while (abs(step)>maxStep) { //if step is too big (might cause click), extend ramp length. + while (static_cast<UINT>(abs(step)) > maxStep) //if step is too big (might cause click), extend ramp length. + { m_nSamplesToGlobalVolRampDest += gnVolumeRampSamples; step = delta/static_cast<long>(m_nSamplesToGlobalVolRampDest); } Modified: trunk/OpenMPT/soundlib/Tables.cpp =================================================================== --- trunk/OpenMPT/soundlib/Tables.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/soundlib/Tables.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -618,7 +618,7 @@ fsinc = sin(x*kPi) * izero(beta*sqrt(1-x*x*(1.0/16.0))) / (izero_beta*x*kPi); // Kaiser window } int n = (int)(fsinc * lowpass_factor * (16384*256)); - *psinc++ = (n+0x80)>>8; // force rounding + *psinc++ = static_cast<short>((n+0x80)>>8); // force rounding } } Modified: trunk/OpenMPT/soundlib/WindowedFIR.cpp =================================================================== --- trunk/OpenMPT/soundlib/WindowedFIR.cpp 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/soundlib/WindowedFIR.cpp 2011-07-30 20:40:29 UTC (rev 944) @@ -66,7 +66,7 @@ int _LPcl; float _LPcllen = (float)(1L<<WFIR_FRACBITS); // number of precalculated lines for 0..1 (-1..0) float _LNorm = 1.0f / (float)(2.0f * _LPcllen); - float _LCut = CMainFrame::GetSettings().gdWFIRCutoff; + float _LCut = static_cast<float>(CMainFrame::GetSettings().gdWFIRCutoff); float _LScale = (float)WFIR_QUANTSCALE; for( _LPcl=0;_LPcl<WFIR_LUTLEN;_LPcl++ ) { Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2011-07-30 20:32:17 UTC (rev 943) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2011-07-30 20:40:29 UTC (rev 944) @@ -50,7 +50,7 @@ UINT speedMin; // Minimum ticks per frame UINT speedMax; // Maximum ticks per frame bool hasComments; // True if format has a comments field - UINT envelopePointsMax; // Maximum number of points of each envelope + uint8 envelopePointsMax; // Maximum number of points of each envelope bool hasReleaseNode; // Envelope release node char commands[MAX_EFFECTS + 1]; // An array holding all commands this format supports; commands that are not supported are marked with "?" char volcommands[MAX_VOLCMDS + 1]; // dito, but for volume column This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-07-30 22:14:12
|
Revision: 947 http://modplug.svn.sourceforge.net/modplug/?rev=947&view=rev Author: saga-games Date: 2011-07-30 22:14:04 +0000 (Sat, 30 Jul 2011) Log Message: ----------- [New/Fix/Imp/Mod/etc] Completely overhauled macro handling system. Hopefully 99% compatible with IT's MIDI macros as defined in MIDI.TXT. Some macro letters have been changed / added, see the "macro help" button in the macro settings. Macros can now also make use of volume / panning envelopes, however this does not work very well yet (neither with Zxx, nor with \xx) - big TODO! Handling of those things is expected to change in the future, so don't rely on the buggy behaviour. [Mod] OpenMPT: Version is now 1.20.00.00 Modified Paths: -------------- trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moddoc.h trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/dlg_misc.h trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Snd_defs.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/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-07-30 21:36:06 UTC (rev 946) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-07-30 22:14:04 UTC (rev 947) @@ -3227,13 +3227,40 @@ if (value.Compare("F0F001z")==0) return sfx_reso; if (value.Compare("F0F002z")==0) return sfx_mode; if (value.Compare("F0F003z")==0) return sfx_drywet; - if (value.Compare("BK00z")>=0 && value.Compare("BKFFz")<=0 && value.GetLength()==5) + if (value.Compare("Bc00z")>=0 && value.Compare("BcFFz")<=0 && value.GetLength()==5) return sfx_cc; if (value.Compare("F0F079z")>0 && value.Compare("F0F1G")<0 && value.GetLength()==7) return sfx_plug; return sfx_custom; //custom/unknown } + +CString CModDoc::GetMacroName(enmParameteredMacroType macro) +//---------------------------------------------------------- +{ + switch(macro) + { + case sfx_unused: + return _T("Unused"); + case sfx_cutoff: + return _T("Set Filter Cutoff"); + case sfx_reso: + return _T("Set Filter Resonance"); + case sfx_mode: + return _T("Set Filter Mode"); + case sfx_drywet: + return _T("Set Plugin Dry/Wet Ratio"); + case sfx_plug: + return _T("Control Plugin Param..."); + case sfx_cc: + return _T("MIDI CC..."); + case sfx_custom: + default: + return _T("Custom"); + } +} + + int CModDoc::MacroToPlugParam(CString macro) //------------------------------------------ { @@ -3291,14 +3318,14 @@ // Retrieve Zxx (Z80-ZFF) type from current macro configuration -enmFixedMacroType CModDoc::GetZxxType(const CHAR (&szMidiZXXExt)[128][MACRO_LENGTH]) +enmFixedMacroType CModDoc::GetZxxType(const char (&szMidiZXXExt)[128][MACRO_LENGTH]) //---------------------------------------------------------------------------------- { // Compare with all possible preset patterns for(size_t i = 1; i < zxx_max; i++) { // Prepare pattern to compare - CHAR szPatterns[128][MACRO_LENGTH]; + char szPatterns[128][MACRO_LENGTH]; CreateZxxFromType(szPatterns, static_cast<enmFixedMacroType>(i)); bool bFound = true; @@ -3317,7 +3344,7 @@ // Create Zxx (Z80 - ZFF) from one out of five presets -void CModDoc::CreateZxxFromType(CHAR (&szMidiZXXExt)[128][MACRO_LENGTH], enmFixedMacroType iZxxType) +void CModDoc::CreateZxxFromType(char (&szMidiZXXExt)[128][MACRO_LENGTH], enmFixedMacroType iZxxType) //-------------------------------------------------------------------------------------------------- { for(size_t i = 0; i < 128; i++) @@ -3759,7 +3786,7 @@ } //set new macro - CHAR *pMacroToSet = GetSoundFile()->m_MidiCfg.szMidiSFXExt[macroToSet]; + char *pMacroToSet = GetSoundFile()->m_MidiCfg.szMidiSFXExt[macroToSet]; if (paramToUse < 128) { wsprintf(pMacroToSet, "F0F0%Xz",paramToUse+128); Modified: trunk/OpenMPT/mptrack/Moddoc.h =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.h 2011-07-30 21:36:06 UTC (rev 946) +++ trunk/OpenMPT/mptrack/Moddoc.h 2011-07-30 22:14:04 UTC (rev 947) @@ -256,10 +256,11 @@ // Various MIDI Macro helpers static enmParameteredMacroType GetMacroType(CString value); //rewbs.xinfo + static CString GetMacroName(enmParameteredMacroType macro); static int MacroToPlugParam(CString value); //rewbs.xinfo static int MacroToMidiCC(CString value); - static enmFixedMacroType GetZxxType(const CHAR (&szMidiZXXExt)[128][MACRO_LENGTH]); - static void CreateZxxFromType(CHAR (&szMidiZXXExt)[128][MACRO_LENGTH], enmFixedMacroType iZxxType); + static enmFixedMacroType GetZxxType(const char (&szMidiZXXExt)[128][MACRO_LENGTH]); + static void CreateZxxFromType(char (&szMidiZXXExt)[128][MACRO_LENGTH], enmFixedMacroType iZxxType); bool IsMacroDefaultSetupUsed() const; int FindMacroForParam(long param) const; Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2011-07-30 21:36:06 UTC (rev 946) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2011-07-30 22:14:04 UTC (rev 947) @@ -211,6 +211,11 @@ GetPrivateProfileString("Zxx Macros", snam, macros.szMidiZXXExt[izxx], macros.szMidiZXXExt[izxx], CountOf(macros.szMidiZXXExt[izxx]), iniFile); SetNullTerminator(macros.szMidiZXXExt[izxx]); } + // Fix old nasty broken (non-standard) MIDI configs in INI file. + if(storedVersion >= "1.17" && storedVersion < "1.20") + { + CSoundFile::FixMIDIConfigStrings(macros); + } theApp.SetDefaultMidiMacro(¯os); // Default directory location @@ -435,7 +440,7 @@ #define SETTINGS_REGKEY_BASE "Software\\Olivier Lapicque\\" -#define SETTINGS_REGKEY_DEFAULT "ModPlug Tracker" +#define SETTINGS_REGKEY_DEFAULT "ModPlug Tracker" #define SETTINGS_REGEXT_WINDOW "\\Window" #define SETTINGS_REGEXT_SETTINGS "\\Settings" Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-07-30 21:36:06 UTC (rev 946) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2011-07-30 22:14:04 UTC (rev 947) @@ -680,6 +680,7 @@ ON_COMMAND(IDC_CHECK1, OnEmbedMidiCfg) ON_COMMAND(IDC_BUTTON1, OnSetAsDefault) ON_COMMAND(IDC_BUTTON2, OnResetCfg) + ON_COMMAND(IDC_BUTTON3, OnMacroHelp) ON_CBN_SELCHANGE(IDC_COMBO1, OnSFxChanged) ON_CBN_SELCHANGE(IDC_COMBO2, OnSFxPresetChanged) ON_CBN_SELCHANGE(IDC_COMBO3, OnZxxPresetChanged) @@ -916,6 +917,26 @@ } +void CMidiMacroSetup::OnMacroHelp() +//--------------------------------- +{ + MessageBox(_T("Valid characters in macros:\n\n" + "0-9, A-F - Raw hex data (4-Bit value)\n" + "c - MIDI channel (4-Bit value)\n" + "n - Note value\n\n" + "v - Note velocity\n" + "u - Computed note volume (including envelopes)\n\n" + "x - Note panning\n" + "y - Computed panning (including envelopes)\n\n" + "a - High byte of bank select\n" + "b - Low byte of bank select\n" + "p - Program select\n\n" + "z - Zxx parameter (00-7F)\n\n" + "Macros can be up to 31 characters long and contain multiple MIDI messages. SysEx messages are automatically terminated if not specified by the user."), + _T("OpenMPT MIDI Macro quick reference"), MB_OK | MB_ICONINFORMATION); +} + + void CMidiMacroSetup::OnEmbedMidiCfg() //------------------------------------ { @@ -946,7 +967,7 @@ if (sfx < 16) { - CHAR *pmacro = m_MidiCfg.szMidiSFXExt[sfx]; + char *pmacro = m_MidiCfg.szMidiSFXExt[sfx]; switch(sfx_preset) { case sfx_unused: strcpy(pmacro, ""); break; // unused @@ -954,7 +975,7 @@ case sfx_reso: strcpy(pmacro, "F0F001z"); break; // reso case sfx_mode: strcpy(pmacro, "F0F002z"); break; // mode case sfx_drywet: strcpy(pmacro, "F0F003z"); break; - case sfx_cc: strcpy(pmacro, "BK00z"); break; // MIDI cc - TODO: get value from other menus + case sfx_cc: strcpy(pmacro, "Bc00z"); break; // MIDI cc - TODO: get value from other menus case sfx_plug: strcpy(pmacro, "F0F080z"); break; // plug param - TODO: get value from other menus case sfx_custom: /*strcpy(pmacro, "z");*/ break; // custom - leave as is. } @@ -983,28 +1004,20 @@ UINT sfx = m_CbnSFx.GetCurSel(); if (sfx < 16) { - memset(s, 0, sizeof(s)); - m_EditSFx.GetWindowText(s, MACRO_LENGTH - 1); - s[MACRO_LENGTH - 1] = 0; - // Fix letter case - for(size_t i = 0; i < MACRO_LENGTH; i++) + if(ValidateMacroString(m_EditSFx, m_MidiCfg.szMidiSFXExt[sfx], true)) { - if(s[i] >= 'd' && s[i] <= 'f') // a,b,c have special meanings - { - s[i] = s[i] - 'a' + 'A'; - } else if(s[i] == 'N' || s[i] == 'V' || s[i] == 'U' || s[i] == 'X' || s[i] == 'Y' || s[i] == 'Z' || s[i] == 'P') - { - s[i] = s[i] - 'A' + 'a'; - } + MemsetZero(s); + m_EditSFx.GetWindowText(s, MACRO_LENGTH); + SetNullTerminator(s); + memcpy(m_MidiCfg.szMidiSFXExt[sfx], s, MACRO_LENGTH); + + int sfx_preset = m_pModDoc->GetMacroType(m_MidiCfg.szMidiSFXExt[sfx]); + //int param = m_pModDoc->MacroToPlugParam(m_MidiCfg.szMidiSFXExt[sfx]); + + m_CbnSFxPreset.SetCurSel(sfx_preset); + ToggleBoxes(sfx_preset, sfx); + UpdateMacroList(sfx); } - - memcpy(m_MidiCfg.szMidiSFXExt[sfx], s, MACRO_LENGTH); - int sfx_preset = m_pModDoc->GetMacroType(m_MidiCfg.szMidiSFXExt[sfx]); - //int param = m_pModDoc->MacroToPlugParam(m_MidiCfg.szMidiSFXExt[sfx]); - - m_CbnSFxPreset.SetCurSel(sfx_preset); - ToggleBoxes(sfx_preset, sfx); - UpdateMacroList(sfx); } } @@ -1016,10 +1029,13 @@ UINT zxx = m_CbnZxx.GetCurSel(); if (zxx < 128) { - memset(s, 0, sizeof(s)); - m_EditZxx.GetWindowText(s, MACRO_LENGTH - 1); - s[MACRO_LENGTH - 1] = 0; - memcpy(m_MidiCfg.szMidiZXXExt[zxx], s, MACRO_LENGTH); + if(ValidateMacroString(m_EditZxx, m_MidiCfg.szMidiZXXExt[zxx], false)) + { + MemsetZero(s); + m_EditZxx.GetWindowText(s, MACRO_LENGTH); + SetNullTerminator(s); + memcpy(m_MidiCfg.szMidiZXXExt[zxx], s, MACRO_LENGTH); + } } } @@ -1116,7 +1132,7 @@ { CString macroText; UINT cc = m_CbnMacroCC.GetItemData(m_CbnMacroCC.GetCurSel()); - macroText.Format("BK%02Xz", cc&0xFF); + macroText.Format("Bc%02Xz", cc & 0xFF); m_EditSFx.SetWindowText(macroText); } @@ -1157,6 +1173,62 @@ } +bool CMidiMacroSetup::ValidateMacroString(CEdit &wnd, char *lastMacro, bool isParametric) +//--------------------------------------------------------------------------------------- +{ + CString macroStr; + wnd.GetWindowText(macroStr); + + bool allowed = true, caseChange = false; + for(int i = 0; i < macroStr.GetLength(); i++) + { + char c = macroStr.GetAt(i); + if(c == 'k' || c == 'K') // Previously, 'K' was used for MIDI channel + { + caseChange = true; + macroStr.SetAt(i, 'c'); + } else if (c >= 'd' && c <= 'f') // abc have special meanings, but def can be fixed + { + caseChange = true; + macroStr.SetAt(i, c - 'a' + 'A'); + } else if(c == 'N' || c == 'V' || c == 'U' || c == 'X' || c == 'Y' || c == 'Z' || c == 'P') + { + caseChange = true; + macroStr.SetAt(i, c - 'A' + 'a'); + } else if(!( + (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'c') || + (c == 'v' || c == 'u' || c == 'x' || c == 'y' || c == 'p' || c == 'n' || c == ' ') || + (c == 'z' && isParametric))) + { + allowed = false; + break; + } + } + + if(!allowed) + { + // Replace text and keep cursor position if we just typed in an invalid character + int start, end; + wnd.GetSel(start, end); + wnd.SetWindowText(lastMacro); + wnd.SetSel(start - 1, end - 1, true); + MessageBeep(MB_OK); + return false; + } + else + { + if(caseChange) + { + // Replace text and keep cursor position if there was a case conversion + int start, end; + wnd.GetSel(start, end); + wnd.SetWindowText(macroStr); + wnd.SetSel(start, end, true); + } + return true; + } +} + //////////////////////////////////////////////////////////////////////////////////////////// // Keyboard Control Modified: trunk/OpenMPT/mptrack/dlg_misc.h =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.h 2011-07-30 21:36:06 UTC (rev 946) +++ trunk/OpenMPT/mptrack/dlg_misc.h 2011-07-30 22:14:04 UTC (rev 947) @@ -152,6 +152,8 @@ CSoundFile *m_pSndFile; CModDoc *m_pModDoc; + bool ValidateMacroString(CEdit &wnd, char *lastMacro, bool isParametric); + void UpdateMacroList(int macro=-1); void ToggleBoxes(UINT preset, UINT sfx); virtual BOOL OnInitDialog(); @@ -159,6 +161,7 @@ afx_msg void UpdateDialog(); afx_msg void OnSetAsDefault(); afx_msg void OnResetCfg(); + afx_msg void OnMacroHelp(); afx_msg void OnEmbedMidiCfg(); afx_msg void OnSFxChanged(); afx_msg void OnSFxPresetChanged(); Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2011-07-30 21:36:06 UTC (rev 946) +++ trunk/OpenMPT/mptrack/mptrack.rc 2011-07-30 22:14:04 UTC (rev 947) @@ -299,12 +299,12 @@ END #endif // APSTUDIO_INVOKED -#endif // German (Germany) resources +#endif // Deutsch (Deutschland) resources ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources +// Englisch (USA) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 @@ -1228,6 +1228,7 @@ CONTROL "Embed macro configuration in file when saving",IDC_CHECK1, "Button",BS_AUTOCHECKBOX | BS_TOP | WS_TABSTOP,6,338,288,10 COMBOBOX IDC_MACROCC,63,257,111,111,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "Macro Help",IDC_BUTTON3,300,84,50,14 END IDD_CHORDEDIT DIALOGEX 0, 0, 245, 148 @@ -2524,12 +2525,12 @@ IDC_SAMPLE_XFADE "Crossfade Loop Points\nCrossfade between loop start and loop end to create seamless sample loops." END -#endif // English (U.S.) resources +#endif // Englisch (USA) resources ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// -// English (U.K.) resources +// Englisch (GB) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) #ifdef _WIN32 @@ -2902,7 +2903,7 @@ // IDR_BUILTIN_TUNINGS TUNING "res\\built-inTunings.tc" -#endif // English (U.K.) resources +#endif // Englisch (GB) resources ///////////////////////////////////////////////////////////////////////////// Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-07-30 21:36:06 UTC (rev 946) +++ trunk/OpenMPT/mptrack/version.h 2011-07-30 22:14:04 UTC (rev 947) @@ -13,8 +13,8 @@ //Version definitions. The only thing that needs to be changed when changing version number. #define VER_MAJORMAJOR 1 -#define VER_MAJOR 19 -#define VER_MINOR 03 +#define VER_MAJOR 20 +#define VER_MINOR 00 #define VER_MINORMINOR 00 //Creates version number from version parts that appears in version string. Modified: trunk/OpenMPT/soundlib/Snd_defs.h =================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h 2011-07-30 21:36:06 UTC (rev 946) +++ trunk/OpenMPT/soundlib/Snd_defs.h 2011-07-30 22:14:04 UTC (rev 947) @@ -403,10 +403,6 @@ INST_NUMFILTERMODES };*/ -// MIDI Macros -#define MACRO_MASK 0x7F5F7F5F -#define MACRO_INTERNAL 0x30463046 // internal macro (F0F0), controls lower 8 bits (f.e. cutoff, resonance, low plugin params) -#define MACRO_INTERNALEX 0x31463046 // internal extended macro (F0F1), controls higher 8 bits (high plugin params) // Vibrato Types enum VibratoType Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-07-30 21:36:06 UTC (rev 946) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-07-30 22:14:04 UTC (rev 947) @@ -457,7 +457,14 @@ for (CHANNELINDEX n = 0; n < m_nChannels; n++) { Chn[n].nGlobalVol = chnvols[n]; - if (notes[n]) Chn[n].nNewNote = notes[n]; + if (notes[n]) + { + Chn[n].nNewNote = notes[n]; + if(NOTE_IS_VALID(notes[n])) + { + Chn[n].nLastNote = notes[n]; + } + } if (instr[n]) Chn[n].nNewIns = instr[n]; if (vols[n] != 0xFF) { @@ -1539,7 +1546,10 @@ // Note Cut/Off/Fade => ignore instrument if (note >= NOTE_MIN_SPECIAL) instr = 0; - if ((note) && (note <= NOTE_MAX)) pChn->nNewNote = note; + if ((note) && (note <= NOTE_MAX)) + { + pChn->nNewNote = pChn->nLastNote = note; + } // New Note Action ? if ((note) && (note <= NOTE_MAX) && (!bPorta)) @@ -2125,14 +2135,14 @@ break; // Midi Controller - case CMD_MIDI: // Midi Controller (on first tick only) - case CMD_SMOOTHMIDI: // Midi Controller (smooth, i.e. on every tick) + 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((cmd == CMD_MIDI) && !(m_dwSongFlags & SONG_FIRSTTICK)) break; if (param < 0x80) - ProcessMidiMacro(nChn, (cmd == CMD_SMOOTHMIDI), m_MidiCfg.szMidiSFXExt[pChn->nActiveMacro], param); + ProcessMIDIMacro(nChn, (cmd == CMD_SMOOTHMIDI), m_MidiCfg.szMidiSFXExt[pChn->nActiveMacro], param); else - ProcessMidiMacro(nChn, (cmd == CMD_SMOOTHMIDI), m_MidiCfg.szMidiZXXExt[(param & 0x7F)], 0); + ProcessMIDIMacro(nChn, (cmd == CMD_SMOOTHMIDI), m_MidiCfg.szMidiZXXExt[(param & 0x7F)], 0);*/ break; // IMF Commands @@ -3049,121 +3059,219 @@ } -// Process a Midi Macro. +// 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) -//------------------------------------------------------------------------------------------ +// [in] macro: Actual MIDI Macro string +// [in] param: Parameter for parametric macros (Z00 - Z7F) +// [in] plugin: Plugin to send MIDI message to (if not specified but needed, it is autodetected) +void CSoundFile::ProcessMIDIMacro(CHANNELINDEX nChn, bool isSmooth, char *macro, uint8 param, PLUGINDEX plugin) +//------------------------------------------------------------------------------------------------------------- { - MODCHANNEL *pChn = &Chn[nChn]; - DWORD dwMacro = LittleEndian(*((DWORD *)pszMidiMacro)) & MACRO_MASK; - int nInternalCode; + const MODCHANNEL *pChn = &Chn[nChn]; + const MODINSTRUMENT *pIns = GetNumInstruments() ? pChn->pModInstrument : nullptr; - // Not Internal Device ? - if (dwMacro != MACRO_INTERNAL && dwMacro != MACRO_INTERNALEX) + unsigned char out[MACRO_LENGTH]; + size_t outPos = 0; // output buffer position, which also equals the number of complete bytes + bool firstNibble = true; + + for(size_t pos = 0; pos < MACRO_LENGTH && macro[pos]; pos++) { - // we don't cater for external devices at tick resolution. - if(isSmooth && !(m_dwSongFlags & SONG_FIRSTTICK)) + bool isNibble = false; // did we parse a nibble or a byte value? + unsigned char data = 0; // data that has just been parsed + + // Parse next macro byte... See Impulse Tracker's MIDI.TXT for detailed information on each possible character. + if(macro[pos] >= '0' && macro[pos] <= '9') { - return; + isNibble = true; + data = (unsigned char)macro[pos] - '0'; } + else if(macro[pos] >= 'A' && macro[pos] <= 'F') + { + isNibble = true; + data = (unsigned char)macro[pos] - 'A' + 0x0A; + } else if(macro[pos] == 'c') // c: MIDI channel + { + isNibble = true; + data = (unsigned char)GetBestMidiChan(pChn); + } else if(macro[pos] == 'n') // n: note value (last triggered note) + { + if(pChn->nLastNote != NOTE_NONE && NOTE_IS_VALID(pChn->nLastNote)) + { + data = (unsigned char)(pChn->nLastNote - NOTE_MIN); + } + } else if(macro[pos] == 'v') // v: velocity + { + data = (unsigned char)min(pChn->nVolume / 2, 127); - UINT pos = 0, nNib = 0, nBytes = 0; - DWORD dwMidiCode = 0, dwByteCode = 0; + } else if(macro[pos] == 'u') // u: volume (calculated) + { + data = (unsigned char)min(pChn->nCalcVolume >> 7, 127); + } else if(macro[pos] == 'x') // x: pan set + { + data = (unsigned char)min(pChn->nPan / 2, 127); + } else if(macro[pos] == 'y') // y: calculated pan + { + data = (unsigned char)min(pChn->nRealPan / 2, 127); + } else if(macro[pos] == 'a') // a: high byte of bank select + { + if(pIns && pIns->wMidiBank) + { + data = (unsigned char)(((pIns->wMidiBank - 1) >> 7) & 0x7F); + } + } else if(macro[pos] == 'b') // b: low byte of bank select + { + if(pIns && pIns->wMidiBank) + { + data = (unsigned char)((pIns->wMidiBank - 1) & 0x7F); + } + } else if(macro[pos] == 'p') // p: program select + { + if(pIns && pIns->nMidiProgram) + { + data = (unsigned char)((pIns->nMidiProgram - 1) & 0x7F); + } + } else if(macro[pos] == 'z') // z: macro data + { + data = (unsigned char)(param & 0x7F); + } else // unrecognized byte (f.e. space char) + { + continue; + } - while (pos + 6 <= 32) + // Append parsed data + if(isNibble) // parsed a nibble (constant or 'c' variable) { - 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 == '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(firstNibble) + { + out[outPos] = data; + } else + { + out[outPos] = (out[outPos] << 4) | data; + outPos++; + } + firstNibble = !firstNibble; + } else // parsed a byte (variable) + { + if(!firstNibble) // From MIDI.TXT: '9n' is exactly the same as '09 n' or '9 n' -- so finish current byte first + { + outPos++; + } + out[outPos++] = data; + firstNibble = true; + } + } + if(!firstNibble) + { + // Finish current byte + outPos++; + } - if (nNib >= 2) + if(outPos == 0) + { + // Nothing there to send! + return; + } + + // Macro string has been parsed and translated, now send the message(s)... + size_t sendPos = 0; + while(sendPos < outPos) + { + size_t sendLen = 0; + if(out[sendPos] == 0xF0) + { + // SysEx start + if((sendPos <= outPos - 4) && (out[sendPos + 1] == 0xF0 || out[sendPos + 1] == 0xF1)) { - nNib = 0; - dwMidiCode |= dwByteCode << (nBytes * 8); - dwByteCode = 0; - nBytes++; - - if (nBytes >= 3) + // Internal macro (normal (F0F0) or extended (F0F1)), 4 bytes long + sendLen = 4; + } else + { + // SysEx message, find end of message + for(size_t i = sendPos + 1; i < outPos; i++) { - UINT nMasterCh = (nChn < m_nChannels) ? nChn + 1 : pChn->nMasterChn; - if ((nMasterCh) && (nMasterCh <= m_nChannels)) + if(out[i] == 0xF7) { -// -> CODE#0015 -// -> DESC="channels management dlg" - 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)) - { - pPlugin->MidiSend(dwMidiCode); - } - } + // Found end of SysEx message + sendLen = i - sendPos + 1; + break; } - nBytes = 0; - dwMidiCode = 0; } + if(sendLen == 0) + { + // Didn't find end, so "invent" end of SysEx message + out[outPos++] = 0xF7; + sendLen = outPos - sendPos; + } } + } else + { + // Other MIDI messages, find beginning of next message + while(sendPos + (++sendLen) < outPos) + { + if((out[sendPos + sendLen] & 0x80) != 0) + { + // Next message begins here. + break; + } + } + } + if(sendLen == 0) + { + break; } - - return; + + size_t bytesSent = SendMIDIData(nChn, isSmooth, out + sendPos, sendLen, plugin); + // Ideally (if there's no error in the macro data), we should have sendLen == bytesSent. + if(bytesSent > 0) + { + sendPos += bytesSent; + } else + { + sendPos += sendLen; + } + } - // Internal device - const bool extendedParam = (dwMacro == MACRO_INTERNALEX); +} - 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; - if ((pszMidiMacro[1] >= '0') && (pszMidiMacro[1] <= '9')) nInternalCode += (pszMidiMacro[1] - '0'); else - if ((pszMidiMacro[1] >= 'A') && (pszMidiMacro[1] <= 'F')) nInternalCode += (pszMidiMacro[1] - 'A' + 0x0A); - // Filter ? - if (nInternalCode >= 0) + +// Process MIDI macro data parsed by ProcessMIDIMacro... return bytes sent on success, 0 on (parse) failure. +size_t CSoundFile::SendMIDIData(CHANNELINDEX nChn, bool isSmooth, const unsigned char *macro, size_t macroLen, PLUGINDEX plugin) +//------------------------------------------------------------------------------------------------------------------------------ +{ + if(macroLen < 1) { - CHAR cData1 = pszMidiMacro[2]; - DWORD dwParam = 0; + return 0; + } - if ((cData1 == 'z') || (cData1 == 'Z')) + MODCHANNEL *pChn = &Chn[nChn]; + + if(macro[0] == 0xF0 && (macro[1] == 0xF0 || macro[1] == 0xF1)) + { + // Internal device. + if(macroLen < 4) { - // 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); + return 0; } + const bool isExtended = (macro[1] == 0xF1); + const uint8 macroCode = macro[2]; + const uint8 param = macro[3]; - switch(nInternalCode) + switch(macroCode) { // F0.F0.00.xx: Set CutOff case 0x00: + if(!isExtended) { int oldcutoff = pChn->nCutOff; - if (dwParam < 0x80) + if(param < 0x80) { if(!isSmooth) { - pChn->nCutOff = dwParam; + pChn->nCutOff = param; } else { // on the first tick only, calculate step @@ -3171,7 +3279,7 @@ { 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; + pChn->m_nPlugParamValueStep = (float)((int)param - pChn->m_nPlugInitialParamValue) / (float)GetNumTicksOnCurrentRow(); } //update param on all ticks pChn->nCutOff = (BYTE) (pChn->m_nPlugInitialParamValue + (m_nTickCount + 1) * pChn->m_nPlugParamValueStep + 0.5); @@ -3180,61 +3288,71 @@ } #ifndef NO_FILTER oldcutoff -= pChn->nCutOff; - if (oldcutoff < 0) oldcutoff = -oldcutoff; - if ((pChn->nVolume > 0) || (oldcutoff < 0x10) + 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 + return 4; } break; - + // F0.F0.01.xx: Set Resonance case 0x01: - if (dwParam < 0x80) + if(!isExtended) { - pChn->nRestoreResonanceOnNewNote = 0; - if(!isSmooth) + if(param < 0x80) { - pChn->nResonance = dwParam; - } else - { - // on the first tick only, calculate step - if(m_dwSongFlags & SONG_FIRSTTICK) + pChn->nRestoreResonanceOnNewNote = 0; + if(!isSmooth) { - 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; + pChn->nResonance = param; + } else + { + // on the first 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)param - pChn->m_nPlugInitialParamValue) / (float)GetNumTicksOnCurrentRow(); + } + //update param on all ticks + pChn->nResonance = (BYTE) (pChn->m_nPlugInitialParamValue + (m_nTickCount + 1) * pChn->m_nPlugParamValueStep + 0.5); } - //update param on all ticks - pChn->nResonance = (BYTE) (pChn->m_nPlugInitialParamValue + (m_nTickCount + 1) * pChn->m_nPlugParamValueStep + 0.5); } - } - + #ifndef NO_FILTER - SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); + SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); #endif // NO_FILTER + return 4; + } break; // F0.F0.02.xx: Set filter mode (high nibble determines filter mode) case 0x02: - if (dwParam < 0x20) + if(!isExtended) { - pChn->nFilterMode = (dwParam >> 4); + if(param < 0x20) + { + pChn->nFilterMode = (param >> 4); #ifndef NO_FILTER - SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); + SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); #endif // NO_FILTER + } + return 4; } break; - // F0.F0.03.xx: Set plug dry/wet + // F0.F0.03.xx: Set plug dry/wet case 0x03: + if(!isExtended) { - const UINT nPlug = GetBestPlugin(nChn, PRIORITISE_CHANNEL, EVEN_IF_MUTED); - if ((nPlug) && (nPlug <= MAX_MIXPLUGINS) && dwParam < 0x80) + const PLUGINDEX nPlug = (plugin != 0) ? plugin : GetBestPlugin(nChn, PRIORITISE_CHANNEL, EVEN_IF_MUTED); + if ((nPlug) && (nPlug <= MAX_MIXPLUGINS) && param < 0x80) { if(!isSmooth) { - m_MixPlugins[nPlug - 1].fDryRatio = 1.0 - (static_cast<float>(dwParam) / 127.0f); + m_MixPlugins[nPlug - 1].fDryRatio = 1.0 - (static_cast<float>(param) / 127.0f); } else { // on the first tick only, calculate step @@ -3242,48 +3360,73 @@ { 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; + pChn->m_nPlugParamValueStep = ((1 - ((float)(param) / 127.0f)) - pChn->m_nPlugInitialParamValue) / (float)GetNumTicksOnCurrentRow(); } //update param on all ticks m_MixPlugins[nPlug - 1].fDryRatio = pChn->m_nPlugInitialParamValue + (float)(m_nTickCount + 1) * pChn->m_nPlugParamValueStep; } } + return 4; } break; - - // F0.F0.{80|n}.xx: Set VST effect parameter n to xx + // F0.F0.{80|n}.xx / F0.F1.n.xx: Set VST effect parameter n to xx default: - if (nInternalCode & 0x80 || extendedParam) + if((macroCode & 0x80) || isExtended) { - UINT nPlug = GetBestPlugin(nChn, PRIORITISE_CHANNEL, EVEN_IF_MUTED); - if ((nPlug) && (nPlug <= MAX_MIXPLUGINS)) + const PLUGINDEX nPlug = (plugin != 0) ? plugin : GetBestPlugin(nChn, PRIORITISE_CHANNEL, EVEN_IF_MUTED); + const UINT plugParam = isExtended ? (0x80 + macroCode) : (macroCode & 0x7F); + if((nPlug) && (nPlug <= MAX_MIXPLUGINS)) { IMixPlugin *pPlugin = m_MixPlugins[nPlug-1].pMixPlugin; - if ((pPlugin) && (m_MixPlugins[nPlug-1].pMixState)) + if((pPlugin) && (m_MixPlugins[nPlug-1].pMixState)) { if(!isSmooth) { - pPlugin->SetZxxParameter(extendedParam ? (0x80 + nInternalCode) : (nInternalCode & 0x7F), dwParam & 0x7F); + pPlugin->SetZxxParameter(plugParam, param & 0x7F); } else { // on the first tick only, calculate step if(m_dwSongFlags & SONG_FIRSTTICK) { - pChn->m_nPlugInitialParamValue = pPlugin->GetZxxParameter(extendedParam ? (0x80 + nInternalCode) : (nInternalCode & 0x7F)); + pChn->m_nPlugInitialParamValue = pPlugin->GetZxxParameter(plugParam); // (dwParam & 0x7F) extracts the actual value that we're going to pass - pChn->m_nPlugParamValueStep = ((int)(dwParam & 0x7F) - pChn->m_nPlugInitialParamValue) / (float)m_nMusicSpeed; + pChn->m_nPlugParamValueStep = ((int)(param & 0x7F) - pChn->m_nPlugInitialParamValue) / (float)GetNumTicksOnCurrentRow(); } //update param on all ticks - pPlugin->SetZxxParameter(extendedParam ? (0x80 + nInternalCode) : (nInternalCode & 0x7F), (UINT) (pChn->m_nPlugInitialParamValue + (m_nTickCount + 1) * pChn->m_nPlugParamValueStep + 0.5)); + pPlugin->SetZxxParameter(plugParam, (UINT) (pChn->m_nPlugInitialParamValue + (m_nTickCount + 1) * pChn->m_nPlugParamValueStep + 0.5)); } } } + return 4; } - - } // end switch - } // end internal device - + break; + } + } else + { + // Not an internal device. Pass on to appropriate plugin. + const UINT nMasterCh = (nChn < GetNumChannels()) ? nChn + 1 : pChn->nMasterChn; + if((nMasterCh) && (nMasterCh <= GetNumChannels())) + { + const PLUGINDEX nPlug = (pChn->dwFlags & CHN_NOFX) ? 0 : ((plugin != 0) ? plugin : GetBestPlugin(nChn, PRIORITISE_CHANNEL, EVEN_IF_MUTED)); + if((nPlug) && (nPlug <= MAX_MIXPLUGINS)) + { + IMixPlugin *pPlugin = m_MixPlugins[nPlug - 1].pMixPlugin; + if ((pPlugin) && (m_MixPlugins[nPlug - 1].pMixState)) + { + // currently, we don't support sending long MIDI messages in one go... split it up + for(size_t pos = 0; pos < macroLen; pos += 3) + { + DWORD curData = 0; + memcpy(&curData, macro + pos, min(3, macroLen - pos)); + pPlugin->MidiSend(curData); + } + } + } + } + return macroLen; + } + return 0; } @@ -3322,14 +3465,6 @@ if ((pChn->nRowNote >= NOTE_MIN) && (pChn->nRowNote <= NOTE_MAX)) { - /* if (bPorta) - pChn->nPos = param; - else - pChn->nPos += param; */ - // The code above doesn't make sense at all. If there's a note and no porta, how on earth could nPos be something else than 0? - // Anyway, keeping a debug assert here, just in case... - ASSERT(bPorta || pChn->nPos == 0); - // XM compatibility: Portamento + Offset = Ignore offset if(bPorta && IsCompatibleMode(TRK_FASTTRACKER2)) { Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2011-07-30 21:36:06 UTC (rev 946) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2011-07-30 22:14:04 UTC (rev 947) @@ -764,6 +764,12 @@ if ((m_nRestartPos >= Order.size()) || (Order[m_nRestartPos] >= Patterns.Size())) m_nRestartPos = 0; + // Fix old nasty broken (non-standard) MIDI configs in files. + if(m_dwLastSavedWithVersion && m_dwLastSavedWithVersion < MAKE_VERSION_NUMERIC(1, 20, 00, 00)) + { + FixMIDIConfigStrings(m_MidiCfg); + } + // plugin loader string sNotFound; std::list<PLUGINDEX> notFoundIDs; @@ -918,13 +924,13 @@ //----------------------------- { MemsetZero(m_MidiCfg); - lstrcpy(m_MidiCfg.szMidiGlb[MIDIOUT_START], "FF"); - lstrcpy(m_MidiCfg.szMidiGlb[MIDIOUT_STOP], "FC"); - lstrcpy(m_MidiCfg.szMidiGlb[MIDIOUT_NOTEON], "9c n v"); - lstrcpy(m_MidiCfg.szMidiGlb[MIDIOUT_NOTEOFF], "9c n 0"); - lstrcpy(m_MidiCfg.szMidiGlb[MIDIOUT_PROGRAM], "Cc p"); - lstrcpy(m_MidiCfg.szMidiSFXExt[0], "F0F000z"); - for (int iz=0; iz<16; iz++) wsprintf(m_MidiCfg.szMidiZXXExt[iz], "F0F001%02X", iz*8); + strcpy(m_MidiCfg.szMidiGlb[MIDIOUT_START], "FF"); + strcpy(m_MidiCfg.szMidiGlb[MIDIOUT_STOP], "FC"); + strcpy(m_MidiCfg.szMidiGlb[MIDIOUT_NOTEON], "9c n v"); + strcpy(m_MidiCfg.szMidiGlb[MIDIOUT_NOTEOFF], "9c n 0"); + strcpy(m_MidiCfg.szMidiGlb[MIDIOUT_PROGRAM], "Cc p"); + strcpy(m_MidiCfg.szMidiSFXExt[0], "F0F000z"); + CModDoc::CreateZxxFromType(m_MidiCfg.szMidiZXXExt, zxx_reso4Bit); } @@ -2902,3 +2908,38 @@ { m_bITBidiMode = IsCompatibleMode(TRK_IMPULSETRACKER); } + + +void FixMIDIConfigString(char *line) +//---------------------------------- +{ + for(size_t i = 0; i < MACRO_LENGTH; i++) + { + if(line[i] >= 'a' && line[i] <= 'f') // both A-F and a-f were treated as hex constants + { + line[i] = line[i] - 'a' + 'A'; + } else if(line[i] == 'K' || line[i] == 'k') // channel was K or k + { + line[i] = 'c'; + } else if(line[i] == 'X' || line[i] == 'x' || line[i] == 'Y' || line[i] == 'y') // those were pointless + { + line[i] = 'z'; + } + } +} + + +// Fix old-format (not conforming to IT's MIDI macro definitions) MIDI config strings. +void CSoundFile::FixMIDIConfigStrings(MODMIDICFG &midiCfg) +//-------------------------------------------------------- +{ + for(size_t i = 0; i < CountOf(midiCfg.szMidiSFXExt); i++) + { + FixMIDIConfigString(midiCfg.szMidiSFXExt[i]); + } + for(size_t i = 0; i < CountOf(midiCfg.szMidiZXXExt); i++) + { + FixMIDIConfigString(midiCfg.szMidiZXXExt[i]); + } +} + Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2011-07-30 21:36:06 UTC (rev 946) +++ trunk/OpenMPT/soundlib/Sndfile.h 2011-07-30 22:14:04 UTC (rev 947) @@ -211,6 +211,7 @@ LONG nRealVolume, nRealPan; LONG nVolume, nPan, nFadeOutVol; LONG nPeriod, nC5Speed, nPortamentoDest; + int nCalcVolume; // Calculated channel volume, 14-Bit (without global volume, pre-amp etc applied) - for MIDI macros MODINSTRUMENT *pModInstrument; // Currently assigned instrument slot MODCHANNEL_ENVINFO VolEnv, PanEnv, PitchEnv; // Envelope playback info MODSAMPLE *pModSample; // Currently assigned sample slot @@ -230,6 +231,7 @@ BYTE nRestoreResonanceOnNewNote; //Like above BYTE nRestoreCutoffOnNewNote; //Like above BYTE nNote, nNNA; + BYTE nLastNote; // Last note, ignoring note offs and cuts - for MIDI macros BYTE nNewNote, nNewIns, nCommand, nArpeggio; BYTE nOldVolumeSlide, nOldFineVolUpDown; BYTE nOldPortaUpDown, nOldFinePortaUpDown; @@ -453,9 +455,9 @@ #define MACRO_LENGTH 32 // max number of chars per macro struct MODMIDICFG { - CHAR szMidiGlb[9][MACRO_LENGTH]; - CHAR szMidiSFXExt[16][MACRO_LENGTH]; - CHAR szMidiZXXExt[128][MACRO_LENGTH]; + char szMidiGlb[9][MACRO_LENGTH]; // Global MIDI macros + char szMidiSFXExt[16][MACRO_LENGTH]; // Parametric MIDI macros + char szMidiZXXExt[128][MACRO_LENGTH]; // Fixed MIDI macros }; STATIC_ASSERT(sizeof(MODMIDICFG) == 4896); // this is directly written to files, so the size must be correct! @@ -778,6 +780,8 @@ bool ReadJ2B(const LPCBYTE lpStream, const DWORD dwMemLength); bool ReadMID(const LPCBYTE lpStream, DWORD dwMemLength); + static void FixMIDIConfigStrings(MODMIDICFG &midiCfg); + // Save Functions #ifndef MODPLUG_NO_FILESAVE UINT WriteSample(FILE *f, MODSAMPLE *pSmp, UINT nFlags, UINT nMaxLen=0); @@ -942,7 +946,9 @@ void ExtendedS3MCommands(UINT nChn, UINT param); void ExtendedChannelEffect(MODCHANNEL *, UINT param); inline void InvertLoop(MODCHANNEL* pChn); - void ProcessMidiMacro(UINT nChn, bool isSmooth, LPCSTR pszMidiMacro, UINT param = 0); + void ProcessMacroOnChannel(CHANNELINDEX nChn); + void ProcessMIDIMacro(CHANNELINDEX nChn, bool isSmooth, char *macro, uint8 param = 0, PLUGINDEX plugin = 0); + size_t SendMIDIData(CHANNELINDEX nChn, bool isSmooth, const unsigned char *macro, size_t macroLen, PLUGINDEX plugin); 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/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2011-07-30 21:36:06 UTC (rev 946) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2011-07-30 22:14:04 UTC (rev 947) @@ -1220,6 +1220,7 @@ pChn->dwFlags |= CHN_NOTEFADE; pChn->nFadeOutVol = 0; pChn->nRealVolume = 0; + pChn->nCalcVolume = 0; } } } @@ -1922,6 +1923,12 @@ // Check for unused channel if ((pChn->dwFlags & CHN_MUTE) || ((nChn >= m_nChannels) && (!pChn->nLength))) { + if(nChn < m_nChannels) + { + // Process MIDI macros on channels that are currently muted. + ProcessMacroOnChannel(nChn); + } + pChn->nVUMeter = 0; #ifdef ENABLE_STEREOVU pChn->nLeftVU = pChn->nRightVU = 0; @@ -1944,6 +1951,7 @@ // Reset channel data pChn->nInc = 0; pChn->nRealVolume = 0; + pChn->nCalcVolume = 0; pChn->nRampLength = 0; @@ -1955,7 +1963,11 @@ // Calc Frequency int period; - if (pChn->nPeriod && pChn->nLength) + + // Also process envelopes etc. when there's a plugin on this channel, for possible fake automation using volume and pan data. + // We only care about master channels, though, since automation only "happens" on them. + const bool plugAssigned = (nChn < m_nChannels) && (ChnSettings[nChn].nMixPlugin || (pChn->pModInstrument != nullptr && pChn->pModInstrument->nMixPlug)); + if ((pChn->nPeriod && pChn->nLength) || plugAssigned) { int vol = pChn->nVolume; @@ -2004,6 +2016,9 @@ pChn->nRealVolume = _muldiv(vol * m_nGlobalVolume, pChn->nGlobalVol * pChn->nInsVol, 1 << 20); } } + + pChn->nCalcVolume = vol; // Update calculated volume for MIDI macros + if (pChn->nPeriod < m_nMinPeriod) pChn->nPeriod = m_nMinPeriod; period = pChn->nPeriod; if ((pChn->dwFlags & (CHN_GLISSANDO|CHN_PORTAMENTO)) == (CHN_GLISSANDO|CHN_PORTAMENTO)) @@ -2021,6 +2036,14 @@ ProcessPanbrello(pChn); + } + + // Now that all relevant envelopes etc. have been processed, we can parse the MIDI macro data. + ProcessMacroOnChannel(nChn); + + // After MIDI macros have been processed, we can also process the pitch / filter envelope and other pitch-related things. + if (pChn->nPeriod && pChn->nLength) + { int nPeriodFrac = 0; ProcessPitchFilterEnvelope(pChn, period); @@ -2075,6 +2098,7 @@ pChn->nFadeOutVol = 0; pChn->dwFlags |= CHN_NOTEFADE; pChn->nRealVolume = 0; + pChn->nCalcVolume = 0; } UINT ninc = _muldiv(freq, 0x10000, gdwMixingFreq); @@ -2303,6 +2327,22 @@ } +void CSoundFile::ProcessMacroOnChannel(CHANNELINDEX nChn) +//------------------------------------------------------- +{ + MODCHANNEL *pChn = &Chn[nChn]; + if(nChn < m_nChannels && pChn->nRowCommand == CMD_MIDI || pChn->nRowCommand == CMD_SMOOTHMIDI) + { + // Only smooth MIDI macros are processed on every tick + if((pChn->nRowCommand == CMD_MIDI) && !(m_dwSongFlags & SONG_FIRSTTICK)) return; + if(pChn->nRowParam < 0x80) + ProcessMIDIMacro(nChn, (pChn->nRowCommand == CMD_SMOOTHMIDI), m_MidiCfg.szMidiSFXExt[pChn->nActiveMacro], pChn->nRowParam); + else + ProcessMIDIMacro(nChn, (pChn->nRowCommand == CMD_SMOOTHMIDI), m_MidiCfg.szMidiZXXExt[(pChn->nRowParam & 0x7F)], 0); + } +} + + #ifdef MODPLUG_TRACKER VOID CSoundFile::ProcessMidiOut(UINT nChn, MODCHANNEL *pChn) //rewbs.VSTdelay: added arg @@ -2329,6 +2369,7 @@ // Get instrument info and plugin reference MODINSTRUMENT *pIns = pChn->pModInstrument; + PLUGINDEX nPlugin = 0; IMixPlugin *pPlugin = nullptr; if ((instr) && (instr < MAX_INSTRUMENTS)) @@ -2339,7 +2380,7 @@ // Check instrument plugins if ((pIns->nMidiChannel >= 1) && (pIns->nMidiChannel <= 16)) { - UINT nPlugin = GetBestPlugin(nChn, PRIORITISE_INSTRUMENT, RESPECT_MUTES); + nPlugin = GetBestPlugin(nChn, PRIORITISE_INSTRUMENT, RESPECT_MUTES); if ((nPlugin) && (nPlugin <= MAX_MIXPLUGINS)) { pPlugin = m_MixPlugins[nPlugin-1].pMixPlugin; @@ -2387,6 +2428,8 @@ MODCOMMAND::NOTE realNote = note; if((note >= NOTE_MIN) && (note <= NOTE_MAX)) realNote = pIns->NoteMap[note - 1]; + // Experimental VST panning + //ProcessMIDIMacro(nChn, false, m_MidiCfg.szMidiGlb[MIDIOUT_PAN], 0, nPlugin); pPlugin->MidiCommand(pIns->nMidiChannel, pIns->nMidiProgram, pIns->wMidiBank, realNote, velocity, nChn); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-07-31 12:02:22
|
Revision: 949 http://modplug.svn.sourceforge.net/modplug/?rev=949&view=rev Author: saga-games Date: 2011-07-31 12:02:15 +0000 (Sun, 31 Jul 2011) Log Message: ----------- [Fix] Pattern amplify broke in revision 927. [Mod] 669 Loader: Extended song title. Revision Links: -------------- http://modplug.svn.sourceforge.net/modplug/?rev=927&view=rev Modified Paths: -------------- trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/soundlib/Load_669.cpp Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2011-07-31 09:45:11 UTC (rev 948) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-07-31 12:02:15 UTC (rev 949) @@ -2890,7 +2890,7 @@ } firstChannel++; } - if(CreateCursor(0, lastChannel << 3, useVolCol ? VOL_COLUMN : EFFECT_COLUMN) > (m_dwEndSel & 0xFFFF)) + if(CreateCursor(0, lastChannel, useVolCol ? VOL_COLUMN : EFFECT_COLUMN) > (m_dwEndSel & 0xFFFF)) { if(lastChannel == 0) { Modified: trunk/OpenMPT/soundlib/Load_669.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_669.cpp 2011-07-31 09:45:11 UTC (rev 948) +++ trunk/OpenMPT/soundlib/Load_669.cpp 2011-07-31 12:02:15 UTC (rev 949) @@ -69,8 +69,8 @@ m_nDefaultSpeed = 6; m_nChannels = 8; - memcpy(m_szNames[0], pfh->songmessage, 16); - SpaceToNullStringFixed<16>(m_szNames[0]); + memcpy(m_szNames[0], pfh->songmessage, min(MAX_SAMPLENAME - 1, 36)); + SpaceToNullStringFixed<min(MAX_SAMPLENAME - 1, 36)>(m_szNames[0]); m_nSamples = pfh->samples; for (SAMPLEINDEX nSmp = 1; nSmp <= m_nSamples; nSmp++, psmp++) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |