View Single Post
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#21
Originally Posted by Bratag View Post
That would be very cool.

I assume you have checked out this thread

http://www.qtforum.org/post/57848/ho...ping#post57848

Has some nice code about halfway down that deals with running a process and handling the returned text etc.
I'll have to see if I can adapt it.

In ruby I'd have it pretty functional already. I've done some I/O work in ruby and thanks to the wonder "read_nonblock" method to IO.popen makes it a breeze.

Unfortunately I'm not finding it in python. Using just popen, I can get it to output the pianobar text to the terminal screen... and I can write to it from the buttons. So it's pretty much completely functional in control... I have a Stop, Next, Love, Hate, and Play/Pause button that all work great.

Unfortunately.. I can't read any of the text out in order to display helpful things like Song Title, Artist, and whether or not you've previously marked it as Liked or not. I've messed with popen2-4 so far.. and using any of those I get nothing at all... pianobar doesn't seem to execute at all.

I think part of that problem is pianobar itself.. if you try to launch it in a terminal with "pianobar &" it will actually immediately stop. Pianobar doesn't like having a noninteractive startup it seems.

I'm debating whether I should just take the shortcut like this guy. He has a working GTK version to control pianobar, including adding/removing stations.. but selecting which station to play is annoying because he has the same problem I do - he can't pull anything back from pianobar so listing the station list is out. He just lets you put in your station number into a dialogue box and listen from there.
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!