PromyLOPh / pianobar

Console-based pandora.com player
http://6xq.net/pianobar/
Other
1.74k stars 326 forks source link

Feature request: stop (or pause) after a song #302

Open ivotron opened 12 years ago

ivotron commented 12 years ago

I'd be nice to have the ability to stop (or pause) after a song finishes. Sometimes I pause and by the time I get back, pandora's timeout is reached so pianobar has to reconnect. This is fine but since I use eventcmd, which scrobbles at the end of a song, the song doesn't get scrobbled.

Also, on a more ethical/maniac front, I feel I'm being disrespectful to the gods of music by shutting a song in the middle of it.

PromyLOPh commented 12 years ago

Scrobbling does not work because no event is fired or because the song has not advanced to 1/2 (or whatever amount you use) of its lenght?

Wrt stopping at the end of a song: There’s no real “stop” command/state right now. Workaround: Bring up the station selection. The current song will continue, but the main thread won’t be able to start a new song, because it’s stuck at the song selection screen.

ivotron commented 12 years ago

Because the song hasn't advanced to 1/2 of its length. I guess this answers my question with regards to scrobbling.

The workaround seems OK, I wouldn't mine to see the list when I get back to piano-bar. Do you have a suggestion on where this change would be done in the code?

PromyLOPh commented 12 years ago

Do you have a suggestion on where this change would be done in the code? See BarUiActDeleteStation in ui_act.c. It does exactly what you want: Clear the playlist and stop the player thread.

terrin2k commented 12 years ago

With regards to pausing in the middle of a song, I was wondering if it would be possible to continue buffering until the end of the currently-playing song, but stop outputting audio. When the user resumes, play the remainder of the song, then re-authenticate with Pandora if the connection has expired.

This would eliminate the problem of a song abruptly cutting off after resuming from a lengthy pause.

What do you think?

Regards,

~ T

PS - running pianobar on a Beaglebone w/ Ubuntu 12.04 LTS. Most awesome!

PromyLOPh commented 12 years ago

I was wondering if it would be possible to continue buffering until the end of the currently-playing song, but stop outputting audio. No, right now that’s not possible. Downloading and playing the file are directly tied together (see src/player.c). Stopping the decoder will stop the download. Patches are welcome.