You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(10) |
Sep
|
Oct
|
Nov
|
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(1) |
Feb
(2) |
Mar
(3) |
Apr
(2) |
May
(10) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2008 |
Jan
(6) |
Feb
(4) |
Mar
(5) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(4) |
Aug
(6) |
Sep
(2) |
Oct
(9) |
Nov
(1) |
Dec
(4) |
| 2009 |
Jan
(9) |
Feb
(2) |
Mar
(2) |
Apr
(2) |
May
(6) |
Jun
(18) |
Jul
(33) |
Aug
(39) |
Sep
(33) |
Oct
(24) |
Nov
(23) |
Dec
(22) |
| 2010 |
Jan
(29) |
Feb
(32) |
Mar
(51) |
Apr
(17) |
May
(31) |
Jun
(21) |
Jul
(32) |
Aug
(28) |
Sep
(35) |
Oct
(27) |
Nov
(11) |
Dec
(13) |
| 2011 |
Jan
(14) |
Feb
(13) |
Mar
(27) |
Apr
(27) |
May
(28) |
Jun
(20) |
Jul
(43) |
Aug
(52) |
Sep
(66) |
Oct
(61) |
Nov
(11) |
Dec
(8) |
| 2012 |
Jan
(20) |
Feb
(30) |
Mar
(38) |
Apr
(21) |
May
(33) |
Jun
(21) |
Jul
(25) |
Aug
(9) |
Sep
(24) |
Oct
(42) |
Nov
(27) |
Dec
(41) |
| 2013 |
Jan
(20) |
Feb
(35) |
Mar
(156) |
Apr
(298) |
May
(258) |
Jun
(201) |
Jul
(105) |
Aug
(60) |
Sep
(193) |
Oct
(245) |
Nov
(280) |
Dec
(194) |
| 2014 |
Jan
(63) |
Feb
(202) |
Mar
(200) |
Apr
(23) |
May
(53) |
Jun
(105) |
Jul
(18) |
Aug
(26) |
Sep
(110) |
Oct
(187) |
Nov
(97) |
Dec
(74) |
| 2015 |
Jan
(45) |
Feb
(55) |
Mar
(116) |
Apr
(116) |
May
(193) |
Jun
(164) |
Jul
(50) |
Aug
(111) |
Sep
(98) |
Oct
(71) |
Nov
(103) |
Dec
(63) |
| 2016 |
Jan
(33) |
Feb
(101) |
Mar
(182) |
Apr
(139) |
May
(140) |
Jun
(103) |
Jul
(165) |
Aug
(286) |
Sep
(208) |
Oct
(127) |
Nov
(97) |
Dec
(54) |
| 2017 |
Jan
(64) |
Feb
(335) |
Mar
(202) |
Apr
(212) |
May
(139) |
Jun
(127) |
Jul
(294) |
Aug
(154) |
Sep
(170) |
Oct
(152) |
Nov
(156) |
Dec
(62) |
| 2018 |
Jan
(168) |
Feb
(237) |
Mar
(196) |
Apr
(174) |
May
(174) |
Jun
(161) |
Jul
(127) |
Aug
(88) |
Sep
(149) |
Oct
(66) |
Nov
(52) |
Dec
(135) |
| 2019 |
Jan
(146) |
Feb
(126) |
Mar
(104) |
Apr
(58) |
May
(60) |
Jun
(28) |
Jul
(197) |
Aug
(129) |
Sep
(141) |
Oct
(148) |
Nov
(63) |
Dec
(100) |
| 2020 |
Jan
(74) |
Feb
(37) |
Mar
(59) |
Apr
(154) |
May
(194) |
Jun
(133) |
Jul
(313) |
Aug
(197) |
Sep
(49) |
Oct
(162) |
Nov
(143) |
Dec
(57) |
| 2021 |
Jan
(120) |
Feb
(107) |
Mar
(314) |
Apr
(157) |
May
(524) |
Jun
(169) |
Jul
(72) |
Aug
(133) |
Sep
(135) |
Oct
(146) |
Nov
(198) |
Dec
(325) |
| 2022 |
Jan
(409) |
Feb
(249) |
Mar
(138) |
Apr
(95) |
May
(102) |
Jun
(221) |
Jul
(66) |
Aug
(120) |
Sep
(192) |
Oct
(131) |
Nov
(53) |
Dec
(171) |
| 2023 |
Jan
(357) |
Feb
(82) |
Mar
(168) |
Apr
(218) |
May
(196) |
Jun
(86) |
Jul
(115) |
Aug
(49) |
Sep
(190) |
Oct
(102) |
Nov
(45) |
Dec
(76) |
| 2024 |
Jan
(86) |
Feb
(50) |
Mar
(324) |
Apr
(209) |
May
(197) |
Jun
(232) |
Jul
(194) |
Aug
(247) |
Sep
(219) |
Oct
(266) |
Nov
(328) |
Dec
(304) |
| 2025 |
Jan
(191) |
Feb
(115) |
Mar
(137) |
Apr
(32) |
May
(126) |
Jun
(403) |
Jul
(213) |
Aug
(203) |
Sep
(148) |
Oct
(109) |
Nov
(191) |
Dec
(209) |
| 2026 |
Jan
(127) |
Feb
(123) |
Mar
(160) |
Apr
(141) |
May
(45) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <sag...@us...> - 2010-10-25 19:28:22
|
Revision: 751
http://modplug.svn.sourceforge.net/modplug/?rev=751&view=rev
Author: saga-games
Date: 2010-10-25 19:28:16 +0000 (Mon, 25 Oct 2010)
Log Message:
-----------
[Fix] XM compatibility: Portamento combined with an Offset command results in the offset command being ignored. I have commented out some code related to Offset that didn't make sense at all, but left a debug assertion there, in case it *did* make sense (which I doubt)
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Snd_fx.cpp
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-23 13:59:13 UTC (rev 750)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-25 19:28:16 UTC (rev 751)
@@ -3334,12 +3334,22 @@
}
// -! NEW_FEATURE#0010
- if ((pChn->nRowNote) && (pChn->nRowNote < 0x80))
+ if ((pChn->nRowNote >= NOTE_MIN) && (pChn->nRowNote <= NOTE_MAX))
{
- if (bPorta)
+ /* if (bPorta)
pChn->nPos = param;
else
- pChn->nPos += param;
+ 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))
+ {
+ return;
+ }
+
if (pChn->nPos >= pChn->nLength)
{
// Offset beyond sample size
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-23 13:59:20
|
Revision: 750
http://modplug.svn.sourceforge.net/modplug/?rev=750&view=rev
Author: saga-games
Date: 2010-10-23 13:59:13 +0000 (Sat, 23 Oct 2010)
Log Message:
-----------
[Mod] Updated History.txt to reflect the current state
Modified Paths:
--------------
trunk/OpenMPT/packageTemplate/History.txt
trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html
Modified: trunk/OpenMPT/packageTemplate/History.txt
===================================================================
--- trunk/OpenMPT/packageTemplate/History.txt 2010-10-23 13:34:19 UTC (rev 749)
+++ trunk/OpenMPT/packageTemplate/History.txt 2010-10-23 13:59:13 UTC (rev 750)
@@ -10,6 +10,95 @@
(tx XYZ): thanks to XYZ for telling us about the bug
+v1.19.xx.xx (October 2010, revision 748) not release yet
+--------------------------------------------------------
+Pattern tab
+ [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.
+ [Fix] <Jojo> Cursor paste was possible even when editing was disabled.
+ [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).
+ [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 S3M / IT.
+
+Sample tab
+ [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.
+
+Instrument tab
+ [Mod] <Jojo> Copying and pasting envelopes with no points isn't possible anymore. (Who wants to do that anyway?)
+ [Fix] <Jojo> Changing the filter mode didn't mark the file as modified.
+
+Mod Conversion
+ [Imp] <Jojo> When converting patterns from a format with instruments to a format without instruments (or when removing all instruments using the cleanup dialog), the instrument note mapping is now also taken care of.
+ [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.
+ [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
+ [Imp] <Jojo> Improved the algorithm for finding a free channel for note playback in the editor (does not affect normal module playback).
+
+IT
+ [New] <Jojo> Edit history information can now be read from IT files and saved to IT / MPTM files. This is based on an undocumented feature in Impulse Tracker. Use View -> Edit History for viewing or deleting this information.
+ [Imp] <Jojo> ITs made with Modplug Tracker 1.00a5 are now also detected as such.
+ [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 compatiblity-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> 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.
+
+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.
+ [New] <Jojo> Edit history information (read the "IT" section above for an explanation)
+
+XM
+ [Fix] <Jojo> XM Compatiblity: Various mind-boggling combinations of EDx, notes and instrument numbers should work correctly now.
+ [Fix] <Jojo> XM Compatiblity: 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 now.
+ [Fix] <Jojo> XM Loader: Fixed handling of instruments with no samples, so that instruments assigned to VST plugins work correctly.
+
+MOD
+ [Imp] <Jojo> It's now possible to create MOD files with more than 64 patterns. Just like in ProTracker, such MOD files are identified by the "M!K!" signature (instead of M.K.)
+ [Fix] <Jojo> The maximum speed for MOD files was off by one in some places (31 instead of 32).
+
+MOD::Loading
+ [New] <Jojo> Added a heuristic detection for VBlank MODs. Most MODs use the CIA timer instead of VBlank timing, but some don't.
+ [New] <Jojo> Added a 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> Added a heuristic detection for MODs with 7-bit panning, which is then automatically converted to 8-bit panning.
+
+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> Removed the X param (#) effect from the supported effect list.
+ [Fix] <Jojo> Speed and tempo values are now adjusted to what Screamtracker actually expects (speed 1 - 254, tempo 32 - 255) - anything out of this range is ignored by Screamtracker, so it is now also ignored by OpenMPT.
+
+VST
+ [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.
+ [Fix] <Jojo> VST: The time signature sent to VST plugins should be correct now.
+
+Other modules
+ [Imp] <Jojo> Garbage characters in sample / instrument / song names should be gone now.. This should f.e. avoid sample names like " ntitled" turning up in modules after deleting sample names.
+ [Imp] <Jojo> Improved handling of the note cut effect in PTM (Polytracker) files a bit.
+ [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.
+ [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.
+ [Imp] <Jojo> New keyboard shortcuts: Panic, View Edit History, Set Invalid / Ignore (--- / +++) Pattern (in the orderlist)
+ [Imp] <Jojo> Some improvements were made to the Registry / INI reading: If there were no Registry settings because MPT 1.16 was previously not installed, the INI file is now also read as it might contain some lines created by the installer.
+ [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.
+ [Fix] <Jojo> Mod Cleanup: Rearrange patterns was broken when using more than one sequence in the MPTM format. (tx Skaven)
+ [Fix] <Jojo> The text length was calculated wrong in the message reader, leading to a possible buffer overflow when reading song messages with mixed line endings where CR or LF line endings where expected.
+ [Fix] <Jojo> 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)
+ [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
@@ -84,7 +173,7 @@
Other modules
[Imp] <Jojo> Song messages are now loaded with more accuracy for some formats.
- [Imp] <Jojo> J2B Loader: J2B 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> 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.
@@ -106,14 +195,14 @@
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 (instead of just the library name) now.
+ [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> Sequence menu also allows to insert empty sequences 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
@@ -173,14 +262,14 @@
[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 if the module is an XM file.
+ [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 treeview.
+ [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.
@@ -227,7 +316,7 @@
[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 did stupid things to XM instrument headers, so mpt failed to load such modules. Tested the fix with a few hundred XMs and apparently only one XM (IFULOVE.XM) that I have has a header size that is different from the struct size - and that's the one that caused problems.
+ [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)
@@ -297,8 +386,8 @@
[Mod] <re> Updated default keybindings.
-v1.18.00.00 (January 2010, revision 475)
-----------------------------------------
+v1.18.00.00 (January 2010, revision 475) internal test build
+------------------------------------------------------------
General tab
[Fix] <Jojo> Channel name input field was not limited properly.
@@ -432,7 +521,7 @@
[Fix] <Jojo> The S3M format actually knows muted channels. This was not taken into account before.
XM::Loading
- [Imp] <Jojo> Allow to load modules with an empty order list (as they are, in fact, valid XM files).
+ [Imp] <Jojo> Allow to load modules with an empty orderlist (as they are, in fact, valid XM files).
XM::Playback compatibility
[Fix] <Jojo> Almost perfect arpeggio emulation (only a few notes are still wrong). Thanks, Ian Luck!
@@ -511,11 +600,11 @@
[Fix] <re> Fixes to handling of 32 chars long instrument name.
-v1.17.03.02 (test build) (September 2009, revision 371)
--------------------------------------------------------
+v1.17.03.02 (September 2009, revision 371) internal test build
+--------------------------------------------------------------
General tab
- [Imp] <Jojo> "Modtype" dialog will revert mod flags to previous values if user presses the Cancel button.
[Imp] <Jojo> Modtype Dialog: Added suffixes "IT" and "S3M" to some mod flags for more clarity.
+ [Fix] <Jojo> Modtype dialog will revert mod flags to previous values if user presses the Cancel button.
[Fix] <Jojo> VSTi / Sample volume sliders only go up to 255 instead of 256.
[Fix] <Jojo> Document will now be set modified when moving or inserting plugins.
@@ -633,9 +722,9 @@
[New] <re> Channel settings(vol&pan) for channels after 64 will now be saved in the file.
IT::Saving
+ [Imp] <Jojo> The row highlighting fields in the IT header are now used.
[Imp] <Jojo> Compatibility Export: Save with custom "tracker version" header field (same as for S3M).
[Imp] <Jojo> Compatibility Export: Removed stereo sample support.
- [Imp] <Jojo> Use row highlighting places in IT header.
[Fix] <Jojo> Compatibility Export: Ignore new MPT effects.
[Fix] <Jojo> Compatibility Export: doesn't screw up patterns anymore if the module has more than 64 channels.
[Fix] <Jojo> Compatibility Export: Changes various version numbers and settings in compatibility export to better match Impulse Tracker made IT files.
@@ -665,7 +754,7 @@
[Fix] <Jojo> Tempo slides won't exceed 255 BPM in compatible mode.
[Fix] <Jojo> Random waveforms (vibrato, tremolo, panbrello) (test #19).
[Fix] <Jojo> Fixed handling of very short pitch / filter envelopes (test #24).
- [Fix] <Jojo> Panning fx (Xxx, S8x, pxx) override pan swing (test #20).
+ [Fix] <Jojo> Panning effects (Xxx, S8x, pxx) override pan swing (test #20).
[Fix] <Jojo> SD0 / SC0 is now interpreted as SD1 / SC1 in compatibility mode (test #22).
[Fix] <Jojo> Portamento up / down resets the destination of tone portamento (test #23).
[Fix] <Jojo> Out of range global volume, local global volume slides.
@@ -673,16 +762,15 @@
S3M::Saving
[Imp] <Jojo> Orderlist is now as small as possible (multiple of 2 instead of multiple of 16); Using ST3's default UltraClick value.
[Imp] <Jojo> Using an own version number in the header now, just like all the other trackers.
- [Imp] <Jojo> Don't write unnecessary invalid order items in the order table.
[Fix] <Jojo> Ignore new MPT effects.
[Fix] <Jojo> Patterns are now saved correctly. Previously, the last few rows might have come up as garbage in ST3 when they were empty.
[Fix] <Jojo> Clamp sample pre-amp to [32;127] instead of just taking the lower 7 bits. (Default pre-amp value was 128, which resulted in pre-amp 0 when saving).
S3M::Loading
- [Fix] <Jojo> Limit min sample preamp value to 16.
+ [Imp] <Jojo> Smarter Zxx conversion without message box (heuristic detection).
+ [Fix] <Jojo> Limit minimum sample preamp value to 16.
[Fix] <Jojo> Small modifications to pattern loader to load somewhat broken S3M files (fix from xmp).
[Fix] <Jojo> Don't reset global volume to max if it is 0 for "new" S3M modules.
- [Fix] <Jojo> Smarter Zxx conversion without message box.
[Fix] <Jojo> Disable loop for sample with very short loop at the beginning.
[Fix] <Jojo> Samples with very short loops (2 bytes) will now load correctly. This fixes for example 94hitmix.s3m and spectral.s3m.
@@ -695,18 +783,18 @@
[New] <Jojo> Compatibility play-mode.
XM::Loading
- [New] <Jojo> Detects compatibility (i.e. modules not made with mpt) mode automatically when loading XM files.
+ [New] <Jojo> Compatibility mode is automatically enabled for XMs not made with MPT.
[Imp] <Jojo> Make XMs with strange pattern header sizes load correctly (removed some code that was there to make really, really broken XMs load - would this have worked at all?).
[Imp] <Jojo> Setting the "last saved with" version to 1.16 (instead of "created with") if module seems to be made with the old MPT.
[Fix] <Jojo> Various changes to make XMs that have been compressed with BoobieSqueezer load correctly.
- [Fix] <Jojo> Can now load XM Version 1.02 and 1.03 (rare).
- [Fix] <Jojo> Don't ignore last pattern if XM file has no instruments.
+ [Fix] <Jojo> Can now load XM version 1.02 and 1.03 (rare).
+ [Fix] <Jojo> Don't ignore last pattern anymore if an XM file has no instruments.
XM::Saving
[Imp] <Jojo> Compatibility export: Export cuts off channels > 32.
[Imp] <Jojo> Setting "OpenMPT <version number>" in the "made with" field (as any other tracker put their signature in here as well).
[Fix] <Jojo> Always save with a channel number that's a multiple of two so FT2 will load the file correctly.
- [Fix] <Jojo> F20 won't turn into G20.
+ [Fix] <Jojo> F20 won't turn into G20 anymore.
[Fix] <Jojo> Limit fadeout values properly.
[Fix] <Jojo> More intelligent conversion of Speed / Tempo commands.
@@ -819,10 +907,10 @@
[Fix] <re> Accidental moving when selecting order in margins shouldn't happen anymore. (rev 225)
[Fix] <re> Fix to possible crash when using undo after pattern resize (bug introduced in rev. 168)
- [Mod] <jojo> When applying "change instrument", won't add instrument number to note off/cut if the note doesn't have instrument already. (rev. 248)
+ [Mod] <jojo> When applying "change instrument", an instrument number won't be added to note off/cut anymore if the note doesn't already have an instrument. (rev. 248)
[Mod] <re> Default orderlist margin value can now be controlled with "DefaultSequenceMargins" ini-settings under "Pattern Editor" context. (rev 225)
[Mod] <jojo & re> Sequence view: Sequence scrolling won't no longer be cut on first '---' item on IT/MPTM/XM. (rev. 237)
- [Mod] <re> Pattern: The keyboard split 'feature' when entering chords is removed (bug 2790). (rev. 244)
+ [Fix] <re> Pattern: The keyboard split 'feature' when entering chords is removed (bug 2790). (rev. 244)
Sample tab
[New] <jojo> Can now normalize sample selections. (rev. 254)
@@ -869,7 +957,7 @@
[Fix] <jojo> Fix to handling a special case of Bxx and Dxx (bug 2769) (rev 241)
S3M
- [Fix] <re> S3M saving: Sequence of length 241-255 should now be cut to length 240 instead of ~16. (rev. 239)
+ [Fix] <re> S3M saving: Sequence of length 241-255 should now be cut to length 240 instead of 16. (rev. 239)
[Mod] <re> When loading S3M files which contain Zxx effects, user is now asked how to process them. (bug 2166) (rev. 233)
[Mod] <re> S3M saving: Saved sequence is no longer cut on first '---' item. (rev. 239)
@@ -887,15 +975,15 @@
v1.17.02.52 (14 Apr 2008, revision 210)
---------------------------------------
- [Fix] <re> Shouldn't need winhttp anymore(at least now that updatecheck is disabled). Dependency caused problems in Win98.
- [Fix] <re> Fix to faulty plug file existence check(introduced in 1.17.02.51)(http://lpchip.com/modplug/viewtopic.php?t=2255)
+ [Fix] <re> Shouldn't need winhttp anymore (at least now that updatecheck is disabled). Dependency caused problems in Win98.
+ [Fix] <re> Fix to faulty plug file existence check (introduced in 1.17.02.51)(http://lpchip.com/modplug/viewtopic.php?t=2255)
[Fix] <re> Sound card-options buffer length value validation.
[Fix] <re> In .51, muted channels were ignored completely in MIDI export. Now pattern effects are processed in muted channels.
[Fix] <re> IT style-playback fix
-v1.17.02.51 (29 Mar 2008, revision 208)
----------------------------------------
+v1.17.02.51 (29 Mar 2008, revision 208) internal test build
+-----------------------------------------------------------
[Fix] <re> Fix to crash when loading VST with long(>32) param name.
[Fix] <ma & re> Fix to possible memory corruption problem on handling VST with more than 30 outputs.
- VST with more than 32 outputs might still be handled poorly.
@@ -934,8 +1022,8 @@
[Mod] <re> Disabled setting channel pan for MOD/XM in general view.
-v1.17.02.50 (26 Jan 2008, revision 198)
----------------------------------------
+v1.17.02.50 (26 Jan 2008, revision 198) internal test build
+-----------------------------------------------------------
[Mod] <re> MIDICC bug related compatibility improvement for loading old IT/MPTm files.
[New] <re> MIDI controller mapping to plug params.
[New] <re> Ability to take MIDI volume into account when playing notes.
@@ -963,8 +1051,8 @@
[Mod] <re> Various validity checks for read data in ITP loading.
-v1.17.02.49 (17 Nov 2007, revision 194)
----------------------------------------
+v1.17.02.49 (17 Nov 2007, revision 194) internal test build
+-----------------------------------------------------------
[New] <re> Improved VST preset navigation in VST window. Known problem: doesn't update if preset is changed from VSTs own preset navigation.
[New] <re> Improvements in IT compatibility playmode. When loading ITs, if file doesn't seem modplug made, then automatically setting IT compatibility playmode. The playmode setting can be toggled in song properties dialog, and the autodetection with an ini setting.
[New] <re> 'key binding not understood'-messages can be disabled with an ini setting.
@@ -1244,7 +1332,7 @@
[Fix] <rewbs> Arpeggio with XM was messed up because implicit transposes were not always taken into account. I introduced this bug shortly after touching the code for the very first time, over a year ago. :) I dread to think what will fall appart now this is fixed.. XM users, test away!! :) (tx LPChip)
[Mod] <rewbs> Plugins are no longer forcefully informed of samplerate on first playback if it has not changed since initialisation. This works around a problem we were having with Crystal where the voice oscillator type soundfont was reset on the first playback. NB: it still gets reset if you explicitly change the samplerate - we're probably still doing something wrong. Have asked Crystal developper.
[Fix] <rewbs> Old IT files were loading with sample volume at 0.
- [Fix] <rewbs> Minor: Removed plugin clone button, corrected view menu to say "General" instead of "Global", implulse tracker version marker changed from "impulse tracker v3" to v8.88.
+ [Fix] <rewbs> Minor: Removed plugin clone button, corrected view menu to say "General" instead of "Global", Impulse Tracker version marker changed from "Impulse Tracker v3" to v8.88.
v1.17.02.25
@@ -1349,7 +1437,7 @@
[New] <rewbs> Interpolate notes. :)
[Fix] <rewbs> Fixed possible truncated lines in comments
[Fix] <rewbs> Fixed channel manager close bug - don't need to "open twice" anymore.
- [Fix] <rewbs> Restored old behaviour that I had accidentally broken: Ctrl-clicking a position in the order list will schedule it to play next.
+ [Fix] <rewbs> Restored old behaviour that I had accidentally broken: Ctrl-clicking a position in the orderlist will schedule it to play next.
[Fix] <rewbs> Fixed corrupt selection bug when mouse drags to the right of last channel.
[Fix] <rewbs> Fixed bug by which NNA'd notes originating from muted channels would still be audible.
[Fix] <rewbs> Changing VSTi preset from an instrument no longer forces reselection of current bank (perf improvement on some plugs)
@@ -1389,7 +1477,7 @@
v1.17RC1 (revision 1.13.2.16)
-----------------------------
[Fix] <rewbs> Fixed corrupt .mod when non existent pattern is listed in sequence.
- [Fix] <rewbs> Autosaver is automatically disabled when save fails.
+ [Fix] <rewbs> Autosaver is automatically disabled when autosave fails.
v1.17RC1 (revision 1.13.2.15)
@@ -1566,7 +1654,7 @@
[Mod] <rewbs> Zxx macro GUI total revamp
[Mod] <rewbs> Time stretcher GUI changes, stretch loop points
[New] <rewbs> new custom keys:
- - Toggle focus between pattern editor<->order list
+ - Toggle focus between pattern editor<->orderlist
- Open/Save/New instrument/sample (focus must be in bottom part
- Pattern editor copy and lose selection
[Mod] <ericus> GUI Cleanup
@@ -1766,4 +1854,4 @@
Questions/comments/bug reports?
-------------------------------
-Visit http://modplug.sourceforge.net/forum.
\ No newline at end of file
+Visit http://openmpt.org/ where you can find our bugtracker and forums.
\ No newline at end of file
Modified: trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html
===================================================================
--- trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2010-10-23 13:34:19 UTC (rev 749)
+++ trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2010-10-23 13:59:13 UTC (rev 750)
@@ -108,7 +108,7 @@
<li>More <strong>customisable colours</strong>. Now, you can export your favourite colour scheme to a file and share it with your friends!</li>
<li>Some <strong>new options</strong>, including the ability not to reset the channels when the module is looping and sample playback indicators in the treeview.</li>
<li><strong>Program settings</strong> are now stored in the Application Data folder by default.</li>
- <li>More <strong>intelligtent autosave</strong> behaviour, which does not autosave anymore if nothing has changed since the last autosave.
+ <li>More <strong>intelligent autosave</strong> behaviour, which does not autosave anymore if nothing has changed since the last autosave.
A friendly reminder: The autosave and backup options should always be enabled; You will be very glad about them once OpenMPT <i>really</i> crashes
or you accidentally overwrite a file.</li>
<li>New and <strong>updated keymaps</strong> with many new shortcuts!</li>
@@ -208,7 +208,7 @@
<h2>Contact</h2>
<p>
Helpful bug reports, new ideas and brave volunteers to test early development builds or contribute to the code are more than welcome!
- You can meet us at the ModPlug Central forums: <a href="http://openmpt.com/forum/">http://openmpt.com/forum/</a>.
+ You can meet us at the ModPlug Central forums: <a href="http://forum.openmpt.org/">http://forum.openmpt.org/</a>.
</p>
</body>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-23 13:34:28
|
Revision: 749
http://modplug.svn.sourceforge.net/modplug/?rev=749&view=rev
Author: saga-games
Date: 2010-10-23 13:34:19 +0000 (Sat, 23 Oct 2010)
Log Message:
-----------
[Mod] Link update :)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/MainFrm.cpp
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2010-10-22 16:00:37 UTC (rev 748)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2010-10-23 13:34:19 UTC (rev 749)
@@ -2782,16 +2782,16 @@
switch(nID)
{
-// case ID_NETLINK_MODPLUG: pszURL = "http://www.modplug.com"; break;
- case ID_NETLINK_OPENMPTWIKI:pszURL = "http://openmpt.xwiki.com/"; break;
+ case ID_NETLINK_MODPLUG: pszURL = "http://openmpt.org/"; break;
+ case ID_NETLINK_OPENMPTWIKI:pszURL = "http://wiki.openmpt.org/"; break;
// case ID_NETLINK_UT: pszURL = "http://www.united-trackers.org"; break;
// case ID_NETLINK_OSMUSIC: pszURL = "http://www.osmusic.net/"; break;
// case ID_NETLINK_HANDBOOK: pszURL = "http://www.modplug.com/mods/handbook/handbook.htm"; break;
case ID_NETLINK_MPTFR: pszURL = "http://mpt.new.fr/"; break;
- case ID_NETLINK_FORUMS: pszURL = "http://openmpt.com/forum/"; break;
+ case ID_NETLINK_FORUMS: pszURL = "http://forum.openmpt.org/"; break;
case ID_NETLINK_PLUGINS: pszURL = "http://www.kvraudio.com/"; break;
case ID_NETLINK_MODARCHIVE: pszURL = "http://modarchive.org/"; break;
- case ID_NETLINK_OPENMPTWIKI_GERMAN: pszURL = "http://sagamusix.de/openmpt/Hauptseite"; break;
+ case ID_NETLINK_OPENMPTWIKI_GERMAN: pszURL = "http://wikide.openmpt.org/Hauptseite"; break;
}
if (pszURL) return CTrackApp::OpenURL(pszURL);
return FALSE;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-22 16:00:45
|
Revision: 748
http://modplug.svn.sourceforge.net/modplug/?rev=748&view=rev
Author: saga-games
Date: 2010-10-22 16:00:37 +0000 (Fri, 22 Oct 2010)
Log Message:
-----------
[Reg] The "Position aware timer" option is gone. It is now always used. It was optional in the first place because of some buggy code, which is now fixed:
[Imp] Cleaned up the mess associated to GetLength and made the parameters more intuitive. As a result, GetLength is now only called once when changing to a different order or when exporting to WAV, instead of three calls.
[Fix] Order list: 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).
[Mod] OpenMPT: Version is now 1.19.00.10
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_seq.cpp
trunk/OpenMPT/mptrack/MainFrm.cpp
trunk/OpenMPT/mptrack/Mainfrm.h
trunk/OpenMPT/mptrack/Moddoc.cpp
trunk/OpenMPT/mptrack/Moddoc.h
trunk/OpenMPT/mptrack/Moptions.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/version.h
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndfile.cpp
trunk/OpenMPT/soundlib/Sndfile.h
Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-10-22 14:26:03 UTC (rev 747)
+++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2010-10-22 16:00:37 UTC (rev 748)
@@ -316,12 +316,15 @@
pSndFile->m_nCurrentPattern = m_nScrollPos;
pSndFile->SetCurrentOrder(m_nScrollPos);
pSndFile->m_dwSongFlags |= dwPaused;
- if (!(dwPaused & SONG_PATTERNLOOP)) pSndFile->GetLength(TRUE); // update channel parameters
+ //if (!(dwPaused & SONG_PATTERNLOOP)) // why?
+ {
+ // update channel parameters and play time
+ m_pModDoc->SetElapsedTime(m_nScrollPos, 0);
+ }
if (bIsPlaying) pMainFrm->ResetNotificationBuffer();
END_CRITICAL();
}
m_pParent->SetCurrentPattern(n);
- m_pModDoc->SetElapsedTime(m_nScrollPos, 0);
}
}
UpdateInfoText();
@@ -672,8 +675,8 @@
p += str.size();
*p++ = ' ';
}
- *p++ = 0x0D;
- *p++ = 0x0A;
+ *p++ = '\r';
+ *p++ = '\n';
*p = 0;
}
GlobalUnlock(hCpy);
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2010-10-22 14:26:03 UTC (rev 747)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2010-10-22 16:00:37 UTC (rev 748)
@@ -465,7 +465,7 @@
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)
- m_dwPatternSetup &= ~(0x200000|0x400000); // various deprecated old options
+ 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);
Modified: trunk/OpenMPT/mptrack/Mainfrm.h
===================================================================
--- trunk/OpenMPT/mptrack/Mainfrm.h 2010-10-22 14:26:03 UTC (rev 747)
+++ trunk/OpenMPT/mptrack/Mainfrm.h 2010-10-22 16:00:37 UTC (rev 748)
@@ -192,7 +192,7 @@
#define PATTERN_AUTODELAY 0x2000000 // automatically insert delay commands in pattern when entering notes
#define PATTERN_NOTEFADE 0x4000000 // alt. note fade behaviour when entering notes
#define PATTERN_OVERFLOWPASTE 0x8000000 // continue paste in the next pattern instead of cutting off
-#define PATTERN_POSITIONAWARETIMER 0x10000000 // try to set the timer in the statusbar when jumping around in modules
+//#define PATTERN_POSITIONAWARETIMER 0x10000000 // try to set the timer in the statusbar when jumping around in modules (deprecated, it generated too much load in the code due to some bugs, hence it was made optional. those bugs are now resolved, so there's no point in keeping this flag.)
#define PATTERN_RESETCHANNELS 0x20000000 // reset channels when looping
#define PATTERN_LIVEUPDATETREE 0x40000000 // update active sample / instr icons in treeview
Modified: trunk/OpenMPT/mptrack/Moddoc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-10-22 14:26:03 UTC (rev 747)
+++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-10-22 16:00:37 UTC (rev 748)
@@ -1587,8 +1587,8 @@
if (wsdlg.m_bSelectPlay)
{
m_SndFile.SetCurrentOrder(wsdlg.m_nMinOrder);
+ m_SndFile.GetLength(true, wsdlg.m_nMinOrder, 0);
m_SndFile.m_nCurrentPattern = wsdlg.m_nMinOrder;
- m_SndFile.GetLength(TRUE, FALSE);
m_SndFile.m_nMaxOrderPosition = wsdlg.m_nMaxOrder + 1;
}
if(dwcdlg.DoModal() != IDOK) break;
@@ -1597,8 +1597,10 @@
// Restore channels' flags
if(wsdlg.m_bChannelMode)
{
- for(int i = 0 ; i < nRenderPasses ; i++)
+ for(CHANNELINDEX i = 0; i < m_SndFile.GetNumChannels(); i++)
+ {
m_SndFile.ChnSettings[i].dwFlags = channelFlags[i];
+ }
}
// Restore instruments' / samples' flags
if(wsdlg.m_bInstrumentMode)
@@ -1619,7 +1621,6 @@
}
m_SndFile.SetCurrentPos(pos);
- m_SndFile.GetLength(TRUE);
CMainFrame::UpdateAudioParameters(TRUE);
}
@@ -1677,7 +1678,6 @@
dwcdlg.m_dwSongLimit = wsdlg.m_dwSongLimit;
dwcdlg.DoModal();
m_SndFile.SetCurrentPos(pos);
- m_SndFile.GetLength(TRUE);
CMainFrame::UpdateAudioParameters(TRUE);
}
@@ -3318,7 +3318,7 @@
END_CRITICAL();
// set playback timer in the status bar
- SetElapsedTime(nOrd, nRow, true);
+ SetElapsedTime(nOrd, nRow);
if (pModPlaying != this)
{
@@ -3373,7 +3373,7 @@
END_CRITICAL();
// set playback timer in the status bar
- SetElapsedTime(nOrd, nRow, true);
+ SetElapsedTime(nOrd, nRow);
if (pModPlaying != this) {
pMainFrm->PlayMod(this, followSonghWnd, m_dwNotifyType|MPTNOTIFY_POSITION|MPTNOTIFY_VUMETERS); //rewbs.fix2977
@@ -3431,7 +3431,7 @@
END_CRITICAL();
// set playback timer in the status bar
- SetElapsedTime(nOrd, nRow, true);
+ SetElapsedTime(nOrd, nRow);
if (pModPlaying != this)
{
@@ -3660,22 +3660,17 @@
}
-// Sets playback timer to playback time at given position. If 'bReset' is true,
-// timer is reset if playback position timer is not enabled.
-void CModDoc::SetElapsedTime(ORDERINDEX nOrd, ROWINDEX nRow, bool bReset)
-//-----------------------------------------------------------------------
+// Sets playback timer to playback time at given position.
+// At the same time, the playback parameters (global volume, channel volume and stuff like that) are calculated for this position.
+void CModDoc::SetElapsedTime(ORDERINDEX nOrd, ROWINDEX nRow)
+//----------------------------------------------------------
{
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
if(pMainFrm == NULL)
return;
- if(CMainFrame::m_dwPatternSetup & PATTERN_POSITIONAWARETIMER)
- {
- double dPatternPlaytime = max(0, m_SndFile.GetPlaybackTimeAt(nOrd, nRow));
- pMainFrm->SetElapsedTime((DWORD) (dPatternPlaytime * 1000));
- }
- else if(bReset)
- pMainFrm->ResetElapsedTime();
+ const double dPatternPlaytime = m_SndFile.GetPlaybackTimeAt(nOrd, nRow, false);
+ pMainFrm->SetElapsedTime((DWORD) (max(0, dPatternPlaytime) * 1000));
}
Modified: trunk/OpenMPT/mptrack/Moddoc.h
===================================================================
--- trunk/OpenMPT/mptrack/Moddoc.h 2010-10-22 14:26:03 UTC (rev 747)
+++ trunk/OpenMPT/mptrack/Moddoc.h 2010-10-22 16:00:37 UTC (rev 748)
@@ -306,7 +306,7 @@
void TogglePluginEditor(UINT m_nCurrentPlugin); //rewbs.patPlugNames
void RecordParamChange(int slot, long param);
void LearnMacro(int macro, long param);
- void SetElapsedTime(ORDERINDEX nOrd, ROWINDEX nRow, bool bReset = false);
+ void SetElapsedTime(ORDERINDEX nOrd, ROWINDEX nRow);
bool RemoveChannels(bool bChnMask[MAX_BASECHANNELS]);
Modified: trunk/OpenMPT/mptrack/Moptions.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moptions.cpp 2010-10-22 14:26:03 UTC (rev 747)
+++ trunk/OpenMPT/mptrack/Moptions.cpp 2010-10-22 16:00:37 UTC (rev 748)
@@ -554,7 +554,8 @@
LPCSTR pszListName, pszDescription;
} OPTGENDESC;
-enum {
+enum
+{
OPTGEN_PLAYNEWNOTES=0,
OPTGEN_PLAYEDITROW,
OPTGEN_CENTERROW,
@@ -606,10 +607,9 @@
{PATTERN_OLDCTXMENUSTYLE, "Old style pattern context menu", "Check this option to hide unavailable items in the pattern editor context menu. Uncheck to grey-out unavailable items instead."},
{PATTERN_SYNCMUTE, "Maintain sample sync on mute", "Samples continue to be processed when channels are muted (like in IT2 and FT2)"},
{PATTERN_AUTODELAY, "Automatic delay commands", "Automatically insert appropriate note-delay commands when recording notes during live playback."},
- {PATTERN_NOTEFADE, "Note fade on key up", "Enable to fade/stop notes on key up in pattern tab." },
+ {PATTERN_NOTEFADE, "Note fade on key up", "Enable to fade / stop notes on key up in pattern tab." },
{PATTERN_OVERFLOWPASTE, "Overflow paste mode", "Wrap pasted pattern data into next pattern. This is useful for creating echo channels."},
- {PATTERN_POSITIONAWARETIMER, "Position aware timer", "If enabled, timer will show the playback position time if possible instead of running timer."},
- {PATTERN_RESETCHANNELS, "Reset channels on loop", "If enabled, channels will be reset to their initial state when song looping is enabled.\nNote: This does not affect manual song loops (i.e. triggered by pattern commands)"},
+ {PATTERN_RESETCHANNELS, "Reset channels on loop", "If enabled, channels will be reset to their initial state when song looping is enabled.\nNote: This does not affect manual song loops (i.e. triggered by pattern commands) and is recommended to be enabled."},
{PATTERN_LIVEUPDATETREE,"Update sample status in tree", "If enabled, active samples and instruments will be indicated by a different icon in the treeview."}
};
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2010-10-22 14:26:03 UTC (rev 747)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-10-22 16:00:37 UTC (rev 748)
@@ -5410,7 +5410,7 @@
ORDERINDEX currentOrder = SendCtrlMessage(CTRLMSG_GETCURRENTORDER);
if(pSndFile->Order[currentOrder] == m_nPattern)
{
- const double t = pSndFile->GetPlaybackTimeAt(currentOrder, m_nRow);
+ const double t = pSndFile->GetPlaybackTimeAt(currentOrder, m_nRow, true);
if(t < 0)
msg.Format("Unable to determine the time. Possible cause: No order %d, row %d found from play sequence", currentOrder, m_nRow);
else
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2010-10-22 14:26:03 UTC (rev 747)
+++ trunk/OpenMPT/mptrack/version.h 2010-10-22 16:00:37 UTC (rev 748)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 00
-#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 2010-10-22 14:26:03 UTC (rev 747)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-22 16:00:37 UTC (rev 748)
@@ -73,17 +73,26 @@
}
*/
-double CSoundFile::GetLength(BOOL bAdjust, BOOL bTotal)
-//-------------------------------------------
+double CSoundFile::GetLength(bool bAdjust, ORDERINDEX endOrder, ROWINDEX endRow)
+//------------------------------------------------------------------------------
{
bool dummy = false;
- double result = GetLength(dummy, bAdjust, bTotal);
- InitializeVisitedRows(true); // forget that we went over the whole module.
+ double result = GetLength(dummy, bAdjust, endOrder, endRow);
+ if(!bAdjust)
+ {
+ InitializeVisitedRows(true); // forget that we went over the whole module.
+ }
return result;
}
-double CSoundFile::GetLength(bool& targetReached, BOOL bAdjust, BOOL bTotal, ORDERINDEX endOrder, ROWINDEX endRow)
-//----------------------------------------------------------------------------------------------------------------
+
+// Get mod length in various cases. Parameters:
+// &targetReached: Will be set to true if the specified order/row combination has been reached while going through the module.
+// bAdjust: If enabled, the mod parameters (such as global volume, speed, tempo, etc...) will be memorized (if the target has been reached) when leaving the function (i.e. they won't be reset to the previous values)
+// endOrder: Order which should be reached (ORDERINDEX_INVALID means whole song)
+// endRow: Row in that order that should be reached
+double CSoundFile::GetLength(bool& targetReached, bool bAdjust, ORDERINDEX endOrder, ROWINDEX endRow)
+//---------------------------------------------------------------------------------------------------
{
// -> CODE#0022
// -> DESC="alternative BPM/Speed interpretation method"
@@ -96,7 +105,6 @@
double dElapsedTime=0.0;
// -! NEW_FEATURE#0022
UINT nMusicSpeed = m_nDefaultSpeed, nMusicTempo = m_nDefaultTempo, nNextRow = 0;
- UINT nMaxRow = 0, nMaxPattern = 0;
LONG nGlbVol = m_nDefaultGlobalVolume, nOldGlbVolSlide = 0;
vector<BYTE> instr;
vector<UINT> notes;
@@ -114,8 +122,6 @@
patloop.resize(m_nChannels, 0);
patloopstart.resize(m_nChannels, 0);
for(CHANNELINDEX icv = 0; icv < m_nChannels; icv++) chnvols[icv] = ChnSettings[icv].nVolume;
- nMaxRow = m_nNextRow;
- nMaxPattern = m_nNextPattern;
nCurrentPattern = nNextPattern = 0;
nPattern = Order[0];
nRow = nNextRow = 0;
@@ -192,18 +198,6 @@
for(UINT ipck = 0; ipck < m_nChannels; ipck++)
patloop[ipck] = dElapsedTime;
}
- if (!bTotal)
- {
- if ((nCurrentPattern > nMaxPattern) || ((nCurrentPattern == nMaxPattern) && (nRow >= nMaxRow)))
- {
- if (bAdjust)
- {
- m_nMusicSpeed = nMusicSpeed;
- m_nMusicTempo = nMusicTempo;
- }
- break;
- }
- }
MODCHANNEL *pChn = Chn;
MODCOMMAND *p = Patterns[nPattern] + nRow * m_nChannels;
@@ -222,7 +216,7 @@
{
// Position Jump
case CMD_POSITIONJUMP:
- positionJumpOnThisRow=true;
+ positionJumpOnThisRow = true;
nNextPattern = (ORDERINDEX)param;
nNextPatStartRow = 0; // FT2 E60 bug
// see http://lpchip.com/modplug/viewtopic.php?t=2769 - FastTracker resets Dxx if Bxx is called _after_ Dxx
@@ -430,17 +424,20 @@
case tempo_mode_alternative:
dElapsedTime += 60000.0 / (1.65625 * (double)(nMusicSpeed * nMusicTempo)); break;
case tempo_mode_modern:
- dElapsedTime += 60000.0/(double)nMusicTempo / (double)m_nCurrentRowsPerBeat; break;
+ dElapsedTime += 60000.0 / (double)nMusicTempo / (double)m_nCurrentRowsPerBeat; break;
case tempo_mode_classic: default:
dElapsedTime += (2500.0 * (double)nSpeedCount) / (double)nMusicTempo;
}
}
- if ((bAdjust) && (!bTotal))
+ // Store final variables
+ if (bAdjust && (targetReached || endOrder == ORDERINDEX_INVALID || endRow == ROWINDEX_INVALID))
{
m_nGlobalVolume = nGlbVol;
m_nOldGlbVolSlide = nOldGlbVolSlide;
- for (UINT n=0; n<m_nChannels; n++)
+ m_nMusicSpeed = nMusicSpeed;
+ m_nMusicTempo = nMusicTempo;
+ for (CHANNELINDEX n = 0; n < m_nChannels; n++)
{
Chn[n].nGlobalVol = chnvols[n];
if (notes[n]) Chn[n].nNewNote = notes[n];
Modified: trunk/OpenMPT/soundlib/Sndfile.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-10-22 14:26:03 UTC (rev 747)
+++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-10-22 16:00:37 UTC (rev 748)
@@ -3052,11 +3052,12 @@
return false;
}
-double CSoundFile::GetPlaybackTimeAt(ORDERINDEX ord, ROWINDEX row)
-//----------------------------------------------------------------
+
+double CSoundFile::GetPlaybackTimeAt(ORDERINDEX ord, ROWINDEX row, bool resetVars)
+//--------------------------------------------------------------------------------
{
bool targetReached = false;
- const double t = GetLength(targetReached, FALSE, TRUE, ord, row);
+ const double t = GetLength(targetReached, !resetVars, ord, row);
if(targetReached) return t;
else return -1; //Given position not found from play sequence.
}
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2010-10-22 14:26:03 UTC (rev 747)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2010-10-22 16:00:37 UTC (rev 748)
@@ -494,8 +494,9 @@
public: //Misc
void ChangeModTypeTo(const MODTYPE& newType);
- //Returns value in seconds. If given position won't be played at all, returns -1.
- double GetPlaybackTimeAt(ORDERINDEX, ROWINDEX);
+ // Returns value in seconds. If given position won't be played at all, returns -1.
+ // If resetVars is true, the state of various playback variables will be retained.
+ double GetPlaybackTimeAt(ORDERINDEX ord, ROWINDEX row, bool resetVars);
uint16 GetModFlags() const {return m_ModFlags;}
void SetModFlags(const uint16 v) {m_ModFlags = v;}
@@ -676,15 +677,15 @@
UINT GetMusicSpeed() const { return m_nMusicSpeed; }
UINT GetMusicTempo() const { return m_nMusicTempo; }
- double GetLength(BOOL bAdjust, BOOL bTotal=FALSE);
+ double GetLength(bool bAdjust, ORDERINDEX ord = ORDERINDEX_MAX, ROWINDEX row = ROWINDEX_MAX);
private:
//Get modlength in various cases: total length, length to
//specific order&row etc. Return value is in seconds.
- double GetLength(bool& targetReached, BOOL bAdjust, BOOL bTotal=FALSE, ORDERINDEX ord = ORDERINDEX_MAX, ROWINDEX row = ROWINDEX_MAX);
+ double GetLength(bool& targetReached, bool bAdjust, ORDERINDEX ord, ROWINDEX row);
public:
//Returns song length in seconds.
- DWORD GetSongTime() { return static_cast<DWORD>((m_nTempoMode == tempo_mode_alternative) ? GetLength(FALSE, TRUE)+1.0 : GetLength(FALSE, TRUE)+0.5); }
+ DWORD GetSongTime() { return static_cast<DWORD>((m_nTempoMode == tempo_mode_alternative) ? GetLength(false) + 1.0 : GetLength(false) + 0.5); }
void SetRepeatCount(int n) { m_nRepeatCount = n; }
int GetRepeatCount() const { return m_nRepeatCount; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-22 14:26:10
|
Revision: 747
http://modplug.svn.sourceforge.net/modplug/?rev=747&view=rev
Author: saga-games
Date: 2010-10-22 14:26:03 +0000 (Fri, 22 Oct 2010)
Log Message:
-----------
[Fix] Pattern Editor: Cursor paste was possible even when editing was disabled.
[Fix] Pattern Editor: Fixed new "play whole row" play mode again (it was affected by some race conditions in the player code)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_pat.cpp
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2010-10-22 14:25:30 UTC (rev 746)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-10-22 14:26:03 UTC (rev 747)
@@ -2082,7 +2082,7 @@
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
CModDoc *pModDoc = GetDocument();
- if ((pModDoc) && (pMainFrm))
+ if ((pModDoc) && (pMainFrm) && (IsEditingEnabled_bmsg()))
{
PrepareUndo(m_dwBeginSel, m_dwEndSel);
UINT nChn = (m_dwCursor & 0xFFFF) >> 3;
@@ -3237,19 +3237,19 @@
{
switch(dwMidiData & 0xFF)
{
- case 0xFA: //Start song
- if(GetDocument())
- GetDocument()->OnPlayerPlayFromStart();
+ case 0xFA: //Start song
+ if(GetDocument())
+ GetDocument()->OnPlayerPlayFromStart();
break;
- case 0xFB: //Continue song
- if(GetDocument())
- GetDocument()->OnPlayerPlay();
+ case 0xFB: //Continue song
+ if(GetDocument())
+ GetDocument()->OnPlayerPlay();
break;
- case 0xFC: //Stop song
- if(GetDocument())
- GetDocument()->OnPlayerStop();
+ case 0xFC: //Stop song
+ if(GetDocument())
+ GetDocument()->OnPlayerStop();
break;
}
}
@@ -4195,6 +4195,7 @@
if ((pModDoc) && (pMainFrm))
{
+ bool modified = false;
ROWINDEX nRow = m_nRow;
CSoundFile *pSndFile = pModDoc->GetSoundFile();
const ROWINDEX nRowPlayback = pSndFile->m_nRow;
@@ -4222,7 +4223,6 @@
return;
BYTE recordGroup = pModDoc->IsChannelRecord(nChn);
- UINT nPlayIns = 0;
const bool bIsLiveRecord = IsLiveRecord(*pMainFrm, *pModDoc, *pSndFile);
const bool usePlaybackPosition = (bIsLiveRecord && (CMainFrame::m_dwPatternSetup & PATTERN_AUTODELAY) && !(pSndFile->m_dwSongFlags & SONG_STEP));
//Param control 'note'
@@ -4258,17 +4258,15 @@
SetEditPos(*pSndFile, nRow, nPat, nRowPlayback, nPatPlayback);
// -- Work out where to put the new note
- MODCOMMAND* p = pSndFile->Patterns[nPat].GetpModCommand(nRow, nChn);
+ MODCOMMAND *pTarget = pSndFile->Patterns[nPat].GetpModCommand(nRow, nChn);
+ MODCOMMAND newcmd = *pTarget;
- //take backup copy of the command we're about to overwrite
- const MODCOMMAND oldcmd = *p;
-
// If record is enabled, create undo point.
if(bRecordEnabled)
pModDoc->GetPatternUndo()->PrepareUndo(nPat, nChn, nRow, 1, 1);
// -- write note and instrument data.
- const bool isSplit = HandleSplit(p, note);
+ const bool isSplit = HandleSplit(&newcmd, note);
// Nice idea actually: Use lower section of the keyboard to play chords (but it won't work 100% correctly this way...)
/*if(isSplit)
@@ -4292,51 +4290,63 @@
if(volWrite != -1)
{
- if(pSndFile->GetType() == MOD_TYPE_MOD)
+ if(pSndFile->GetModSpecifications().HasVolCommand(VOLCMD_VOLUME))
{
- p->command = CMD_VOLUME;
- p->param = (MODCOMMAND::PARAM)volWrite;
+ newcmd.volcmd = VOLCMD_VOLUME;
+ newcmd.vol = (MODCOMMAND::VOL)volWrite;
} else
{
- p->volcmd = VOLCMD_VOLUME;
- p->vol = (MODCOMMAND::VOL)volWrite;
+ newcmd.command = CMD_VOLUME;
+ newcmd.param = (MODCOMMAND::PARAM)volWrite;
}
}
// -- write sdx if playing live
if (usePlaybackPosition && nTick) // avoid SD0 which will be mis-interpreted
{
- if (p->command == CMD_NONE) //make sure we don't overwrite any existing commands.
+ if (newcmd.command == CMD_NONE) //make sure we don't overwrite any existing commands.
{
- p->command = (pSndFile->TypeIsS3M_IT_MPT()) ? CMD_S3MCMDEX : CMD_MODCMDEX;
+ newcmd.command = (pSndFile->TypeIsS3M_IT_MPT()) ? CMD_S3MCMDEX : CMD_MODCMDEX;
UINT maxSpeed = 0x0F;
if(pSndFile->m_nMusicSpeed > 0) maxSpeed = min(0x0F, pSndFile->m_nMusicSpeed - 1);
- p->param = 0xD0 + min(maxSpeed, nTick);
+ newcmd.param = 0xD0 + min(maxSpeed, nTick);
}
}
- // -- old style note cut/off: erase instrument number
- if (oldStyle && ((p->note == NOTE_NOTECUT) || (p->note == NOTE_KEYOFF) || (p->note == NOTE_FADE)))
- p->instr=0;
+ // -- old style note cut/off/fade: erase instrument number
+ if (oldStyle && newcmd.note >= NOTE_MIN_SPECIAL)
+ newcmd.instr = 0;
+
+ // -- if recording, write out modified command.
+ if (bRecordEnabled && *pTarget != newcmd)
+ {
+ *pTarget = newcmd;
+ modified = true;
+ }
+
+
// -- play note
if ((CMainFrame::m_dwPatternSetup & (PATTERN_PLAYNEWNOTE|PATTERN_PLAYEDITROW)) || (!bRecordEnabled))
{
- if ((CMainFrame::m_dwPatternSetup & PATTERN_PLAYEDITROW) && !bIsLiveRecord)
+ const bool playWholeRow = ((CMainFrame::m_dwPatternSetup & PATTERN_PLAYEDITROW) && !bIsLiveRecord);
+ if (playWholeRow)
{
// play the whole row in "step mode"
PatternStep(false);
- } else
+ }
+ if (!playWholeRow || !bRecordEnabled)
{
- // just play the newly inserted note...
- if (p->instr)
+ // NOTE: This code is *also* used for the PATTERN_PLAYEDITROW edit mode because of some unforseeable race conditions when modifying pattern data.
+ // We have to use this code when editing is disabled or else we will get some stupid hazards, because we would first have to write the new note
+ // data to the pattern and then remove it again - but often, it is actually removed before the row is parsed by the soundlib.
+
+ // just play the newly inserted note using the already specified instrument...
+ UINT nPlayIns = newcmd.instr;
+ if(!nPlayIns && (note <= NOTE_MAX))
{
- // ...using the already specified instrument
- nPlayIns = p->instr;
- } else if ((!p->instr) && (p->note <= NOTE_MAX))
- {
// ...or one that can be found on a previous row of this pattern.
- MODCOMMAND *search = p;
+ MODCOMMAND *search = pTarget;
UINT srow = nRow;
while (srow-- > 0)
{
@@ -4351,24 +4361,10 @@
}
BOOL bNotPlaying = ((pMainFrm->GetModPlaying() == pModDoc) && (pMainFrm->IsPlaying())) ? FALSE : TRUE;
//pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, -1, 0, 0, nChn); //rewbs.vstiLive - added extra args
- pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, 4*vol, 0, 0, nChn); //rewbs.vstiLive - added extra args
-/* for (UINT kplchrd=0; kplchrd<nPlayChord; kplchrd++)
- {
- if (chordplaylist[kplchrd])
- {
- pModDoc->PlayNote(chordplaylist[kplchrd], nPlayIns, 0, FALSE, -1, 0, 0, nChn); //rewbs.vstiLive - - added extra args
- m_dwStatus |= PATSTATUS_CHORDPLAYING;
- }
- }
-*/
+ pModDoc->PlayNote(newcmd.note, nPlayIns, 0, bNotPlaying, 4*vol, 0, 0, nChn); //rewbs.vstiLive - added extra args
}
}
- //-- if not recording, restore old command.
- if (bRecordEnabled == false)
- {
- *p = oldcmd;
- }
// -- if recording, handle post note entry behaviour (move cursor etc..)
if(bRecordEnabled)
@@ -4380,7 +4376,7 @@
sel &= ~7;
}
- if(*p != oldcmd) //has it really changed?
+ if(modified) //has it really changed?
{
pModDoc->SetModified();
if(bIsLiveRecord == false)
@@ -4410,8 +4406,8 @@
}
BYTE* activeNoteMap = isSplit ? splitActiveNoteChannel : activeNoteChannel;
- if (p->note <= NOTE_MAX)
- activeNoteMap[p->note] = nChn;
+ if (newcmd.note <= NOTE_MAX)
+ activeNoteMap[newcmd.note] = nChn;
//Move to next channel if required
if (recordGroup)
@@ -4464,15 +4460,17 @@
pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, nChn, m_nRow, pSndFile->GetNumChannels(), 1);
const PatternRow prowbase = pSndFile->Patterns[m_nPattern].GetRow(m_nRow);
- MODCOMMAND* p = &prowbase[nChn];
-
+ MODCOMMAND* pTarget = &prowbase[nChn];
// Save old row contents
- vector<MODCOMMAND> oldrow(pSndFile->GetNumChannels());
- for(CHANNELINDEX nChn = 0; nChn < pSndFile->GetNumChannels(); nChn++)
+ vector<MODCOMMAND> newrow(pSndFile->GetNumChannels());
+ for(CHANNELINDEX n = 0; n < pSndFile->GetNumChannels(); n++)
{
- oldrow[nChn] = prowbase[nChn];
+ newrow[n] = prowbase[n];
}
+ // This is being written to
+ MODCOMMAND* p = &newrow[nChn];
+
const bool bIsLiveRecord = IsLiveRecord(*pMainFrm, *pModDoc, *pSndFile);
const bool bRecordEnabled = IsEditingEnabled();
@@ -4516,9 +4514,9 @@
{
if ((nchordch != nChn) && recordGroup && (currentRecordGroup == recordGroup) && (n <= NOTE_MAX))
{
- prowbase[nchordch].note = n;
- if (p->instr) prowbase[nchordch].instr = p->instr;
- if(prowbase[nchordch] != oldrow[nchordch])
+ newrow[nchordch].note = n;
+ if (p->instr) newrow[nchordch].instr = p->instr;
+ if(prowbase[nchordch] != newrow[nchordch])
{
modified = true;
}
@@ -4539,16 +4537,41 @@
}
+ // -- write notedata
+ if(bRecordEnabled)
+ {
+ DWORD sel = (m_nRow << 16) | m_dwCursor;
+ SetCurSel(sel, sel);
+ sel &= ~7;
+ if(modified)
+ {
+ for(CHANNELINDEX n = 0; n < pSndFile->GetNumChannels(); n++)
+ {
+ prowbase[n] = newrow[n];
+ }
+ pModDoc->SetModified();
+ InvalidateRow();
+ UpdateIndicator();
+ }
+ }
+
+
// -- play note
if ((CMainFrame::m_dwPatternSetup & (PATTERN_PLAYNEWNOTE|PATTERN_PLAYEDITROW)) || (!bRecordEnabled))
{
- if ((CMainFrame::m_dwPatternSetup & PATTERN_PLAYEDITROW) && !bIsLiveRecord)
+ const bool playWholeRow = ((CMainFrame::m_dwPatternSetup & PATTERN_PLAYEDITROW) && !bIsLiveRecord);
+ if (playWholeRow)
{
// play the whole row in "step mode"
PatternStep(false);
- } else
+ }
+ if (!playWholeRow || !bRecordEnabled)
{
+ // NOTE: This code is *also* used for the PATTERN_PLAYEDITROW edit mode because of some unforseeable race conditions when modifying pattern data.
+ // We have to use this code when editing is disabled or else we will get some stupid hazards, because we would first have to write the new note
+ // data to the pattern and then remove it again - but often, it is actually removed before the row is parsed by the soundlib.
// just play the newly inserted notes...
+
if (p->instr)
{
// ...using the already specified instrument
@@ -4556,7 +4579,7 @@
} else if ((!p->instr) && (p->note <= NOTE_MAX))
{
// ...or one that can be found on a previous row of this pattern.
- MODCOMMAND *search = p;
+ MODCOMMAND *search = pTarget;
UINT srow = m_nRow;
while (srow-- > 0)
{
@@ -4583,27 +4606,6 @@
} // end play note
- // -- write notedata
- if(bRecordEnabled)
- {
- DWORD sel = (m_nRow << 16) | m_dwCursor;
- SetCurSel(sel, sel);
- sel &= ~7;
- if(modified)
- {
- pModDoc->SetModified();
- InvalidateRow();
- UpdateIndicator();
- }
- } else
- {
- // recording disabled
- for(CHANNELINDEX nChn = 0; nChn < pSndFile->GetNumChannels(); nChn++)
- {
- prowbase[nChn] = oldrow[nChn];
- }
- }
-
// Set new cursor position (row spacing) - only when not recording live
if (bRecordEnabled && !bIsLiveRecord)
{
@@ -4777,28 +4779,32 @@
{
CModDoc *pModDoc = GetDocument(); if (!pModDoc) return false;
- if (note > pModDoc->GetSplitKeyboardSettings()->splitNote)
+ MODCOMMAND::INSTR ins = GetCurrentInstrument();
+ bool isSplit = false;
+
+ if(pModDoc->GetSplitKeyboardSettings()->IsSplitActive())
{
- p->note = note;
- UINT nins = GetCurrentInstrument();
- if (nins)
- p->instr = nins;
- return false;
+ if(note <= pModDoc->GetSplitKeyboardSettings()->splitNote)
+ {
+ isSplit = true;
+
+ if (pModDoc->GetSplitKeyboardSettings()->octaveLink && note <= NOTE_MAX)
+ {
+ note += 12 * pModDoc->GetSplitKeyboardSettings()->octaveModifier;
+ note = CLAMP(note, NOTE_MIN, NOTE_MAX);
+ }
+ if (pModDoc->GetSplitKeyboardSettings()->splitInstrument)
+ {
+ p->instr = pModDoc->GetSplitKeyboardSettings()->splitInstrument;
+ }
+ }
}
- else
- {
- if (pModDoc->GetSplitKeyboardSettings()->splitInstrument)
- p->instr = pModDoc->GetSplitKeyboardSettings()->splitInstrument;
- else
- if(GetCurrentInstrument()) p->instr = GetCurrentInstrument();
- if (pModDoc->GetSplitKeyboardSettings()->octaveLink)
- note += 12 * pModDoc->GetSplitKeyboardSettings()->octaveModifier;
- if (note > NOTE_MAX && note < NOTE_MIN_SPECIAL) note = NOTE_MAX;
- if (note < 0) note = 1;
+
+ p->note = note;
+ if(ins)
+ p->instr = ins;
- p->note = note;
- return true;
- }
+ return isSplit;
}
bool CViewPattern::BuildPluginCtxMenu(HMENU hMenu, UINT nChn, CSoundFile* pSndFile)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-22 14:25:36
|
Revision: 746
http://modplug.svn.sourceforge.net/modplug/?rev=746&view=rev
Author: saga-games
Date: 2010-10-22 14:25:30 +0000 (Fri, 22 Oct 2010)
Log Message:
-----------
[Fix] XM Loader: Fixed handling of instruments with no samples, so that instruments assigned to VST plugins work correctly.
[Imp] PTM Loader: Improved handling of the note cut effect a bit.
[Ref] J2B Loader: Replaced some numbers by their #defined macros
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_ptm.cpp
trunk/OpenMPT/soundlib/Load_xm.cpp
trunk/OpenMPT/soundlib/load_j2b.cpp
Modified: trunk/OpenMPT/soundlib/Load_ptm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_ptm.cpp 2010-10-22 14:24:48 UTC (rev 745)
+++ trunk/OpenMPT/soundlib/Load_ptm.cpp 2010-10-22 14:25:30 UTC (rev 746)
@@ -177,6 +177,15 @@
{
ConvertModCommand(&m[nChn]);
MODExx2S3MSxx(&m[nChn]);
+ // Note cut does just mute the sample, not cut it. We have to fix that, if possible.
+ if(m[nChn].command == CMD_S3MCMDEX && (m[nChn].param & 0xF0) == 0xC0 && m[nChn].volcmd == VOLCMD_NONE)
+ {
+ // SCx => v00 + SDx
+ // This is a pretty dumb solution because many (?) PTM files make usage of the volume column + note cut at the same time.
+ m[nChn].param = 0xD0 | (m[nChn].param & 0x0F);
+ m[nChn].volcmd = VOLCMD_VOLUME;
+ m[nChn].vol = 0;
+ }
} else
{
switch(m[nChn].command)
Modified: trunk/OpenMPT/soundlib/Load_xm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_xm.cpp 2010-10-22 14:24:48 UTC (rev 745)
+++ trunk/OpenMPT/soundlib/Load_xm.cpp 2010-10-22 14:25:30 UTC (rev 746)
@@ -327,6 +327,8 @@
memcpy(Instruments[iIns]->name, pih.name, 22);
SpaceToNullStringFixed(Instruments[iIns]->name, 22);
+ memset(&xmsh, 0, sizeof(XMSAMPLEHEADER));
+
if ((nsamples = pih.samples) > 0)
{
/* we have samples, so let's read the rest of this instrument
@@ -336,7 +338,6 @@
if (dwMemPos + ihsize >= dwMemLength)
return true;
- memset(&xmsh, 0, sizeof(XMSAMPLEHEADER));
memcpy(&xmsh,
lpStream + dwMemPos + sizeof(XMINSTRUMENTHEADER),
min(ihsize - sizeof(XMINSTRUMENTHEADER), sizeof(XMSAMPLEHEADER)));
@@ -355,15 +356,11 @@
if(xmsh.midichannel != 0 || xmsh.midienabled != 0 || xmsh.midiprogram != 0 || xmsh.mutecomputer != 0 || xmsh.pitchwheelrange != 0)
bIsFT2 = true; // definitely not MPT. (or any other tracker)
- dwMemPos += LittleEndian(pih.size);
- } else
- {
- if (LittleEndian(pih.size))
- dwMemPos += LittleEndian(pih.size);
- else
- dwMemPos += sizeof(XMINSTRUMENTHEADER);
- continue;
}
+ if (LittleEndian(pih.size))
+ dwMemPos += LittleEndian(pih.size);
+ else
+ dwMemPos += sizeof(XMINSTRUMENTHEADER);
memset(samplemap, 0, sizeof(samplemap));
if (nsamples > 32) return true;
Modified: trunk/OpenMPT/soundlib/load_j2b.cpp
===================================================================
--- trunk/OpenMPT/soundlib/load_j2b.cpp 2010-10-22 14:24:48 UTC (rev 745)
+++ trunk/OpenMPT/soundlib/load_j2b.cpp 2010-10-22 14:25:30 UTC (rev 746)
@@ -478,7 +478,7 @@
{
case AMCHUNKID_MAIN: // "MAIN" - Song info (AMFF)
case AMCHUNKID_INIT: // "INIT" - Song info (AM)
- if((LittleEndian(chunkheader->signature) == 0x4E49414D && !bIsAM) || (LittleEndian(chunkheader->signature) == 0x54494E49 && bIsAM))
+ if((LittleEndian(chunkheader->signature) == AMCHUNKID_MAIN && !bIsAM) || (LittleEndian(chunkheader->signature) == AMCHUNKID_INIT && bIsAM))
{
ASSERT_CAN_READ_CHUNK(sizeof(AMFFCHUNK_MAIN));
AMFFCHUNK_MAIN *mainchunk = (AMFFCHUNK_MAIN *)(lpStream + dwMemPos);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-22 14:24:55
|
Revision: 745
http://modplug.svn.sourceforge.net/modplug/?rev=745&view=rev
Author: saga-games
Date: 2010-10-22 14:24:48 +0000 (Fri, 22 Oct 2010)
Log Message:
-----------
[Mod] VST Editor: When automatically inserting a new instrument, the bank and patch values are now not filled in anymore, so it is easier to change to another patch while editing.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/AbstractVstEditor.cpp
Modified: trunk/OpenMPT/mptrack/AbstractVstEditor.cpp
===================================================================
--- trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2010-10-22 14:24:19 UTC (rev 744)
+++ trunk/OpenMPT/mptrack/AbstractVstEditor.cpp 2010-10-22 14:24:48 UTC (rev 745)
@@ -380,8 +380,9 @@
strncpy(pIns->filename, pSndFile->m_MixPlugins[m_pVstPlugin->GetSlot()].Info.szLibraryName, ARRAYELEMCOUNT(pIns->filename) - 1);
pIns->nMixPlug = (PLUGINDEX)m_pVstPlugin->GetSlot() + 1;
pIns->nMidiChannel = 1;
- pIns->wMidiBank = (WORD)((m_pVstPlugin->GetCurrentProgram() >> 7) + 1);
- pIns->nMidiProgram = (BYTE)((m_pVstPlugin->GetCurrentProgram() & 0x7F) + 1);
+ // People will forget to change this anyway, so the following lines can lead to some bad surprises after re-opening the module.
+ //pIns->wMidiBank = (WORD)((m_pVstPlugin->GetCurrentProgram() >> 7) + 1);
+ //pIns->nMidiProgram = (BYTE)((m_pVstPlugin->GetCurrentProgram() & 0x7F) + 1);
pModDoc->UpdateAllViews(NULL, (nIns << HINT_SHIFT_INS) | HINT_INSTRUMENT | HINT_INSNAMES | HINT_ENVELOPE | (bFirst ? HINT_MODTYPE : 0));
if(pSndFile->GetModSpecifications().supportsPlugins)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-22 14:24:25
|
Revision: 744
http://modplug.svn.sourceforge.net/modplug/?rev=744&view=rev
Author: saga-games
Date: 2010-10-22 14:24:19 +0000 (Fri, 22 Oct 2010)
Log Message:
-----------
[Fix] S3M Compatibility: Speed and tempo values to what ST3 actually expects and adjusted the loader code to how ST3 would react to out-of-range speed and tempo values.
[Fix] S3M Specs: Removed the X param (#) effect from the supported effect list.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Ctrl_gen.cpp
trunk/OpenMPT/soundlib/Load_s3m.cpp
trunk/OpenMPT/soundlib/mod_specifications.h
Modified: trunk/OpenMPT/mptrack/Ctrl_gen.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2010-10-16 21:06:10 UTC (rev 743)
+++ trunk/OpenMPT/mptrack/Ctrl_gen.cpp 2010-10-22 14:24:19 UTC (rev 744)
@@ -92,8 +92,16 @@
// -> CODE#0016
// -> DESC="default tempo update"
// m_SpinTempo.SetRange(32, 255); // 255 bpm max
- m_SpinTempo.SetRange((short)specs.tempoMin, (short)specs.tempoMax);
- m_SpinSpeed.SetRange((short)specs.speedMin, (short)specs.speedMax);
+ // S3M HACK
+ if(m_pSndFile->GetType() & MOD_TYPE_S3M)
+ {
+ m_SpinTempo.SetRange(33, 255);
+ m_SpinSpeed.SetRange(1, 25);
+ } else
+ {
+ m_SpinTempo.SetRange((short)specs.tempoMin, (short)specs.tempoMax);
+ m_SpinSpeed.SetRange((short)specs.speedMin, (short)specs.speedMax);
+ }
// -! BEHAVIOUR_CHANGE#0016
m_SpinGlobalVol.SetRange(0, 128);
m_SpinSamplePA.SetRange(0, 2000);
Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-10-16 21:06:10 UTC (rev 743)
+++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-10-22 14:24:19 UTC (rev 744)
@@ -270,10 +270,11 @@
SpaceToNullStringFixed(m_szNames[0], 28);
// Speed
m_nDefaultSpeed = psfh.speed;
- if (!m_nDefaultSpeed) m_nDefaultSpeed = 6;
+ if (!m_nDefaultSpeed || m_nDefaultSpeed == 255) m_nDefaultSpeed = 6;
// Tempo
m_nDefaultTempo = psfh.tempo;
- m_nDefaultTempo = CLAMP(m_nDefaultTempo, 32, 255);
+ //m_nDefaultTempo = CLAMP(m_nDefaultTempo, 32, 255);
+ if(m_nDefaultTempo < 33) m_nDefaultTempo = 125;
// Global Volume
m_nDefaultGlobalVolume = psfh.globalvol << 2;
if(!m_nDefaultGlobalVolume && psfh.cwtv < 0x1320) m_nDefaultGlobalVolume = MAX_GLOBAL_VOLUME; // not very reliable, but it fixes a few tunes
Modified: trunk/OpenMPT/soundlib/mod_specifications.h
===================================================================
--- trunk/OpenMPT/soundlib/mod_specifications.h 2010-10-16 21:06:10 UTC (rev 743)
+++ trunk/OpenMPT/soundlib/mod_specifications.h 2010-10-22 14:24:19 UTC (rev 744)
@@ -331,7 +331,7 @@
false, // No song comments
0, // No instrument envelopes
false, // No envelope release node
- " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\?#", // Supported Effects
+ " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\??", // Supported Effects
" vp?????????????", // Supported Volume Column commands
true, // Has "+++" pattern
false, // Doesn't have restart position (order)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-16 21:06:16
|
Revision: 743
http://modplug.svn.sourceforge.net/modplug/?rev=743&view=rev
Author: saga-games
Date: 2010-10-16 21:06:10 +0000 (Sat, 16 Oct 2010)
Log Message:
-----------
[Fix] IT Loader: IT files with no samples made OpenMPT crash since rev.730
[Mod] Edit History: Dialog also shows total edit count now.
Modified Paths:
--------------
trunk/OpenMPT/mptrack/dlg_misc.cpp
trunk/OpenMPT/soundlib/Load_it.cpp
Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-10-16 00:26:47 UTC (rev 742)
+++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-10-16 21:06:10 UTC (rev 743)
@@ -3139,12 +3139,17 @@
SetDlgItemText(IDC_EDIT_HISTORY, s);
// Total edit time
- totalTime = (uint64)((double)(totalTime) / HISTORY_TIMER_PRECISION);
- s.Format(_T("Total edit time: %lluh %02llum %02llus"), totalTime / 3600, (totalTime / 60) % 60, totalTime % 60);
- SetDlgItemText(IDC_TOTAL_EDIT_TIME, s);
- // Window title
- s.Format(_T("Edit history for %s"), m_pModDoc->GetTitle());
- SetWindowText(s);
+ s = "";
+ if(totalTime)
+ {
+ totalTime = (uint64)((double)(totalTime) / HISTORY_TIMER_PRECISION);
+
+ s.Format(_T("Total edit time: %lluh %02llum %02llus (%u session%s)"), totalTime / 3600, (totalTime / 60) % 60, totalTime % 60, num, (num != 1) ? _T("s") : _T(""));
+ SetDlgItemText(IDC_TOTAL_EDIT_TIME, s);
+ // Window title
+ s.Format(_T("Edit history for %s"), m_pModDoc->GetTitle());
+ SetWindowText(s);
+ }
// Enable or disable Clear button
GetDlgItem(IDC_BTN_CLEAR)->EnableWindow((m_pModDoc->GetFileHistory()->empty()) ? FALSE : TRUE);
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2010-10-16 00:26:47 UTC (rev 742)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-10-16 21:06:10 UTC (rev 743)
@@ -904,7 +904,11 @@
// In order to properly compute the position, in file, of eventual extended settings
// such as "attack" we need to keep the "real" size of the last sample as those extra
// setting will follow this sample in the file
- UINT lastSampleOffset = smppos[min(0, pifh->smpnum - 1)] + sizeof(ITSAMPLESTRUCT);
+ UINT lastSampleOffset = 0;
+ if(pifh->smpnum > 0)
+ {
+ lastSampleOffset = smppos[pifh->smpnum - 1] + sizeof(ITSAMPLESTRUCT);
+ }
// -! NEW_FEATURE#0027
// Reading Samples
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-16 00:26:54
|
Revision: 742
http://modplug.svn.sourceforge.net/modplug/?rev=742&view=rev
Author: saga-games
Date: 2010-10-16 00:26:47 +0000 (Sat, 16 Oct 2010)
Log Message:
-----------
[Fix] Playing instruments in the pattern while recording is disabled is now possible again (broke with the new "play whole row" setting)
[Mod] OpenMPT: Version is now 1.19.00.09
Modified Paths:
--------------
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/version.h
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2010-10-15 20:50:52 UTC (rev 741)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-10-16 00:26:47 UTC (rev 742)
@@ -4319,12 +4319,6 @@
if (oldStyle && ((p->note == NOTE_NOTECUT) || (p->note == NOTE_KEYOFF) || (p->note == NOTE_FADE)))
p->instr=0;
- //-- if not recording, restore old command.
- if (bRecordEnabled == false)
- {
- *p = oldcmd;
- }
-
// -- play note
if ((CMainFrame::m_dwPatternSetup & (PATTERN_PLAYNEWNOTE|PATTERN_PLAYEDITROW)) || (!bRecordEnabled))
{
@@ -4370,6 +4364,12 @@
}
}
+ //-- if not recording, restore old command.
+ if (bRecordEnabled == false)
+ {
+ *p = oldcmd;
+ }
+
// -- if recording, handle post note entry behaviour (move cursor etc..)
if(bRecordEnabled)
{
@@ -4411,7 +4411,7 @@
BYTE* activeNoteMap = isSplit ? splitActiveNoteChannel : activeNoteChannel;
if (p->note <= NOTE_MAX)
- activeNoteMap[p->note]=nChn;
+ activeNoteMap[p->note] = nChn;
//Move to next channel if required
if (recordGroup)
@@ -4466,7 +4466,12 @@
const PatternRow prowbase = pSndFile->Patterns[m_nPattern].GetRow(m_nRow);
MODCOMMAND* p = &prowbase[nChn];
- const MODCOMMAND oldcmd = *p; // This is the command we are about to overwrite
+ // Save old row contents
+ vector<MODCOMMAND> oldrow(pSndFile->GetNumChannels());
+ for(CHANNELINDEX nChn = 0; nChn < pSndFile->GetNumChannels(); nChn++)
+ {
+ oldrow[nChn] = prowbase[nChn];
+ }
const bool bIsLiveRecord = IsLiveRecord(*pMainFrm, *pModDoc, *pSndFile);
const bool bRecordEnabled = IsEditingEnabled();
@@ -4479,9 +4484,10 @@
UINT baseoctave = pMainFrm->GetBaseOctave();
UINT nchord = note - baseoctave * 12 - 1;
UINT nNote;
- if (nchord < 3*12)
+ bool modified = false;
+ if (nchord < 3 * 12)
{
- UINT nchordnote = pChords[nchord].key + baseoctave*12 + 1;
+ UINT nchordnote = pChords[nchord].key + baseoctave * 12 + 1;
// Rev. 244, commented the isSplit conditions below, can't see the point in it.
//if (isSplit)
// nchordnote = pChords[nchord].key + baseoctave*(p->note%12) + 1;
@@ -4512,38 +4518,26 @@
{
prowbase[nchordch].note = n;
if (p->instr) prowbase[nchordch].instr = p->instr;
+ if(prowbase[nchordch] != oldrow[nchordch])
+ {
+ modified = true;
+ }
+
nchno++;
if (CMainFrame::m_dwPatternSetup & PATTERN_PLAYNEWNOTE)
{
- if ((n) && (n<=NOTE_MAX)) chordplaylist[nPlayChord++] = n;
+ if ((n) && (n <= NOTE_MAX)) chordplaylist[nPlayChord++] = n;
}
}
} else
{
nchno++;
- if ((n) && (n<=NOTE_MAX)) chordplaylist[nPlayChord++] = n;
+ if ((n) && (n <= NOTE_MAX)) chordplaylist[nPlayChord++] = n;
}
}
}
}
- // -- write notedata
- if(bRecordEnabled)
- {
- DWORD sel = (m_nRow << 16) | m_dwCursor;
- SetCurSel(sel, sel);
- sel &= ~7;
- if(*p != oldcmd)
- {
- pModDoc->SetModified();
- InvalidateRow();
- UpdateIndicator();
- }
- } else
- {
- // recording disabled
- *p = oldcmd;
- }
// -- play note
if ((CMainFrame::m_dwPatternSetup & (PATTERN_PLAYNEWNOTE|PATTERN_PLAYEDITROW)) || (!bRecordEnabled))
@@ -4559,7 +4553,7 @@
{
// ...using the already specified instrument
nPlayIns = p->instr;
- } else if ((!p->instr) && (p->note < 128))
+ } else if ((!p->instr) && (p->note <= NOTE_MAX))
{
// ...or one that can be found on a previous row of this pattern.
MODCOMMAND *search = p;
@@ -4588,6 +4582,28 @@
}
} // end play note
+
+ // -- write notedata
+ if(bRecordEnabled)
+ {
+ DWORD sel = (m_nRow << 16) | m_dwCursor;
+ SetCurSel(sel, sel);
+ sel &= ~7;
+ if(modified)
+ {
+ pModDoc->SetModified();
+ InvalidateRow();
+ UpdateIndicator();
+ }
+ } else
+ {
+ // recording disabled
+ for(CHANNELINDEX nChn = 0; nChn < pSndFile->GetNumChannels(); nChn++)
+ {
+ prowbase[nChn] = oldrow[nChn];
+ }
+ }
+
// Set new cursor position (row spacing) - only when not recording live
if (bRecordEnabled && !bIsLiveRecord)
{
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2010-10-15 20:50:52 UTC (rev 741)
+++ trunk/OpenMPT/mptrack/version.h 2010-10-16 00:26:47 UTC (rev 742)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 00
-#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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-15 20:50:58
|
Revision: 741
http://modplug.svn.sourceforge.net/modplug/?rev=741&view=rev
Author: saga-games
Date: 2010-10-15 20:50:52 +0000 (Fri, 15 Oct 2010)
Log Message:
-----------
[Fix] I can't believe I'm fixing more of these EDx idiosyncrasies...
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Snd_fx.cpp
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-15 17:59:23 UTC (rev 740)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-15 20:50:52 UTC (rev 741)
@@ -1368,12 +1368,16 @@
{
UINT note = pChn->nRowNote;
if (instr) pChn->nNewIns = instr;
+ bool retrigEnv = (!note) && (instr);
+
+ // Now it's time for some FT2 crap...
if (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2))
{
// XM: FT2 ignores a note next to a K00 effect, and a fade-out seems to be done when no volume envelope is present (not exactly the Kxx behaviour)
if(cmd == CMD_KEYOFF && param == 0 && IsCompatibleMode(TRK_FASTTRACKER2))
{
note = instr = 0;
+ retrigEnv = false;
}
// XM: Key-Off + Sample == Note Cut (BUT: Only if no instr number or volume effect is present!)
@@ -1382,15 +1386,25 @@
pChn->dwFlags |= CHN_FASTVOLRAMP;
pChn->nVolume = 0;
note = instr = 0;
- }
+ retrigEnv = false;
+ } else if(IsCompatibleMode(TRK_FASTTRACKER2) && !(m_dwSongFlags & SONG_FIRSTTICK))
+ {
+ // XM Compatibility: Some special hacks for rogue note delays... (EDx with x > 0)
+ // Apparently anything that is next to a note delay behaves totally unpredictable in FT2. Swedish tracker logic. :)
- // XM: Rogue note delays cause retrig
- if ((note == NOTE_NONE || instr == 0) && IsCompatibleMode(TRK_FASTTRACKER2) && !(m_dwSongFlags & SONG_FIRSTTICK))
- {
- note = pChn->nNote - pChn->nTranspose;
- // Stupid HACK to retrieve the last used instrument *number*
- if(instr == 0)
+ // If there's a note delay but no note, retrig the last note.
+ if(note == NOTE_NONE)
{
+ note = pChn->nNote - pChn->nTranspose;
+ } else if(note >= NOTE_MIN_SPECIAL)
+ {
+ // Gah! Note Off + Note Delay will cause envelopes to *retrigger*! How stupid is that?
+ retrigEnv = true;
+ }
+ // Stupid HACK to retrieve the last used instrument *number* for rouge note delays in XM
+ // This is only applied if the instrument column is empty and if there is either no note or a "normal" note (e.g. no note off)
+ if(instr == 0 && note <= NOTE_MAX)
+ {
for(INSTRUMENTINDEX nIns = 1; nIns <= m_nInstruments; nIns++)
{
if(Instruments[nIns] == pChn->pModInstrument)
@@ -1402,7 +1416,7 @@
}
}
}
- if ((!note) && (instr)) //Case: instrument with no note data.
+ if (retrigEnv) //Case: instrument with no note data.
{
//IT compatibility: Instrument with no note.
if(IsCompatibleMode(TRK_IMPULSETRACKER) || (m_dwSongFlags & SONG_PT1XMODE))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-15 17:59:31
|
Revision: 740
http://modplug.svn.sourceforge.net/modplug/?rev=740&view=rev
Author: saga-games
Date: 2010-10-15 17:59:23 +0000 (Fri, 15 Oct 2010)
Log Message:
-----------
[Fix] XM Compatibility: Fixing many mind-boggling EDx testcases in one sweep
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Snd_fx.cpp
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-15 14:52:26 UTC (rev 739)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-15 17:59:23 UTC (rev 740)
@@ -1385,9 +1385,21 @@
}
// XM: Rogue note delays cause retrig
- if ((note == NOTE_NONE) && IsCompatibleMode(TRK_FASTTRACKER2) && !(m_dwSongFlags & SONG_FIRSTTICK))
+ if ((note == NOTE_NONE || instr == 0) && IsCompatibleMode(TRK_FASTTRACKER2) && !(m_dwSongFlags & SONG_FIRSTTICK))
{
note = pChn->nNote - pChn->nTranspose;
+ // Stupid HACK to retrieve the last used instrument *number*
+ if(instr == 0)
+ {
+ for(INSTRUMENTINDEX nIns = 1; nIns <= m_nInstruments; nIns++)
+ {
+ if(Instruments[nIns] == pChn->pModInstrument)
+ {
+ instr = nIns;
+ break;
+ }
+ }
+ }
}
}
if ((!note) && (instr)) //Case: instrument with no note data.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-15 14:52:33
|
Revision: 739
http://modplug.svn.sourceforge.net/modplug/?rev=739&view=rev
Author: saga-games
Date: 2010-10-15 14:52:26 +0000 (Fri, 15 Oct 2010)
Log Message:
-----------
[Fix] XM Compatibility: Fixed some more upside-down logic when it comes to instrument number + portamento
[Mod] OpenMPT: Version is now 1.19.00.07
Modified Paths:
--------------
trunk/OpenMPT/mptrack/version.h
trunk/OpenMPT/soundlib/Snd_fx.cpp
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2010-10-15 14:22:57 UTC (rev 738)
+++ trunk/OpenMPT/mptrack/version.h 2010-10-15 14:52:26 UTC (rev 739)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 00
-#define VER_MINORMINOR 07
+#define VER_MINORMINOR 08
//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 2010-10-15 14:22:57 UTC (rev 738)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-15 14:52:26 UTC (rev 739)
@@ -83,7 +83,7 @@
}
double CSoundFile::GetLength(bool& targetReached, BOOL bAdjust, BOOL bTotal, ORDERINDEX endOrder, ROWINDEX endRow)
-//----------------------------------------------------
+//----------------------------------------------------------------------------------------------------------------
{
// -> CODE#0022
// -> DESC="alternative BPM/Speed interpretation method"
@@ -503,7 +503,7 @@
} else
{
// Original behaviour
- if (pIns->NoteMap[note-1] >= NOTE_MIN_SPECIAL) return;
+ if(pIns->NoteMap[note-1] > NOTE_MAX) return;
UINT n = pIns->Keyboard[note-1];
pSmp = ((n) && (n < MAX_SAMPLES)) ? &Samples[n] : nullptr;
}
@@ -539,10 +539,12 @@
}
}
- // XM compatibility: new instrument + portamento = forget it!
+ // XM compatibility: new instrument + portamento = ignore new instrument number, but reload old instrument settings (the world of XM is upside down...)
if(bInstrumentChanged && bPorta && IsCompatibleMode(TRK_FASTTRACKER2))
{
- return;
+ pIns = pChn->pModInstrument;
+ pSmp = pChn->pModSample;
+ bInstrumentChanged = false;
} else
{
pChn->pModInstrument = pIns;
@@ -4180,7 +4182,7 @@
//---------------------------------------------------------------------------------------------
{
const ORDERINDEX nMaxOrd = Order.GetLengthTailTrimmed();
- if(nOrd >= nMaxOrd)
+ if(nOrd >= nMaxOrd || nRow > Patterns[Order[nOrd]].GetNumRows())
return;
// The module might have been edited in the meantime - so we have to extend this a bit.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-15 14:23:05
|
Revision: 738
http://modplug.svn.sourceforge.net/modplug/?rev=738&view=rev
Author: saga-games
Date: 2010-10-15 14:22:57 +0000 (Fri, 15 Oct 2010)
Log Message:
-----------
[Fix] The new "play whole row" thing should also work properly with auto stepping enabled. This also involves a change in CSoundFile::IsPaused() to also check for SONG_STEP, which fixes some problems with this new edit mode but I hope it doesn't break anything else (looks like it doesn't, but who knows...)
Modified Paths:
--------------
trunk/OpenMPT/mptrack/MainFrm.cpp
trunk/OpenMPT/mptrack/Mainfrm.h
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/View_pat.h
trunk/OpenMPT/soundlib/Sndfile.h
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2010-10-12 20:17:40 UTC (rev 737)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2010-10-15 14:22:57 UTC (rev 738)
@@ -1878,17 +1878,14 @@
BOOL CMainFrame::PlayMod(CModDoc *pModDoc, HWND hPat, DWORD dwNotifyType)
//-----------------------------------------------------------------------
{
- BOOL bPaused, bPatLoop, bResetAGC;
if (!pModDoc) return FALSE;
CSoundFile *pSndFile = pModDoc->GetSoundFile();
if ((!pSndFile) || (!pSndFile->GetType())) return FALSE;
- bPaused = (pSndFile->m_dwSongFlags & SONG_PAUSED) ? TRUE : FALSE;
- bPatLoop = (pSndFile->m_dwSongFlags & SONG_PATTERNLOOP) ? TRUE : FALSE;
+ const bool bPaused = pSndFile->IsPaused();
+ const bool bPatLoop = (pSndFile->m_dwSongFlags & SONG_PATTERNLOOP) ? true : false;
pSndFile->ResetChannels();
- bResetAGC = FALSE;
- if (((m_pSndFile) && (pSndFile != m_pSndFile)) || (!m_dwElapsedTime)) bResetAGC = TRUE;
if ((m_pSndFile) || (m_dwStatus & MODSTATUS_PLAYING)) PauseMod();
- if (bResetAGC) CSoundFile::ResetAGC();
+ if (((m_pSndFile) && (pSndFile != m_pSndFile)) || (!m_dwElapsedTime)) CSoundFile::ResetAGC();
m_pSndFile = pSndFile;
m_pModPlaying = pModDoc;
m_hFollowSong = hPat;
Modified: trunk/OpenMPT/mptrack/Mainfrm.h
===================================================================
--- trunk/OpenMPT/mptrack/Mainfrm.h 2010-10-12 20:17:40 UTC (rev 737)
+++ trunk/OpenMPT/mptrack/Mainfrm.h 2010-10-15 14:22:57 UTC (rev 738)
@@ -162,9 +162,11 @@
#define NUM_VUMETER_PENS 32
// Pattern Setup (contains also non-pattern related settings)
+// Feel free to replace the deprecated flags by new flags, but be sure to
+// update CMainFrame::LoadIniSettings() as well.
#define PATTERN_PLAYNEWNOTE 0x01 // play new notes while recording
#define PATTERN_LARGECOMMENTS 0x02 // use large font in comments
-#define PATTERN_STDHIGHLIGHT 0x04 // enable primary highlight
+#define PATTERN_STDHIGHLIGHT 0x04 // enable primary highlight (measures)
#define PATTERN_SMALLFONT 0x08 // use small font in pattern editor
#define PATTERN_CENTERROW 0x10 // always center active row
#define PATTERN_WRAP 0x20 // wrap around cursor in editor
@@ -176,7 +178,7 @@
#define PATTERN_PLAYEDITROW 0x800 // play all notes on the current row while entering notes
#define PATTERN_NOEXTRALOUD 0x1000 // no loud samples in sample editor
#define PATTERN_DRAGNDROPEDIT 0x2000 // enable drag and drop editing
-#define PATTERN_2NDHIGHLIGHT 0x4000 // activate secondary highlight
+#define PATTERN_2NDHIGHLIGHT 0x4000 // activate secondary highlight (beats)
#define PATTERN_MUTECHNMODE 0x8000 // ignore muted channels
#define PATTERN_SHOWPREVIOUS 0x10000 // show prev/next patterns
#define PATTERN_CONTSCROLL 0x20000 // continous pattern scrolling
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2010-10-12 20:17:40 UTC (rev 737)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-10-15 14:22:57 UTC (rev 738)
@@ -2007,7 +2007,7 @@
void CViewPattern::PatternStep(bool autoStep)
-//---------------------------------------------
+//-------------------------------------------
{
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
CModDoc *pModDoc = GetDocument();
@@ -2015,17 +2015,17 @@
if ((pMainFrm) && (pModDoc))
{
CSoundFile *pSndFile = pModDoc->GetSoundFile();
- if ((!pSndFile->Patterns[m_nPattern].GetNumRows()) || (!pSndFile->Patterns[m_nPattern])) return;
- // Cut instrument/sample
+ if ((!pSndFile->Patterns.IsValidPat(m_nPattern)) || (!pSndFile->Patterns[m_nPattern].GetNumRows())) return;
BEGIN_CRITICAL();
- for (UINT i=pSndFile->m_nChannels; i<MAX_CHANNELS; i++)
+ // Cut instrument\xB4s/samples in virtual channels
+ for (CHANNELINDEX i = pSndFile->m_nChannels; i < MAX_CHANNELS; i++)
{
pSndFile->Chn[i].dwFlags |= CHN_NOTEFADE | CHN_KEYOFF;
- pSndFile->m_dwSongFlags &= ~SONG_PAUSED;
- pSndFile->LoopPattern(m_nPattern);
- pSndFile->m_nNextRow = GetCurrentRow();
- pSndFile->m_dwSongFlags |= SONG_STEP;
}
+ pSndFile->LoopPattern(m_nPattern);
+ pSndFile->m_nNextRow = GetCurrentRow();
+ pSndFile->m_dwSongFlags &= ~SONG_PAUSED;
+ pSndFile->m_dwSongFlags |= SONG_STEP;
END_CRITICAL();
if (pMainFrm->GetModPlaying() != pModDoc)
{
@@ -3770,6 +3770,8 @@
} \
}
+
+// Enter volume effect / number in the pattern.
void CViewPattern::TempEnterVol(int v)
//------------------------------------
{
@@ -3864,6 +3866,7 @@
}
+// Enter an effect letter in the pattenr
void CViewPattern::TempEnterFX(int c)
//-----------------------------------
{
@@ -3918,6 +3921,7 @@
}
+// Enter an effect param in the pattenr
void CViewPattern::TempEnterFXparam(int v)
//----------------------------------------
{
@@ -3964,6 +3968,7 @@
}
+// Stop a note that has been entered
void CViewPattern::TempStopNote(int note, bool fromMidi, const bool bChordMode)
//-----------------------------------------------------------------------------
{
@@ -4097,6 +4102,7 @@
}
+// Enter an octave number in the pattern
void CViewPattern::TempEnterOctave(int val)
//-----------------------------------------
{
@@ -4118,6 +4124,8 @@
}
+
+// Enter an instrument number in the pattern
void CViewPattern::TempEnterIns(int val)
//--------------------------------------
{
@@ -4178,6 +4186,7 @@
}
+// Enter a note in the pattern
void CViewPattern::TempEnterNote(int note, bool oldStyle, int vol)
//----------------------------------------------------------------
{
@@ -4230,11 +4239,15 @@
// -- Chord autodetection: step back if we just entered a note
- if ((bRecordEnabled) && (recordGroup) && !bIsLiveRecord) {
- if ((m_nSpacing > 0) && (m_nSpacing <= MAX_SPACING)) {
+ if ((bRecordEnabled) && (recordGroup) && !bIsLiveRecord)
+ {
+ if ((m_nSpacing > 0) && (m_nSpacing <= MAX_SPACING))
+ {
if ((timeGetTime() - m_dwLastNoteEntryTime < CMainFrame::gnAutoChordWaitTime)
- && (nRow>=m_nSpacing) && (!m_bLastNoteEntryBlocked))
+ && (nRow >= m_nSpacing) && (!m_bLastNoteEntryBlocked))
+ {
nRow -= m_nSpacing;
+ }
}
}
m_dwLastNoteEntryTime = timeGetTime();
@@ -4257,7 +4270,7 @@
// -- write note and instrument data.
const bool isSplit = HandleSplit(p, note);
- // Nice idea actually: Use lower section of the keyboard to play chords
+ // Nice idea actually: Use lower section of the keyboard to play chords (but it won't work 100% correctly this way...)
/*if(isSplit)
{
TempEnterChord(note);
@@ -4306,6 +4319,57 @@
if (oldStyle && ((p->note == NOTE_NOTECUT) || (p->note == NOTE_KEYOFF) || (p->note == NOTE_FADE)))
p->instr=0;
+ //-- if not recording, restore old command.
+ if (bRecordEnabled == false)
+ {
+ *p = oldcmd;
+ }
+
+ // -- play note
+ if ((CMainFrame::m_dwPatternSetup & (PATTERN_PLAYNEWNOTE|PATTERN_PLAYEDITROW)) || (!bRecordEnabled))
+ {
+ if ((CMainFrame::m_dwPatternSetup & PATTERN_PLAYEDITROW) && !bIsLiveRecord)
+ {
+ // play the whole row in "step mode"
+ PatternStep(false);
+ } else
+ {
+ // just play the newly inserted note...
+ if (p->instr)
+ {
+ // ...using the already specified instrument
+ nPlayIns = p->instr;
+ } else if ((!p->instr) && (p->note <= NOTE_MAX))
+ {
+ // ...or one that can be found on a previous row of this pattern.
+ MODCOMMAND *search = p;
+ UINT srow = nRow;
+ while (srow-- > 0)
+ {
+ search -= pSndFile->m_nChannels;
+ if (search->instr)
+ {
+ nPlayIns = search->instr;
+ m_nFoundInstrument = nPlayIns; //used to figure out which instrument to stop on key release.
+ break;
+ }
+ }
+ }
+ BOOL bNotPlaying = ((pMainFrm->GetModPlaying() == pModDoc) && (pMainFrm->IsPlaying())) ? FALSE : TRUE;
+ //pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, -1, 0, 0, nChn); //rewbs.vstiLive - added extra args
+ pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, 4*vol, 0, 0, nChn); //rewbs.vstiLive - added extra args
+/* for (UINT kplchrd=0; kplchrd<nPlayChord; kplchrd++)
+ {
+ if (chordplaylist[kplchrd])
+ {
+ pModDoc->PlayNote(chordplaylist[kplchrd], nPlayIns, 0, FALSE, -1, 0, 0, nChn); //rewbs.vstiLive - - added extra args
+ m_dwStatus |= PATSTATUS_CHORDPLAYING;
+ }
+ }
+*/
+ }
+ }
+
// -- if recording, handle post note entry behaviour (move cursor etc..)
if(bRecordEnabled)
{
@@ -4326,20 +4390,19 @@
}
}
- //Move cursor down only if not recording live.
- if(bIsLiveRecord == false)
+ // Set new cursor position (row spacing)
+ if (!bIsLiveRecord)
{
if((m_nSpacing > 0) && (m_nSpacing <= MAX_SPACING))
{
-
if(nRow + m_nSpacing < pSndFile->Patterns[nPat].GetNumRows() || (CMainFrame::m_dwPatternSetup & PATTERN_CONTSCROLL))
{
SetCurrentRow(nRow + m_nSpacing, (CMainFrame::m_dwPatternSetup & PATTERN_CONTSCROLL) ? true: false);
- m_bLastNoteEntryBlocked=false;
+ m_bLastNoteEntryBlocked = false;
} else
{
- m_bLastNoteEntryBlocked=true; // if the cursor is block by the end of the pattern here,
- } // we must remember to not step back should the next note form a chord.
+ m_bLastNoteEntryBlocked = true; // if the cursor is block by the end of the pattern here,
+ } // we must remember to not step back should the next note form a chord.
}
DWORD sel = m_dwCursor | (m_nRow << 16);
@@ -4378,61 +4441,12 @@
}
}
}
-
- // -- play note
- if ((CMainFrame::m_dwPatternSetup & (PATTERN_PLAYNEWNOTE|PATTERN_PLAYEDITROW)) || (bRecordEnabled == false))
- {
- if ((CMainFrame::m_dwPatternSetup & PATTERN_PLAYEDITROW) && !bIsLiveRecord)
- {
- // play the whole row
- PatternStep(false);
- } else
- {
- // just play the newly inserted note...
- if (p->instr)
- {
- // ...using the already specified instrument
- nPlayIns = p->instr;
- } else if ((!p->instr) && (p->note <= NOTE_MAX))
- {
- // ...or one that can be found on a previous row of this pattern.
- MODCOMMAND *search = p;
- UINT srow = nRow;
- while (srow-- > 0)
- {
- search -= pSndFile->m_nChannels;
- if (search->instr)
- {
- nPlayIns = search->instr;
- m_nFoundInstrument = nPlayIns; //used to figure out which instrument to stop on key release.
- break;
- }
- }
- }
- BOOL bNotPlaying = ((pMainFrm->GetModPlaying() == pModDoc) && (pMainFrm->IsPlaying())) ? FALSE : TRUE;
- //pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, -1, 0, 0, nChn); //rewbs.vstiLive - added extra args
- pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, 4*vol, 0, 0, nChn); //rewbs.vstiLive - added extra args
-/* for (UINT kplchrd=0; kplchrd<nPlayChord; kplchrd++)
- {
- if (chordplaylist[kplchrd])
- {
- pModDoc->PlayNote(chordplaylist[kplchrd], nPlayIns, 0, FALSE, -1, 0, 0, nChn); //rewbs.vstiLive - - added extra args
- m_dwStatus |= PATSTATUS_CHORDPLAYING;
- }
- }
-*/
- }
- }
-
- //-- if not recording, restore old command.
- if (bRecordEnabled == false)
- {
- *p = oldcmd;
- }
}
}
+
+// Enter a chord in the pattern
void CViewPattern::TempEnterChord(int note)
//-----------------------------------------
{
@@ -4453,7 +4467,9 @@
MODCOMMAND* p = &prowbase[nChn];
const MODCOMMAND oldcmd = *p; // This is the command we are about to overwrite
+
const bool bIsLiveRecord = IsLiveRecord(*pMainFrm, *pModDoc, *pSndFile);
+ const bool bRecordEnabled = IsEditingEnabled();
// -- establish note data
//const bool isSplit = HandleSplit(p, note);
@@ -4490,7 +4506,7 @@
recordGroup = currentRecordGroup; //record group found
UINT n = ((nchordnote-1)/12) * 12 + pChords[nchord].notes[nchno];
- if(IsEditingEnabled())
+ if(bRecordEnabled)
{
if ((nchordch != nChn) && recordGroup && (currentRecordGroup == recordGroup) && (n <= NOTE_MAX))
{
@@ -4512,7 +4528,7 @@
}
// -- write notedata
- if(IsEditingEnabled())
+ if(bRecordEnabled)
{
DWORD sel = (m_nRow << 16) | m_dwCursor;
SetCurSel(sel, sel);
@@ -4523,14 +4539,6 @@
InvalidateRow();
UpdateIndicator();
}
- if ( IsLiveRecord(*pMainFrm, *pModDoc, *pSndFile) == false )
- {
- if ((m_nSpacing > 0) && (m_nSpacing <= MAX_SPACING))
- SetCurrentRow(m_nRow+m_nSpacing);
- DWORD sel = m_dwCursor | (m_nRow << 16);
- SetCurSel(sel, sel);
-
- }
} else
{
// recording disabled
@@ -4538,11 +4546,11 @@
}
// -- play note
- if ((CMainFrame::m_dwPatternSetup & (PATTERN_PLAYNEWNOTE|PATTERN_PLAYEDITROW)) || (!(IsEditingEnabled())))
+ if ((CMainFrame::m_dwPatternSetup & (PATTERN_PLAYNEWNOTE|PATTERN_PLAYEDITROW)) || (!bRecordEnabled))
{
if ((CMainFrame::m_dwPatternSetup & PATTERN_PLAYEDITROW) && !bIsLiveRecord)
{
- // play the whole row
+ // play the whole row in "step mode"
PatternStep(false);
} else
{
@@ -4556,9 +4564,8 @@
// ...or one that can be found on a previous row of this pattern.
MODCOMMAND *search = p;
UINT srow = m_nRow;
- while (srow > 0)
+ while (srow-- > 0)
{
- srow--;
search -= pSndFile->m_nChannels;
if (search->instr)
{
@@ -4580,6 +4587,16 @@
}
}
} // end play note
+
+ // Set new cursor position (row spacing) - only when not recording live
+ if (bRecordEnabled && !bIsLiveRecord)
+ {
+ if ((m_nSpacing > 0) && (m_nSpacing <= MAX_SPACING))
+ SetCurrentRow(m_nRow + m_nSpacing);
+ DWORD sel = m_dwCursor | (m_nRow << 16);
+ SetCurSel(sel, sel);
+ }
+
} // end mainframe and moddoc exist
}
Modified: trunk/OpenMPT/mptrack/View_pat.h
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.h 2010-10-12 20:17:40 UTC (rev 737)
+++ trunk/OpenMPT/mptrack/View_pat.h 2010-10-15 14:22:57 UTC (rev 738)
@@ -31,7 +31,7 @@
#define PATSTATUS_PATTERNLOOP 0x4000
// Row Spacing
-#define MAX_SPACING 64
+#define MAX_SPACING 64 // MAX_PATTERN_ROWS
enum PatternColumns
{
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2010-10-12 20:17:40 UTC (rev 737)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2010-10-15 14:22:57 UTC (rev 738)
@@ -688,7 +688,7 @@
void SetRepeatCount(int n) { m_nRepeatCount = n; }
int GetRepeatCount() const { return m_nRepeatCount; }
- bool IsPaused() const { return (m_dwSongFlags & SONG_PAUSED) ? true : false; }
+ bool IsPaused() const { return (m_dwSongFlags & (SONG_PAUSED|SONG_STEP)) ? true : false; } // Added SONG_STEP as it seems to be desirable in most cases to check for this as well.
void LoopPattern(PATTERNINDEX nPat, ROWINDEX nRow = 0);
void CheckCPUUsage(UINT nCPU);
BOOL SetPatternName(PATTERNINDEX nPat, LPCSTR lpszName);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-12 20:17:46
|
Revision: 737
http://modplug.svn.sourceforge.net/modplug/?rev=737&view=rev
Author: saga-games
Date: 2010-10-12 20:17:40 +0000 (Tue, 12 Oct 2010)
Log Message:
-----------
[New] Experimental feature: Play the whole pattern row when entering notes and chords into the pattern editor.
[Mod] OpenMPT: Version is now 1.19.00.07
Modified Paths:
--------------
trunk/OpenMPT/mptrack/MainFrm.cpp
trunk/OpenMPT/mptrack/Mainfrm.h
trunk/OpenMPT/mptrack/Moptions.cpp
trunk/OpenMPT/mptrack/View_pat.cpp
trunk/OpenMPT/mptrack/View_pat.h
trunk/OpenMPT/mptrack/version.h
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2010-10-12 20:13:10 UTC (rev 736)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2010-10-12 20:17:40 UTC (rev 737)
@@ -462,8 +462,10 @@
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,00))
- m_dwPatternSetup &= ~(0x800|0x200000|0x400000); // various deprecated old options
+ 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)
+ m_dwPatternSetup &= ~(0x200000|0x400000); // various deprecated old options
m_nRowSpacing = GetPrivateProfileDWord("Pattern Editor", "RowSpacing", 16, iniFile);
m_nRowSpacing2 = GetPrivateProfileDWord("Pattern Editor", "RowSpacing2", 4, iniFile);
@@ -600,9 +602,9 @@
RegQueryValueEx(key, "MidiSetup", NULL, &dwREG_DWORD, (LPBYTE)&m_dwMidiSetup, &dwDWORDSize);
RegQueryValueEx(key, "MidiDevice", NULL, &dwREG_DWORD, (LPBYTE)&m_nMidiDevice, &dwDWORDSize);
RegQueryValueEx(key, "PatternSetup", NULL, &dwREG_DWORD, (LPBYTE)&m_dwPatternSetup, &dwDWORDSize);
+ m_dwPatternSetup &= ~(0x800|0x200000|0x400000); // various deprecated old options
m_dwPatternSetup |= PATTERN_NOTEFADE; // Set flag to maintain old behaviour (was changed in 1.17.02.50).
m_dwPatternSetup |= PATTERN_RESETCHANNELS; // Set flag to reset channels on loop was changed in 1.17.03.01).
- m_dwPatternSetup &= ~0x800; // quick paste autorepeat is now a keymap option
RegQueryValueEx(key, "RowSpacing", NULL, &dwREG_DWORD, (LPBYTE)&m_nRowSpacing, &dwDWORDSize);
RegQueryValueEx(key, "RowSpacing2", NULL, &dwREG_DWORD, (LPBYTE)&m_nRowSpacing2, &dwDWORDSize);
RegQueryValueEx(key, "LoopSong", NULL, &dwREG_DWORD, (LPBYTE)&gbLoopSong, &dwDWORDSize);
Modified: trunk/OpenMPT/mptrack/Mainfrm.h
===================================================================
--- trunk/OpenMPT/mptrack/Mainfrm.h 2010-10-12 20:13:10 UTC (rev 736)
+++ trunk/OpenMPT/mptrack/Mainfrm.h 2010-10-12 20:17:40 UTC (rev 737)
@@ -173,7 +173,7 @@
#define PATTERN_FLATBUTTONS 0x100 // flat toolbar buttons
#define PATTERN_CREATEBACKUP 0x200 // create .bak files when saving
#define PATTERN_SINGLEEXPAND 0x400 // single click to expand tree
-//#define PATTERN_AUTOSPACEBAR 0x800 // space bar repeats previous action - DOES NOT EXIST ANYMORE, use "on key hold" instead
+#define PATTERN_PLAYEDITROW 0x800 // play all notes on the current row while entering notes
#define PATTERN_NOEXTRALOUD 0x1000 // no loud samples in sample editor
#define PATTERN_DRAGNDROPEDIT 0x2000 // enable drag and drop editing
#define PATTERN_2NDHIGHLIGHT 0x4000 // activate secondary highlight
Modified: trunk/OpenMPT/mptrack/Moptions.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Moptions.cpp 2010-10-12 20:13:10 UTC (rev 736)
+++ trunk/OpenMPT/mptrack/Moptions.cpp 2010-10-12 20:17:40 UTC (rev 737)
@@ -556,6 +556,7 @@
enum {
OPTGEN_PLAYNEWNOTES=0,
+ OPTGEN_PLAYEDITROW,
OPTGEN_CENTERROW,
OPTGEN_LARGECOMMENTSFONT,
OPTGEN_HEXROWDISP,
@@ -586,6 +587,7 @@
static OPTGENDESC gOptGenDesc[OPTGEN_MAXOPTIONS] =
{
{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."},
{PATTERN_CENTERROW, "Always center active row", "Turn on this option to have the active row always centered in the pattern editor (requires \"Always center active row\")."},
{PATTERN_LARGECOMMENTS, "Use large font for comments", "With this option enabled, the song message editor will use a larger font."},
{PATTERN_HEXDISPLAY, "Display rows in hex", "With this option enabled, row numbers and sequence numbers will be displayed in hexadecimal."},
Modified: trunk/OpenMPT/mptrack/View_pat.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.cpp 2010-10-12 20:13:10 UTC (rev 736)
+++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-10-12 20:17:40 UTC (rev 737)
@@ -2002,6 +2002,13 @@
void CViewPattern::OnPatternStep()
//--------------------------------
{
+ PatternStep(true);
+}
+
+
+void CViewPattern::PatternStep(bool autoStep)
+//---------------------------------------------
+{
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
CModDoc *pModDoc = GetDocument();
@@ -2025,10 +2032,13 @@
pMainFrm->PlayMod(pModDoc, m_hWnd, MPTNOTIFY_POSITION|MPTNOTIFY_VUMETERS);
}
CMainFrame::EnableLowLatencyMode();
- if (CMainFrame::m_dwPatternSetup & PATTERN_CONTSCROLL)
- SetCurrentRow(GetCurrentRow()+1, TRUE);
- else
- SetCurrentRow((GetCurrentRow()+1) % pSndFile->Patterns[m_nPattern].GetNumRows(), FALSE);
+ if(autoStep)
+ {
+ if (CMainFrame::m_dwPatternSetup & PATTERN_CONTSCROLL)
+ SetCurrentRow(GetCurrentRow() + 1, TRUE);
+ else
+ SetCurrentRow((GetCurrentRow() + 1) % pSndFile->Patterns[m_nPattern].GetNumRows(), FALSE);
+ }
SetFocus();
}
}
@@ -4109,7 +4119,7 @@
}
void CViewPattern::TempEnterIns(int val)
-//---------------------------------------------
+//--------------------------------------
{
CMainFrame *pMainFrm = CMainFrame::GetMainFrame();
CModDoc *pModDoc = GetDocument();
@@ -4205,7 +4215,7 @@
BYTE recordGroup = pModDoc->IsChannelRecord(nChn);
UINT nPlayIns = 0;
const bool bIsLiveRecord = IsLiveRecord(*pMainFrm, *pModDoc, *pSndFile);
- const bool usePlaybackPosition = (bIsLiveRecord && (CMainFrame::m_dwPatternSetup & PATTERN_AUTODELAY));
+ const bool usePlaybackPosition = (bIsLiveRecord && (CMainFrame::m_dwPatternSetup & PATTERN_AUTODELAY) && !(pSndFile->m_dwSongFlags & SONG_STEP));
//Param control 'note'
if(MODCOMMAND::IsPcNote(note) && bRecordEnabled)
{
@@ -4370,38 +4380,48 @@
}
// -- play note
- if ((CMainFrame::m_dwPatternSetup & PATTERN_PLAYNEWNOTE) || (bRecordEnabled == false))
+ if ((CMainFrame::m_dwPatternSetup & (PATTERN_PLAYNEWNOTE|PATTERN_PLAYEDITROW)) || (bRecordEnabled == false))
{
- if (p->instr) nPlayIns = p->instr;
-
- else if ((!p->instr) && (p->note < 128))
+ if ((CMainFrame::m_dwPatternSetup & PATTERN_PLAYEDITROW) && !bIsLiveRecord)
{
- MODCOMMAND *search = p;
- UINT srow = nRow;
- while (srow > 0)
+ // play the whole row
+ PatternStep(false);
+ } else
+ {
+ // just play the newly inserted note...
+ if (p->instr)
{
- srow--;
- search -= pSndFile->m_nChannels;
- if (search->instr)
+ // ...using the already specified instrument
+ nPlayIns = p->instr;
+ } else if ((!p->instr) && (p->note <= NOTE_MAX))
+ {
+ // ...or one that can be found on a previous row of this pattern.
+ MODCOMMAND *search = p;
+ UINT srow = nRow;
+ while (srow-- > 0)
{
- nPlayIns = search->instr;
- m_nFoundInstrument = nPlayIns; //used to figure out which instrument to stop on key release.
- break;
+ search -= pSndFile->m_nChannels;
+ if (search->instr)
+ {
+ nPlayIns = search->instr;
+ m_nFoundInstrument = nPlayIns; //used to figure out which instrument to stop on key release.
+ break;
+ }
}
}
- }
- BOOL bNotPlaying = ((pMainFrm->GetModPlaying() == pModDoc) && (pMainFrm->IsPlaying())) ? FALSE : TRUE;
- //pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, -1, 0, 0, nChn); //rewbs.vstiLive - added extra args
- pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, 4*vol, 0, 0, nChn); //rewbs.vstiLive - added extra args
-/* for (UINT kplchrd=0; kplchrd<nPlayChord; kplchrd++)
- {
- if (chordplaylist[kplchrd])
+ BOOL bNotPlaying = ((pMainFrm->GetModPlaying() == pModDoc) && (pMainFrm->IsPlaying())) ? FALSE : TRUE;
+ //pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, -1, 0, 0, nChn); //rewbs.vstiLive - added extra args
+ pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, 4*vol, 0, 0, nChn); //rewbs.vstiLive - added extra args
+/* for (UINT kplchrd=0; kplchrd<nPlayChord; kplchrd++)
{
- pModDoc->PlayNote(chordplaylist[kplchrd], nPlayIns, 0, FALSE, -1, 0, 0, nChn); //rewbs.vstiLive - - added extra args
- m_dwStatus |= PATSTATUS_CHORDPLAYING;
+ if (chordplaylist[kplchrd])
+ {
+ pModDoc->PlayNote(chordplaylist[kplchrd], nPlayIns, 0, FALSE, -1, 0, 0, nChn); //rewbs.vstiLive - - added extra args
+ m_dwStatus |= PATSTATUS_CHORDPLAYING;
+ }
}
+*/
}
-*/
}
//-- if not recording, restore old command.
@@ -4433,6 +4453,7 @@
MODCOMMAND* p = &prowbase[nChn];
const MODCOMMAND oldcmd = *p; // This is the command we are about to overwrite
+ const bool bIsLiveRecord = IsLiveRecord(*pMainFrm, *pModDoc, *pSndFile);
// -- establish note data
//const bool isSplit = HandleSplit(p, note);
@@ -4517,34 +4538,45 @@
}
// -- play note
- if ((CMainFrame::m_dwPatternSetup & PATTERN_PLAYNEWNOTE) || (!(IsEditingEnabled())))
+ if ((CMainFrame::m_dwPatternSetup & (PATTERN_PLAYNEWNOTE|PATTERN_PLAYEDITROW)) || (!(IsEditingEnabled())))
{
- if (p->instr) nPlayIns = p->instr;
-
- else if ((!p->instr) && (p->note < 128))
+ if ((CMainFrame::m_dwPatternSetup & PATTERN_PLAYEDITROW) && !bIsLiveRecord)
{
- MODCOMMAND *search = p;
- UINT srow = m_nRow;
- while (srow > 0)
+ // play the whole row
+ PatternStep(false);
+ } else
+ {
+ // just play the newly inserted notes...
+ if (p->instr)
{
- srow--;
- search -= pSndFile->m_nChannels;
- if (search->instr)
+ // ...using the already specified instrument
+ nPlayIns = p->instr;
+ } else if ((!p->instr) && (p->note < 128))
+ {
+ // ...or one that can be found on a previous row of this pattern.
+ MODCOMMAND *search = p;
+ UINT srow = m_nRow;
+ while (srow > 0)
{
- nPlayIns = search->instr;
- m_nFoundInstrument = nPlayIns; //used to figure out which instrument to stop on key release.
- break;
+ srow--;
+ search -= pSndFile->m_nChannels;
+ if (search->instr)
+ {
+ nPlayIns = search->instr;
+ m_nFoundInstrument = nPlayIns; //used to figure out which instrument to stop on key release.
+ break;
+ }
}
}
- }
- BOOL bNotPlaying = ((pMainFrm->GetModPlaying() == pModDoc) && (pMainFrm->IsPlaying())) ? FALSE : TRUE;
- pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, -1, 0, 0, nChn); //rewbs.vstiLive - added extra args
- for (UINT kplchrd=0; kplchrd<nPlayChord; kplchrd++)
- {
- if (chordplaylist[kplchrd])
+ BOOL bNotPlaying = ((pMainFrm->GetModPlaying() == pModDoc) && (pMainFrm->IsPlaying())) ? FALSE : TRUE;
+ pModDoc->PlayNote(p->note, nPlayIns, 0, bNotPlaying, -1, 0, 0, nChn); //rewbs.vstiLive - added extra args
+ for (UINT kplchrd=0; kplchrd<nPlayChord; kplchrd++)
{
- pModDoc->PlayNote(chordplaylist[kplchrd], nPlayIns, 0, FALSE, -1, 0, 0, nChn); //rewbs.vstiLive - - added extra args
- m_dwStatus |= PATSTATUS_CHORDPLAYING;
+ if (chordplaylist[kplchrd])
+ {
+ pModDoc->PlayNote(chordplaylist[kplchrd], nPlayIns, 0, FALSE, -1, 0, 0, nChn); //rewbs.vstiLive - - added extra args
+ m_dwStatus |= PATSTATUS_CHORDPLAYING;
+ }
}
}
} // end play note
Modified: trunk/OpenMPT/mptrack/View_pat.h
===================================================================
--- trunk/OpenMPT/mptrack/View_pat.h 2010-10-12 20:13:10 UTC (rev 736)
+++ trunk/OpenMPT/mptrack/View_pat.h 2010-10-12 20:17:40 UTC (rev 737)
@@ -375,8 +375,10 @@
//Like IsEditingEnabled(), but shows some notification when editing is not enabled.
bool IsEditingEnabled_bmsg();
-
+ // Play one pattern row and stop ("step mode")
+ void PatternStep(bool autoStep);
+
public:
afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point);
private:
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2010-10-12 20:13:10 UTC (rev 736)
+++ trunk/OpenMPT/mptrack/version.h 2010-10-12 20:17:40 UTC (rev 737)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 00
-#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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-12 20:13:17
|
Revision: 736
http://modplug.svn.sourceforge.net/modplug/?rev=736&view=rev
Author: saga-games
Date: 2010-10-12 20:13:10 +0000 (Tue, 12 Oct 2010)
Log Message:
-----------
[Ref] Sound device code refactoring
Modified Paths:
--------------
trunk/OpenMPT/mptrack/MainFrm.cpp
trunk/OpenMPT/mptrack/Mainfrm.h
trunk/OpenMPT/soundlib/SNDDEV.H
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2010-10-08 14:40:44 UTC (rev 735)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2010-10-12 20:13:10 UTC (rev 736)
@@ -187,7 +187,7 @@
DWORD CMainFrame::m_nBitsPerSample = 16;
DWORD CMainFrame::m_nPreAmp = 128;
DWORD CMainFrame::gbLoopSong = TRUE;
-LONG CMainFrame::m_nWaveDevice = (SNDDEV_DSOUND<<8);
+LONG CMainFrame::m_nWaveDevice = (SNDDEV_DSOUND << SNDDEV_DEVICE_SHIFT);
LONG CMainFrame::m_nMidiDevice = 0;
DWORD CMainFrame::m_nBufferLength = 75;
LONG CMainFrame::gnLVuMeter = 0;
@@ -433,12 +433,12 @@
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((m_nWaveDevice >> 8) == SNDDEV_ASIO)
+ if(SNDDEV_GET_TYPE(m_nWaveDevice) == SNDDEV_ASIO)
{
ISoundDevice *dummy;
if(CreateSoundDevice(SNDDEV_ASIO, &dummy))
{
- m_dwRate = dummy->GetCurrentSampleRate(m_nWaveDevice & 0xFF);
+ m_dwRate = dummy->GetCurrentSampleRate(SNDDEV_GET_NUMBER(m_nWaveDevice));
delete dummy;
}
}
@@ -691,8 +691,6 @@
VOID CMainFrame::Initialize()
//---------------------------
{
- CHAR s[256];
-
//Adding version number to the frame title
CString title = GetTitle();
title += CString(" ") + MptVersion::str;
@@ -711,12 +709,12 @@
// Load Chords
theApp.LoadChords(Chords);
// Check for valid sound device
- if (!EnumerateSoundDevices(m_nWaveDevice>>8, m_nWaveDevice&0xff, s, sizeof(s)))
+ if (!EnumerateSoundDevices(SNDDEV_GET_TYPE(m_nWaveDevice), SNDDEV_GET_NUMBER(m_nWaveDevice), nullptr, 0))
{
- m_nWaveDevice = (SNDDEV_DSOUND<<8);
- if (!EnumerateSoundDevices(m_nWaveDevice>>8, m_nWaveDevice&0xff, s, sizeof(s)))
+ m_nWaveDevice = (SNDDEV_DSOUND << SNDDEV_DEVICE_SHIFT);
+ if (!EnumerateSoundDevices(SNDDEV_GET_TYPE(m_nWaveDevice), SNDDEV_GET_NUMBER(m_nWaveDevice), nullptr, 0))
{
- m_nWaveDevice = (SNDDEV_WAVEOUT<<8);
+ m_nWaveDevice = (SNDDEV_WAVEOUT << SNDDEV_DEVICE_SHIFT);
}
}
// Default directory location
@@ -1480,8 +1478,8 @@
m_pSndFile->SetWaveConfig(samplespersec, bits, channels, (m_dwSoundSetup & SOUNDSETUP_ENABLEMMX) ? TRUE : FALSE);
// Maybe we failed because someone is playing sound already.
// Shut any sound off, and try once more before giving up.
- UINT nDevType = m_nWaveDevice>>8;
- UINT nDevNo = m_nWaveDevice&0xff;
+ UINT nDevType = SNDDEV_GET_TYPE(m_nWaveDevice);
+ UINT nDevNo = SNDDEV_GET_NUMBER(m_nWaveDevice);
UINT fulOptions = (m_dwSoundSetup & SOUNDSETUP_SECONDARY) ? SNDDEV_OPTIONS_SECONDARY : 0;
if ((gpSoundDevice) && (gpSoundDevice->GetDeviceType() != nDevType))
{
Modified: trunk/OpenMPT/mptrack/Mainfrm.h
===================================================================
--- trunk/OpenMPT/mptrack/Mainfrm.h 2010-10-08 14:40:44 UTC (rev 735)
+++ trunk/OpenMPT/mptrack/Mainfrm.h 2010-10-12 20:13:10 UTC (rev 736)
@@ -423,7 +423,7 @@
// Audio Setup
static DWORD m_dwSoundSetup, m_dwRate, m_dwQuality, m_nSrcMode, m_nBitsPerSample, m_nPreAmp, gbLoopSong, m_nChannels;
- static LONG m_nWaveDevice; // lower 8 bits: device number (for this type). higher 8 bits: device type
+ static LONG m_nWaveDevice; // use the SNDDEV_GET_NUMBER and SNDDEV_GET_TYPE macros to decode
static LONG m_nMidiDevice;
static DWORD m_nBufferLength;
static EQPRESET m_EqSettings;
Modified: trunk/OpenMPT/soundlib/SNDDEV.H
===================================================================
--- trunk/OpenMPT/soundlib/SNDDEV.H 2010-10-08 14:40:44 UTC (rev 735)
+++ trunk/OpenMPT/soundlib/SNDDEV.H 2010-10-12 20:13:10 UTC (rev 736)
@@ -22,13 +22,19 @@
//
// Sound Device Types
-enum {
- SNDDEV_WAVEOUT=0,
+enum
+{
+ SNDDEV_WAVEOUT = 0,
SNDDEV_DSOUND,
SNDDEV_ASIO,
SNDDEV_NUM_DEVTYPES
};
+#define SNDDEV_DEVICE_MASK 0xFF // Mask for getting the device number
+#define SNDDEV_DEVICE_SHIFT 8 // Shift amount for getting the device type
+#define SNDDEV_GET_NUMBER(x) (x & SNDDEV_DEVICE_MASK) // Use this for getting the device number
+#define SNDDEV_GET_TYPE(x) (x >> SNDDEV_DEVICE_SHIFT) // ...and this for getting the device type
+
#define SNDDEV_MINBUFFERS 2
#define SNDDEV_MAXBUFFERS 16
#define SNDDEV_MINBUFFERLEN 1 // 1ms
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-08 14:40:51
|
Revision: 735
http://modplug.svn.sourceforge.net/modplug/?rev=735&view=rev
Author: saga-games
Date: 2010-10-08 14:40:44 +0000 (Fri, 08 Oct 2010)
Log Message:
-----------
[Fix] STM Loader: Some fix from Schism which makes sense.
[Fix] Mod Specifications: Octave 8 was allowed in S3M files, that's a bit much of course (it wasn't even saved)
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_stm.cpp
trunk/OpenMPT/soundlib/mod_specifications.h
Modified: trunk/OpenMPT/soundlib/Load_stm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_stm.cpp 2010-10-05 16:55:20 UTC (rev 734)
+++ trunk/OpenMPT/soundlib/Load_stm.cpp 2010-10-08 14:40:44 UTC (rev 735)
@@ -108,7 +108,11 @@
if ((pIns->nLength < 4) || (!pIns->nVolume)) pIns->nLength = 0;
pIns->nLoopStart = LittleEndianW(pStm->loopbeg);
pIns->nLoopEnd = LittleEndianW(pStm->loopend);
- if ((pIns->nLoopEnd > pIns->nLoopStart) && (pIns->nLoopEnd != 0xFFFF)) pIns->uFlags |= CHN_LOOP;
+ if ((pIns->nLoopEnd > pIns->nLoopStart) && (pIns->nLoopEnd != 0xFFFF))
+ {
+ pIns->uFlags |= CHN_LOOP;
+ pIns->nLoopEnd = min(pIns->nLoopEnd, pIns->nLength);
+ }
}
dwMemPos = sizeof(STMHEADER);
for (UINT nOrd = 0; nOrd < 128; nOrd++) if (Order[nOrd] >= 99) Order[nOrd] = Order.GetInvalidPatIndex();
Modified: trunk/OpenMPT/soundlib/mod_specifications.h
===================================================================
--- trunk/OpenMPT/soundlib/mod_specifications.h 2010-10-05 16:55:20 UTC (rev 734)
+++ trunk/OpenMPT/soundlib/mod_specifications.h 2010-10-08 14:40:44 UTC (rev 735)
@@ -265,7 +265,7 @@
// TODO: Set correct values.
"s3m", // File extension
13, // Minimum note index
- 120, // Maximum note index
+ 108, // Maximum note index
true, // Has notecut.
false, // No noteoff.
false, // No notefade.
@@ -305,7 +305,7 @@
// TODO: Set correct values.
"s3m", // File extension
13, // Minimum note index
- NOTE_MAX, // Maximum note index
+ 108, // Maximum note index
true, // Has notecut.
false, // No noteoff.
false, // No notefade.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-05 16:55:27
|
Revision: 734
http://modplug.svn.sourceforge.net/modplug/?rev=734&view=rev
Author: saga-games
Date: 2010-10-05 16:55:20 +0000 (Tue, 05 Oct 2010)
Log Message:
-----------
[Imp] When there's no mix rate specified in the INI file and the current audio device is an ASIO device, the default frequency is now obtained from the driver (previously, it was 44KHz in all cases, which some ASIO drivers doesn't support)
[Imp] Some improvements to the Registry / INI reading (if there were no Registry settings because MPT 1.16 was previously not installed, the INI file is now read as it might contain some lines created by the installer)
[Ref] Minor refactoring in the ASIO device class
[Ref] Removed some unused #include lines
Modified Paths:
--------------
trunk/OpenMPT/mptrack/KeyConfigDlg.h
trunk/OpenMPT/mptrack/MainFrm.cpp
trunk/OpenMPT/mptrack/Mainfrm.h
trunk/OpenMPT/soundlib/SNDDEV.H
trunk/OpenMPT/soundlib/SNDDEVX.H
trunk/OpenMPT/soundlib/Snddev.cpp
trunk/OpenMPT/soundlib/Sndfile.h
Modified: trunk/OpenMPT/mptrack/KeyConfigDlg.h
===================================================================
--- trunk/OpenMPT/mptrack/KeyConfigDlg.h 2010-10-04 17:44:27 UTC (rev 733)
+++ trunk/OpenMPT/mptrack/KeyConfigDlg.h 2010-10-05 16:55:20 UTC (rev 734)
@@ -1,15 +1,8 @@
#include "stdafx.h"
#include "mptrack.h"
#include "MainFrm.h"
-#include "snddev.h"
-#include "moddoc.h"
-#include "childfrm.h"
-#include "dlsbank.h"
#include "mpdlgs.h"
#include "moptions.h"
-#include "vstplug.h"
-#include "moptions.h"
-//#include "KeyConfigDlg.h"
// Might promote to class so we can add rules
// (eg automatically do note off stuff, generate chord keybindings from notes based just on modifier.
Modified: trunk/OpenMPT/mptrack/MainFrm.cpp
===================================================================
--- trunk/OpenMPT/mptrack/MainFrm.cpp 2010-10-04 17:44:27 UTC (rev 733)
+++ trunk/OpenMPT/mptrack/MainFrm.cpp 2010-10-05 16:55:20 UTC (rev 734)
@@ -137,7 +137,6 @@
BOOL CMainFrame::gbMdiMaximize = FALSE;
bool CMainFrame::gbShowHackControls = false;
//rewbs.varWindowSize
-LONG CMainFrame::glCtrlWindowHeight = 188; //obsolete, for backwards compat only
LONG CMainFrame::glGeneralWindowHeight = 178;
LONG CMainFrame::glPatternWindowHeight = 152;
LONG CMainFrame::glSampleWindowHeight = 188;
@@ -319,15 +318,15 @@
{
if (i == DIR_TUNING) // Hack: Tuning folder is set already so don't reset it.
continue;
- m_szDefaultDirectory[i][0] = 0;
- m_szWorkingDirectory[i][0] = 0;
+ MemsetZero(m_szDefaultDirectory[i]);
+ MemsetZero(m_szWorkingDirectory[i]);
}
m_dTotalCPU=0;
- memset(gpenVuMeter, 0, sizeof(gpenVuMeter));
+ MemsetZero(gpenVuMeter);
// Default chords
- memset(Chords, 0, sizeof(Chords));
+ MemsetZero(Chords);
for (UINT ichord=0; ichord<3*12; ichord++)
{
Chords[ichord].key = (BYTE)ichord;
@@ -359,12 +358,12 @@
m_csRegWindow.Format("%s%s", m_csRegKey, MAINFRAME_REGEXT_WINDOW);
CString storedVersion = GetPrivateProfileCString("Version", "Version", "", theApp.GetConfigFileName());
- //If version number stored in INI is 1.17.02.40 or later, load setting from INI file.
- //Else load settings from Registry
- if (storedVersion >= "1.17.02.40")
+ // 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();
- else
- LoadRegistrySettings();
+ }
m_InputHandler = new CInputHandler(this); //rewbs.customKeys
m_pPerfCounter= new CPerformanceCounter();
@@ -411,17 +410,40 @@
rgbCustomColors[ncol] = GetPrivateProfileDWord("Display", s, rgbCustomColors[ncol], iniFile);
}
- LONG defaultDevice = EnumerateSoundDevices(SNDDEV_ASIO, 0, nullptr, 0) ? SNDDEV_ASIO : SNDDEV_DSOUND;
- m_nWaveDevice = GetPrivateProfileLong("Sound Settings", "WaveDevice", (defaultDevice << 8), iniFile);
+ DWORD defaultDevice = SNDDEV_DSOUND << 8; // first DirectSound device
+#ifndef NO_ASIO
+ // If there's an ASIO device available, prefer it over DirectSound
+ if(EnumerateSoundDevices(SNDDEV_ASIO, 0, nullptr, 0))
+ {
+ defaultDevice = SNDDEV_ASIO << 8;
+ }
+#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", 44100, 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", 75, 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((m_nWaveDevice >> 8) == SNDDEV_ASIO)
+ {
+ ISoundDevice *dummy;
+ if(CreateSoundDevice(SNDDEV_ASIO, &dummy))
+ {
+ m_dwRate = dummy->GetCurrentSampleRate(m_nWaveDevice & 0xFF);
+ delete dummy;
+ }
+ }
+#endif // NO_ASIO
+ }
m_nPreAmp = GetPrivateProfileDWord("Sound Settings", "PreAmp", 128, iniFile);
CSoundFile::m_nStereoSeparation = GetPrivateProfileLong("Sound Settings", "StereoSeparation", 128, iniFile);
@@ -498,7 +520,7 @@
m_pAutoSaver->SetFilenameTemplate(GetPrivateProfileCString("AutoSave", "FileNameTemplate", "", iniFile));
}
-void CMainFrame::LoadRegistrySettings()
+bool CMainFrame::LoadRegistrySettings()
//-------------------------------------
{
@@ -523,7 +545,6 @@
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, "MDICtrlHeight", NULL, &dwREG_DWORD, (LPBYTE)&glCtrlWindowHeight, &dwDWORDSize); //obsolete, for backwards compat only
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);
@@ -579,7 +600,7 @@
RegQueryValueEx(key, "MidiSetup", NULL, &dwREG_DWORD, (LPBYTE)&m_dwMidiSetup, &dwDWORDSize);
RegQueryValueEx(key, "MidiDevice", NULL, &dwREG_DWORD, (LPBYTE)&m_nMidiDevice, &dwDWORDSize);
RegQueryValueEx(key, "PatternSetup", NULL, &dwREG_DWORD, (LPBYTE)&m_dwPatternSetup, &dwDWORDSize);
- m_dwPatternSetup |= PATTERN_NOTEFADE; // Set flag to maintain old behaviour(was changed in 1.17.02.50).
+ m_dwPatternSetup |= PATTERN_NOTEFADE; // Set flag to maintain old behaviour (was changed in 1.17.02.50).
m_dwPatternSetup |= PATTERN_RESETCHANNELS; // Set flag to reset channels on loop was changed in 1.17.03.01).
m_dwPatternSetup &= ~0x800; // quick paste autorepeat is now a keymap option
RegQueryValueEx(key, "RowSpacing", NULL, &dwREG_DWORD, (LPBYTE)&m_nRowSpacing, &dwDWORDSize);
@@ -643,6 +664,9 @@
//end rewbs.autoSave
RegCloseKey(key);
+ } else
+ {
+ return false;
}
if (RegOpenKeyEx(HKEY_CURRENT_USER, m_csRegSettings, 0, KEY_READ, &key) == ERROR_SUCCESS)
@@ -659,6 +683,8 @@
gnPatternSpacing = theApp.GetProfileInt("Pattern Editor", "Spacing", 0);
gbPatternVUMeters = theApp.GetProfileInt("Pattern Editor", "VU-Meters", 0);
gbPatternPluginNames = theApp.GetProfileInt("Pattern Editor", "Plugin-Names", 1);
+
+ return true;
}
Modified: trunk/OpenMPT/mptrack/Mainfrm.h
===================================================================
--- trunk/OpenMPT/mptrack/Mainfrm.h 2010-10-04 17:44:27 UTC (rev 733)
+++ trunk/OpenMPT/mptrack/Mainfrm.h 2010-10-05 16:55:20 UTC (rev 734)
@@ -412,7 +412,7 @@
static UINT m_nLastOptionsPage;
static BOOL gbMdiMaximize;
static bool gbShowHackControls;
- static LONG glCtrlWindowHeight, glTreeWindowWidth, glTreeSplitRatio;
+ static LONG glTreeWindowWidth, glTreeSplitRatio;
static LONG glGeneralWindowHeight, glPatternWindowHeight, glSampleWindowHeight,
glInstrumentWindowHeight, glCommentsWindowHeight, glGraphWindowHeight; //rewbs.varWindowSize
static HHOOK ghKbdHook;
@@ -423,7 +423,8 @@
// Audio Setup
static DWORD m_dwSoundSetup, m_dwRate, m_dwQuality, m_nSrcMode, m_nBitsPerSample, m_nPreAmp, gbLoopSong, m_nChannels;
- static LONG m_nWaveDevice, m_nMidiDevice;
+ static LONG m_nWaveDevice; // lower 8 bits: device number (for this type). higher 8 bits: device type
+ static LONG m_nMidiDevice;
static DWORD m_nBufferLength;
static EQPRESET m_EqSettings;
// Pattern Setup
@@ -702,7 +703,7 @@
afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
private:
- void LoadRegistrySettings();
+ bool LoadRegistrySettings();
void LoadIniSettings();
void SaveIniSettings();
};
Modified: trunk/OpenMPT/soundlib/SNDDEV.H
===================================================================
--- trunk/OpenMPT/soundlib/SNDDEV.H 2010-10-04 17:44:27 UTC (rev 733)
+++ trunk/OpenMPT/soundlib/SNDDEV.H 2010-10-05 16:55:20 UTC (rev 734)
@@ -73,6 +73,7 @@
virtual BOOL IsOpen() = 0;
virtual UINT GetCurrentLatency() = 0;
virtual void SilenceAudioBuffer(ISoundSource *pSource, ULONG nMaxLatency, DWORD dwUser=0) = 0;
+ virtual UINT GetCurrentSampleRate(UINT nDevice) { return 0; }
};
Modified: trunk/OpenMPT/soundlib/SNDDEVX.H
===================================================================
--- trunk/OpenMPT/soundlib/SNDDEVX.H 2010-10-04 17:44:27 UTC (rev 733)
+++ trunk/OpenMPT/soundlib/SNDDEVX.H 2010-10-05 16:55:20 UTC (rev 734)
@@ -1,6 +1,14 @@
#ifndef _SNDDEVX_H_
#define _SNDDEVX_H_
+#include <mmsystem.h>
+#include <dsound.h>
+
+#ifndef NO_ASIO
+#include <iasiodrv.h>
+#define ASIO_LOG
+#endif
+
////////////////////////////////////////////////////////////////////////////////////
//
// MMSYSTEM WaveOut device
@@ -123,11 +131,16 @@
UINT GetCurrentLatency() { return m_nAsioBufferLen; }
void SilenceAudioBuffer(ISoundSource *pSource, ULONG nMaxLatency, DWORD dwBuffer);
+ UINT GetCurrentSampleRate(UINT nDevice);
public:
static BOOL EnumerateDevices(UINT nIndex, LPSTR pszDescription, UINT cbSize);
protected:
+ void OpenDevice(UINT nDevice);
+ void CloseDevice();
+
+protected:
static CASIODevice *gpCurrentAsio;
static LONG gnFillBuffers;
static void BufferSwitch(long doubleBufferIndex, ASIOBool directProcess);
Modified: trunk/OpenMPT/soundlib/Snddev.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snddev.cpp 2010-10-04 17:44:27 UTC (rev 733)
+++ trunk/OpenMPT/soundlib/Snddev.cpp 2010-10-05 16:55:20 UTC (rev 734)
@@ -1,12 +1,5 @@
#include "stdafx.h"
-#include <mmsystem.h>
-#include <dsound.h>
-#ifndef NO_ASIO
-#include <iasiodrv.h>
-#define ASIO_LOG
-#endif
-
#include "snddev.h"
#include "snddevx.h"
@@ -652,18 +645,13 @@
{
gpCurrentAsio = NULL;
}
- if (m_pAsioDrv)
- {
- m_pAsioDrv->Release();
- m_pAsioDrv = NULL;
- }
+ CloseDevice();
}
BOOL CASIODevice::Open(UINT nDevice, LPWAVEFORMATEX pwfx)
//-------------------------------------------------------
{
- CLSID clsid;
BOOL bOk = FALSE;
if (m_pAsioDrv) Close();
@@ -678,17 +666,8 @@
Log("CASIODevice::Open(%d:\"%s\"): %d-bit, %d channels, %dHz\n",
nDevice, gAsioDrivers[nDevice].name, pwfx->wBitsPerSample, pwfx->nChannels, pwfx->nSamplesPerSec);
#endif
- clsid = gAsioDrivers[nDevice].clsid;
- if (CoCreateInstance(clsid,0,CLSCTX_INPROC_SERVER, clsid, (VOID **)&m_pAsioDrv) == S_OK)
- {
- m_pAsioDrv->init((void *)m_hWnd);
- } else
- {
- #ifdef ASIO_LOG
- Log(" CoCreateInstance failed!\n");
- #endif
- m_pAsioDrv = NULL;
- }
+ OpenDevice(nDevice);
+
if (m_pAsioDrv)
{
long nInputChannels = 0, nOutputChannels = 0;
@@ -812,11 +791,7 @@
#ifdef ASIO_LOG
Log("Error opening ASIO device!\n");
#endif
- if (m_pAsioDrv)
- {
- m_pAsioDrv->Release();
- m_pAsioDrv = NULL;
- }
+ CloseDevice();
}
return bOk;
}
@@ -856,12 +831,7 @@
} catch(...) {
CASIODevice::ReportASIOException("ASIO crash in disposeBuffers()\n");
}
- try {
- m_pAsioDrv->Release();
- } catch(...) {
- CASIODevice::ReportASIOException("ASIO crash in Release()\n");
- }
- m_pAsioDrv = NULL;
+ CloseDevice();
}
if (gpCurrentAsio == this)
{
@@ -885,7 +855,48 @@
}
}
+
+void CASIODevice::OpenDevice(UINT nDevice)
+//----------------------------------------
+{
+ if (m_pAsioDrv)
+ {
+ return;
+ }
+
+ CLSID clsid = gAsioDrivers[nDevice].clsid;
+ if (CoCreateInstance(clsid,0,CLSCTX_INPROC_SERVER, clsid, (VOID **)&m_pAsioDrv) == S_OK)
+ {
+ m_pAsioDrv->init((void *)m_hWnd);
+ } else
+ {
+#ifdef ASIO_LOG
+ Log(" CoCreateInstance failed!\n");
+#endif
+ m_pAsioDrv = NULL;
+ }
+}
+
+
+void CASIODevice::CloseDevice()
+//-----------------------------
+{
+ if (m_pAsioDrv)
+ {
+ try
+ {
+ m_pAsioDrv->Release();
+ } catch(...)
+ {
+ CASIODevice::ReportASIOException("ASIO crash in Release()\n");
+ }
+ m_pAsioDrv = NULL;
+ }
+}
+
+
void CASIODevice::SilenceAudioBuffer(ISoundSource *pSource, ULONG nMaxLatency, DWORD dwBuffer)
+//--------------------------------------------------------------------------------------------
{
for (UINT ich=0; ich<m_nChannels; ich++){
memset(m_BufferInfo[ich].buffers[dwBuffer], 0, m_nAsioBufferLen);
@@ -1276,7 +1287,7 @@
}
BOOL CASIODevice::ReportASIOException(LPCSTR format,...)
-//-------------------------------------------------------
+//------------------------------------------------------
{
CHAR cBuf[1024];
va_list va;
@@ -1289,6 +1300,36 @@
return TRUE;
}
+
+// If the device is open, this returns the current sample rate. If it's not open, it returns some sample rate supported by the device.
+UINT CASIODevice::GetCurrentSampleRate(UINT nDevice)
+//--------------------------------------------------
+{
+ const bool wasOpen = (m_pAsioDrv != NULL);
+ if(!wasOpen)
+ {
+ OpenDevice(nDevice);
+ if(m_pAsioDrv == NULL)
+ {
+ return 0;
+ }
+ }
+
+ ASIOSampleRate samplerate;
+ if(m_pAsioDrv->getSampleRate(&samplerate) != ASE_OK)
+ {
+ samplerate = 0;
+ }
+
+ if(!wasOpen)
+ {
+ CloseDevice();
+ }
+
+ return (UINT)samplerate;
+}
+
+
#endif // NO_ASIO
///////////////////////////////////////////////////////////////////////////////////////
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2010-10-04 17:44:27 UTC (rev 733)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2010-10-05 16:55:20 UTC (rev 734)
@@ -40,7 +40,7 @@
BYTE nVibSweep; // Auto vibrato sweep (i.e. how long it takes until the vibrato effect reaches its full strength)
BYTE nVibDepth; // Auto vibrato depth
BYTE nVibRate; // Auto vibrato rate (speed)
- //CHAR name[32]; // Maybe it would be nicer to have sample names here, but that would require some refactoring. Also, would this slow down the mixer (cache misses)?
+ //CHAR name[MAX_SAMPLENAME]; // Maybe it would be nicer to have sample names here, but that would require some refactoring. Also, would this slow down the mixer (cache misses)?
CHAR filename[MAX_SAMPLEFILENAME];
// Return the size of one (elementary) sample in bytes.
@@ -106,8 +106,8 @@
BYTE nDNA; // Duplicate note action
BYTE nPanSwing; // Random panning factor
BYTE nVolSwing; // Random volume factor
- BYTE nIFC; // Default filter cutoff
- BYTE nIFR; // Default filter resonance
+ BYTE nIFC; // Default filter cutoff (00...7F). Used if the high bit is set
+ BYTE nIFR; // Default filter resonance (00...7F). Used if the high bit is set
WORD wMidiBank; // MIDI bank
BYTE nMidiProgram; // MIDI program
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-04 17:44:33
|
Revision: 733
http://modplug.svn.sourceforge.net/modplug/?rev=733&view=rev
Author: saga-games
Date: 2010-10-04 17:44:27 +0000 (Mon, 04 Oct 2010)
Log Message:
-----------
[Mod] S3M Loader: Changed some code 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] Mod Conversion: E9x is now converted to Q0x, not Q8x.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_s3m.cpp
trunk/OpenMPT/soundlib/modcommand.cpp
Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-10-03 21:22:48 UTC (rev 732)
+++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-10-04 17:44:27 UTC (rev 733)
@@ -377,9 +377,7 @@
if (c5Speed < 1024) c5Speed = 1024;
Samples[iSmp].nC5Speed = c5Speed;
- insfile[iSmp] = ((DWORD)LittleEndianW(*((LPWORD)(s+0x0E)))) << 4;
- insfile[iSmp] += ((DWORD)(BYTE)s[0x0D]) << 20;
- if (insfile[iSmp] > dwMemLength) insfile[iSmp] &= 0xFFFF; // wtf? whose idea was this?
+ insfile[iSmp - 1] = (s[0x0E] << 4) | (s[0x0F] << 12) | (s[0x0D] << 20);
if(Samples[iSmp].nLoopEnd < 2)
Samples[iSmp].nLoopStart = Samples[iSmp].nLoopEnd = 0;
@@ -499,23 +497,29 @@
}
// Reading samples
- for (UINT iRaw = 1; iRaw <= insnum; iRaw++) if ((Samples[iRaw].nLength) && (insfile[iRaw]))
+ for (UINT iRaw = 1; iRaw <= insnum; iRaw++) if ((Samples[iRaw].nLength) && (insfile[iRaw - 1]))
{
UINT flags = (psfh.version == 1) ? RS_PCM8S : RS_PCM8U;
if (insflags[iRaw-1] & 4) flags += 5;
if (insflags[iRaw-1] & 2) flags |= RSF_STEREO;
if (inspack[iRaw-1] == 4) flags = RS_ADPCM4;
- dwMemPos = insfile[iRaw];
- dwMemPos += ReadSample(&Samples[iRaw], flags, (LPSTR)(lpStream + dwMemPos), dwMemLength - dwMemPos);
+ if(insfile[iRaw - 1] < dwMemLength)
+ {
+ dwMemPos = insfile[iRaw - 1];
+ }
+ if(dwMemPos < dwMemLength)
+ {
+ dwMemPos += ReadSample(&Samples[iRaw], flags, (LPSTR)(lpStream + dwMemPos), dwMemLength - dwMemPos);
+ }
}
m_nMinPeriod = 64;
m_nMaxPeriod = 32767;
if (psfh.flags & 0x10) m_dwSongFlags |= SONG_AMIGALIMITS;
#ifdef MODPLUG_TRACKER
- if(bHasAdlibPatches && m_pModDoc != nullptr)
+ if(bHasAdlibPatches && GetpModDoc() != nullptr)
{
- m_pModDoc->AddToLog("This track uses Adlib instruments, which are not supported by OpenMPT.");
+ GetpModDoc()->AddToLog("This track uses Adlib instruments, which are not supported by OpenMPT.");
}
#endif // MODPLUG_TRACKER
Modified: trunk/OpenMPT/soundlib/modcommand.cpp
===================================================================
--- trunk/OpenMPT/soundlib/modcommand.cpp 2010-10-03 21:22:48 UTC (rev 732)
+++ trunk/OpenMPT/soundlib/modcommand.cpp 2010-10-04 17:44:27 UTC (rev 733)
@@ -27,7 +27,7 @@
case 0x50: m->param = (m->param & 0x0F) | 0x20; break;
case 0x60: m->param = (m->param & 0x0F) | 0xB0; break;
case 0x70: m->param = (m->param & 0x03) | 0x40; break;
- case 0x90: m->command = CMD_RETRIG; m->param = 0x80 | (m->param & 0x0F); break;
+ case 0x90: m->command = CMD_RETRIG; m->param = (m->param & 0x0F); break;
case 0xA0: if (m->param & 0x0F) { m->command = CMD_VOLUMESLIDE; m->param = (m->param << 4) | 0x0F; } else m->command = 0; break;
case 0xB0: if (m->param & 0x0F) { m->command = CMD_VOLUMESLIDE; m->param |= 0xF0; } else m->command = 0; break;
case 0xC0: if (m->param == 0xC0) { m->command = CMD_NONE; m->note = NOTE_NOTECUT; } // this does different things in IT and ST3
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-03 21:22:54
|
Revision: 732
http://modplug.svn.sourceforge.net/modplug/?rev=732&view=rev
Author: saga-games
Date: 2010-10-03 21:22:48 +0000 (Sun, 03 Oct 2010)
Log Message:
-----------
[Fix] Do you know what a null pointer is?
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Snd_fx.cpp
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-03 16:15:11 UTC (rev 731)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-03 21:22:48 UTC (rev 732)
@@ -475,7 +475,7 @@
if ((pIns) && (note) && (note <= 128))
{
- if(bPorta && pIns == pChn->pModInstrument && pChn->pModSample->pSample != nullptr && IsCompatibleMode(TRK_IMPULSETRACKER))
+ if(bPorta && pIns == pChn->pModInstrument && (pChn->pModSample != nullptr && pChn->pModSample->pSample != nullptr) && IsCompatibleMode(TRK_IMPULSETRACKER))
{
#ifdef DEBUG
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-03 16:15:17
|
Revision: 731
http://modplug.svn.sourceforge.net/modplug/?rev=731&view=rev
Author: saga-games
Date: 2010-10-03 16:15:11 +0000 (Sun, 03 Oct 2010)
Log Message:
-----------
[Fix] IT Compatibility: Fixed a combination of multisample instruments and Gxx (fixes the guitars in "Ultima Ratio" by Nebularia and some subtle things in spx-shuttledeparture.it)
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Snd_fx.cpp
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-03 16:13:09 UTC (rev 730)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-03 16:15:11 UTC (rev 731)
@@ -475,9 +475,38 @@
if ((pIns) && (note) && (note <= 128))
{
- if (pIns->NoteMap[note-1] >= NOTE_MIN_SPECIAL) return;
- UINT n = pIns->Keyboard[note-1];
- pSmp = ((n) && (n < MAX_SAMPLES)) ? &Samples[n] : NULL;
+ if(bPorta && pIns == pChn->pModInstrument && pChn->pModSample->pSample != nullptr && IsCompatibleMode(TRK_IMPULSETRACKER))
+ {
+#ifdef DEBUG
+ {
+ // Check if original behaviour would have been used here
+ if (pIns->NoteMap[note-1] >= NOTE_MIN_SPECIAL)
+ {
+ ASSERT(false);
+ return;
+ }
+ UINT n = pIns->Keyboard[note-1];
+ pSmp = ((n) && (n < MAX_SAMPLES)) ? &Samples[n] : nullptr;
+ if(pSmp != pChn->pModSample)
+ {
+ ASSERT(false);
+ }
+ }
+#endif // DEBUG
+ // Impulse Tracker doesn't seem to look up the sample for new notes when in instrument mode and it encounters a situation like this:
+ // G-6 01 ... ... <-- G-6 is bound to sample 01
+ // F-6 01 ... GFF <-- F-6 is bound to sample 02, but sample 01 will be played
+ // This behaviour is not used if sample 01 has no actual sample data (hence the "pChn->pModSample->pSample != nullptr")
+ // and it is also ignored when the instrument number changes. This fixes f.e. the guitars in "Ultima Ratio" by Nebularia
+ // and some slides in spx-shuttledeparture.it.
+ pSmp = pChn->pModSample;
+ } else
+ {
+ // Original behaviour
+ if (pIns->NoteMap[note-1] >= NOTE_MIN_SPECIAL) return;
+ UINT n = pIns->Keyboard[note-1];
+ pSmp = ((n) && (n < MAX_SAMPLES)) ? &Samples[n] : nullptr;
+ }
} else
if (m_nInstruments)
{
@@ -656,7 +685,6 @@
}
-
pChn->pSample = pSmp->pSample;
pChn->nTranspose = pSmp->RelativeTone;
@@ -738,7 +766,7 @@
pChn->nFineTune = pSmp->nFineTune;
}
}
- // IT Compatibility: Update multisample instruments frequency even if instrument is not specified
+ // IT Compatibility: Update multisample instruments frequency even if instrument is not specified (fixes the guitars in spx-shuttledeparture.it)
if(!bPorta && pSmp && IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nC5Speed = pSmp->nC5Speed;
// XM Compatibility: Ignore notes with portamento if there was no note playing.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-03 16:13:15
|
Revision: 730
http://modplug.svn.sourceforge.net/modplug/?rev=730&view=rev
Author: saga-games
Date: 2010-10-03 16:13:09 +0000 (Sun, 03 Oct 2010)
Log Message:
-----------
[Imp] IT Loader: Added some parapointer checks to detect a possibly broken edit history (fix for those old broken IT files created with early versions of Schism Tracker)
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_it.cpp
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2010-10-03 16:11:07 UTC (rev 729)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-10-03 16:13:09 UTC (rev 730)
@@ -457,9 +457,9 @@
ITFILEHEADER *pifh = (ITFILEHEADER *)lpStream;
DWORD dwMemPos = sizeof(ITFILEHEADER);
- DWORD inspos[MAX_INSTRUMENTS];
- DWORD smppos[MAX_SAMPLES];
- vector<DWORD> patpos; patpos.resize(Patterns.Size(), 0);
+ vector<DWORD> inspos;
+ vector<DWORD> smppos;
+ vector<DWORD> patpos;
// Using eric's code here to take care of NNAs etc..
// -> CODE#0006
// -> DESC="misc quantity changes"
@@ -639,58 +639,88 @@
}
}
+ // Find the first parapointer.
+ // This is used for finding out whether the edit history is actually stored in the file or not,
+ // as some early versions of Schism Tracker set the history flag, but didn't save anything.
+ // We will consider the history invalid if it ends after the first parapointer.
+ DWORD minptr = dwMemLength;
+
// Reading Instrument Offsets
- memset(inspos, 0, sizeof(inspos));
- UINT inspossize = pifh->insnum;
- if (inspossize > MAX_INSTRUMENTS) inspossize = MAX_INSTRUMENTS;
- inspossize <<= 2;
- memcpy(inspos, lpStream+dwMemPos, inspossize);
- dwMemPos += pifh->insnum * 4;
+ inspos.resize(pifh->insnum);
+ for(size_t n = 0; n < pifh->insnum; n++)
+ {
+ if(4 > dwMemLength - dwMemPos)
+ return false;
+ DWORD insptr = LittleEndian(*(DWORD *)(lpStream + dwMemPos));
+ inspos[n] = insptr;
+ if(insptr > 0)
+ {
+ minptr = min(minptr, insptr);
+ }
+ dwMemPos += 4;
+ }
- // Reading Samples Offsets
- memset(smppos, 0, sizeof(smppos));
- UINT smppossize = pifh->smpnum;
- if (smppossize > MAX_SAMPLES) smppossize = MAX_SAMPLES;
- smppossize <<= 2;
- memcpy(smppos, lpStream+dwMemPos, smppossize);
- dwMemPos += pifh->smpnum * 4;
+ // Reading Sample Offsets
+ smppos.resize(pifh->smpnum);
+ for(size_t n = 0; n < pifh->smpnum; n++)
+ {
+ if(4 > dwMemLength - dwMemPos)
+ return false;
+ DWORD smpptr = LittleEndian(*(DWORD *)(lpStream + dwMemPos));
+ smppos[n] = smpptr;
+ if(smpptr > 0)
+ {
+ minptr = min(minptr, smpptr);
+ }
+ dwMemPos += 4;
+ }
+ // Reading Pattern Offsets
+ patpos.resize(pifh->patnum);
+ for(size_t n = 0; n < pifh->patnum; n++)
+ {
+ if(4 > dwMemLength - dwMemPos)
+ return false;
+ DWORD patptr = LittleEndian(*(DWORD *)(lpStream + dwMemPos));
+ patpos[n] = patptr;
+ if(patptr > 0)
+ {
+ minptr = min(minptr, patptr);
+ }
+ dwMemPos += 4;
+ }
+
// Reading Patterns Offsets
- UINT patpossize = pifh->patnum;
- if(patpossize > GetModSpecifications().patternsMax)
+ if(patpos.size() > GetModSpecifications().patternsMax)
{
// Hack: Note user here if file contains more patterns than what can be read.
#ifdef MODPLUG_TRACKER
if(GetpModDoc() != nullptr)
{
CString str;
- str.Format(str_PatternSetTruncationNote, patpossize, GetModSpecifications().patternsMax);
+ str.Format(str_PatternSetTruncationNote, patpos.size(), GetModSpecifications().patternsMax);
GetpModDoc()->AddToLog(str);
}
#endif // MODPLUG_TRACKER
- patpossize = GetModSpecifications().patternsMax;
}
- patpos.resize(patpossize);
- patpossize *= 4; // <-> patpossize *= sizeof(DWORD);
- if(patpossize > dwMemLength - dwMemPos)
- return false;
- if(patpossize > 0)
- memcpy(&patpos[0], lpStream+dwMemPos, patpossize);
- dwMemPos += pifh->patnum * 4;
+ if(pifh->special & 0x01)
+ {
+ minptr = min(minptr, pifh->msgoffset);
+ }
// Reading IT Edit History Info
// This is only supposed to be present if bit 1 of the special flags is set.
- // However, old versions of Schism and probably other trackers always set this
+ // However, old versions of Schism and probably other trackers always set this bit
// even if they don't write the edit history count. So we have to filter this out...
- // (for now we will just ignore those Schism versions, as Schism seems to be the only tracker that did this)
- const bool oldSchism = ((pifh->cwtv & 0xF000) == 0x1000 && pifh->cwtv < 0x1050) ? true : false;
- if (dwMemPos + 2 < dwMemLength && (pifh->special & 0x02) && !oldSchism)
+ // This is done by looking at the parapointers. If the history data end after
+ // the first parapointer, we assume that it's actually no history data.
+ if (dwMemPos + 2 < dwMemLength && (pifh->special & 0x02))
{
size_t nflt = LittleEndianW(*((uint16*)(lpStream + dwMemPos)));
dwMemPos += 2;
- if (nflt * 8 <= dwMemLength - dwMemPos)
+ if (nflt * 8 <= dwMemLength - dwMemPos && dwMemPos + nflt * 8 <= minptr)
{
GetpModDoc()->GetFileHistory()->clear();
for(size_t n = 0; n < nflt; n++)
@@ -723,6 +753,10 @@
#endif // MODPLUG_TRACKER
dwMemPos += 8;
}
+ } else
+ {
+ // Oops, we were not supposed to read this.
+ dwMemPos -= 2;
}
}
// Reading MIDI Output & Macros
@@ -870,12 +904,12 @@
// In order to properly compute the position, in file, of eventual extended settings
// such as "attack" we need to keep the "real" size of the last sample as those extra
// setting will follow this sample in the file
- UINT lastSampleOffset = smppos[pifh->smpnum - 1] + sizeof(ITSAMPLESTRUCT);
+ UINT lastSampleOffset = smppos[min(0, pifh->smpnum - 1)] + sizeof(ITSAMPLESTRUCT);
// -! NEW_FEATURE#0027
// Reading Samples
- m_nSamples = CLAMP(pifh->smpnum, 1, MAX_SAMPLES - 1);
- for (UINT nsmp=0; nsmp<pifh->smpnum; nsmp++) if ((smppos[nsmp]) && (smppos[nsmp] <= dwMemLength - sizeof(ITSAMPLESTRUCT)))
+ m_nSamples = min(pifh->smpnum, MAX_SAMPLES - 1);
+ for (UINT nsmp = 0; nsmp < m_nSamples; nsmp++) if ((smppos[nsmp]) && (smppos[nsmp] <= dwMemLength - sizeof(ITSAMPLESTRUCT)))
{
ITSAMPLESTRUCT *pis = (ITSAMPLESTRUCT *)(lpStream+smppos[nsmp]);
if (pis->id == LittleEndian(IT_IMPS))
@@ -939,6 +973,7 @@
memcpy(m_szNames[nsmp + 1], pis->name, 26);
SpaceToNullStringFixed(m_szNames[nsmp + 1], 26);
}
+ m_nSamples = max(1, m_nSamples);
m_nMinPeriod = 8;
m_nMaxPeriod = 0xF000;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-10-03 16:11:14
|
Revision: 729
http://modplug.svn.sourceforge.net/modplug/?rev=729&view=rev
Author: saga-games
Date: 2010-10-03 16:11:07 +0000 (Sun, 03 Oct 2010)
Log Message:
-----------
[Mod] ITP Loader: Added version check (why was this not there in the first place?)
[Mod] Mod Conversion: Added warning if the edit history will be lost
[Ref] Some minor changes here and there
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Mod2wave.cpp
trunk/OpenMPT/mptrack/ModConvert.cpp
trunk/OpenMPT/mptrack/ModConvert.h
trunk/OpenMPT/soundlib/Load_itp.cpp
trunk/OpenMPT/soundlib/Snd_defs.h
trunk/OpenMPT/soundlib/Sndmix.cpp
Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mod2wave.cpp 2010-09-30 22:44:28 UTC (rev 728)
+++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2010-10-03 16:11:07 UTC (rev 729)
@@ -708,12 +708,12 @@
DWORD dwSleepTime = dwStartTime;
CMainFrame::GetMainFrame()->InitRenderer(m_pSndFile); //rewbs.VSTTimeInfo
- for (UINT n=0; ; n++)
+ for (UINT n = 0; ; n++)
{
UINT lRead = m_pSndFile->Read(buffer, sizeof(buffer));
// Process cue points (add base offset), if there are any to process.
- vector<PatternCuePoint>::reverse_iterator iter = m_pSndFile->m_PatternCuePoints.rbegin();
+ vector<PatternCuePoint>::reverse_iterator iter;
for(iter = m_pSndFile->m_PatternCuePoints.rbegin(); iter != m_pSndFile->m_PatternCuePoints.rend(); ++iter)
{
if(iter->processed)
@@ -857,6 +857,7 @@
DWORD cuePointLength = 0;
if(m_pSndFile->m_PatternCuePoints.size() > 0)
{
+ // Cue point header
WAVCUEHEADER cuehdr;
cuehdr.cue_id = LittleEndian(IFFID_cue);
cuehdr.cue_num = m_pSndFile->m_PatternCuePoints.size();
@@ -867,7 +868,7 @@
fwrite(&cuehdr, 1, sizeof(WAVCUEHEADER), f);
// Write all cue points
- vector<PatternCuePoint>::iterator iter;
+ vector<PatternCuePoint>::const_iterator iter;
DWORD num = 0;
for(iter = m_pSndFile->m_PatternCuePoints.begin(); iter != m_pSndFile->m_PatternCuePoints.end(); ++iter)
{
@@ -875,11 +876,12 @@
cuepoint.cp_id = LittleEndian(num++);
cuepoint.cp_pos = LittleEndian((DWORD)iter->offset);
cuepoint.cp_chunkid = LittleEndian(IFFID_data);
- cuepoint.cp_chunkstart = 0; // we use no Wave List Chunk (wavl) as we have only one data block, so this should be 0.
- cuepoint.cp_blockstart = 0;
+ cuepoint.cp_chunkstart = 0; // we use no Wave List Chunk (wavl) as we have only one data block, so this should be 0.
+ cuepoint.cp_blockstart = 0; // dito
cuepoint.cp_offset = LittleEndian((DWORD)iter->offset);
fwrite(&cuepoint, 1, sizeof(WAVCUEPOINT), f);
}
+ m_pSndFile->m_PatternCuePoints.clear();
}
header.filesize = (sizeof(WAVEFILEHEADER) - 8) + (8 + fmthdr.length) + (8 + datahdr.length) + (cuePointLength);
Modified: trunk/OpenMPT/mptrack/ModConvert.cpp
===================================================================
--- trunk/OpenMPT/mptrack/ModConvert.cpp 2010-09-30 22:44:28 UTC (rev 728)
+++ trunk/OpenMPT/mptrack/ModConvert.cpp 2010-10-03 16:11:07 UTC (rev 729)
@@ -409,6 +409,12 @@
}
}
+ // Check whether the new format supports embedding the edit history in the file.
+ if(oldTypeIsIT_MPT && !newTypeIsIT_MPT && GetFileHistory()->size() > 0)
+ {
+ CHANGEMODTYPE_WARNING(wEditHistory);
+ }
+
BEGIN_CRITICAL();
m_SndFile.ChangeModTypeTo(nNewType);
if(!newTypeIsXM_IT_MPT && (m_SndFile.m_dwSongFlags & SONG_LINEARSLIDES))
@@ -456,6 +462,7 @@
CHANGEMODTYPE_CHECK(wLinearSlides, "Linear Frequency Slides not supported by the new format.\n");
CHANGEMODTYPE_CHECK(wTrimmedEnvelopes, "Instrument envelopes have been shortened.\n");
CHANGEMODTYPE_CHECK(wReleaseNode, "Instrument envelope release nodes are not supported by the new format.\n");
+ CHANGEMODTYPE_CHECK(wEditHistory, "Edit history will not be saved in the new format.\n");
SetModified();
GetPatternUndo()->ClearUndo();
Modified: trunk/OpenMPT/mptrack/ModConvert.h
===================================================================
--- trunk/OpenMPT/mptrack/ModConvert.h 2010-09-30 22:44:28 UTC (rev 728)
+++ trunk/OpenMPT/mptrack/ModConvert.h 2010-10-03 16:11:07 UTC (rev 729)
@@ -32,6 +32,7 @@
wLinearSlides,
wTrimmedEnvelopes,
wReleaseNode,
+ wEditHistory,
wNumWarnings
};
Modified: trunk/OpenMPT/soundlib/Load_itp.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_itp.cpp 2010-09-30 22:44:28 UTC (rev 728)
+++ trunk/OpenMPT/soundlib/Load_itp.cpp 2010-10-03 16:11:07 UTC (rev 729)
@@ -43,6 +43,12 @@
version = id;
dwMemPos += sizeof(DWORD);
+ // max supported version
+ if(version > ITP_VERSION)
+ {
+ return false;
+ }
+
m_nType = MOD_TYPE_IT;
// Song name
@@ -402,7 +408,8 @@
}
// Embed instruments' header [v1.01]
- if(version >= 0x00000101 && m_dwSongFlags & SONG_ITPEMBEDIH && fcode == 'EBIH'){
+ if(version >= 0x00000101 && m_dwSongFlags & SONG_ITPEMBEDIH && fcode == 'EBIH')
+ {
// jump embeded instrument header tag
ptr += sizeof(__int32);
@@ -698,13 +705,15 @@
// Embed instruments' header [v1.01]
- if(m_dwSongFlags & SONG_ITPEMBEDIH){
+ if(m_dwSongFlags & SONG_ITPEMBEDIH)
+ {
// embeded instrument header tag
__int32 code = 'EBIH';
fwrite(&code, 1, sizeof(__int32), f);
// instruments' header
- for(i=0; i<m_nInstruments; i++){
+ for(i=0; i<m_nInstruments; i++)
+ {
if(Instruments[i+1]) WriteInstrumentHeaderStruct(Instruments[i+1], f);
// write separator tag
code = 'SEP@';
Modified: trunk/OpenMPT/soundlib/Snd_defs.h
===================================================================
--- trunk/OpenMPT/soundlib/Snd_defs.h 2010-09-30 22:44:28 UTC (rev 728)
+++ trunk/OpenMPT/soundlib/Snd_defs.h 2010-10-03 16:11:07 UTC (rev 729)
@@ -117,11 +117,11 @@
#define MOD_TYPE_UMX 0x80000000 // Fake type
// For compatibility mode
-#define TRK_IMPULSETRACKER MOD_TYPE_IT | MOD_TYPE_MPT
-#define TRK_FASTTRACKER2 MOD_TYPE_XM
-#define TRK_SCREAMTRACKER MOD_TYPE_S3M
-#define TRK_PROTRACKER MOD_TYPE_MOD
-#define TRK_ALLTRACKERS TRK_IMPULSETRACKER | TRK_FASTTRACKER2 | TRK_SCREAMTRACKER | TRK_PROTRACKER
+#define TRK_IMPULSETRACKER (MOD_TYPE_IT | MOD_TYPE_MPT)
+#define TRK_FASTTRACKER2 (MOD_TYPE_XM)
+#define TRK_SCREAMTRACKER (MOD_TYPE_S3M)
+#define TRK_PROTRACKER (MOD_TYPE_MOD)
+#define TRK_ALLTRACKERS (TRK_IMPULSETRACKER | TRK_FASTTRACKER2 | TRK_SCREAMTRACKER | TRK_PROTRACKER)
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2010-09-30 22:44:28 UTC (rev 728)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2010-10-03 16:11:07 UTC (rev 729)
@@ -320,7 +320,7 @@
PatternCuePoint cue;
cue.offset = lMax - lRead;
cue.order = m_nCurrentPattern;
- cue.processed = false;
+ cue.processed = false; // We don't know the base offset in the file here. It has to be added in the main conversion loop.
m_PatternCuePoints.push_back(cue);
}
} else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sag...@us...> - 2010-09-30 22:44:40
|
Revision: 728
http://modplug.svn.sourceforge.net/modplug/?rev=728&view=rev
Author: saga-games
Date: 2010-09-30 22:44:28 +0000 (Thu, 30 Sep 2010)
Log Message:
-----------
[New] WAV Export: Sample-exact cue points are now written for each pattern transition (as requested by Skaven). TODO: Make this feature optional.
[Ref] Moved WAV structs and IFF chunk ID stuff to a separate file
[Mod] OpenMPT: Version is now 1.19.00.06
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Mod2wave.cpp
trunk/OpenMPT/mptrack/View_smp.cpp
trunk/OpenMPT/mptrack/mod2midi.cpp
trunk/OpenMPT/mptrack/mptrack.vcproj
trunk/OpenMPT/mptrack/mptrack_08.vcproj
trunk/OpenMPT/mptrack/tagging.h
trunk/OpenMPT/mptrack/version.h
trunk/OpenMPT/soundlib/Dlsbank.cpp
trunk/OpenMPT/soundlib/Load_mid.cpp
trunk/OpenMPT/soundlib/Load_wav.cpp
trunk/OpenMPT/soundlib/Sampleio.cpp
trunk/OpenMPT/soundlib/Sndfile.h
trunk/OpenMPT/soundlib/Sndmix.cpp
Added Paths:
-----------
trunk/OpenMPT/soundlib/Wav.h
Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Mod2wave.cpp 2010-09-29 23:28:20 UTC (rev 727)
+++ trunk/OpenMPT/mptrack/Mod2wave.cpp 2010-09-30 22:44:28 UTC (rev 728)
@@ -6,6 +6,7 @@
#include "mpdlgs.h"
#include "vstplug.h"
#include "mod2wave.h"
+#include "Wav.h"
extern UINT nMixingRates[NUMMIXRATE];
extern LPCSTR gszChnCfgNames[3];
@@ -696,6 +697,9 @@
::SendMessage(progress, PBM_SETRANGE, 0, MAKELPARAM(0, (DWORD)(max >> 14)));
}
+ // No pattern cue points yet
+ m_pSndFile->m_PatternCuePoints.clear();
+
// Process the conversion
UINT nBytesPerSample = (CSoundFile::gnBitsPerSample * CSoundFile::gnChannels) / 8;
// For calculating the remaining time
@@ -707,6 +711,20 @@
for (UINT n=0; ; n++)
{
UINT lRead = m_pSndFile->Read(buffer, sizeof(buffer));
+
+ // Process cue points (add base offset), if there are any to process.
+ vector<PatternCuePoint>::reverse_iterator iter = m_pSndFile->m_PatternCuePoints.rbegin();
+ for(iter = m_pSndFile->m_PatternCuePoints.rbegin(); iter != m_pSndFile->m_PatternCuePoints.rend(); ++iter)
+ {
+ if(iter->processed)
+ {
+ // From this point, all cues have already been processed.
+ break;
+ }
+ iter->offset += ullSamples;
+ iter->processed = true;
+ }
+
/* if (m_bGivePlugsIdleTime) {
LARGE_INTEGER startTime, endTime, duration,Freq;
QueryPerformanceFrequency(&Freq);
@@ -834,7 +852,37 @@
}
}
}
- header.filesize = (sizeof(WAVEFILEHEADER)-8) + (8+fmthdr.length) + (8+datahdr.length);
+
+ // Write cue points
+ DWORD cuePointLength = 0;
+ if(m_pSndFile->m_PatternCuePoints.size() > 0)
+ {
+ WAVCUEHEADER cuehdr;
+ cuehdr.cue_id = LittleEndian(IFFID_cue);
+ cuehdr.cue_num = m_pSndFile->m_PatternCuePoints.size();
+ cuehdr.cue_len = 4 + cuehdr.cue_num * sizeof(WAVCUEPOINT);
+ cuePointLength = 8 + cuehdr.cue_len;
+ cuehdr.cue_num = LittleEndian(cuehdr.cue_num);
+ cuehdr.cue_len = LittleEndian(cuehdr.cue_len);
+ fwrite(&cuehdr, 1, sizeof(WAVCUEHEADER), f);
+
+ // Write all cue points
+ vector<PatternCuePoint>::iterator iter;
+ DWORD num = 0;
+ for(iter = m_pSndFile->m_PatternCuePoints.begin(); iter != m_pSndFile->m_PatternCuePoints.end(); ++iter)
+ {
+ WAVCUEPOINT cuepoint;
+ cuepoint.cp_id = LittleEndian(num++);
+ cuepoint.cp_pos = LittleEndian((DWORD)iter->offset);
+ cuepoint.cp_chunkid = LittleEndian(IFFID_data);
+ cuepoint.cp_chunkstart = 0; // we use no Wave List Chunk (wavl) as we have only one data block, so this should be 0.
+ cuepoint.cp_blockstart = 0;
+ cuepoint.cp_offset = LittleEndian((DWORD)iter->offset);
+ fwrite(&cuepoint, 1, sizeof(WAVCUEPOINT), f);
+ }
+ }
+
+ header.filesize = (sizeof(WAVEFILEHEADER) - 8) + (8 + fmthdr.length) + (8 + datahdr.length) + (cuePointLength);
fseek(f, 0, SEEK_SET);
fwrite(&header, sizeof(header), 1, f);
fseek(f, dwDataOffset-sizeof(datahdr), SEEK_SET);
Modified: trunk/OpenMPT/mptrack/View_smp.cpp
===================================================================
--- trunk/OpenMPT/mptrack/View_smp.cpp 2010-09-29 23:28:20 UTC (rev 727)
+++ trunk/OpenMPT/mptrack/View_smp.cpp 2010-09-30 22:44:28 UTC (rev 728)
@@ -11,6 +11,7 @@
#include "midi.h"
#include "dlg_misc.h"
#include "modsmp_ctrl.h"
+#include "Wav.h"
#define new DEBUG_NEW
Modified: trunk/OpenMPT/mptrack/mod2midi.cpp
===================================================================
--- trunk/OpenMPT/mptrack/mod2midi.cpp 2010-09-29 23:28:20 UTC (rev 727)
+++ trunk/OpenMPT/mptrack/mod2midi.cpp 2010-09-30 22:44:28 UTC (rev 728)
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "mptrack.h"
#include "mod2midi.h"
+#include "Wav.h"
#pragma pack(1)
Modified: trunk/OpenMPT/mptrack/mptrack.vcproj
===================================================================
--- trunk/OpenMPT/mptrack/mptrack.vcproj 2010-09-29 23:28:20 UTC (rev 727)
+++ trunk/OpenMPT/mptrack/mptrack.vcproj 2010-09-30 22:44:28 UTC (rev 728)
@@ -942,6 +942,9 @@
RelativePath=".\vstplug.h">
</File>
<File
+ RelativePath="..\soundlib\Wav.h">
+ </File>
+ <File
RelativePath="..\soundlib\wavConverter.h">
</File>
<File
Modified: trunk/OpenMPT/mptrack/mptrack_08.vcproj
===================================================================
--- trunk/OpenMPT/mptrack/mptrack_08.vcproj 2010-09-29 23:28:20 UTC (rev 727)
+++ trunk/OpenMPT/mptrack/mptrack_08.vcproj 2010-09-30 22:44:28 UTC (rev 728)
@@ -1251,6 +1251,10 @@
>
</File>
<File
+ RelativePath="..\soundlib\Wav.h"
+ >
+ </File>
+ <File
RelativePath="..\soundlib\wavConverter.h"
>
</File>
Modified: trunk/OpenMPT/mptrack/tagging.h
===================================================================
--- trunk/OpenMPT/mptrack/tagging.h 2010-09-29 23:28:20 UTC (rev 727)
+++ trunk/OpenMPT/mptrack/tagging.h 2010-09-30 22:44:28 UTC (rev 728)
@@ -2,6 +2,7 @@
// ID3v2.4 / etc. tagging class (for mp3 / wav / etc. support)
#include <string>
+#include "Wav.h"
using std::string;
Modified: trunk/OpenMPT/mptrack/version.h
===================================================================
--- trunk/OpenMPT/mptrack/version.h 2010-09-29 23:28:20 UTC (rev 727)
+++ trunk/OpenMPT/mptrack/version.h 2010-09-30 22:44:28 UTC (rev 728)
@@ -15,7 +15,7 @@
#define VER_MAJORMAJOR 1
#define VER_MAJOR 19
#define VER_MINOR 00
-#define VER_MINORMINOR 05
+#define VER_MINORMINOR 06
//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/Dlsbank.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Dlsbank.cpp 2010-09-29 23:28:20 UTC (rev 727)
+++ trunk/OpenMPT/soundlib/Dlsbank.cpp 2010-09-30 22:44:28 UTC (rev 728)
@@ -16,7 +16,9 @@
#include "sndfile.h"
#include "../mptrack/mptrack.h"
#include "dlsbank.h"
+#include "Wav.h"
+
//#define DLSBANK_LOG
//#define DLSINSTR_LOG
Modified: trunk/OpenMPT/soundlib/Load_mid.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mid.cpp 2010-09-29 23:28:20 UTC (rev 727)
+++ trunk/OpenMPT/soundlib/Load_mid.cpp 2010-09-30 22:44:28 UTC (rev 728)
@@ -13,7 +13,9 @@
#include "stdafx.h"
#include "Loaders.h"
#include "dlsbank.h"
+#include "Wav.h"
+
#pragma warning(disable:4244)
//#define MIDI_LOG
Modified: trunk/OpenMPT/soundlib/Load_wav.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_wav.cpp 2010-09-29 23:28:20 UTC (rev 727)
+++ trunk/OpenMPT/soundlib/Load_wav.cpp 2010-09-30 22:44:28 UTC (rev 728)
@@ -9,6 +9,7 @@
#include "stdafx.h"
#include "Loaders.h"
+#include "Wav.h"
#ifndef WAVE_FORMAT_EXTENSIBLE
#define WAVE_FORMAT_EXTENSIBLE 0xFFFE
Modified: trunk/OpenMPT/soundlib/Sampleio.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sampleio.cpp 2010-09-29 23:28:20 UTC (rev 727)
+++ trunk/OpenMPT/soundlib/Sampleio.cpp 2010-09-30 22:44:28 UTC (rev 728)
@@ -11,6 +11,7 @@
#include "sndfile.h"
#include "it_defs.h"
#include "wavConverter.h"
+#include "Wav.h"
#pragma warning(disable:4244)
Modified: trunk/OpenMPT/soundlib/Sndfile.h
===================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h 2010-09-29 23:28:20 UTC (rev 727)
+++ trunk/OpenMPT/soundlib/Sndfile.h 2010-09-30 22:44:28 UTC (rev 728)
@@ -462,6 +462,15 @@
};
+// For WAV export (writing pattern positions to file)
+struct PatternCuePoint
+{
+ bool processed; // has this point been processed by the main WAV render function yet?
+ ULONGLONG offset; // offset in the file (in samples)
+ ORDERINDEX order; // which order is this?
+};
+
+
class CSoundFile;
@@ -599,8 +608,8 @@
UINT m_nMaxOrderPosition, m_nPatternNames;
LPSTR m_lpszSongComments, m_lpszPatternNames;
UINT ChnMix[MAX_CHANNELS]; // Channels to be mixed
- MODCHANNEL Chn[MAX_CHANNELS]; // Channels
- MODCHANNELSETTINGS ChnSettings[MAX_BASECHANNELS]; // Channels settings
+ MODCHANNEL Chn[MAX_CHANNELS]; // Mixing channels
+ MODCHANNELSETTINGS ChnSettings[MAX_BASECHANNELS]; // Initial channels settings
CPatternContainer Patterns; // Patterns
ModSequenceSet Order; // Modsequences. Order[x] returns an index of a pattern located at order x of the current sequence.
MODSAMPLE Samples[MAX_SAMPLES]; // Sample Headers
@@ -617,6 +626,8 @@
DWORD m_dwCreatedWithVersion;
DWORD m_dwLastSavedWithVersion;
+ vector<PatternCuePoint> m_PatternCuePoints; // For WAV export (writing pattern positions to file)
+
// -> CODE#0023
// -> DESC="IT project files (.itp)"
CHAR m_szInstrumentPath[MAX_INSTRUMENTS][_MAX_PATH];
@@ -1048,127 +1059,6 @@
}
-//////////////////////////////////////////////////////////
-// WAVE format information
-
-#pragma pack(1)
-
-// Standard IFF chunks IDs
-#define IFFID_FORM 0x4d524f46
-#define IFFID_RIFF 0x46464952
-#define IFFID_WAVE 0x45564157
-#define IFFID_LIST 0x5453494C
-#define IFFID_INFO 0x4F464E49
-
-// IFF Info fields
-#define IFFID_ICOP 0x504F4349
-#define IFFID_IART 0x54524149
-#define IFFID_IPRD 0x44525049
-#define IFFID_INAM 0x4D414E49
-#define IFFID_ICMT 0x544D4349
-#define IFFID_IENG 0x474E4549
-#define IFFID_ISFT 0x54465349
-#define IFFID_ISBJ 0x4A425349
-#define IFFID_IGNR 0x524E4749
-#define IFFID_ICRD 0x44524349
-
-// Wave IFF chunks IDs
-#define IFFID_wave 0x65766177
-#define IFFID_fmt 0x20746D66
-#define IFFID_wsmp 0x706D7377
-#define IFFID_pcm 0x206d6370
-#define IFFID_data 0x61746164
-#define IFFID_smpl 0x6C706D73
-#define IFFID_xtra 0x61727478
-
-typedef struct WAVEFILEHEADER
-{
- DWORD id_RIFF; // "RIFF"
- DWORD filesize; // file length-8
- DWORD id_WAVE;
-} WAVEFILEHEADER;
-
-
-typedef struct WAVEFORMATHEADER
-{
- DWORD id_fmt; // "fmt "
- DWORD hdrlen; // 16
- WORD format; // 1
- WORD channels; // 1:mono, 2:stereo
- DWORD freqHz; // sampling freq
- DWORD bytessec; // bytes/sec=freqHz*samplesize
- WORD samplesize; // sizeof(sample)
- WORD bitspersample; // bits per sample (8/16)
-} WAVEFORMATHEADER;
-
-
-typedef struct WAVEDATAHEADER
-{
- DWORD id_data; // "data"
- DWORD length; // length of data
-} WAVEDATAHEADER;
-
-
-typedef struct WAVESMPLHEADER
-{
- // SMPL
- DWORD smpl_id; // "smpl" -> 0x6C706D73
- DWORD smpl_len; // length of smpl: 3Ch (54h with sustain loop)
- DWORD dwManufacturer;
- DWORD dwProduct;
- DWORD dwSamplePeriod; // 1000000000/freqHz
- DWORD dwBaseNote; // 3Ch = C-4 -> 60 + RelativeTone
- DWORD dwPitchFraction;
- DWORD dwSMPTEFormat;
- DWORD dwSMPTEOffset;
- DWORD dwSampleLoops; // number of loops
- DWORD cbSamplerData;
-} WAVESMPLHEADER;
-
-
-typedef struct SAMPLELOOPSTRUCT
-{
- DWORD dwIdentifier;
- DWORD dwLoopType; // 0=normal, 1=bidi
- DWORD dwLoopStart;
- DWORD dwLoopEnd; // Byte offset ?
- DWORD dwFraction;
- DWORD dwPlayCount; // Loop Count, 0=infinite
-} SAMPLELOOPSTRUCT;
-
-
-typedef struct WAVESAMPLERINFO
-{
- WAVESMPLHEADER wsiHdr;
- SAMPLELOOPSTRUCT wsiLoops[2];
-} WAVESAMPLERINFO;
-
-
-typedef struct WAVELISTHEADER
-{
- DWORD list_id; // "LIST" -> 0x5453494C
- DWORD list_len;
- DWORD info; // "INFO"
-} WAVELISTHEADER;
-
-
-typedef struct WAVEEXTRAHEADER
-{
- DWORD xtra_id; // "xtra" -> 0x61727478
- DWORD xtra_len;
- DWORD dwFlags;
- WORD wPan;
- WORD wVolume;
- WORD wGlobalVol;
- WORD wReserved;
- BYTE nVibType;
- BYTE nVibSweep;
- BYTE nVibDepth;
- BYTE nVibRate;
-} WAVEEXTRAHEADER;
-
-#pragma pack()
-
///////////////////////////////////////////////////////////
// Low-level Mixing functions
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2010-09-29 23:28:20 UTC (rev 727)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2010-09-30 22:44:28 UTC (rev 728)
@@ -312,8 +312,19 @@
m_nBufferCount = lRead;
} else
#endif
- if (!ReadNote())
+ if (ReadNote())
{
+ // Save pattern cue points for WAV rendering here (if we reached a new pattern, that is.)
+ if(m_bIsRendering && (m_PatternCuePoints.empty() || m_nCurrentPattern != m_PatternCuePoints.back().order))
+ {
+ PatternCuePoint cue;
+ cue.offset = lMax - lRead;
+ cue.order = m_nCurrentPattern;
+ cue.processed = false;
+ m_PatternCuePoints.push_back(cue);
+ }
+ } else
+ {
#ifdef MODPLUG_TRACKER
if ((m_nMaxOrderPosition) && (m_nCurrentPattern >= m_nMaxOrderPosition))
{
Added: trunk/OpenMPT/soundlib/Wav.h
===================================================================
--- trunk/OpenMPT/soundlib/Wav.h (rev 0)
+++ trunk/OpenMPT/soundlib/Wav.h 2010-09-30 22:44:28 UTC (rev 728)
@@ -0,0 +1,154 @@
+/*
+ * Wav.h
+ * -----
+ * Purpose: Headers for WAV reading / writing (WAV structs, FOURCCs, etc...)
+ * Notes : Some FOURCCs are also used by the MIDI/DLS routines.
+ * Authors: OpenMPT Devs
+ *
+ */
+
+#ifndef WAV_H
+#define WAV_H
+#pragma once
+
+#pragma pack(1)
+
+// Standard IFF chunks IDs
+#define IFFID_FORM 0x4d524f46
+#define IFFID_RIFF 0x46464952
+#define IFFID_WAVE 0x45564157
+#define IFFID_LIST 0x5453494C
+#define IFFID_INFO 0x4F464E49
+
+// IFF Info fields
+#define IFFID_ICOP 0x504F4349
+#define IFFID_IART 0x54524149
+#define IFFID_IPRD 0x44525049
+#define IFFID_INAM 0x4D414E49
+#define IFFID_ICMT 0x544D4349
+#define IFFID_IENG 0x474E4549
+#define IFFID_ISFT 0x54465349
+#define IFFID_ISBJ 0x4A425349
+#define IFFID_IGNR 0x524E4749
+#define IFFID_ICRD 0x44524349
+
+// Wave IFF chunks IDs
+#define IFFID_wave 0x65766177
+#define IFFID_fmt 0x20746D66
+#define IFFID_wsmp 0x706D7377
+#define IFFID_pcm 0x206d6370
+#define IFFID_data 0x61746164
+#define IFFID_smpl 0x6C706D73
+#define IFFID_xtra 0x61727478
+#define IFFID_cue 0x20657563
+
+
+typedef struct WAVEFILEHEADER
+{
+ DWORD id_RIFF; // "RIFF"
+ DWORD filesize; // file length-8
+ DWORD id_WAVE;
+} WAVEFILEHEADER;
+
+
+typedef struct WAVEFORMATHEADER
+{
+ DWORD id_fmt; // "fmt "
+ DWORD hdrlen; // 16
+ WORD format; // 1
+ WORD channels; // 1:mono, 2:stereo
+ DWORD freqHz; // sampling freq
+ DWORD bytessec; // bytes/sec=freqHz*samplesize
+ WORD samplesize; // sizeof(sample)
+ WORD bitspersample; // bits per sample (8/16)
+} WAVEFORMATHEADER;
+
+
+typedef struct WAVEDATAHEADER
+{
+ DWORD id_data; // "data"
+ DWORD length; // length of data
+} WAVEDATAHEADER;
+
+
+typedef struct WAVESMPLHEADER
+{
+ // SMPL
+ DWORD smpl_id; // "smpl" -> 0x6C706D73
+ DWORD smpl_len; // length of smpl: 3Ch (54h with sustain loop)
+ DWORD dwManufacturer;
+ DWORD dwProduct;
+ DWORD dwSamplePeriod; // 1000000000/freqHz
+ DWORD dwBaseNote; // 3Ch = C-4 -> 60 + RelativeTone
+ DWORD dwPitchFraction;
+ DWORD dwSMPTEFormat;
+ DWORD dwSMPTEOffset;
+ DWORD dwSampleLoops; // number of loops
+ DWORD cbSamplerData;
+} WAVESMPLHEADER;
+
+
+typedef struct SAMPLELOOPSTRUCT
+{
+ DWORD dwIdentifier;
+ DWORD dwLoopType; // 0=normal, 1=bidi
+ DWORD dwLoopStart;
+ DWORD dwLoopEnd; // Byte offset ?
+ DWORD dwFraction;
+ DWORD dwPlayCount; // Loop Count, 0=infinite
+} SAMPLELOOPSTRUCT;
+
+
+typedef struct WAVESAMPLERINFO
+{
+ WAVESMPLHEADER wsiHdr;
+ SAMPLELOOPSTRUCT wsiLoops[2];
+} WAVESAMPLERINFO;
+
+
+typedef struct WAVELISTHEADER
+{
+ DWORD list_id; // "LIST" -> 0x5453494C
+ DWORD list_len;
+ DWORD info; // "INFO"
+} WAVELISTHEADER;
+
+
+typedef struct WAVEEXTRAHEADER
+{
+ DWORD xtra_id; // "xtra" -> 0x61727478
+ DWORD xtra_len;
+ DWORD dwFlags;
+ WORD wPan;
+ WORD wVolume;
+ WORD wGlobalVol;
+ WORD wReserved;
+ BYTE nVibType;
+ BYTE nVibSweep;
+ BYTE nVibDepth;
+ BYTE nVibRate;
+} WAVEEXTRAHEADER;
+
+
+typedef struct WAVCUEHEADER
+{
+ DWORD cue_id; // "cue " -> 0x20657563
+ DWORD cue_len;
+ DWORD cue_num;
+} WAVCUEHEADER;
+
+
+typedef struct WAVCUEPOINT
+{
+ DWORD cp_id; // Unique identification value
+ DWORD cp_pos; // Play order position
+ DWORD cp_chunkid; // RIFF ID of corresponding data chunk
+ DWORD cp_chunkstart; // Byte Offset of Data Chunk
+ DWORD cp_blockstart; // Byte Offset to sample of First Channel
+ DWORD cp_offset; // Byte Offset to sample byte of First Channel
+} WAVCUEPOINT;
+
+
+#pragma pack()
+
+#endif // WAV_H
\ 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...> - 2010-09-29 23:28:26
|
Revision: 727
http://modplug.svn.sourceforge.net/modplug/?rev=727&view=rev
Author: saga-games
Date: 2010-09-29 23:28:20 +0000 (Wed, 29 Sep 2010)
Log Message:
-----------
[Mod] Instrument editor: Copying / pasting envelopes with no points isn't possible anymore (who wants to do that anyway?).
Modified Paths:
--------------
trunk/OpenMPT/mptrack/Modedit.cpp
Modified: trunk/OpenMPT/mptrack/Modedit.cpp
===================================================================
--- trunk/OpenMPT/mptrack/Modedit.cpp 2010-09-28 20:07:44 UTC (rev 726)
+++ trunk/OpenMPT/mptrack/Modedit.cpp 2010-09-29 23:28:20 UTC (rev 727)
@@ -1109,6 +1109,12 @@
break;
}
+ // We don't want to copy empty envelopes
+ if(pEnv->nNodes == 0)
+ {
+ return false;
+ }
+
strcpy(s, pszEnvHdr);
wsprintf(s + strlen(s), pszEnvFmt, pEnv->nNodes, pEnv->nSustainStart, pEnv->nSustainEnd, pEnv->nLoopStart, pEnv->nLoopEnd, (pEnv->dwFlags & ENV_SUSTAIN) ? 1 : 0, (pEnv->dwFlags & ENV_LOOP) ? 1 : 0, (pEnv->dwFlags & ENV_CARRY) ? 1 : 0);
for (UINT i = 0; i < pEnv->nNodes; i++)
@@ -1186,7 +1192,7 @@
pEnv->nLoopStart = loopBegin;
pEnv->nLoopEnd = loopEnd;
pEnv->nReleaseNode = releaseNode;
- pEnv->dwFlags = (pEnv->dwFlags & ~(ENV_LOOP|ENV_SUSTAIN|ENV_CARRY)) | (bLoop ? ENV_LOOP : 0) | (bSus ? ENV_SUSTAIN : 0) | (bCarry ? ENV_CARRY: 0) | ENV_ENABLED;
+ pEnv->dwFlags = (pEnv->dwFlags & ~(ENV_LOOP|ENV_SUSTAIN|ENV_CARRY)) | (bLoop ? ENV_LOOP : 0) | (bSus ? ENV_SUSTAIN : 0) | (bCarry ? ENV_CARRY: 0) | (nPoints > 0 ? ENV_ENABLED : 0);
int oldn = 0;
for (UINT i=0; i<nPoints; i++)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|