Closed firthm01 closed 1 year ago
Note that FX can also be renamed in the plug-in selection window, which makes the state chunk appear as follows;
<VST "VST3: blahblah" "EAR Object.vst3" 0 "" 1933719658{ABCDEF019182FAEB4542552045505311} ""
ajhCc+5e7f4CAAAAAQAAAAAAAAACAAAAAAAAAEAAAAABAAAAAAAAAAIAAAAAAAAABAAAAAAAAAAIAAAAAAAAABAAAAAAAAAAIAAAAAAAAABAAAAAAAAAAIAAAAAAAAAAAAEAAAAAAAAAAgAAAAAAAAAEAAAAAAAAAAgAAAAAAAAAEAAAAAAAAAAgAAAAAAAAAEAAAAAAAAAAgAAAAAAAAAAAAQAAAAAAAAACAAAAAAAAAAQAAAAAAAAACAAAAAAAAAAQAAAAAAAAACAAAAAAAAAA
QAAAAAAAAACAAAAAAAAAAAABAAAAAAAAAAIAAAAAAAAABAAAAAAAAAAIAAAAAAAAABAAAAAAAAAAIAAAAAAAAABAAAAAAAAAAIAAAAAAAAAAAAEAAAAAAAAAAgAAAAAAAAAEAAAAAAAAAAgAAAAAAAAAEAAAAAAAAAAgAAAAAAAAAEAAAAAAAAAAgAAAAAAAAAAAAQAAAAAAAAACAAAAAAAAAAQAAAAAAAAACAAAAAAAAAAQAAAAAAAAACAAAAAAAAAAQAAAAAAAAACAAAAAAAAA
AAABAAAAAAAAAAIAAAAAAAAABAAAAAAAAAAIAAAAAAAAABAAAAAAAAAAIAAAAAAAAABAAAAAAAAAAIAAAAAAAAAAAAEAAAAAAAAAAgAAAAAAAAAEAAAAAAAAAAgAAAAAAAAAEAAAAAAAAAAgAAAAAAAAAEAAAAAAAAAAgJ0BAAABAAAA//8QAA==
jQEAAAEAAABWQzIhSAEAADw/eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04Ij8+IDxPYmplY3RzUGx1Z2luIGNvbm5lY3Rpb25faWQ9IjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCIgcm91dGluZz0iLTEiIGdhaW49IjAuMCIgYXppbXV0aD0iMC4wIiBlbGV2YXRpb249IjAuMCIgZGlzdGFuY2U9IjEuMCIgbGlua19zaXplPSIwIiBzaXpl
PSIwLjAiIHdpZHRoPSIwLjAiIGhlaWdodD0iMC4wIiBkZXB0aD0iMC4wIiBkaWZmdXNlPSIwLjAiIGRpdmVyZ2VuY2U9IjAiIGZhY3Rvcj0iMC4wIiByYW5nZT0iNDUuMCIgdXNlX3RyYWNrX25hbWU9IjEiIG5hbWU9IlRyYWNrIDEiLz4AAAAAAAAAAABKVUNFUHJpdmF0ZURhdGEAAQFCeXBhc3MAAQEDAB0AAAAAAAAASlVDRVByaXZhdGVEYXRhAAAAAAAAAAA=
AFByb2dyYW0gMQAQAAAA
>
Therefore, we can not rely on the first string - we could use the filename. Filename could obviously change too, but I think that's the least likely to change (and users should probably expect some issues if they start renaming essential components). The ideal solution is to compare plug-in IDs. This is where #122 would certainly help.
If the user renames the plug-in in the plug-in selection window, then this will also break import since int TrackFX_AddByName(MediaTrack* track, const char* fxname, bool recFX, int instantiate )
can not find the relevant plug-ins. It does at least fail gracefully.
With this in mind, it's probably OK to accept that renaming the plug-ins in the plug-in selection window will break things and not try to cover that case.
REAPER now allows the user to rename FX, which is going to mess up any calls to;
int TrackFX_GetByName(MediaTrack* track, const char* fxname, bool instantiate )
bool TrackFX_GetFXName(MediaTrack* track, int fx, char* bufOut, int bufOut_sz )
There is currently (at v6.74) no API function to get the original name rather than the user-specified name. It can however be derived by parsing the tracks state chunk using;
bool GetTrackStateChunk(MediaTrack* track, char* strNeedBig, int strNeedBig_sz, bool isundoOptional )
This will return something like;
Care needs to be taken with quote marks. In this case there were 5 EAR Object plugins (to understand quotes and escaping). They were named;
...with the final one having no custom name.