View Full Version : Use of + in input parameters
vcmohan
24th October 2004, 05:13
For some of plugins or filters some parameters have + (for instance horizontalstack has cc+.
What happens if there are more parameters
cc+[name]s
In this case how can Avisynth distinguish between clip and string if one does not use the name?
In case cc+i+ does it distinguish and arrive at correct formulation or will it report an error if I specify clip1, clip2, clip3,4,5,6
?
can I have named argument?
c[name]c+[digit]i+
if so how to input?
clip1, name=clip2, c3,c4,c5 digit=1,2,3,4 or have one to state
c, name=c1, name=c2, name=c3 and so on?
mohan
stickboy
24th October 2004, 11:43
Originally posted by vcmohan
For some of plugins or filters some parameters have + (for instance horizontalstack has cc+.
What happens if there are more parameters
cc+[name]s
In this case how can Avisynth distinguish between clip and string if one does not use the name?Because AviSynth tries to match the types.
In case cc+i+ does it distinguish and arrive at correct formulation or will it report an error if I specify clip1, clip2, clip3,4,5,6
?It should be able to handle it. Why don't you try it and see? It's trivial to write a test plug-in that reports back the input values (e.g. via MessageClip, Subtitle, by writing to a file, etc.)
can I have named argument?
c[name]c+[digit]i+
if so how to input?
clip1, name=clip2, c3,c4,c5 digit=1,2,3,4This one I'm not sure about. Possibly it's not allowed. At any rate, it's probably a construct that you should avoid.or have one to state
c, name=c1, name=c2, name=c3 and so on?
mohanThat definitely wouldn't work.
(BTW, this probably would be more appropriate for the AviSynth development forum.)
stickboy
24th October 2004, 12:12
Originally posted by stickboy
can I have named argument?
c[name]c+[digit]i+This one I'm not sure about. Possibly it's not allowed. At any rate, it's probably a construct that you should avoid.Okay, I just tried it. I don't think named arguments are allowed to be used with + or * modifiers.
It passes AviSynth's parameter string validation routine (which directly follows this DFA (http://www.avisynth.org/stickboy/etc/avisynth_param_dfa.gif)), but I guess the script parser won't match the arguments to parameters in this case.
(If anyone cares, it's trivial to modify the validator to disallow plugins that use such parameter strings; state 3 merely needs to transition to state 0 instead of to state 1.)
Edit:
Hm, looking at the DFA again, I noticed that I didn't disallow a parameter string such as "[foo]ib" (an optional, named argument preceding a required one). I guess it needs two more states if we want it to be strict.
vcmohan
25th October 2004, 04:25
Originally posted by stickboy
Because AviSynth tries to match the types.
Clip is specified as a string within quotes. So are strings. And a string can just be a clip path. So I presume that it can not distinguish.
I also think specifying i+i+i+ or c+c+ or s+s+ may not be allowed
stickboy
25th October 2004, 06:27
Originally posted by vcmohan
Clip is specified as a string within quotes. So are strings.No. You're confusing filenames with clips. Clips are a distinct type.
AVISource("someFile.avi")returns a clip. Its argument--"someFile.avi"--is a string.
Trim("someFile.avi", 100, 200)on the other hand, is illegal.I also think specifying i+i+i+ or c+c+ or s+s+ may not be allowedPossibly... those constructs definitely should be avoided, though.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.