primitive
8th September 2002, 19:53
I have plugin autoloading working, and it's great, but there's an obvious enhancement that I think has been missed: function exporting and autoloading.
I see it working like this:
1) You put an .avs file in your plugin directory where you have one or more functions defined. It doesn't matter whether or not the .avs actually returns a video clip (making it so that .avs files with just a function definition in them would work).
2) At the end of the .avs, you put a line that says something like "export <funcname>", one line for each function you want to export (so you can have multiple definitions in one file).
3) When avisynth scans your plugin directory for plugins to register, it also scans .avs files in that same directory, looking for the "export" lines. It registers those functions, too.
4) You can use those functions avisynth imported for you as if you had defined them in your .avs.
I see potential namespace issues, but I don't think they'd be any more serious than the namespace issues already implicit in having plugin autoloading. (I'm assuming that the plugin autoloader warns you if you have a namespace conflict instead of catching on fire.)
Let me know what you think,
-p
I see it working like this:
1) You put an .avs file in your plugin directory where you have one or more functions defined. It doesn't matter whether or not the .avs actually returns a video clip (making it so that .avs files with just a function definition in them would work).
2) At the end of the .avs, you put a line that says something like "export <funcname>", one line for each function you want to export (so you can have multiple definitions in one file).
3) When avisynth scans your plugin directory for plugins to register, it also scans .avs files in that same directory, looking for the "export" lines. It registers those functions, too.
4) You can use those functions avisynth imported for you as if you had defined them in your .avs.
I see potential namespace issues, but I don't think they'd be any more serious than the namespace issues already implicit in having plugin autoloading. (I'm assuming that the plugin autoloader warns you if you have a namespace conflict instead of catching on fire.)
Let me know what you think,
-p