View Single Post
Old 10-22-2016, 05:38 PM   #8
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 4,171
Default

Quote:
Originally Posted by Veto View Post
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(chunki)
  
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).
__________________
Projects - Reascripts - Lua:
Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner
Donate via Paypal | LBX Tools Website
lb0 is offline   Reply With Quote