I'm dying to know how I can make a GUI for ffmpeg and jhead in OSX. I've been looking for a solution for a while and thought you, stackoverflow's users, could help me. Maybe you know some document I haven't come across of or, better, a tutorial to make a GUI.
I love those two tools but I like the simplicity of drag/drop operations.
Note: I don't need a GUI for them, I want to make one.
There is a tutorial for wrapping command-line tools using NSTask, on the Cocoa Dev Central site:
It's a few years old now, but should get you started.
You are too late, there is already a GUI frontend for ffmpeg called ffmpegX, but anyway, you would create a model that either wraps or uses the library or executable.... if it uses the executable you can use popen to invoke the executable, write to its STDIN, and read from its STDOUT. The view and controller would be basically the same as you would design it for any other GUI application. Since this is a Cocoa post, you could use Objective-C and Cocoa to the make the GUI, but it really can be implemented in any language.
First create a Modal Dialog NIB with the needed GUI.
When called in C , create an NSReleasePool, and then the magic sauce.
Later after you load the NIB from the Bundle, issue
Without the TransfromProcessType(), the Terminal app will get keystrokes, not the Modal Dialog.
You can use a scripting language like Tcl, Python or Ruby with a toolkit like Tk which uses native widgets on the mac.
On your Leopard/Snow Leopard disk you can find XCode, but you can also download it from the Apple Developer Community. XCode comes with the Interface Builder, which lets you build GUI's and you can rig to your commands using the Cocoa framework.
This may not be the best answer but in the book "Xcode unleashed" is a chapter how to embed a Command Line Tool inside a Cocoa Application. Maybe you should have a look. Nice book anyway.