On Friday 16 January 2015 00:13:02 Nils Tonnätt wrote:
> because of bug #235 I'm trying to understand how the LV2 Plugin works.
> I'm a wannabe programmer but maybe I have found two things.

Disclaimer: I did not write the LV2 plugin, Andreas wrote it. And I am not 
into the details of the LV2 API either. I just had a glimpse at the code ...

> 1. The function LV2_State_Status Restore() has the parameter flags in
> PluginLv2.h but rflags in .cpp. I think that's a typo?!

Looks intentional. The "flag"/"rflags" argument is there, because Andreas 
resembled the method prototype with the respective LV2 save/restore function 
callback signatures:

        http://lv2plug.in/doc/html/structLV2__State__Interface.html

So yes, the "flags" argument is not used, but he retained it for clarity with 
the LV2 API. And he renamed the argument "flags" (.h) -> "rflags" in the cpp 
file, because he added a local variable "flags" in the method body which would 
clash with the argument's name. That's no issue. You can name the argument in 
the .cpp file whatever you want. It does not affect the compiled behavior.

> Why is there actually a flags parameter when we want to retrieve it
> afterwards (or rflags when we don't use it).

See above.

> 2. LV2_State_Status Save() stores NS_LS "state-file" with flag
> LV2_STATE_IS_PORTABLE but
> http://lv2plug.in/doc/html/state_8h.html#afb5cc1033410d51fdcdbfdd09fc7d808
> says "Portable values MUST NOT contain filenames."

Well, no idea about the LV2 aspects here. I mean I currently don't know what 
the actual use case of "portable" data in a LV2 session data is for. Or is 
there any LV2 plugin/host out there that allows to store a plugin state on one 
machine and allows to restore it on another machine (with different OS)?

> And two questions:
> 1. Why don't we store the absolute path?
> http://lv2plug.in/ns/ext/atom/#Path --> "effectively any Path sent to or
> received from a plugin instance MUST be absolute."

Because it seems MapPath is used to transform the "abstract" relative paths 
back to absolute paths. Looks valid to me.

> 2. Why are the old MapPath and MakePath restored after saving and
> restoring the state?

No idea about that one. :) Maybe Andreas can bring some more clues into it.

CU
Christian

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Linuxsampler-devel mailing list
Linuxsampler-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxsampler-devel

Reply via email to