From: <sag...@us...> - 2015-01-10 13:22:30
|
Revision: 4707 http://sourceforge.net/p/modplug/code/4707 Author: saga-games Date: 2015-01-10 13:22:17 +0000 (Sat, 10 Jan 2015) Log Message: ----------- [Imp] Pattern tab: Show verbose effect descriptions in the status bar instead of the short versions (as a side effect, this fixes http://bugs.openmpt.org/view.php?id=51) Modified Paths: -------------- trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/EffectInfo.cpp trunk/OpenMPT/mptrack/EffectInfo.h trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp trunk/OpenMPT/soundlib/MIDIMacros.cpp Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2015-01-08 23:41:32 UTC (rev 4706) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2015-01-10 13:22:17 UTC (rev 4707) @@ -124,7 +124,7 @@ m_szHeader.cx = ROWHDR_WIDTH; m_szHeader.cy = COLHDR_HEIGHT; m_szPluginHeader.cx = 0; - m_szPluginHeader.cy = m_Status[psShowPluginNames] ? PLUGNAME_HEIGHT : 0; + m_szPluginHeader.cy = m_Status[psShowPluginNames] ? MulDiv(PLUGNAME_HEIGHT, m_nDPIy, 96) : 0; if(m_Status[psShowVUMeters]) m_szHeader.cy += VUMETERS_HEIGHT; m_szCell.cx = 4 + pfnt->nEltWidths[0]; if (m_nDetailLevel >= PatternCursor::instrColumn) m_szCell.cx += pfnt->nEltWidths[1]; @@ -134,7 +134,6 @@ m_szHeader.cx = MulDiv(m_szHeader.cx, m_nDPIx, 96); m_szHeader.cy = MulDiv(m_szHeader.cy, m_nDPIy, 96); - m_szPluginHeader.cy = MulDiv(m_szPluginHeader.cy, m_nDPIy, 96); m_szHeader.cy += m_szPluginHeader.cy; if(oldy != m_szCell.cy) @@ -468,7 +467,7 @@ const int vuHeight = MulDiv(VUMETERS_HEIGHT, m_nDPIy, 96); const int colHeight = MulDiv(COLHDR_HEIGHT, m_nDPIy, 96); - const int recordInsX = MulDiv(3, m_nDPIy, 96); + const int recordInsX = MulDiv(3, m_nDPIx, 96); GetClientRect(&rcClient); hdc = pDC->m_hDC; @@ -1612,14 +1611,14 @@ s.Format(_T("Parameter value: %u"), m->GetValueEffectCol()); } else if(m->command != CMD_NONE) { - TCHAR sztmp[64] = ""; - /*LONG fxndx = effectInfo.GetIndexFromEffect(m->command, m->param); + TCHAR sztmp[128] = ""; + LONG fxndx = effectInfo.GetIndexFromEffect(m->command, m->param); if(fxndx >= 0) { - effectInfo.GetEffectNameEx(sztmp, fxndx, m->param); - }*/ - effectInfo.GetEffectName(sztmp, m->command, m->param, false, nChn); - if(sztmp[0]) s.Format(_T("%s (%02X)"), sztmp, m->param); + effectInfo.GetEffectNameEx(sztmp, fxndx, m->param, nChn); + } + //effectInfo.GetEffectName(sztmp, m->command, m->param, false, nChn); + if(sztmp[0]) s.Format(_T("%c%02X: %s"), pSndFile->GetModSpecifications().GetEffectLetter(m->command), m->param, sztmp); } break; } Modified: trunk/OpenMPT/mptrack/EffectInfo.cpp =================================================================== --- trunk/OpenMPT/mptrack/EffectInfo.cpp 2015-01-08 23:41:32 UTC (rev 4706) +++ trunk/OpenMPT/mptrack/EffectInfo.cpp 2015-01-10 13:22:17 UTC (rev 4707) @@ -145,8 +145,8 @@ } -bool EffectInfo::GetEffectName(LPSTR pszDescription, ModCommand::COMMAND command, UINT param, bool bXX, CHANNELINDEX nChn) const -//------------------------------------------------------------------------------------------------------------------------------ +bool EffectInfo::GetEffectName(LPSTR pszDescription, ModCommand::COMMAND command, UINT param, bool bXX) const +//----------------------------------------------------------------------------------------------------------- { bool bSupported; UINT fxndx = CountOf(gFXInfo); @@ -176,48 +176,6 @@ if ((gFXInfo[fxndx].paramMask & 0x0F) == 0x0F) pszDescription[2] = szHexChar[gFXInfo[fxndx].paramValue & 0x0F]; } strcat(pszDescription, gFXInfo[fxndx].name); - //Get channel specific info - if (nChn < sndFile.GetNumChannels()) - { - CString chanSpec = ""; - size_t macroIndex = size_t(-1); - - switch (command) - { - case CMD_MODCMDEX: - case CMD_S3MCMDEX: - if ((param & 0xF0) == 0xF0 && !(sndFile.GetType() & MOD_TYPE_MOD)) //Set Macro - { - macroIndex = (param & 0x0F); - chanSpec.Format(" to %d: ", param & 0x0F); - } - break; - - case CMD_MIDI: - case CMD_SMOOTHMIDI: - if (param < 0x80 && nChn != CHANNELINDEX_INVALID) - { - macroIndex = sndFile.m_PlayState.Chn[nChn].nActiveMacro; - chanSpec.Format(": currently %d: ", sndFile.m_PlayState.Chn[nChn].nActiveMacro); - } - else - { - chanSpec = " (Fixed)"; - } - break; - } - - if(macroIndex != size_t(-1)) - { - const PLUGINDEX plugin = sndFile.GetBestPlugin(nChn, PrioritiseChannel, EvenIfMuted) - 1; - chanSpec.Append(sndFile.m_MidiCfg.GetParameteredMacroName(macroIndex, plugin, sndFile)); - } - if (!chanSpec.IsEmpty()) - { - strcat(pszDescription, chanSpec); - } - - } } return bSupported; } @@ -466,10 +424,10 @@ } -bool EffectInfo::GetEffectNameEx(LPSTR pszName, UINT ndx, UINT param) const -//------------------------------------------------------------------------- +bool EffectInfo::GetEffectNameEx(LPSTR pszName, UINT ndx, UINT param, CHANNELINDEX chn) const +//------------------------------------------------------------------------------------------- { - char s[64]; + char s[128]; char szContinueOrIgnore[16]; if (pszName) pszName[0] = 0; @@ -670,7 +628,15 @@ case CMD_SMOOTHMIDI: if (param < 0x80) { - wsprintf(pszName, "SFx macro: z=%02X (%d)", param, param); + if(chn != CHANNELINDEX_INVALID) + { + const uint8 macroIndex = sndFile.m_PlayState.Chn[chn].nActiveMacro; + const PLUGINDEX plugin = sndFile.GetBestPlugin(chn, PrioritiseChannel, EvenIfMuted) - 1; + wsprintf(pszName, "SFx MIDI Macro z=%d (SF%X: %s)", param, macroIndex, sndFile.m_MidiCfg.GetParameteredMacroName(macroIndex, plugin, sndFile)); + } else + { + wsprintf(pszName, "SFx macro: z=%02X (%d)", param, param); + } } else { wsprintf(pszName, "Fixed Macro Z%02X", param); @@ -791,8 +757,7 @@ strcat(s, " rows"); break; case 0xF0: // macro - if(sndFile.GetType() != MOD_TYPE_MOD) - wsprintf(s, "SF%X", param & 0x0F); + strcpy(s, sndFile.m_MidiCfg.GetParameteredMacroName(param & 0x0F, PLUGINDEX_INVALID, sndFile)); break; default: break; @@ -861,11 +826,11 @@ if((param & 0x0F) == 0) strcpy(s, "Stop"); else - wsprintf(s, "Speed %d", param & 0x0F); + wsprintf(s, "Speed %d", param & 0x0F); } else { // macro - wsprintf(s, "SF%X", param & 0x0F); + strcpy(s, sndFile.m_MidiCfg.GetParameteredMacroName(param & 0x0F, PLUGINDEX_INVALID, sndFile)); } break; default: Modified: trunk/OpenMPT/mptrack/EffectInfo.h =================================================================== --- trunk/OpenMPT/mptrack/EffectInfo.h 2015-01-08 23:41:32 UTC (rev 4706) +++ trunk/OpenMPT/mptrack/EffectInfo.h 2015-01-10 13:22:17 UTC (rev 4707) @@ -29,8 +29,7 @@ // Effects Description - // Get basic effect name with some additional information for some effects - bool GetEffectName(LPSTR pszDescription, ModCommand::COMMAND command, UINT param, bool bXX = false, CHANNELINDEX nChn = CHANNELINDEX_INVALID) const; // bXX: Nxx: ... + bool GetEffectName(LPSTR pszDescription, ModCommand::COMMAND command, UINT param, bool bXX = false) const; // bXX: Nxx: ... // Get size of list of known effect commands UINT GetNumEffects() const; // Get range information, effect name, etc... from a given effect. @@ -43,7 +42,7 @@ // Get parameter mask from effect (for extended effects) UINT GetEffectMaskFromIndex(UINT ndx) const; // Get precise effect name, also with explanation of effect parameter - bool GetEffectNameEx(LPSTR pszName, UINT ndx, UINT param) const; + bool GetEffectNameEx(LPSTR pszName, UINT ndx, UINT param, CHANNELINDEX chn = CHANNELINDEX_INVALID) const; // Check whether an effect is extended (with parameter nibbles) bool IsExtendedEffect(UINT ndx) const; // Map an effect value to slider position Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2015-01-08 23:41:32 UTC (rev 4706) +++ trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2015-01-10 13:22:17 UTC (rev 4707) @@ -1091,7 +1091,7 @@ if(fxndx >= 0) { newParam = static_cast<ModCommand::PARAM>(effectInfo.MapPosToValue(fxndx, sldParam.GetPos())); - effectInfo.GetEffectNameEx(s, fxndx, newParam * xMultiplier + xParam); + effectInfo.GetEffectNameEx(s, fxndx, newParam * xMultiplier + xParam, editPos.channel); } } SetDlgItemText(IDC_TEXT1, s); Modified: trunk/OpenMPT/soundlib/MIDIMacros.cpp =================================================================== --- trunk/OpenMPT/soundlib/MIDIMacros.cpp 2015-01-08 23:41:32 UTC (rev 4706) +++ trunk/OpenMPT/soundlib/MIDIMacros.cpp 2015-01-10 13:22:17 UTC (rev 4707) @@ -222,35 +222,33 @@ case sfx_plug: { const int param = MacroToPlugParam(macroIndex); - CString paramName; - + CString formattedName; + formattedName.Format(_T("Param %u"), param); #ifndef NO_VST if(plugin < MAX_MIXPLUGINS) { CVstPlugin *pPlug = dynamic_cast<CVstPlugin *>(sndFile.m_MixPlugins[plugin].pMixPlugin); if(pPlug) { + CString paramName; paramName = pPlug->GetParamName(param); + if(!paramName.IsEmpty()) + { + formattedName.AppendFormat(_T(" (%s)"), paramName); + } } - if (paramName.IsEmpty()) - { - return TEXT("N/A"); - } - - CString formattedName; - formattedName.Format(TEXT("Param %d (%s)"), param, paramName); - return formattedName; } else #endif // NO_VST { - return TEXT("N/A - No Plugin"); + formattedName += _T(" (N/A)"); } + return formattedName; } case sfx_cc: { CString formattedCC; - formattedCC.Format(TEXT("MIDI CC %d"), MacroToMidiCC(macroIndex)); + formattedCC.Format(_T("MIDI CC %u"), MacroToMidiCC(macroIndex)); return formattedCC; } @@ -267,26 +265,26 @@ switch(macroType) { case sfx_unused: - return TEXT("Unused"); + return _T("Unused"); case sfx_cutoff: - return TEXT("Set Filter Cutoff"); + return _T("Set Filter Cutoff"); case sfx_reso: - return TEXT("Set Filter Resonance"); + return _T("Set Filter Resonance"); case sfx_mode: - return TEXT("Set Filter Mode"); + return _T("Set Filter Mode"); case sfx_drywet: - return TEXT("Set Plugin Dry/Wet Ratio"); + return _T("Set Plugin Dry/Wet Ratio"); case sfx_plug: - return TEXT("Control Plugin Parameter..."); + return _T("Control Plugin Parameter..."); case sfx_cc: - return TEXT("MIDI CC..."); + return _T("MIDI CC..."); case sfx_channelAT: - return TEXT("Channel Aftertouch"); + return _T("Channel Aftertouch"); case sfx_polyAT: - return TEXT("Polyphonic Aftertouch"); + return _T("Polyphonic Aftertouch"); case sfx_custom: default: - return TEXT("Custom"); + return _T("Custom"); } } @@ -298,24 +296,24 @@ switch(macroType) { case zxx_unused: - return TEXT("Unused"); + return _T("Unused"); case zxx_reso4Bit: - return TEXT("Z80 - Z8F controls Resonant Filter Resonance"); + return _T("Z80 - Z8F controls Resonant Filter Resonance"); case zxx_reso7Bit: - return TEXT("Z80 - ZFF controls Resonant Filter Resonance"); + return _T("Z80 - ZFF controls Resonant Filter Resonance"); case zxx_cutoff: - return TEXT("Z80 - ZFF controls Resonant Filter Cutoff"); + return _T("Z80 - ZFF controls Resonant Filter Cutoff"); case zxx_mode: - return TEXT("Z80 - ZFF controls Resonant Filter Mode"); + return _T("Z80 - ZFF controls Resonant Filter Mode"); case zxx_resomode: - return TEXT("Z80 - Z9F controls Resonance + Filter Mode"); + return _T("Z80 - Z9F controls Resonance + Filter Mode"); case zxx_channelAT: - return TEXT("Z80 - ZFF controls Channel Aftertouch"); + return _T("Z80 - ZFF controls Channel Aftertouch"); case zxx_polyAT: - return TEXT("Z80 - ZFF controls Polyphonic Aftertouch"); + return _T("Z80 - ZFF controls Polyphonic Aftertouch"); case zxx_custom: default: - return TEXT("Custom"); + return _T("Custom"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |