in reply to Re: Where oh where to start (looking)
in thread Where oh where to start (looking)

Thank you little (and of course jcwren).

I think I will pursue both avenues (GTK and HTML), I am well on my way with links to read about for GTK. However I know HTML is a hairy and TIMTOWDI way of programming.

Unfortunately HTML is also a place I am not well experienced (at least, on the backside of things). I understand what CGI is (as in, it's not a programming language, it's an interface), and a few other basic concepts.

However, I am very swamped at the myriad of choices on how to approach programming a HTML server. I like the idea of using Apache (because it's a good karma program and useful for many other things), but I'm not wholly against writing the UI to be completely standalone without Apache.

So, I am asking, which do I choose, what are the differences? mod_perl, etc? My UI program will be interfacing with the jukebox program to get it's information and send it's commands (most likely through UNIX domain and TCP/IP socket programming). It would need to present the current playlist with a few commands to help control what the play list looks like (I think the gtk-perl interface will have more powerful/interactive commands than the HTML one).

Thanks again guys for all your help, I really appreciate it!!! :)

Cheers,
Gryn

Replies are listed 'Best First'.
RE: HTML UI?
by swiftone (Curate) on Sep 15, 2000 at 22:51 UTC
    A lot depends on the details. Are you looking to have the program contain it's own mini-web server, allowing you to run it on any box that runs the rest of your perl code, and interact with it via a web-browser? or are you looking to have an HTML interface that will send commands to your jukebox server that runs on the same machine as the webserver, allowing you to connect to that box from any machine with a browser? (I'd really recommend the latter over the former. Less overhead, less re-inventing the wheel.)

    Assuming the latter, I'd just set up Apache with the default mod_cgi which lets you run perl scripts as CGI. (Mod_perl is wonderful, but takes a significant time investment to learn the tricks of.)

    Perl scripts via CGI work on a sort of call-response system. The webserver gets the request, runs the perl script, and returns any output.

    What you'd probably want is to have your jukebox server sitting on the box, accepting connections (on, say, port 8080). Your perl script, if called with no arguments, simply returns an HTML page of options. If a button is clicked/selected on this page, the perl script will connect to port 8080, send whatever authentication you require, and send "SET VOLUME to 80%" (or whatever). Once it gets a reply from your jukebox server, it prints the results in HTML, re-displays the original options (all in HTML), and finishes. The webserver returns this result to the browser.

    If you designed your jukebox program was built as a sort of API, your jukebox program will be a gtk-perl program (or even console) that does a loop over $jukebox->accept_commands().. Likewise, the client, be it a looping gtk-perl program, or a one-shot CGI script, will call $jukebox_client->play(), $jukebox_client->set_volume() etc.

    Of course, this is all IMHO, TIMTOWTDI, and I'm very new to socket programming myself, so I have only my recent successes to judge by.