grannyGeek
23rd July 2007, 05:24
Please, could someone provide a simple example for making a function that can use a string or integer argument to call a filter setup out of a list of different presets. For example call ColorMill, and use numbers or names to call the different settings. (I get the settings from VDub vcf files.)
I want the equivalent of an If ... Then .... ElseIf .... Then.... ElseIf....EndIf statement. ( "Choose" would be even better, I never thought I would miss Visual Basic :) )
Then when I call the function in a script, have an argument that will use the settings Dark or Lite or Brite, etc.
If I only use two choices, the simple true/false example in Avisynth "Operators" documentation works for me, but I can't seem to make multiple conditions work.
Function CMill (clip input, string "pik")
{
klip = input
Lite = klip.Colormill(2500,2501,,,,,,etc)
Brite = klip.Colormill(2500,2506,,,,etc)
Dark = klip.Colormill(2500,2502,,,,,,,etc)
HiSat = klip.Colormill(2700, 2403,,,,,etc)
## here is where I would want an If---then---else list
# if PIK = "Lite" then klip = Lite
# if PIK = "Brite" then klip = Brite
# if PIK = "Dark" then klip = Dark
# if PIK = "Hisat" then klip = HiSat
Return klip
}
Would someone please explain to this dumb old granny how to do this? Many thanks in advance for any help.
I want the equivalent of an If ... Then .... ElseIf .... Then.... ElseIf....EndIf statement. ( "Choose" would be even better, I never thought I would miss Visual Basic :) )
Then when I call the function in a script, have an argument that will use the settings Dark or Lite or Brite, etc.
If I only use two choices, the simple true/false example in Avisynth "Operators" documentation works for me, but I can't seem to make multiple conditions work.
Function CMill (clip input, string "pik")
{
klip = input
Lite = klip.Colormill(2500,2501,,,,,,etc)
Brite = klip.Colormill(2500,2506,,,,etc)
Dark = klip.Colormill(2500,2502,,,,,,,etc)
HiSat = klip.Colormill(2700, 2403,,,,,etc)
## here is where I would want an If---then---else list
# if PIK = "Lite" then klip = Lite
# if PIK = "Brite" then klip = Brite
# if PIK = "Dark" then klip = Dark
# if PIK = "Hisat" then klip = HiSat
Return klip
}
Would someone please explain to this dumb old granny how to do this? Many thanks in advance for any help.