Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: EEMcGee on November 02, 2013, 07:59:09 PM

Title: Using AVIdemux GUI menu items in scripts??
Post by: EEMcGee on November 02, 2013, 07:59:09 PM
Is there a way to use/access  the Gui menu items in a custom script to be put in the custom menu?  I have been looking through source code but don't really know where if anyplace to find the function or command calls.
Title: Re: Using AVIdemux GUI menu items in scripts??
Post by: mean on November 03, 2013, 01:35:12 PM
You can do (some) GUI operations from a python script
There are some samples here :

http://svn.berlios.de/viewvc/avidemux/branches/avidemux_2.6_branch_mean/autononreg/py/?pathrev=8949

The VCD/SVCD auto ones are made that way
Title: Re: Using AVIdemux GUI menu items in scripts??
Post by: EEMcGee on November 03, 2013, 05:22:28 PM
It looks like I need to use something like getPythonScriptEngine().  But it probably isn't set up to be able to call in a script file.
I found this section of code in the source files that looks like it is for saving py scripts.

engine=getPythonScriptEngine();
                if(!engine)
                {
                    GUI_Error_HIG("No engine","tinyPy script is not enabled in this build");
                    break;
                }
                char fileName[1024];
                if(FileSel_SelectWrite("Saving tinypy project",fileName,1000, NULL))
                {
                        int l=strlen(fileName);
                        if(l>3)
                        {
                            char *tail=fileName+l-3;
                            if(tail[0]!='.'|| tail[1]!='p'|| tail[2]!='y')
                                strcat(fileName,".py");
                        }
                        A_saveScript(engine, fileName);
                }
                 break;

Title: Re: Using AVIdemux GUI menu items in scripts??
Post by: EEMcGee on November 03, 2013, 05:28:43 PM
I think Avidemux really needs quick save buttons for saving the currently open file.
One would be for saving with the currently open file name with the currently selected muxing container file extension;
the other for saving as project with the currently opened files name.

That would speed things up alot.  I assume most people want a transcoded  or project files name to be the same as the currently opened files name.