From: <sag...@us...> - 2011-03-24 20:05:09
|
Revision: 828 http://modplug.svn.sourceforge.net/modplug/?rev=828&view=rev Author: saga-games Date: 2011-03-24 20:05:01 +0000 (Thu, 24 Mar 2011) Log Message: ----------- [Ref] Merged ProcessMidiMacro and ProcessSmoothMidiMacro into one function to avoid copypasta [Ref] Project files: Moved mod loaders into own folder in the project tree [Ref] Added Get[Vol]EffectLetter to mod specs. Modified Paths: -------------- trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/mptrack.vcproj trunk/OpenMPT/mptrack/mptrack_08.vcproj trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/mod_specifications.cpp trunk/OpenMPT/soundlib/mod_specifications.h Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2011-03-23 22:40:37 UTC (rev 827) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2011-03-24 20:05:01 UTC (rev 828) @@ -1282,11 +1282,12 @@ if (pMainFrm && m_dwEndSel <= m_dwBeginSel) { - if(m_nSample > 0 && m_nSample < MAX_SAMPLES && x < pSndFile->Samples[m_nSample].nLength ) + if(m_nSample > 0 && m_nSample < MAX_SAMPLES && x < pSndFile->Samples[m_nSample].nLength) { const DWORD xLow = (x / 0x100) % 0x100; const DWORD xHigh = x / 0x10000; - const char cOffsetChar = (pSndFile->TypeIsS3M_IT_MPT()) ? gszS3mCommands[CMD_OFFSET] : gszModCommands[CMD_OFFSET]; + + const char cOffsetChar = pSndFile->GetModSpecifications().GetEffectLetter(CMD_OFFSET); const bool bHasHighOffset = (pSndFile->TypeIsS3M_IT_MPT() || (pSndFile->GetType() == MOD_TYPE_XM)); const char cHighOffsetChar = (pSndFile->TypeIsS3M_IT_MPT()) ? gszS3mCommands[CMD_S3MCMDEX] : gszModCommands[CMD_XFINEPORTAUPDOWN]; @@ -1299,7 +1300,9 @@ pMainFrm->SetInfoText(s); } else + { pMainFrm->SetInfoText(""); + } } } else UpdateIndicator(NULL); if (m_dwStatus & SMPSTATUS_MOUSEDRAG) Modified: trunk/OpenMPT/mptrack/Vstplug.cpp =================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp 2011-03-23 22:40:37 UTC (rev 827) +++ trunk/OpenMPT/mptrack/Vstplug.cpp 2011-03-24 20:05:01 UTC (rev 828) @@ -18,7 +18,7 @@ #ifdef VST_USE_ALTERNATIVE_MAGIC //Pelya's plugin ID fix. Breaks fx presets, so let's avoid it for now. #define ZLIB_WINAPI #include "../zlib/zlib.h" //For CRC32 calculation (to detect plugins with same UID) -#endif +#endif // VST_USE_ALTERNATIVE_MAGIC #define new DEBUG_NEW @@ -52,7 +52,7 @@ return crc32(0, (BYTE *)fn, f); } -#endif +#endif // VST_USE_ALTERNATIVE_MAGIC VstIntPtr VSTCALLBACK CVstPluginManager::MasterCallBack(AEffect *effect, VstInt32 opcode, VstInt32 index, VstIntPtr value, void *ptr, float opt) //---------------------------------------------------------------------------------------------------------------------------------------------- @@ -261,16 +261,16 @@ { p->dwPluginId1 = CalculateCRC32fromFilename(p->szLibraryName); // Make Plugin ID unique for sure (for VSTs with same UID) }; - #endif + #endif // VST_USE_ALTERNATIVE_MAGIC #ifdef VST_LOG Log("Plugin \"%s\" found in PluginCache\n", p->szLibraryName); - #endif + #endif // VST_LOG return p; } else { #ifdef VST_LOG Log("Plugin \"%s\" mismatch in PluginCache: \"%s\" [%s]=\"%s\"\n", s, pszDllPath, (LPCTSTR)IDs, (LPCTSTR)strFullPath); - #endif + #endif // VST_LOG } } } @@ -278,20 +278,21 @@ HINSTANCE hLib = NULL; - try { + try + { hLib = LoadLibrary(pszDllPath); //rewbs.VSTcompliance #ifdef _DEBUG - if (!hLib) - { - TCHAR szBuf[256]; - LPVOID lpMsgBuf; - DWORD dw = GetLastError(); - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); - wsprintf(szBuf, "Warning: encountered problem when loading plugin dll. Error %d: %s", dw, lpMsgBuf); - MessageBox(NULL, szBuf, "DEBUG: Error when loading plugin dll", MB_OK); - LocalFree(lpMsgBuf); - } + if (!hLib) + { + TCHAR szBuf[256]; + LPVOID lpMsgBuf; + DWORD dw = GetLastError(); + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); + wsprintf(szBuf, "Warning: encountered problem when loading plugin dll. Error %d: %s", dw, lpMsgBuf); + MessageBox(NULL, szBuf, "DEBUG: Error when loading plugin dll", MB_OK); + LocalFree(lpMsgBuf); + } #endif //_DEBUG //end rewbs.VSTcompliance } catch(...) @@ -304,7 +305,7 @@ PVSTPLUGENTRY pMainProc = (PVSTPLUGENTRY)GetProcAddress(hLib, "main"); #ifdef ENABLE_BUZZ GET_INFO pBuzzGetInfo = (GET_INFO)GetProcAddress(hLib, "GetInfo"); - #endif + #endif // ENABLE_BUZZ if (pMainProc) { PVSTPLUGINLIB p = new VSTPLUGINLIB; @@ -329,9 +330,9 @@ pEffect->dispatcher(pEffect, effOpen, 0,0,0,0); #ifdef VST_USE_ALTERNATIVE_MAGIC p->dwPluginId1 = CalculateCRC32fromFilename(p->szLibraryName); // Make Plugin ID unique for sure - #else + #else p->dwPluginId1 = pEffect->magic; - #endif + #endif // VST_USE_ALTERNATIVE_MAGIC p->dwPluginId2 = pEffect->uniqueID; if ((pEffect->flags & effFlagsIsSynth) || (!pEffect->numInputs)) p->bIsInstrument = TRUE; #ifdef VST_LOG @@ -342,7 +343,7 @@ pEffect->numInputs, pEffect->numOutputs, pEffect->numPrograms, pEffect->numParams, pEffect->flags, pEffect->realQualities, pEffect->offQualities); - #endif + #endif // VST_LOG pEffect->dispatcher(pEffect, effClose, 0,0,0,0); bOk = TRUE; } @@ -406,7 +407,7 @@ { #ifdef VST_LOG Log("Entry point not found!\n"); - #endif + #endif // VST_LOG } try { @@ -420,7 +421,7 @@ { #ifdef VST_LOG Log("LoadLibrary(%s) failed!\n", pszDllPath); - #endif + #endif // VST_LOG } return NULL; } @@ -753,7 +754,7 @@ //---from here VST 2.0 extension opcodes------------------------------------------------------ - // <value> is a filter which is currently ignored + // <value> is a filter which is currently ignored - DEPRECATED in VST 2.4 // Herman Seib only processes Midi events for plugs that call this. Keep in mind. case audioMasterWantMidi: return 1; // returns const VstTimeInfo* (or 0 if not supported) @@ -761,43 +762,53 @@ case audioMasterGetTime: { CVstPlugin* pVstPlugin = (CVstPlugin*)effect->resvd1; - memset(&timeInfo, 0, sizeof(timeInfo)); + MemsetZero(timeInfo); timeInfo.sampleRate = CMainFrame::GetMainFrame()->GetSampleRate(); - if (pVstPlugin) { + if (pVstPlugin) + { CSoundFile* pSndFile = pVstPlugin->GetSoundFile(); - if (pVstPlugin->IsSongPlaying()) { + if (pVstPlugin->IsSongPlaying()) + { timeInfo.flags |= kVstTransportPlaying; timeInfo.samplePos = CMainFrame::GetMainFrame()->GetTotalSampleCount(); if (timeInfo.samplePos == 0) //samplePos=0 means we just started playing - timeInfo.flags |= kVstTransportChanged; - } else { + { + timeInfo.flags |= kVstTransportChanged; + } + } else + { timeInfo.flags |= kVstTransportChanged; //just stopped. timeInfo.samplePos = 0; } - if ((value & kVstNanosValid)) { + if ((value & kVstNanosValid)) + { timeInfo.flags |= kVstNanosValid; timeInfo.nanoSeconds = pVstPlugin->GetTimeAtStartOfProcess(); } - if ((value & kVstPpqPosValid) && pSndFile) { + if ((value & kVstPpqPosValid) && pSndFile) + { timeInfo.flags |= kVstPpqPosValid; - if (timeInfo.flags & kVstTransportPlaying) { + if (timeInfo.flags & kVstTransportPlaying) + { timeInfo.ppqPos = (timeInfo.samplePos/timeInfo.sampleRate)*(pSndFile->GetCurrentBPM()/60.0); - } else { + } else + { timeInfo.ppqPos = 0; } } - if ((value & kVstTempoValid) && pSndFile) { + if ((value & kVstTempoValid) && pSndFile) + { timeInfo.tempo = pSndFile->GetCurrentBPM(); - if (timeInfo.tempo) { + if (timeInfo.tempo) + { timeInfo.flags |= kVstTempoValid; } } - if ((value & kVstTimeSigValid) && pSndFile) { - timeInfo.flags |= kVstTimeSigValid; - //timeInfo.timeSigNumerator = pSndFile->m_nCurrentRowsPerBeat; - //timeInfo.timeSigDenominator = pSndFile->m_nCurrentRowsPerMeasure; + if ((value & kVstTimeSigValid) && pSndFile) + { + timeInfo.flags |= kVstTimeSigValid; // Time signature. numerator = rows per beats / rows pear measure (should sound somewhat logical to you). // the denominator is a bit more tricky, since it cannot be set explicitely. so we just assume quarters for now. @@ -811,27 +822,31 @@ // We don't support plugs that send VSTEvents to the host case audioMasterProcessEvents: Log("VST plugin to host: Process Events\n"); - break; + break; + // DEPRECATED in VST 2.4 case audioMasterSetTime: Log("VST plugin to host: Set Time\n"); break; - // returns tempo (in bpm * 10000) at sample frame location passed in <value> + // returns tempo (in bpm * 10000) at sample frame location passed in <value> - DEPRECATED in VST 2.4 case audioMasterTempoAt: //Screw it! Let's just return the tempo at this point in time (might be a bit wrong). - if (effect->resvd1) { + if (effect->resvd1) + { CSoundFile *pSndFile = ((CVstPlugin*)effect->resvd1)->GetSoundFile(); - if (pSndFile) { - return pSndFile->GetCurrentBPM()*10000; - } else { - return 125*10000; + if (pSndFile) + { + return (VstInt32)(pSndFile->GetCurrentBPM() * 10000); + } else + { + return (VstInt32)(125 * 10000); } } return 125*10000; - // parameters + // parameters - DEPRECATED in VST 2.4 case audioMasterGetNumAutomatableParameters: Log("VST plugin to host: Get Num Automatable Parameters\n"); break; - // Apparently, this one is broken in VST SDK anyway. + // Apparently, this one is broken in VST SDK anyway. - DEPRECATED in VST 2.4 case audioMasterGetParameterQuantization: Log("VST plugin to host: Audio Master Get Parameter Quantization\n"); break; @@ -839,7 +854,7 @@ case audioMasterIOChanged: Log("VST plugin to host: IOchanged\n"); break; - // plug needs idle calls (outside its editor window) + // plug needs idle calls (outside its editor window) - DEPRECATED in VST 2.4 case audioMasterNeedIdle: if (effect && effect->resvd1) { @@ -880,16 +895,16 @@ VstIntPtr latency = CMainFrame::GetMainFrame()->m_nBufferLength * (CMainFrame::GetMainFrame()->GetSampleRate()/1000L); return latency; } - // input pin in <value> (-1: first to come), returns cEffect* + // input pin in <value> (-1: first to come), returns cEffect* - DEPRECATED in VST 2.4 case audioMasterGetPreviousPlug: Log("VST plugin to host: Get Previous Plug\n"); break; - // output pin in <value> (-1: first to come), returns cEffect* + // output pin in <value> (-1: first to come), returns cEffect* - DEPRECATED in VST 2.4 case audioMasterGetNextPlug: Log("VST plugin to host: Get Next Plug\n"); break; // realtime info - // returns: 0: not supported, 1: replace, 2: accumulate + // returns: 0: not supported, 1: replace, 2: accumulate - DEPRECATED in VST 2.4 (replace is default) case audioMasterWillReplaceOrAccumulate: return 1; //we replace. case audioMasterGetCurrentProcessLevel: @@ -924,16 +939,16 @@ case audioMasterOfflineGetCurrentMetaPass: Log("VST plugin to host: OfflineGetCurrentMetapass\n"); break; - // for variable i/o, sample rate in <opt> + // for variable i/o, sample rate in <opt> - DEPRECATED in VST 2.4 case audioMasterSetOutputSampleRate: Log("VST plugin to host: Set Output Sample Rate\n"); break; - // result in ret + // result in ret - DEPRECATED in VST 2.4 case audioMasterGetOutputSpeakerArrangement: Log("VST plugin to host: Get Output Speaker Arrangement\n"); break; case audioMasterGetVendorString: - strcpy((char*)ptr, s_szHostVendorString); + strcpy((char *) ptr, s_szHostVendorString); //strcpy((char*)ptr,"Steinberg"); //return 0; return true; @@ -941,13 +956,13 @@ return s_nHostVendorVersion; //return 7000; case audioMasterGetProductString: - strcpy((char*)ptr, s_szHostProductString); + strcpy((char *) ptr, s_szHostProductString); //strcpy((char*)ptr,"Cubase VST"); //return 0; return true; case audioMasterVendorSpecific: return 0; - // void* in <ptr>, format not defined yet + // void* in <ptr>, format not defined yet - DEPRECATED in VST 2.4 case audioMasterSetIcon: Log("VST plugin to host: Set Icon\n"); break; @@ -978,11 +993,11 @@ // case audioMasterGetLanguage: return kVstLangEnglish; - // returns platform specific ptr + // returns platform specific ptr - DEPRECATED in VST 2.4 case audioMasterOpenWindow: Log("VST plugin to host: Open Window\n"); break; - // close window, platform specific handle in <ptr> + // close window, platform specific handle in <ptr> - DEPRECATED in VST 2.4 case audioMasterCloseWindow: Log("VST plugin to host: Close Window\n"); break; @@ -1026,19 +1041,19 @@ case audioMasterCloseFileSelector: return VstFileSelector(opcode == audioMasterCloseFileSelector, (VstFileSelect *)ptr, effect); - // open an editor for audio (defined by XML text in ptr) - DEPRECATED + // open an editor for audio (defined by XML text in ptr) - DEPRECATED in VST 2.4 case audioMasterEditFile: Log("VST plugin to host: Edit File\n"); break; // get the native path of currently loading bank or project - // (called from writeChunk) void* in <ptr> (char[2048], or sizeof(FSSpec)) - DEPRECATED + // (called from writeChunk) void* in <ptr> (char[2048], or sizeof(FSSpec)) - DEPRECATED in VST 2.4 case audioMasterGetChunkFile: Log("VST plugin to host: Get Chunk File\n"); break; //---from here VST 2.3 extension opcodes------------------------------------------------------ - // result a VstSpeakerArrangement in ret - DEPRECATED + // result a VstSpeakerArrangement in ret - DEPRECATED in VST 2.4 case audioMasterGetInputSpeakerArrangement: Log("VST plugin to host: Get Input Speaker Arrangement\n"); break; Modified: trunk/OpenMPT/mptrack/mptrack.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack.vcproj 2011-03-23 22:40:37 UTC (rev 827) +++ trunk/OpenMPT/mptrack/mptrack.vcproj 2011-03-24 20:05:01 UTC (rev 828) @@ -259,90 +259,6 @@ RelativePath=".\KeyConfigDlg.cpp"> </File> <File - RelativePath="..\soundlib\Load_669.cpp"> - </File> - <File - RelativePath="..\Soundlib\load_amf.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_ams.cpp"> - </File> - <File - RelativePath="..\soundlib\load_dbm.cpp"> - </File> - <File - RelativePath="..\soundlib\load_dmf.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_dsm.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_far.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_gdm.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_imf.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_it.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_itp.cpp"> - </File> - <File - RelativePath="..\soundlib\load_j2b.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_mdl.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_med.cpp"> - </File> - <File - RelativePath="..\soundlib\load_mid.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_mo3.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_mod.cpp"> - </File> - <File - RelativePath="..\Soundlib\load_mt2.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_mtm.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_okt.cpp"> - </File> - <File - RelativePath="..\Soundlib\load_psm.cpp"> - </File> - <File - RelativePath="..\soundlib\load_ptm.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_s3m.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_stm.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_ult.cpp"> - </File> - <File - RelativePath="..\Soundlib\Load_umx.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_wav.cpp"> - </File> - <File - RelativePath="..\soundlib\Load_xm.cpp"> - </File> - <File RelativePath=".\mainbar.cpp"> </File> <File @@ -804,9 +720,6 @@ RelativePath=".\KeyConfigDlg.h"> </File> <File - RelativePath="..\soundlib\Loaders.h"> - </File> - <File RelativePath=".\mainbar.h"> </File> <File @@ -992,6 +905,97 @@ RelativePath=".\test\test.h"> </File> </Filter> + <Filter + Name="Module Loaders" + Filter=""> + <File + RelativePath="..\soundlib\Load_669.cpp"> + </File> + <File + RelativePath="..\Soundlib\load_amf.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_ams.cpp"> + </File> + <File + RelativePath="..\soundlib\load_dbm.cpp"> + </File> + <File + RelativePath="..\soundlib\load_dmf.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_dsm.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_far.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_gdm.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_imf.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_it.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_itp.cpp"> + </File> + <File + RelativePath="..\soundlib\load_j2b.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_mdl.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_med.cpp"> + </File> + <File + RelativePath="..\soundlib\load_mid.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_mo3.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_mod.cpp"> + </File> + <File + RelativePath="..\Soundlib\load_mt2.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_mtm.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_okt.cpp"> + </File> + <File + RelativePath="..\Soundlib\load_psm.cpp"> + </File> + <File + RelativePath="..\soundlib\load_ptm.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_s3m.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_stm.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_ult.cpp"> + </File> + <File + RelativePath="..\Soundlib\Load_umx.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_wav.cpp"> + </File> + <File + RelativePath="..\soundlib\Load_xm.cpp"> + </File> + <File + RelativePath="..\soundlib\Loaders.h"> + </File> + </Filter> <File RelativePath=".\mptrack.reg"> </File> Modified: trunk/OpenMPT/mptrack/mptrack_08.vcproj =================================================================== --- trunk/OpenMPT/mptrack/mptrack_08.vcproj 2011-03-23 22:40:37 UTC (rev 827) +++ trunk/OpenMPT/mptrack/mptrack_08.vcproj 2011-03-24 20:05:01 UTC (rev 828) @@ -349,118 +349,6 @@ > </File> <File - RelativePath="..\soundlib\Load_669.cpp" - > - </File> - <File - RelativePath="..\Soundlib\load_amf.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_ams.cpp" - > - </File> - <File - RelativePath="..\soundlib\load_dbm.cpp" - > - </File> - <File - RelativePath="..\soundlib\load_dmf.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_dsm.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_far.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_gdm.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_imf.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_it.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_itp.cpp" - > - </File> - <File - RelativePath="..\soundlib\load_j2b.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_mdl.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_med.cpp" - > - </File> - <File - RelativePath="..\soundlib\load_mid.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_mo3.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_mod.cpp" - > - </File> - <File - RelativePath="..\Soundlib\load_mt2.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_mtm.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_okt.cpp" - > - </File> - <File - RelativePath="..\Soundlib\load_psm.cpp" - > - </File> - <File - RelativePath="..\soundlib\load_ptm.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_s3m.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_stm.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_ult.cpp" - > - </File> - <File - RelativePath="..\Soundlib\Load_umx.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_wav.cpp" - > - </File> - <File - RelativePath="..\soundlib\Load_xm.cpp" - > - </File> - <File RelativePath=".\mainbar.cpp" > </File> @@ -1067,10 +955,6 @@ > </File> <File - RelativePath="..\soundlib\Loaders.h" - > - </File> - <File RelativePath=".\mainbar.h" > </File> @@ -1319,6 +1203,126 @@ > </File> </Filter> + <Filter + Name="Module Loaders" + > + <File + RelativePath="..\soundlib\Load_669.cpp" + > + </File> + <File + RelativePath="..\Soundlib\load_amf.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_ams.cpp" + > + </File> + <File + RelativePath="..\soundlib\load_dbm.cpp" + > + </File> + <File + RelativePath="..\soundlib\load_dmf.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_dsm.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_far.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_gdm.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_imf.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_it.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_itp.cpp" + > + </File> + <File + RelativePath="..\soundlib\load_j2b.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_mdl.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_med.cpp" + > + </File> + <File + RelativePath="..\soundlib\load_mid.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_mo3.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_mod.cpp" + > + </File> + <File + RelativePath="..\Soundlib\load_mt2.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_mtm.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_okt.cpp" + > + </File> + <File + RelativePath="..\Soundlib\load_psm.cpp" + > + </File> + <File + RelativePath="..\soundlib\load_ptm.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_s3m.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_stm.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_ult.cpp" + > + </File> + <File + RelativePath="..\Soundlib\Load_umx.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_wav.cpp" + > + </File> + <File + RelativePath="..\soundlib\Load_xm.cpp" + > + </File> + <File + RelativePath="..\soundlib\Loaders.h" + > + </File> + </Filter> <File RelativePath=".\res\built-inTunings.tc" > Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-23 22:40:37 UTC (rev 827) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-03-24 20:05:01 UTC (rev 828) @@ -1703,7 +1703,7 @@ break; case VOLCMD_OFFSET: //rewbs.volOff - if (m_nTickCount == nStartTick) + if (m_nTickCount == nStartTick) SampleOffset(nChn, vol<<3, bPorta); break; } @@ -2079,23 +2079,17 @@ } break; - // Midi Controller (on first tick only) - case CMD_MIDI: - if(!(m_dwSongFlags & SONG_FIRSTTICK)) break; + // Midi Controller + case CMD_MIDI: // Midi Controller (on first tick only) + case CMD_SMOOTHMIDI: // Midi Controller (smooth, i.e. on every tick) + + if((cmd == CMD_MIDI) && !(m_dwSongFlags & SONG_FIRSTTICK)) break; if (param < 0x80) - ProcessMidiMacro(nChn, &m_MidiCfg.szMidiSFXExt[pChn->nActiveMacro << 5], param); + ProcessMidiMacro(nChn, (cmd == CMD_SMOOTHMIDI), &m_MidiCfg.szMidiSFXExt[pChn->nActiveMacro << 5], param); else - ProcessMidiMacro(nChn, &m_MidiCfg.szMidiZXXExt[(param & 0x7F) << 5], 0); + ProcessMidiMacro(nChn, (cmd == CMD_SMOOTHMIDI), &m_MidiCfg.szMidiZXXExt[(param & 0x7F) << 5], 0); break; - // Midi Controller (smooth, i.e. on every tick) - case CMD_SMOOTHMIDI: - if (param < 0x80) - ProcessSmoothMidiMacro(nChn, &m_MidiCfg.szMidiSFXExt[pChn->nActiveMacro << 5], param); - else - ProcessSmoothMidiMacro(nChn, &m_MidiCfg.szMidiZXXExt[(param & 0x7F) << 5], 0); - break; - // IMF Commands case CMD_NOTESLIDEUP: NoteSlide(pChn, param, 1); @@ -3017,41 +3011,53 @@ } -void CSoundFile::ProcessMidiMacro(UINT nChn, LPCSTR pszMidiMacro, UINT param) -//--------------------------------------------------------------------------- +// Process a Midi Macro. +// Parameters: +// [in] nChn: Mod channel to apply macro on +// [in] isSmooth: If true, internal macros are interpolated between two rows +// [in] pszMidiMacro: Actual Midi Macro +// [in] param: Parameter for parametric macros +void CSoundFile::ProcessMidiMacro(UINT nChn, bool isSmooth, LPCSTR pszMidiMacro, UINT param) +//------------------------------------------------------------------------------------------ { MODCHANNEL *pChn = &Chn[nChn]; - DWORD dwMacro = (*((LPDWORD)pszMidiMacro)) & MACRO_MASK; + DWORD dwMacro = (*((DWORD *)pszMidiMacro)) & MACRO_MASK; int nInternalCode; // Not Internal Device ? if (dwMacro != MACRO_INTERNAL && dwMacro != MACRO_INTERNALEX) { + // we don't cater for external devices at tick resolution. + if(isSmooth && !(m_dwSongFlags & SONG_FIRSTTICK)) + { + return; + } + UINT pos = 0, nNib = 0, nBytes = 0; DWORD dwMidiCode = 0, dwByteCode = 0; - while (pos+6 <= 32) + while (pos + 6 <= 32) { - CHAR cData = pszMidiMacro[pos++]; + const CHAR cData = pszMidiMacro[pos++]; if (!cData) break; - if ((cData >= '0') && (cData <= '9')) { dwByteCode = (dwByteCode<<4) | (cData-'0'); nNib++; } else - if ((cData >= 'A') && (cData <= 'F')) { dwByteCode = (dwByteCode<<4) | (cData-'A'+10); nNib++; } else - if ((cData >= 'a') && (cData <= 'f')) { dwByteCode = (dwByteCode<<4) | (cData-'a'+10); nNib++; } else - if ((cData == 'z') || (cData == 'Z')) { dwByteCode = param & 0x7f; nNib = 2; } else + if ((cData >= '0') && (cData <= '9')) { dwByteCode = (dwByteCode << 4) | (cData - '0'); nNib++; } else + if ((cData >= 'A') && (cData <= 'F')) { dwByteCode = (dwByteCode << 4) | (cData - 'A' + 10); nNib++; } else + if ((cData >= 'a') && (cData <= 'f')) { dwByteCode = (dwByteCode << 4) | (cData - 'a' + 10); nNib++; } else + if ((cData == 'z') || (cData == 'Z')) { dwByteCode = param & 0x7F; nNib = 2; } else if ((cData == 'x') || (cData == 'X')) { dwByteCode = param & 0x70; nNib = 2; } else - if ((cData == 'y') || (cData == 'Y')) { dwByteCode = (param & 0x0f)<<3; nNib = 2; } - if ((cData == 'k') || (cData == 'K')) { dwByteCode = (dwByteCode<<4) | GetBestMidiChan(pChn); nNib++; } + if ((cData == 'y') || (cData == 'Y')) { dwByteCode = (param & 0x0F) << 3; nNib = 2; } + if ((cData == 'k') || (cData == 'K')) { dwByteCode = (dwByteCode << 4) | GetBestMidiChan(pChn); nNib++; } if (nNib >= 2) { nNib = 0; - dwMidiCode |= dwByteCode << (nBytes*8); + dwMidiCode |= dwByteCode << (nBytes * 8); dwByteCode = 0; nBytes++; if (nBytes >= 3) { - UINT nMasterCh = (nChn < m_nChannels) ? nChn+1 : pChn->nMasterChn; + UINT nMasterCh = (nChn < m_nChannels) ? nChn + 1 : pChn->nMasterChn; if ((nMasterCh) && (nMasterCh <= m_nChannels)) { // -> CODE#0015 @@ -3059,9 +3065,10 @@ UINT nPlug = GetBestPlugin(nChn, PRIORITISE_CHANNEL, EVEN_IF_MUTED); if(pChn->dwFlags & CHN_NOFX) nPlug = 0; // -! NEW_FEATURE#0015 - if ((nPlug) && (nPlug <= MAX_MIXPLUGINS)) { - IMixPlugin *pPlugin = m_MixPlugins[nPlug-1].pMixPlugin; - if ((pPlugin) && (m_MixPlugins[nPlug-1].pMixState)) + if ((nPlug) && (nPlug <= MAX_MIXPLUGINS)) + { + IMixPlugin *pPlugin = m_MixPlugins[nPlug - 1].pMixPlugin; + if ((pPlugin) && (m_MixPlugins[nPlug - 1].pMixState)) { pPlugin->MidiSend(dwMidiCode); } @@ -3078,10 +3085,11 @@ } // Internal device - //HACK: const bool extendedParam = (dwMacro == MACRO_INTERNALEX); - pszMidiMacro += 4; + pszMidiMacro += 4; // skip the F0.F0 part of the macro + // Determine which internal device is called; every internal code looks like F0.F0.yy.xx, + // where yy is the "device" (cutoff, resonance, plugin parameter, etc.) and xx is the value. nInternalCode = -256; if ((pszMidiMacro[0] >= '0') && (pszMidiMacro[0] <= '9')) nInternalCode = (pszMidiMacro[0] - '0') << 4; else if ((pszMidiMacro[0] >= 'A') && (pszMidiMacro[0] <= 'F')) nInternalCode = (pszMidiMacro[0] - 'A' + 0x0A) << 4; @@ -3092,17 +3100,21 @@ { CHAR cData1 = pszMidiMacro[2]; DWORD dwParam = 0; + if ((cData1 == 'z') || (cData1 == 'Z')) { + // parametric macro dwParam = param; } else { + // fixed macro CHAR cData2 = pszMidiMacro[3]; if ((cData1 >= '0') && (cData1 <= '9')) dwParam += (cData1 - '0') << 4; else if ((cData1 >= 'A') && (cData1 <= 'F')) dwParam += (cData1 - 'A' + 0x0A) << 4; if ((cData2 >= '0') && (cData2 <= '9')) dwParam += (cData2 - '0'); else if ((cData2 >= 'A') && (cData2 <= 'F')) dwParam += (cData2 - 'A' + 0x0A); } + switch(nInternalCode) { // F0.F0.00.xx: Set CutOff @@ -3111,16 +3123,30 @@ int oldcutoff = pChn->nCutOff; if (dwParam < 0x80) { - pChn->nCutOff = dwParam; + if(!isSmooth) + { + pChn->nCutOff = dwParam; + } else + { + // on the first tick only, calculate step + if(m_dwSongFlags & SONG_FIRSTTICK) + { + pChn->m_nPlugInitialParamValue = pChn->nCutOff; + // (dwParam & 0x7F) extracts the actual value that we're going to pass + pChn->m_nPlugParamValueStep = (float)((int)dwParam - pChn->m_nPlugInitialParamValue) / (float)m_nMusicSpeed; + } + //update param on all ticks + pChn->nCutOff = (BYTE) (pChn->m_nPlugInitialParamValue + (m_nTickCount + 1 ) *pChn->m_nPlugParamValueStep + 0.5); + } pChn->nRestoreCutoffOnNewNote = 0; } - #ifndef NO_FILTER +#ifndef NO_FILTER oldcutoff -= pChn->nCutOff; if (oldcutoff < 0) oldcutoff = -oldcutoff; if ((pChn->nVolume > 0) || (oldcutoff < 0x10) - || (!(pChn->dwFlags & CHN_FILTER)) || (!(pChn->nLeftVol|pChn->nRightVol))) + || (!(pChn->dwFlags & CHN_FILTER)) || (!(pChn->nLeftVol|pChn->nRightVol))) SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); - #endif // NO_FILTER +#endif // NO_FILTER } break; @@ -3129,191 +3155,68 @@ if (dwParam < 0x80) { pChn->nRestoreResonanceOnNewNote = 0; - pChn->nResonance = dwParam; - } - - #ifndef NO_FILTER - SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); - #endif // NO_FILTER - break; - - // F0.F0.02.xx: Set filter mode - case 0x02: - if (dwParam < 0x20) - { - pChn->nFilterMode = (dwParam>>4); - #ifndef NO_FILTER - SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); - #endif // NO_FILTER - } - break; - - // F0.F0.03.xx: Set plug dry/wet - case 0x03: - { - UINT nPlug = GetBestPlugin(nChn, PRIORITISE_CHANNEL, EVEN_IF_MUTED); - if ((nPlug) && (nPlug <= MAX_MIXPLUGINS)) { - if (dwParam < 0x80) - m_MixPlugins[nPlug-1].fDryRatio = 1.0-(static_cast<float>(dwParam)/127.0f); - } - } - break; - - - // F0.F0.{80|n}.xx: Set VST effect parameter n to xx - default: - if (nInternalCode & 0x80 || extendedParam) - { - UINT nPlug = GetBestPlugin(nChn, PRIORITISE_CHANNEL, EVEN_IF_MUTED); - if ((nPlug) && (nPlug <= MAX_MIXPLUGINS)) + if(!isSmooth) { - IMixPlugin *pPlugin = m_MixPlugins[nPlug-1].pMixPlugin; - if ((pPlugin) && (m_MixPlugins[nPlug-1].pMixState)) + pChn->nResonance = dwParam; + } else + { + // on the first tick only, calculate step + if(m_dwSongFlags & SONG_FIRSTTICK) { - pPlugin->SetZxxParameter(extendedParam?(0x80+nInternalCode):(nInternalCode&0x7F), dwParam & 0x7F); + pChn->m_nPlugInitialParamValue = pChn->nResonance; + // (dwParam & 0x7F) extracts the actual value that we're going to pass + pChn->m_nPlugParamValueStep = (float)((int)dwParam - pChn->m_nPlugInitialParamValue) / (float)m_nMusicSpeed; } + //update param on all ticks + pChn->nResonance = (BYTE) (pChn->m_nPlugInitialParamValue + (m_nTickCount + 1) * pChn->m_nPlugParamValueStep + 0.5); } } - - } // end switch - } // end internal device - -} - -//rewbs.smoothVST: begin tick resolution handling. -void CSoundFile::ProcessSmoothMidiMacro(UINT nChn, LPCSTR pszMidiMacro, UINT param) -//--------------------------------------------------------------------------- -{ - MODCHANNEL *pChn = &Chn[nChn]; - DWORD dwMacro = (*((LPDWORD)pszMidiMacro)) & MACRO_MASK; - int nInternalCode; - CHAR cData1; // rewbs.smoothVST: - DWORD dwParam; // increased scope to fuction. - - if (dwMacro != MACRO_INTERNAL && dwMacro != MACRO_INTERNALEX) - { - // we don't cater for external devices at tick resolution. - if(m_dwSongFlags & SONG_FIRSTTICK) { - ProcessMidiMacro(nChn, pszMidiMacro, param); - } - return; - } - - //HACK: - const bool extendedParam = (dwMacro == MACRO_INTERNALEX); - - // not sure what we're doing here; some sort of info gathering from the macros - pszMidiMacro += 4; - nInternalCode = -256; - if ((pszMidiMacro[0] >= '0') && (pszMidiMacro[0] <= '9')) nInternalCode = (pszMidiMacro[0] - '0') << 4; else - if ((pszMidiMacro[0] >= 'A') && (pszMidiMacro[0] <= 'F')) nInternalCode = (pszMidiMacro[0] - 'A' + 0x0A) << 4; - if ((pszMidiMacro[1] >= '0') && (pszMidiMacro[1] <= '9')) nInternalCode += (pszMidiMacro[1] - '0'); else - if ((pszMidiMacro[1] >= 'A') && (pszMidiMacro[1] <= 'F')) nInternalCode += (pszMidiMacro[1] - 'A' + 0x0A); - - if (nInternalCode < 0) // not good plugin param macro. (?) - return; - - cData1 = pszMidiMacro[2]; - dwParam = 0; - - if ((cData1 == 'z') || (cData1 == 'Z')) //parametric macro - { - dwParam = param; - } else //fixed macro - { - CHAR cData2 = pszMidiMacro[3]; - if ((cData1 >= '0') && (cData1 <= '9')) dwParam += (cData1 - '0') << 4; else - if ((cData1 >= 'A') && (cData1 <= 'F')) dwParam += (cData1 - 'A' + 0x0A) << 4; - if ((cData2 >= '0') && (cData2 <= '9')) dwParam += (cData2 - '0'); else - if ((cData2 >= 'A') && (cData2 <= 'F')) dwParam += (cData2 - 'A' + 0x0A); - } - - switch(nInternalCode) - { - // F0.F0.00.xx: Set CutOff - case 0x00: - { - int oldcutoff = pChn->nCutOff; - if (dwParam < 0x80) - { - // on the fist tick only, calculate step - if (m_dwSongFlags & SONG_FIRSTTICK) - { - pChn->m_nPlugInitialParamValue = pChn->nCutOff; - // (dwParam & 0x7F) extracts the actual value that we're going to pass - pChn->m_nPlugParamValueStep = (float)((int)dwParam-pChn->m_nPlugInitialParamValue)/(float)m_nMusicSpeed; - } - //update param on all ticks - pChn->nCutOff = (BYTE) (pChn->m_nPlugInitialParamValue + (m_nTickCount+1)*pChn->m_nPlugParamValueStep + 0.5); - pChn->nRestoreCutoffOnNewNote = 0; - } - #ifndef NO_FILTER - oldcutoff -= pChn->nCutOff; - if (oldcutoff < 0) oldcutoff = -oldcutoff; - if ((pChn->nVolume > 0) || (oldcutoff < 0x10) - || (!(pChn->dwFlags & CHN_FILTER)) || (!(pChn->nLeftVol|pChn->nRightVol))) - SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); - #endif // NO_FILTER - } break; - - // F0.F0.01.xx: Set Resonance - case 0x01: - if (dwParam < 0x80) - { - // on the fist tick only, calculate step - if (m_dwSongFlags & SONG_FIRSTTICK) - { - pChn->m_nPlugInitialParamValue = pChn->nResonance; - // (dwParam & 0x7F) extracts the actual value that we're going to pass - pChn->m_nPlugParamValueStep = (float)((int)dwParam-pChn->m_nPlugInitialParamValue)/(float)m_nMusicSpeed; - } - //update param on all ticks - pChn->nResonance = (BYTE) (pChn->m_nPlugInitialParamValue + (m_nTickCount+1)*pChn->m_nPlugParamValueStep + 0.5); - pChn->nRestoreResonanceOnNewNote = 0; - #ifndef NO_FILTER - SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); - #endif // NO_FILTER - } - + +#ifndef NO_FILTER + SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); +#endif // NO_FILTER break; - // F0.F0.02.xx: Set filter mode + // F0.F0.02.xx: Set filter mode (high nibble determines filter mode) case 0x02: if (dwParam < 0x20) { - pChn->nFilterMode = (dwParam>>4); - #ifndef NO_FILTER + pChn->nFilterMode = (dwParam >> 4); +#ifndef NO_FILTER SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true); - #endif // NO_FILTER +#endif // NO_FILTER } break; // F0.F0.03.xx: Set plug dry/wet case 0x03: { - UINT nPlug = GetBestPlugin(nChn, PRIORITISE_CHANNEL, EVEN_IF_MUTED); - if ((nPlug) && (nPlug <= MAX_MIXPLUGINS)) { - // on the fist tick only, calculate step - if (m_dwSongFlags & SONG_FIRSTTICK) + const UINT nPlug = GetBestPlugin(nChn, PRIORITISE_CHANNEL, EVEN_IF_MUTED); + if ((nPlug) && (nPlug <= MAX_MIXPLUGINS) && dwParam < 0x80) + { + if(!isSmooth) { - pChn->m_nPlugInitialParamValue = m_MixPlugins[nPlug-1].fDryRatio; - // (dwParam & 0x7F) extracts the actual value that we're going to pass - pChn->m_nPlugParamValueStep = ((1-((float)(dwParam)/127.0f))-pChn->m_nPlugInitialParamValue)/(float)m_nMusicSpeed; + m_MixPlugins[nPlug - 1].fDryRatio = 1.0 - (static_cast<float>(dwParam) / 127.0f); + } else + { + // on the first tick only, calculate step + if(m_dwSongFlags & SONG_FIRSTTICK) + { + pChn->m_nPlugInitialParamValue = m_MixPlugins[nPlug - 1].fDryRatio; + // (dwParam & 0x7F) extracts the actual value that we're going to pass + pChn->m_nPlugParamValueStep = ((1 - ((float)(dwParam) / 127.0f)) - pChn->m_nPlugInitialParamValue) / (float)m_nMusicSpeed; + } + //update param on all ticks + m_MixPlugins[nPlug - 1].fDryRatio = pChn->m_nPlugInitialParamValue + (float)(m_nTickCount + 1) * pChn->m_nPlugParamValueStep; } - //update param on all ticks - IMixPlugin *pPlugin = m_MixPlugins[nPlug-1].pMixPlugin; - if ((pPlugin) && (m_MixPlugins[nPlug-1].pMixState)) { - m_MixPlugins[nPlug-1].fDryRatio = pChn->m_nPlugInitialParamValue+(float)(m_nTickCount+1)*pChn->m_nPlugParamValueStep; - } - } } break; - + // F0.F0.{80|n}.xx: Set VST effect parameter n to xx default: - if (nInternalCode & 0x80 || extendedParam) + if (nInternalCode & 0x80 || extendedParam) { UINT nPlug = GetBestPlugin(nChn, PRIORITISE_CHANNEL, EVEN_IF_MUTED); if ((nPlug) && (nPlug <= MAX_MIXPLUGINS)) @@ -3321,24 +3224,31 @@ IMixPlugin *pPlugin = m_MixPlugins[nPlug-1].pMixPlugin; if ((pPlugin) && (m_MixPlugins[nPlug-1].pMixState)) { - // on the fist tick only, calculate step - if (m_dwSongFlags & SONG_FIRSTTICK) + if(!isSmooth) { - pChn->m_nPlugInitialParamValue = pPlugin->GetZxxParameter(extendedParam?(0x80+nInternalCode):(nInternalCode&0x7F)); - // (dwParam & 0x7F) extracts the actual value that we're going to pass - pChn->m_nPlugParamValueStep = ((int)(dwParam & 0x7F)-pChn->m_nPlugInitialParamValue)/(float)m_nMusicSpeed; + pPlugin->SetZxxParameter(extendedParam ? (0x80 + nInternalCode) : (nInternalCode & 0x7F), dwParam & 0x7F); + } else + { + // on the first tick only, calculate step + if(m_dwSongFlags & SONG_FIRSTTICK) + { + pChn->m_nPlugInitialParamValue = pPlugin->GetZxxParameter(extendedParam ? (0x80 + nInternalCode) : (nInternalCode & 0x7F)); + // (dwParam & 0x7F) extracts the actual value that we're going to pass + pChn->m_nPlugParamValueStep = ((int)(dwParam & 0x7F) - pChn->m_nPlugInitialParamValue) / (float)m_nMusicSpeed; + } + //update param on all ticks + pPlugin->SetZxxParameter(extendedParam ? (0x80 + nInternalCode) : (nInternalCode & 0x7F), (UINT) (pChn->m_nPlugInitialParamValue + (m_nTickCount + 1) * pChn->m_nPlugParamValueStep + 0.5)); } - //update param on all ticks - pPlugin->SetZxxParameter(extendedParam?(0x80+nInternalCode):(nInternalCode&0x7F), (UINT) (pChn->m_nPlugInitialParamValue + (m_nTickCount+1)*pChn->m_nPlugParamValueStep + 0.5)); } } + } - } - } // end switch + } // end switch + } // end internal device } -//end rewbs.smoothVST + //rewbs.volOffset: moved offset code to own method as it will be used in several places now void CSoundFile::SampleOffset(UINT nChn, UINT param, bool bPorta) //--------------------------------------------------------------- Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2011-03-23 22:40:37 UTC (rev 827) +++ trunk/OpenMPT/soundlib/Sndfile.h 2011-03-24 20:05:01 UTC (rev 828) @@ -911,8 +911,7 @@ void ExtendedS3MCommands(UINT nChn, UINT param); void ExtendedChannelEffect(MODCHANNEL *, UINT param); inline void InvertLoop(MODCHANNEL* pChn); - void ProcessMidiMacro(UINT nChn, LPCSTR pszMidiMacro, UINT param=0); - void ProcessSmoothMidiMacro(UINT nChn, LPCSTR pszMidiMacro, UINT param=0); //rewbs.smoothVST + void ProcessMidiMacro(UINT nChn, bool isSmooth, LPCSTR pszMidiMacro, UINT param = 0); void SetupChannelFilter(MODCHANNEL *pChn, bool bReset, int flt_modifier = 256) const; // Low-Level effect processing void DoFreqSlide(MODCHANNEL *pChn, LONG nFreqSlide); Modified: trunk/OpenMPT/soundlib/mod_specifications.cpp =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.cpp 2011-03-23 22:40:37 UTC (rev 827) +++ trunk/OpenMPT/soundlib/mod_specifications.cpp 2011-03-24 20:05:01 UTC (rev 828) @@ -38,4 +38,16 @@ return true; } +char CModSpecifications::GetVolEffectLetter(MODCOMMAND::VOLCMD volcmd) const +//-------------------------------------------------------------------------- +{ + if(volcmd >= MAX_VOLCMDS) return '?'; + return volcommands[volcmd]; +} +char CModSpecifications::GetEffectLetter(MODCOMMAND::COMMAND cmd) const +//--------------------------------------------------------------------- +{ + if(cmd >= MAX_EFFECTS) return '?'; + return commands[cmd]; +} Modified: trunk/OpenMPT/soundlib/mod_specifications.h =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.h 2011-03-23 22:40:37 UTC (rev 827) +++ trunk/OpenMPT/soundlib/mod_specifications.h 2011-03-24 20:05:01 UTC (rev 828) @@ -14,6 +14,9 @@ bool HasNote(MODCOMMAND::NOTE note) const; bool HasVolCommand(MODCOMMAND::VOLCMD volcmd) const; bool HasCommand(MODCOMMAND::COMMAND cmd) const; + // Return corresponding effect letter for this format + char GetEffectLetter(MODCOMMAND::COMMAND cmd) const; + char GetVolEffectLetter(MODCOMMAND::VOLCMD cmd) const; // NOTE: If changing order, update all initializations below. char fileExtension[6]; // File extension without dot. @@ -64,7 +67,7 @@ -savefile format and GUI methods can handle new values(might not be a small task :). */ "mptm", // File extension - 1, // Minimum note index + NOTE_MIN, // Minimum note index NOTE_MAX, // Maximum note index true, // Has notecut. true, // Has noteoff. @@ -383,7 +386,7 @@ // TODO: Set correct values. "it", // File extension 1, // Minimum note index - NOTE_MAX, // Maximum note index + 120, // Maximum note index true, // Has notecut. true, // Has noteoff. true, // Has notefade. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |