duckie
04-02-2002, 04:55 PM
Hey all,
Just a lil question - it's nothing too major if it can't be solved.
I'm creating a frontend script with Gtk-Perl for a home theater PC-kinda thing. I've got a good deal of it written and working fine, and today I'm looking at the mp3 part of it.
When it's all done (this is what it looks like in my head right now anyways), there will be a screen showing a track listing of the mp3s that are up in the playlist. As you're on the screen, I'll have keys mapped (1 = Rewind, 2 = Play, 3 = Pause, 4 = Stop, 5 = Fast Forward, ala Winamp/xmms), and through a Gtk key_press_event, see if a key has been hit, and then call whichever sub it's supposed to.
Today though, I found a new module (Audio::Play::MPG123) that'll make my life a LOT easier. I'd like to test it in the console before going through all the Gtk code and rewriting, so I'm writing a test script.
Long question short, is there anyway I can set up some way to check for a keypress in a while loop? I'm not too sure if starting up the mp3 and then running through a bunch of "if / elsif" statements while it's playing will work (then again I still don't know if it'll actually work in Gtk-Perl either - I haven't tested it yet). And I'm stuck at work so I can't test any of it yet.
If anyone can help, I'd appreciate it. Thanks!
Just a lil question - it's nothing too major if it can't be solved.
I'm creating a frontend script with Gtk-Perl for a home theater PC-kinda thing. I've got a good deal of it written and working fine, and today I'm looking at the mp3 part of it.
When it's all done (this is what it looks like in my head right now anyways), there will be a screen showing a track listing of the mp3s that are up in the playlist. As you're on the screen, I'll have keys mapped (1 = Rewind, 2 = Play, 3 = Pause, 4 = Stop, 5 = Fast Forward, ala Winamp/xmms), and through a Gtk key_press_event, see if a key has been hit, and then call whichever sub it's supposed to.
Today though, I found a new module (Audio::Play::MPG123) that'll make my life a LOT easier. I'd like to test it in the console before going through all the Gtk code and rewriting, so I'm writing a test script.
Long question short, is there anyway I can set up some way to check for a keypress in a while loop? I'm not too sure if starting up the mp3 and then running through a bunch of "if / elsif" statements while it's playing will work (then again I still don't know if it'll actually work in Gtk-Perl either - I haven't tested it yet). And I'm stuck at work so I can't test any of it yet.
If anyone can help, I'd appreciate it. Thanks!