From: <sag...@us...> - 2011-10-09 16:01:52
|
Revision: 1099 http://modplug.svn.sourceforge.net/modplug/?rev=1099&view=rev Author: saga-games Date: 2011-10-09 16:01:46 +0000 (Sun, 09 Oct 2011) Log Message: ----------- [Fix] General Tab: Switching between plugin presets didn't update the plugin parameter display. [Mod] \xx command has been removed from S3M format (existing tracks are updated automatically to use the Zxx command instead). Modified Paths: -------------- trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/soundlib/Load_s3m.cpp trunk/OpenMPT/soundlib/mod_specifications.h trunk/OpenMPT/soundlib/modcommand.cpp Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2011-10-07 21:56:02 UTC (rev 1098) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2011-10-09 16:01:46 UTC (rev 1099) @@ -2252,7 +2252,7 @@ {CMD_PANNINGSLIDE, 0,0, 0, MOD_TYPE_NOMOD, "Panning Slide"}, {CMD_SETENVPOSITION,0,0, 0, MOD_TYPE_XM, "Envelope position"}, {CMD_MIDI, 0,0, 0x7F, MOD_TYPE_NOMOD, "MIDI Macro"}, - {CMD_SMOOTHMIDI, 0,0, 0x7F, MOD_TYPE_NOMOD, "Smooth MIDI Macro"}, //rewbs.smoothVST + {CMD_SMOOTHMIDI, 0,0, 0x7F, MOD_TYPE_XMITMPT, "Smooth MIDI Macro"}, //rewbs.smoothVST // Extended MOD/XM effects {CMD_MODCMDEX, 0xF0,0x10, 0, MOD_TYPE_MODXM, "Fine Porta Up"}, {CMD_MODCMDEX, 0xF0,0x20, 0, MOD_TYPE_MODXM, "Fine Porta Down"}, Modified: trunk/OpenMPT/mptrack/View_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_gen.cpp 2011-10-07 21:56:02 UTC (rev 1098) +++ trunk/OpenMPT/mptrack/View_gen.cpp 2011-10-09 16:01:46 UTC (rev 1099) @@ -1005,8 +1005,11 @@ CVstPlugin *pVstPlugin = (CVstPlugin *)pPlugin->pMixPlugin; UINT nParams = pVstPlugin->GetNumPrograms(); if ((cursel > 0) && (cursel <= (int)nParams)) m_nCurrentPreset = cursel; - if (m_nCurrentPreset > 0 && m_nCurrentPreset <= nParams){ - pVstPlugin->SetCurrentProgram(m_nCurrentPreset-1); + if (m_nCurrentPreset > 0 && m_nCurrentPreset <= nParams) + { + pVstPlugin->SetCurrentProgram(m_nCurrentPreset - 1); + // Update parameter display + OnParamChanged(); } if(pSndFile->GetModSpecifications().supportsPlugins) pModDoc->SetModified(); Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_s3m.cpp 2011-10-07 21:56:02 UTC (rev 1098) +++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2011-10-09 16:01:46 UTC (rev 1099) @@ -107,7 +107,7 @@ case 'X': command = CMD_PANNING8; break; case 'Y': command = CMD_PANBRELLO; break; case 'Z': command = CMD_MIDI; break; - case '\\': command = CMD_SMOOTHMIDI; break; //rewbs.smoothVST + case '\\': command = bIT ? CMD_SMOOTHMIDI : CMD_MIDI; break; //rewbs.smoothVST // Chars under 0x40 don't save properly, so map : to ] and # to [. case ']': command = CMD_DELAYCUT; break; case '[': command = CMD_XPARAM; break; @@ -164,7 +164,7 @@ case CMD_PANBRELLO: command = 'Y'; break; case CMD_MIDI: command = 'Z'; break; case CMD_SMOOTHMIDI: //rewbs.smoothVST - if(bCompatibilityExport) + if(bCompatibilityExport || !bIT) command = 'Z'; else command = '\\'; Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2011-10-07 21:56:02 UTC (rev 1098) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2011-10-09 16:01:46 UTC (rev 1099) @@ -346,7 +346,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) Modified: trunk/OpenMPT/soundlib/modcommand.cpp =================================================================== --- trunk/OpenMPT/soundlib/modcommand.cpp 2011-10-07 21:56:02 UTC (rev 1098) +++ trunk/OpenMPT/soundlib/modcommand.cpp 2011-10-09 16:01:46 UTC (rev 1099) @@ -100,6 +100,12 @@ } } // End if(m->command == CMD_PANNING8) + // Re-map \xx to Zxx if the new format only knows the latter command. + if(m->command == CMD_SMOOTHMIDI && !GetModSpecifications(nNewType).HasCommand(CMD_SMOOTHMIDI) && GetModSpecifications(nNewType).HasCommand(CMD_MIDI)) + { + m->command = CMD_MIDI; + } + /////////////////////////////////////////////////////////////////////////////////////// // MPTM to anything: Convert param control, extended envelope control, note delay+cut if(oldTypeIsMPT) @@ -145,6 +151,7 @@ case CMD_MODCMDEX: MODExx2S3MSxx(m); break; + case CMD_VOLUME: // Effect column volume command overrides the volume column in XM. if (m->volcmd == VOLCMD_NONE || m->volcmd == VOLCMD_VOLUME) @@ -162,12 +169,15 @@ m->param = 0x80 | ((m->param * 15 + 32) / 64); // XM volcol panning is 4-Bit, so we can use 4-Bit panning here. } break; + case CMD_PORTAMENTOUP: if (m->param > 0xDF) m->param = 0xDF; break; + case CMD_PORTAMENTODOWN: if (m->param > 0xDF) m->param = 0xDF; break; + case CMD_XFINEPORTAUPDOWN: switch(m->param & 0xF0) { @@ -188,8 +198,9 @@ break; } break; + case CMD_KEYOFF: - if(m->note == 0) + if(m->note == NOTE_NONE) { m->note = (newTypeIsS3M) ? NOTE_NOTECUT : NOTE_KEYOFF; m->command = CMD_S3MCMDEX; @@ -198,6 +209,7 @@ m->param = 0xD0 | (m->param & 0x0F); } break; + case CMD_PANNINGSLIDE: // swap L/R, convert to fine slide if(m->param & 0xF0) @@ -207,6 +219,7 @@ { m->param = 0x0F | (min(0x0E, m->param & 0x0F) << 4); } + default: break; } @@ -234,6 +247,7 @@ case CMD_S3MCMDEX: S3MSxx2MODExx(m); break; + case CMD_VOLUMESLIDE: if ((m->param & 0xF0) && ((m->param & 0x0F) == 0x0F)) { @@ -246,6 +260,7 @@ m->param = (m->param & 0x0F) | 0xB0; } break; + case CMD_PORTAMENTOUP: if (m->param >= 0xF0) { @@ -265,6 +280,7 @@ } } else m->command = CMD_PORTAMENTOUP; break; + case CMD_PORTAMENTODOWN: if (m->param >= 0xF0) { @@ -284,14 +300,17 @@ } } else m->command = CMD_PORTAMENTODOWN; break; + case CMD_SPEED: { m->param = min(m->param, (nNewType == MOD_TYPE_XM) ? 0x1F : 0x20); } break; + case CMD_TEMPO: if(m->param < 0x20) m->command = CMD_NONE; // no tempo slides break; + case CMD_PANNINGSLIDE: // swap L/R, convert fine slides to normal slides if((m->param & 0x0F) == 0x0F && (m->param & 0xF0)) @@ -311,6 +330,7 @@ m->param = 0; } break; + case CMD_RETRIG: // Retrig: Q0y doesn't change volume in IT/S3M, but R0y in XM takes the last x parameter if(m->param != 0 && (m->param & 0xF0) == 0) @@ -318,6 +338,7 @@ m->param |= 0x80; } break; + default: break; } @@ -351,12 +372,11 @@ break; } break; - case CMD_SMOOTHMIDI: - m->command = CMD_MIDI; - break; + case CMD_GLOBALVOLUME: m->param = (min(0x80, m->param) + 1) / 2; break; + default: break; } @@ -416,6 +436,7 @@ case CMD_TONEPORTAVOL: // lacks memory -> 500 is the same as 300 if(m->param == 0x00) m->command = CMD_TONEPORTAMENTO; break; + case CMD_VIBRATOVOL: // lacks memory -> 600 is the same as 400 if(m->param == 0x00) m->command = CMD_VIBRATO; break; @@ -453,6 +474,7 @@ m->command = CMD_MODCMDEX; m->param = 0x90 | (m->param & 0x0F); break; + case CMD_MODCMDEX: // This would turn into "Invert Loop", so let's better remove it if((m->param & 0xF0) == 0xF0) m->command = CMD_NONE; break; @@ -464,53 +486,63 @@ m->command = CMD_VOLUME; m->param = m->vol; break; + case VOLCMD_PANNING: m->command = CMD_PANNING8; m->param = CLAMP(m->vol << 2, 0, 0xFF); break; + case VOLCMD_VOLSLIDEDOWN: m->command = CMD_VOLUMESLIDE; m->param = m->vol; break; + case VOLCMD_VOLSLIDEUP: m->command = CMD_VOLUMESLIDE; m->param = m->vol << 4; break; + case VOLCMD_FINEVOLDOWN: m->command = CMD_MODCMDEX; m->param = 0xB0 | m->vol; break; + case VOLCMD_FINEVOLUP: m->command = CMD_MODCMDEX; m->param = 0xA0 | m->vol; break; + case VOLCMD_PORTADOWN: m->command = CMD_PORTAMENTODOWN; m->param = m->vol << 2; break; + case VOLCMD_PORTAUP: m->command = CMD_PORTAMENTOUP; m->param = m->vol << 2; break; + case VOLCMD_TONEPORTAMENTO: m->command = CMD_TONEPORTAMENTO; m->param = m->vol << 2; break; + case VOLCMD_VIBRATODEPTH: m->command = CMD_VIBRATO; m->param = m->vol; break; + case VOLCMD_VIBRATOSPEED: m->command = CMD_VIBRATO; m->param = m->vol << 4; break; // OpenMPT-specific commands + case VOLCMD_OFFSET: m->command = CMD_OFFSET; m->param = m->vol << 3; break; - default: - break; + } m->volcmd = CMD_NONE; } // End if (newTypeIsMOD) @@ -526,64 +558,74 @@ m->param = m->vol; m->volcmd = CMD_NONE; break; + case VOLCMD_VOLSLIDEUP: m->command = CMD_VOLUMESLIDE; m->param = m->vol << 4; m->volcmd = CMD_NONE; break; + case VOLCMD_FINEVOLDOWN: m->command = CMD_VOLUMESLIDE; m->param = 0xF0 | m->vol; m->volcmd = CMD_NONE; break; + case VOLCMD_FINEVOLUP: m->command = CMD_VOLUMESLIDE; m->param = (m->vol << 4) | 0x0F; m->volcmd = CMD_NONE; break; + case VOLCMD_PORTADOWN: m->command = CMD_PORTAMENTODOWN; m->param = m->vol << 2; m->volcmd = CMD_NONE; break; + case VOLCMD_PORTAUP: m->command = CMD_PORTAMENTOUP; m->param = m->vol << 2; m->volcmd = CMD_NONE; break; + case VOLCMD_TONEPORTAMENTO: m->command = CMD_TONEPORTAMENTO; m->param = m->vol << 2; m->volcmd = CMD_NONE; break; + case VOLCMD_VIBRATODEPTH: m->command = CMD_VIBRATO; m->param = m->vol; m->volcmd = CMD_NONE; break; + case VOLCMD_VIBRATOSPEED: m->command = CMD_VIBRATO; m->param = m->vol << 4; m->volcmd = CMD_NONE; break; + case VOLCMD_PANSLIDELEFT: m->command = CMD_PANNINGSLIDE; m->param = m->vol << 4; m->volcmd = CMD_NONE; break; + case VOLCMD_PANSLIDERIGHT: m->command = CMD_PANNINGSLIDE; m->param = m->vol; m->volcmd = CMD_NONE; break; // OpenMPT-specific commands + case VOLCMD_OFFSET: m->command = CMD_OFFSET; m->param = m->vol << 3; m->volcmd = CMD_NONE; break; - default: - break; + } } // End if (newTypeIsS3M) @@ -618,19 +660,20 @@ m->param = m->vol << 2; m->volcmd = CMD_NONE; break; + case VOLCMD_PORTAUP: m->command = CMD_PORTAMENTOUP; m->param = m->vol << 2; m->volcmd = CMD_NONE; break; // OpenMPT-specific commands + case VOLCMD_OFFSET: m->command = CMD_OFFSET; m->param = m->vol << 3; m->volcmd = CMD_NONE; break; - default: - break; + } } // End if (newTypeIsXM) @@ -652,23 +695,25 @@ case VOLCMD_OFFSET: m->vol = min(m->vol, 9); break; + case VOLCMD_PANSLIDELEFT: m->command = CMD_PANNINGSLIDE; m->param = m->vol << 4; m->volcmd = CMD_NONE; break; + case VOLCMD_PANSLIDERIGHT: m->command = CMD_PANNINGSLIDE; m->param = m->vol; m->volcmd = CMD_NONE; break; + case VOLCMD_VIBRATOSPEED: m->command = CMD_VIBRATO; m->param = m->vol << 4; m->volcmd = CMD_NONE; break; - default: - break; + } } // End if (newTypeIsIT) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |