Quote:
Originally Posted by Veto
In my opinion operating on the chunk and the corresponding string processing is always a bit risky (and probably also more inefficient).
Atm your code would fail on AU effects and on renamed non-JSFX's.
I don't know what the code should do exactly, but wouldn't it be possible with GUIDs (TrackFX_GetFXGUID)?
EDIT: Nope my fault, GetChunkPresetData() works as expected.
EDIT2: Just saw your other thread, it would not be possible with GUIDs. So here's my take:
PHP Code:
local _, chunk = reaper.GetTrackStateChunk(tr,'',false)
local fxchunk = GetChunkPresetData(chunk, i)
local fxchunk=fxchunk:match("%s.*")
local fxn
if fxchunk:sub(2,2)=="\"" then
fxn=fxchunk:match("%s\"(.-)\"")
else
fxn=fxchunk:match("%s(.-)%s")
end
fxn=fxn:match("([^/]+)$")
|
Also - I'm pretty sure I've fixed the renamed VST name - now reading the name from the chunk <VST:
plugin name (other data such as x86 or company name)...>
Here I'm pulling out the bit between the 'VST*: ' up to the first ' (' - this always seems to correspond to the required name for loading the plugin. Works for VSTs VSTi's and VST3's as far as my tests have shown - even when they're renamed as the matching pattern doesn't need to change for these as I'm not needing to read right up to the new plugin name (unlike JSFX).