Example #1
0
// Returns macro description including plugin parameter / MIDI CC information
CString MIDIMacroConfig::GetParameteredMacroName(size_t macroIndex, PLUGINDEX plugin, const CSoundFile &sndFile) const
//--------------------------------------------------------------------------------------------------------------------
{
	const parameteredMacroType macroType = GetParameteredMacroType(macroIndex);

	switch(macroType)
	{
	case sfx_plug:
		{
			const int param = MacroToPlugParam(macroIndex);
			CString paramName;

#ifndef NO_VST
			if(plugin < MAX_MIXPLUGINS)
			{
				CVstPlugin *pPlug = dynamic_cast<CVstPlugin *>(sndFile.m_MixPlugins[plugin].pMixPlugin);
				if(pPlug)
				{
					paramName = pPlug->GetParamName(param);
				}
				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");
			}
		}

	case sfx_cc:
		{
			CString formattedCC;
			formattedCC.Format(TEXT("MIDI CC %d"), MacroToMidiCC(macroIndex));
			return formattedCC;
		}

	default:
		return GetParameteredMacroName(macroType);
	}
}
Example #2
0
// Returns macro description including plugin parameter / MIDI CC information
CString MIDIMacroConfig::GetParameteredMacroName(uint32 macroIndex, IMixPlugin *plugin) const
//-------------------------------------------------------------------------------------------
{
	const parameteredMacroType macroType = GetParameteredMacroType(macroIndex);

	switch(macroType)
	{
	case sfx_plug:
		{
			const int param = MacroToPlugParam(macroIndex);
			CString formattedName;
			formattedName.Format(_T("Param %u"), param);
#ifndef NO_PLUGINS
			if(plugin != nullptr)
			{
				CString paramName = plugin->GetParamName(param);
				if(!paramName.IsEmpty())
				{
					formattedName += _T(" (") + paramName + _T(")");
				}
			} else
#else
			MPT_UNREFERENCED_PARAMETER(plugin);
#endif // NO_PLUGINS
			{
				formattedName += _T(" (N/A)");
			}
			return formattedName;
		}

	case sfx_cc:
		{
			CString formattedCC;
			formattedCC.Format(_T("MIDI CC %u"), MacroToMidiCC(macroIndex));
			return formattedCC;
		}

	default:
		return GetParameteredMacroName(macroType);
	}
}