creating graphical front ends to commandline programs
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
They probably use system calls to execute the programs, capture there output, and parse it for updating there status fields in the gui. At least that is what I would do. But perhaps that is because I don't know a better way.
I am pretty sure programs like grip actually call the cdparanioa programs, and the encoder programs, and whatnot.
What you said is quite sensible... But what if the user has a different version of the backend software and the output of this is different from other versions... Do the frontend programs have to be able to parse all different backends??
Anyway how do you read the output of another program. Can anyone point me to a HOWTO or a sample program etc... I will be glad to try some examples.
I think there are some classes in the boost (http://www.boost.org), I know that with wxWindows you can do it with a class like wxProcess. You can access an input stream and/or output stream of the process. If you don't want to use a library, I think you must use some pipe. If i'm correct, RealTimeBattle (it's a program) use it.
There really isn't a good answer for the version stuff. Well, there is and there isn't. I think a program like grip assumes you have at least a certain version of a tool (and most likely checks for it when you run ./configure before building it). People try pretty hard to make new versions of software backwards compatible with old versions. Most good developers make sure to make lots of announcements before drastically changing anything, especially one something like an audio encoder.
As far as reading a programs output, you can redirect it's output to a buffer you are reading from.
Wrapper UI's, like my own http://acidrip.sf.net work by doing what they need to do to get the results... sorry to sound dumb but there are oads of ways to access certain bits of information, generally it's though parsing the output of system calls and such....
you're asking about compatability etc... hell you're making the front end yourself, it is as compatible as you make it... there is no specification you have to conform to...
i'll tell you know though... generally C / C++ suck at text parsing, they're not desgined for it. you might want to look at a scripting language instead... perl or python for example.