View Full Version : Request for Version()
Cyberia
20th June 2004, 06:35
Would it be possible to modify the Version() command so that if a video is loaded already, it simply prints the version string on screen?
If no video is loaded, function as it does now.
Alternatively, the version could be displayed in the Info() display.
Also, could Version() be fixed so it does not generate an error in WMP9?
stickboy
20th June 2004, 07:46
If you really want, you can use Subtitle(VersionString()).
Also, although it would be possible to modify Version to accept the following:AVISource("foo.avi")
Version(last)the following would not produce your desired result:
AVISource("foo.avi")
Version()There is no implicit last for functions whose first parameter is an optional clip. (If this weren't the case, it would be nearly impossible to opt out of feeding a clip to such functions.)
Bidoche
20th June 2004, 15:19
if Subtitle(VersionString()) works, then it should be made as such.
There is no point in modifying filters when a trivial line of code performs as well.
There is no implicit last for functions whose first parameter is an optional clip. (If this weren't the case, it would be nearly impossible to opt out of feeding a clip to such functions.)Are you sure of that ?
I doubt the parser is smart enought to make the distinction.
Cyberia
20th June 2004, 19:28
Originally posted by stickboy
If you really want, you can use Subtitle(VersionString()).
Subtitle(VersionString()) gives me this error:
Script error: Invalid arguments to function "subtitle"
stickboy
20th June 2004, 19:54
Originally posted by Bidoche
Are you sure of that ?
I doubt the parser is smart enought to make the distinction.Yes. Try it and see.function Foo(clip "c")
{
return Default(c, MessageString("bye"))
}
MessageString("hi")
Foo()The result is the "bye" clip. However, you get the "hi" clip if you explicitly call Foo(last).
You also can see this behavior with BlankClip, which I think is the only internal function that takes an optional clip as its first argument.Originally posted by Cyberia:
Script error: Invalid arguments to function "subtitle"Did you assign something to last?
Cyberia
20th June 2004, 20:19
No. How do I do that?
stickboy
20th June 2004, 20:50
Either implicitly:
AVISource("foo.avi")
# since the resulting clip was not assigned to a variable,
# AviSynth automatically assigned it to the variable <last>
Subtitle(VersionString())or explicitly:
c = AVISource("foo.avi")
# since the resulting clip *was* assigned to a variable,
# <last> is unassigned at this point
last = c
Subtitle(VersionString())In the latter case, though, you could use c directly:c = AVISource("foo.avi")
c.Subtitle(VersionString()) # alternatively: Subtitle(c, VersionString())The way that AviSynth "knows" that a clip is loaded is through this implicit last mechanism. See the "Implicit 'last'" section from BenRG's original AviSynth tutorial (http://www.neuron2.net/www.math.berkeley.edu/benrg/avisynth-tutorial.html).
Cyberia
20th June 2004, 21:23
Ok thank you, I was assigning the clip to a variable, and using the explicit method works. Thanks.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.