maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Multimedia (https://talk.maemo.org/forumdisplay.php?f=32)
-   -   Pandora/pianobar GUI (https://talk.maemo.org/showthread.php?t=39027)

bobbarker 2010-01-02 03:25

Pandora/pianobar GUI
 
http://maemo.org/community/brainstor...-pianobar_gui/

Quote:

Pandora is an online radio service similar to last.fm. They are fairly 'closed source' and don't have an API available (unliked last.fm). A program called pianobar has been written which gives a CLI interface to Pandora. It has been ported to the N900 already and works rather well (much less resource hungry than running the flash based webpage).

What is needed is a simple "finger friendly" GUI wrapper to the CLI pianobar program.

This is a fairly simple project. Someone with the proper experience could bang this out in a weekend.

fatalsaint 2010-01-18 04:35

Re: Pandora/pianobar GUI
 
I just wanna voice my support for this. I love Pandora Radio and would love to see a good widget/GUI app show up for the N900. I use pianobar and it's decent, but annoying to have a terminal open for it.. a GUI would make things simpler. It seems to me PyQT4 could handle this.. in order to make it (hopefully) support the next Maemo release as well (which will be more QT based).

bbns 2010-01-18 05:12

Re: Pandora/pianobar GUI
 
I am second to this. :-) Then I could simply ditch my iPod Touch. =P

ViciousXUSMC 2010-01-18 06:44

Re: Pandora/pianobar GUI
 
Yeah I was happy to "know" the N900 supported flash so I could just use Pandora from the browser, I had no idea how dissapointed I would be in the flash performance of the N900 though so a dedicated application is definitly needed.

I know iphone/itouch has one and heck my bosses blueray player even has one. Its a great service and a good way to find new music so I hope we get a iphone quality application for it soon.

I do not know how good pianobar is, if its already good then we just need a simple script or gui to lauch it and run it I suppose.

fatalsaint 2010-01-18 06:59

Re: Pandora/pianobar GUI
 
Pianobar is actually very impressive.. but not the most intuitive in creating/editing stations. it's possible.. but it's all done with key shortcuts.

next is easy enough "n", and thumbs up and down is +/-.. but beyond that it gets a little more indepth.

Pianobar supports a FIFO file, according to the man page, that you have to manually create with mkfifo and then you can control it with something like:
Code:

echo -n 'n' >> ~/.config/pianobar/ctl
As an example. Also, python has a popen ability to open a read/write to a binary command... so I'm thinking this can't be too difficult. I might try and code it but I don't have an N900.. just the SDK.

Also, the pianobar has not been packaged yet it doesn't look like which is extremely easy. I'm beating my head on a desk right now I don't have the money for a real device. I may just package it into a deb and send it to intervigil who started the pianobar thread to test it.

The other thing about pianobar... it allows you to give it a last.fm username/pass and it will send that song title to last.fm as a recently played if you allow it to play past a configurable percentage (default 50%). Pretty cool.

intervigil 2010-01-18 07:20

Re: Pandora/pianobar GUI
 
Packaging is on my todo list, although unfortunately not a very high priority given how busy work has made me the last few weeks. If you want to write/package pianobar-related stuff I'd love to test it out for you.

ViciousXUSMC 2010-01-18 07:28

Re: Pandora/pianobar GUI
 
I'll be more than happy to test stuff for bugs and try to help with developing from a tester standpoint but I have absolutely no coding ability.

I'll sit tight till we have something in the repo that I can download.

fatalsaint 2010-01-18 18:55

Re: Pandora/pianobar GUI
 
Quote:

Originally Posted by intervigil (Post 479312)
Packaging is on my todo list, although unfortunately not a very high priority given how busy work has made me the last few weeks. If you want to write/package pianobar-related stuff I'd love to test it out for you.

I made a package in your thread:
http://talk.maemo.org/showthread.php?t=38786

I would be careful with this as I haven't had any ability to truly test it other than my scratchbox SDK.

fatalsaint 2010-01-21 15:16

Re: Pandora/pianobar GUI
 
1 Attachment(s)
Well, it works. I am absolutely in no way a designer. I fail horribly at anything regarding buttons, layout, or pointy-clicky crap.

I am calling on UI designers here to help me out... I can redesign this to work with whatever you can get me. All I need is a graphic showing what the layout should look like, and separate graphics for the individual items (like buttons and what-not).

Obviously the intent with this UI is to have the top and bottom labels be Song Artist and Song Title.. and the big textbox in the middle will eventually (I am thinking) be replaced by an updating graphic of the album that the song comes from. But that'll take a while as I need to learn how to interface with one of the free online song-search databases like FreeDB.

I am by no means attached to this design, as you can tell it's extremely rudimentary and took me probably an hour of total time (including tweaking) in getting it situated right. The hardest part was learning QT Designers layout buttons in order to make the whole thing expandable.

Of course the buttons are intended to be little graphics like an actual square for stop, not my totally awesome [ ] :p... and a real triangle for play - I mean, I know |> is revolutionary and all.. but.... :rolleyes:

Anyway... consider this a proof of concept. It works.. I still need a whole interface for settings.. you need username and password at the least, then I also want to include the last.fm username/password scrobbling since it's a simple configuration change. I actually intend it to directly control the /home/user/.config/pianobar/config file and write it with settings from the UI. Obviously this means you can't have different configs for pianobar and the PyQT4 app (I'm currently referring to it as pyPandora - I'm so imaginative, right?! - but due to copyright issues I don't think I'll be able to release it under that) unless you manually move the configs around every time.

In any case.. here's a pretty (ugly) proof of concept for you guys to look at. And really.. I think it's pretty obvious: I need UI help!!!!!!!!!! :D.

Thorprime 2010-01-21 23:42

Re: Pandora/pianobar GUI
 
Not sure of the feasibility, but here is a pretty fast mockup of a simply (N900 centric I admit) GUI. Might require using QT5 rather than qt4 also, but at the very least, I can hand you some non-ascii icons :P

http://img94.imageshack.us/img94/1826/pyboxui.png

ViciousXUSMC 2010-01-21 23:52

Re: Pandora/pianobar GUI
 
Quote:

Originally Posted by Thorprime (Post 487829)
Not sure of the feasibility, but here is a pretty fast mockup of a simply (N900 centric I admit) GUI. Might require using QT5 rather than qt4 also, but at the very least, I can hand you some non-ascii icons :P

http://img94.imageshack.us/img94/1826/pyboxui.png

Looks nice, I suppose if you use QT5 thats only a good thing right? I mean may as well use the technology available to us. I have not updated my QT yet on my N900.

Bratag 2010-01-22 00:58

Re: Pandora/pianobar GUI
 
Quote:

Originally Posted by ViciousXUSMC (Post 487848)
Looks nice, I suppose if you use QT5 thats only a good thing right? I mean may as well use the technology available to us. I have not updated my QT yet on my N900.

I am currently writing a Qt front end for pianobar. Not because I want to steal any of fatals thunder, but because I thought it would be a nice simple project to get into Qt coding and refresh the C++ skills.

Would be happy to use any graphics you are willing to provide.

fatalsaint 2010-01-22 01:30

Re: Pandora/pianobar GUI
 
Quote:

Originally Posted by Thorprime (Post 487829)
Not sure of the feasibility, but here is a pretty fast mockup of a simply (N900 centric I admit) GUI. Might require using QT5 rather than qt4 also, but at the very least, I can hand you some non-ascii icons :P

Wow.. very impressive. I'll have to look at qt5 I guess.. I didn't see development tools for it in the SDK/Devel/Testing.. so I've just been using qt4.

Where are the Maemo packages for qt5?

And I would definitely use any help you're willing to give!

fatalsaint 2010-01-22 01:31

Re: Pandora/pianobar GUI
 
Quote:

Originally Posted by Bratag (Post 487959)
I am currently writing a Qt front end for pianobar. Not because I want to steal any of fatals thunder, but because I thought it would be a nice simple project to get into Qt coding and refresh the C++ skills.

Would be happy to use any graphics you are willing to provide.

Meh.. more applications is never a bad thing ;). I'm doing python, yours C++, so they'll be different. Arguably, yours will be a tad more efficient :), but I'm hoping I won't have to change much for Maemo 6 either.

fatalsaint 2010-01-22 07:59

Re: Pandora/pianobar GUI
 
Quote:

Originally Posted by Thorprime (Post 487829)
Not sure of the feasibility, but here is a pretty fast mockup of a simply (N900 centric I admit) GUI. Might require using QT5 rather than qt4 also, but at the very least, I can hand you some non-ascii icons :P

Ok, hopefully you don't mind ;). I've coded your interface, it worked fine in QT4 (mostly).

It actually looks fairly nice.. I still have a problem with accessing a "settings" dialogue (including what it should look like).. I'm thinking a menu-like system. Haven't tried that yet.

Currently, as far as layout goes, I'm having trouble getting the station list to look like yours :D. Using QListWidget it just wants to make a straight list of items, and doesn't let me do a gradient even though I've set it in the stylesheet. So the station listing is pretty ugly ATM. But I cut out your buttons, set the background color to black, and positioned the labels at the top like yours. I added a "liked: Yes/No" label as well to indicate whether you've set the song as liked or not previously.

Two requests from you, a "pause" graphic that shows the play button with the other one highlighted would be nice, and maybe a "highlighted" + for the "like" button, then I can remove that label for Yes/No and just highlight the Like button if it's liked already.

Currently the ZZZ button does nothing. Thanks again for the shot!

ViciousXUSMC 2010-01-22 11:19

Re: Pandora/pianobar GUI
 
Cant wait to see a release of this in the repository for testing. It sounds like it is coming along quite nicely.

Thorprime 2010-01-22 19:38

Re: Pandora/pianobar GUI
 
1 Attachment(s)
Glad to help.

I've attached the icons as png's in a zip so that they can be used a little easier.

As for the settings, Is there a way from the QT4 api to use the build in menu system? On the N900 at least this would make the dialog drop dead simple to lay out (Username/password fields and thats about it?).

I should also point out the the UI mockup I posted wasn't implemented in any code, but simply an SVG put together in inkscape. I have no idea if the gradient on the list is possible(or easy) in QT.

fatalsaint 2010-01-22 21:05

Re: Pandora/pianobar GUI
 
Thanks Thor.. I will replace my haphazard cuts from the Gimp with yours when I get home.

And don't worry at all about the Gradient.. I do this a lot with web design. I personally prefer it if people helping me with graphics do not worry about what I can and can't do or what is or is not possible... make me an image of something that looks nice... then it's up to me to make it work.

I may not get it 100%.. but I usually can get fairly close. That's actually why I think it's better if UI designers aren't programmers for the most part... if you think to much about what kind of code goes into a design it might hinder the end-product.

vietn900 2010-01-25 00:20

Re: Pandora/pianobar GUI
 
ahh i want this on n900 it's the best internet radio IMO

fatalsaint 2010-01-25 00:23

Re: Pandora/pianobar GUI
 
Quote:

Originally Posted by vietn900 (Post 492761)
ahh i want this on n900 it's the best internet radio IMO

Well you can use pianobar now. Just download the deb here and install it.

My PyQt4 app is nearly ready. The problem with this one is that it requires you to have python-qt4 packages installed which are non-optified and take up a good portion of the rootfs.

Bratag is also getting close with his C++ version that will not be hindered by that requirement. So you'll have this real soon ;).

I've applied for the ability to upload to extras-devel so I can get both these into that for people so they don't need to download deb files.

Bratag 2010-01-25 03:39

Re: Pandora/pianobar GUI
 
I have finished the C++ version. It will require the qt 4.6 libs but they are optified and only chew up about 7mb of space.

Looks wise and functionality wise its pretty much the same at the py version - though it does make the assumption you have put your login details in the config. I will package it up put out a deb probably tomorrow and try get it into the repos as well.

If I ask Fatal nicely he might even let me yoink the settings code :)

fatalsaint 2010-01-25 03:45

Re: Pandora/pianobar GUI
 
You can grab whatever is useful :). I foresee yours being used more than mine just because of the python dependencies.

Ultimately I plan to have mine use the pianobar config directly just in case they change their own options like skipping songs and such. Also to save the username/pass across restarts. Getting prompted everytime is quite annoying so I'll have it save back in proper format so pianobar reads it for me :).

Did you already add the ability to create and delete stations?

Bratag 2010-01-25 04:01

Re: Pandora/pianobar GUI
 
Quote:

Originally Posted by fatalsaint (Post 492933)
You can grab whatever is useful :). I foresee yours being used more than mine just because of the python dependencies.

Ultimately I plan to have mine use the pianobar config directly just in case they change their own options like skipping songs and such. Also to save the username/pass across restarts. Getting prompted everytime is quite annoying so I'll have it save back in proper format so pianobar reads it for me :).

Did you already add the ability to create and delete stations?

No - right now its basic play functionality, favourite and banning etc. I will add the other functionality at a later date I guess, wasn't that important to me at this stage (besides this is my first Qt project and dusting off the ole c++ hurt my brain)

Here are a couple of screenshots of the apps.

http://thecrayonbox.org/files/attachment-8TJS6U.png
http://thecrayonbox.org/files/attachment-EVMW6U.png

fatalsaint 2010-01-25 04:18

Re: Pandora/pianobar GUI
 
Wow.. you got the timer to work! Very nice. I set that aside for now.. definitely should try to figure out how to put that back though.

I'd be interested to see how you grabbed the constantly updating, single-line stream. I kept getting into block issues.

fatalsaint 2010-01-25 04:34

Re: Pandora/pianobar GUI
 
Those interested in pyPianobar: here.

I'll do yet another warning: the python qt bindings take a lot of rootfs room. Unfortunate.

If this is a problem for you, await bratag's most excellent app.

christexaport 2010-01-25 04:37

Re: Pandora/pianobar GUI
 
Whatever happened to getting Nokia to give the code for the media player so we could make a universal UI for various music streamers, like Last.fm and pandora?

Bratag 2010-01-25 04:41

Re: Pandora/pianobar GUI
 
Quote:

Originally Posted by christexaport (Post 492985)
Whatever happened to getting Nokia to give the code for the media player so we could make a universal UI for various music streamers, like Last.fm and pandora?

Don't know about that - didnt know it was an option. Who do we need to contact re that do you know?

fatalsaint 2010-01-25 04:42

Re: Pandora/pianobar GUI
 
Quote:

Originally Posted by christexaport (Post 492985)
Whatever happened to getting Nokia to give the code for the media player so we could make a universal UI for various music streamers, like Last.fm and pandora?

I'm impatient. Do I think this is an excellent idea? Sure.. do I think people should have to suffer without pandora until Nokia gives it to us??? No.

This is also why I support things such as wine, cedega, CXoffice, etc. Do I think game manufacturers should make games for Linux? Yes.. should I have to dual boot windows just to play my games? No.

*shrug*

Bratag 2010-01-25 04:45

Re: Pandora/pianobar GUI
 
Quote:

Originally Posted by fatalsaint (Post 492988)
I'm impatient. Do I think this is an excellent idea? Sure.. do I think people should have to suffer without pandora until Nokia gives it to us??? No.

This is also why I support things such as wine, cedega, CXoffice, etc. Do I think game manufacturers should make games for Linux? Yes.. should I have to dual boot windows just to play my games? No.

*shrug*

Right there with you on that. I have been a donator/supporter of Cedega since before they were Cedega :).

Also agree - while it would be nice for Nokia to give us the source. I won't be holding my breath and am happy to crank out a little gui to get us by in the meanwhile.

daperl 2010-01-25 05:20

Re: Pandora/pianobar GUI
 
If I read things correctly, aren't MAFW plugins suppose to integrate with the Media Player?

vjones777 2010-08-15 19:21

Re: Pandora/pianobar GUI
 
Whats the status on these projects? I'm looking for a way to get pandora on an N800 & foundd this thread. Is there anything close to usable?

Thanks.

fatalsaint 2010-08-16 04:43

Re: Pandora/pianobar GUI
 
http://talk.maemo.org/showthread.php?t=56036

pyRadio is in the Diablo Extras-Devel.

crasbelize 2010-10-01 15:11

Re: Pandora/pianobar GUI
 
can we have the player do some buffering......i hate it when my music stops in the middle of my favorite line because of spotie 3G.

maybe the app could load 30secs of the song before it starts playing.....i mean that would be only a few seconds on 3G right?

Vagalume(Last.fm app) works great.

and is there any update on better GUI for Pianobar?

j.s 2010-10-01 15:27

Re: Pandora/pianobar GUI
 
Quote:

Originally Posted by crasbelize (Post 831009)
can we have the player do some buffering......i hate it when my music stops in the middle of my favorite line because of spotie 3G.

maybe the app could load 30secs of the song before it starts playing.....i mean that would be only a few seconds on 3G right?

Vagalume(Last.fm app) works great.

and is there any update on better GUI for Pianobar?

The post immediately above yours has a link to the thread for PyRadio.

crasbelize 2010-10-01 15:49

Re: Pandora/pianobar GUI
 
thanks....i'll read up on that one later.


All times are GMT. The time now is 23:53.

vBulletin® Version 3.8.8