PDA

View Full Version : Drag and Drop, perhaps?


DDogg
25th February 2003, 16:56
It would be great if we could drag and drop a file on an AVS like a batchfile. For example, the INFO parameter of avisynth is very useful. Let's say you wanted a drag and drop avs for the info command of avisynth. Would this be something the developers would consider implementing, or does the architecture of avisynth preclude this?:

#drag and drop info for avi files
#Info
set fname=%1% #(or whatever convention)(Imaginary)
avisource(fname).info

Unarmed
26th February 2003, 00:05
You could make a batch file that would create the .avs and then run it for you:

echo AVISource("%1").info > %temp%\info.avs
"C:\Program Files\Windows Media Player\mplayer2.exe" "%temp%\info.avs"

Then you could drag & drop onto the batch file.

Edit: It looks like you don't need the quotes around %1 on the first line for drag and drop; Windows inserts them for you.

DDogg
26th February 2003, 01:12
Very, very nice workaround. Thanks much. Works like a charm.

I still hope for a reply on the original topic.

sh0dan
27th February 2003, 09:06
This might be what you are looking for:

http://tangentsoft.net/video/asynther/

DDogg
28th February 2003, 01:14
Thanks for the reply but no, I was hoping a file dragged upon an avisynth script would read the filename in as a variable the same way a batch file does and run the AVS. Would this be so difficult to do? I am absolutely sure you would be using it all the time. :p

DD

vhelp
28th February 2003, 04:51
hi DDogg..

I'm curious.. do you mean, a user would proceed to click on an
* an .AVS file (ie, an icon w/ .avs extention ie, superman.avs)
* on a suposed container or .exe app that intercepts files,
* and reads their format (ie, .AVS and directs it to the VFAPI
.. plugin)
* thereby running AVIsynth, and as a result..
.. (give or take a little code) and (just for your scenario)
.. display some info about this .avs file ?? ?? ??

So..

scenario:
---------
* a user want to get some INFO on file: "superman.avs"
* he/she clicks it, and drags it to an AVS aware app
* as a result, AVIsynth is somehow loaded up and begins parsing/
..reading the file "superman.avs"
* as a result of this click and drag, a final display would be:

Superman AVS info:
--------------------------
Height & Width: 720x480
Length: 120 minutes
Media type: Film / 24fps
Source: mjpeg


If the above is what you're looking for, that's an interesting idea,
but you could get that by double-clicking or opening up in notepad.
Or, are you after something else all-to-gether ??

-vhelp

DDogg
28th February 2003, 09:14
Um, yes, Unarmed's workaround example shows exactly how to do that.

Simply save this in notepad as info.bat You can then drag any AVS, AVI onto it and see the information you gave in your question.

Like this:

Rem start of batchfile
@echo AVISource(%1).info > %temp%\info.avs
@"C:\Program Files\Windows Media Player\mplayer2.exe" "%temp%\info.avs"
rem end of batchfile

To answer you question more specifically, Windows is a drag and drop OS. Avisynth is used in Windows. The ability to be able to drop a file on a set of "toolkit" scripts would be a tremendous time saver. In a similar fashion, I don't even open a program to burn a disk. I just drag the CUE onto a small batchfile and it is done. Simple and elegant.

To get back to the topic, I had asked "Would this be something the developers would consider implementing, or does the architecture of avisynth preclude this?"

Look if it can't be done then so be it. If it can, and is reasonably simple, IMO, it ought to be done. As I can't do it, all I can do is ask and hope for a direct answer to my question.

sh0dan
28th February 2003, 11:13
Have you looked at the link I posted???

It makes it possible to use the "Send-To" menu to send files into templates, and create the AVS files you want.

trbarry
28th February 2003, 16:50
I think support for those same templates is also buit into VirtualdubMod. I use them to open .d2v files now.

But I don't know if that helps the drag-n-drop thing any. You can drop avi or avs files on Vdubmod but I don't think you can drop files on templates yet. This would be nicer.

- Tom

DDogg
28th February 2003, 19:14
@sh0dan, yes I use it a lot. Thanks.
...but I don't think you can drop files on templates yet. This would be nicer.
Yes, it would be much more elegant. Maybe some day.

Belgabor
28th February 2003, 21:09
Originally posted by trbarry
I think support for those same templates is also buit into VirtualdubMod. I use them to open .d2v files now.


Absolutely right. I used code from AviSynthesizer for the template engine.

I someone has a use for this I could add an option to vdubmod that pops up a window allowing selection of a template to open it with.

Cheers
Belgabor

trbarry
1st March 2003, 04:55
I someone has a use for this I could add an option to vdubmod that pops up a window allowing selection of a template to open it with.

I'd like that. :)

I guess it would just be a choice of whether the default dragondrop open behavior was open or the Open-with-Avisynth dialog. Right?

Or something else?

- Tom

DDogg
1st March 2003, 17:46
A general question:

1> When programming, what is required to make a application drag and drop aware, that is, for it to highlight when something is dragged on top of it and be passed the name of what was dragged on top of it?

Belgabor
1st March 2003, 20:40
Originally posted by trbarry
I'd like that. :)

I guess it would just be a choice of whether the default dragondrop open behavior was open or the Open-with-Avisynth dialog. Right?

Or something else?

- Tom

Yup, thats what I was thinking of :)

@DDogg: As I never implemented that myself I can only recommend to read the VDub Source on that.

DDogg
2nd March 2003, 22:23
@DDogg: As I never implemented that myself I can only recommend to read the VDub Source on that.

I was asking more about windows apps in general than vdub specific, but thanks for the reply.

Belgabor
3rd March 2003, 18:04
Originally posted by DDogg
I was asking more about windows apps in general than vdub specific, but thanks for the reply.

VDub is a windows app ;)

Atamido
4th March 2003, 02:13
Originally posted by DDogg
1> When programming, what is required to make a application drag and drop aware, that is, for it to highlight when something is dragged on top of it and be passed the name of what was dragged on top of it?

For basic VB controls, it is automatic within windows. For instance, in Visual Basic, if you create a text box within the interface, it will automatically accept text dragged to it. So, I would assume its just a matter of finding the correct control object, and defining a simple property for the window itself. But I have never done this, so I wouldn't know for sure.

You might glance at the sources for DivFix as I know it supports drag and drop of files.