Ionshard / pyxis

A Command Line Player for SIRIUS and XM Sattelite Radio
http://www.ionshard.com/pyxis
GNU General Public License v2.0
19 stars 13 forks source link

The 'Now Playing Loop' Issue #2

Open johnrabotnik opened 14 years ago

johnrabotnik commented 14 years ago

This may seem like a small thing but when you're playing a station and want to change to another station (or issue any pyxis command) you have to Control-C to break out of the 'now playing loop' before the console will accept any commands.

I was thinking of rewriting the 'now playing' part so we can still issue commands while playing. Perhaps adding a stop command too.

I guess we could achieve this by running the 'now playing' function as a background process using Python's multiprocessing module. Does this sound okay or does anyone have a preferred method of accepting new commands while a station is playing?

Ionshard commented 14 years ago

Actually this is already possible, mplayer is already in the background and the system just sleeps in a loop.

The only thing is how to handle output while at the prompt?

We don't want to just print output if the user is doing something.

In the spirit of not cowboying, are you working on this or shall I? I have a couple ideas that might work.

johnrabotnik commented 14 years ago

Sounds like your method is more straightforward, go for it!

Ionshard commented 14 years ago

Ok, want to do this, but I don't think it's release notable. So I may be slow on this. Feel free to work on it. I will notify everyone if I do begin work on this.

johnrabotnik commented 14 years ago

No problem, I'll have a play around with it in the meantime.

jvc commented 14 years ago

I have had some thoughts on this. It would be really nice to be able to keep the music playing while selecting another station. Making the output perfect when the user is being prompted seems like it will require more terminal control. For some cases we may be able to get away with printing a CR here, the now playing update, CR, LF, and then reprinting the current readline buffer.

Some other thoughts -

Ionshard commented 14 years ago

While I also have no intention of using or maintaining a curses interface I wouldn't be against it being there.

I think jvc's '\rNow Playing Output\nPyxis:' would work. But we would have to change the input from rawinput and I don't know how to do that.