From: <sag...@us...> - 2011-09-01 19:03:16
|
Revision: 1005 http://modplug.svn.sourceforge.net/modplug/?rev=1005&view=rev Author: saga-games Date: 2011-09-01 19:03:09 +0000 (Thu, 01 Sep 2011) Log Message: ----------- [Imp] Named DMO parameter values are now displayed properly. [Mod] OpenMPT: Version is now 1.20.00.15 Modified Paths: -------------- trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/version.h Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2011-09-01 17:57:33 UTC (rev 1004) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2011-09-01 19:03:09 UTC (rev 1005) @@ -473,7 +473,7 @@ BOOL CVstPluginManager::CreateMixPlugin(PSNDMIXPLUGIN pMixPlugin, CSoundFile* pSndFile) //------------------------------------------------------------------------------------- { - UINT nMatch=0; + UINT nMatch = 0; PVSTPLUGINLIB pFound = NULL; if (pMixPlugin) @@ -850,12 +850,9 @@ if (pSndFile) { return (VstInt32)(pSndFile->GetCurrentBPM() * 10000); - } else - { - return (VstInt32)(125 * 10000); } } - return 125 * 10000; + return (VstInt32)(125 * 10000); // parameters - DEPRECATED in VST 2.4 case audioMasterGetNumAutomatableParameters: Log("VST plugin to host: Get Num Automatable Parameters\n"); @@ -1212,7 +1209,7 @@ LPITEMIDLIST pid = SHBrowseForFolder(&bi); if(pid != NULL && SHGetPathFromIDList(pid, szBuffer)) { - if(!memcmp(&(effect->uniqueID), "rTSV", 4) && pFileSel->returnPath != nullptr && pFileSel->sizeReturnPath == 0) + if(CCONST('V', 'S', 'T', 'r') == effect->uniqueID && pFileSel->returnPath != nullptr && pFileSel->sizeReturnPath == 0) { // old versions of reViSiT (which still relied on the host's file selection code) seem to be dodgy. // They report a path size of 0, but when using an own buffer, they will crash. @@ -1342,7 +1339,7 @@ m_bModified = false; m_dwTimeAtStartOfProcess=0; m_nSampleRate = nInvalidSampleRate; //rewbs.VSTCompliance: gets set on Resume() - memset(m_MidiCh, 0, sizeof(m_MidiCh)); + MemsetZero(m_MidiCh); for (int ch=0; ch<16; ch++) { m_nMidiPitchBendPos[ch]=MIDI_PitchBend_Centre; //centre pitch bend on all channels @@ -1368,7 +1365,7 @@ m_bRecordAutomation=false; m_bPassKeypressesToPlug=false; - memset(m_MidiCh, 0, sizeof(m_MidiCh)); + MemsetZero(m_MidiCh); //rewbs.VSTcompliance //Store a pointer so we can get the CVstPlugin object from the basic VST effect object. @@ -2060,7 +2057,8 @@ if (m_bIsInstrument) { mixop = 0; //force normal mix mode for instruments - } else { + } else + { mixop = m_pMixStruct ? (m_pMixStruct->Info.dwInputRouting>>8) & 0xff : 0; } @@ -2542,7 +2540,7 @@ bool progChanged = (pCh->nProgram != --nMidiProg) && (nMidiProg < 0x80); //bool chanChanged = nCh != m_nPreviousMidiChan; //get vol in [0,128[ - vol = min(vol/2, 127); + vol = min(vol / 2, 127); // Note: Some VSTis update bank/prog on midi channel change, others don't. // For those that don't, we do it for them. @@ -3525,7 +3523,7 @@ m_pMediaProcess = pMOIP; m_pParamInfo = NULL; m_pMediaParams = NULL; - memset(&m_Effect, 0, sizeof(m_Effect)); + MemsetZero(m_Effect); m_Effect.magic = kDmoMagic; m_Effect.numPrograms = 0; m_Effect.numParams = 0; @@ -3671,10 +3669,26 @@ wsprintf(pszName, (bNeg) ? "-%d.%02d" : "%d.%02d", nValue/100, nValue%100); } break; + case MPT_BOOL: strcpy(pszName, ((int)md) ? "Yes" : "No"); break; - // TODO: case MPT_ENUM: -> GetParamText + + case MPT_ENUM: + { + WCHAR *text = nullptr; + m_pParamInfo->GetParamText(index, &text); + + const int nValue = (int)(md * (mpi.mpdMaxValue - mpi.mpdMinValue) + 0.5f); + // Always skip first two strings (param name, unit name) + for(int i = 0; i < nValue + 2; i++) + { + text += wcslen(text) + 1; + } + WideCharToMultiByte(CP_ACP, 0, text, -1, pszName, 32, NULL, NULL); + } + break; + default: wsprintf(pszName, "%d", (int)md); break; Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-09-01 17:57:33 UTC (rev 1004) +++ trunk/OpenMPT/mptrack/version.h 2011-09-01 19:03:09 UTC (rev 1005) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 20 #define VER_MINOR 00 -#define VER_MINORMINOR 14 +#define VER_MINORMINOR 15 //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. |