Code Monkey home page Code Monkey logo

Comments (7)

alexcrichton avatar alexcrichton commented on August 19, 2024

I agree, I'm working on this. Having fun figuring out Lion APIs and such... I'll post here when I've fixed this.

from hermes.

alexcrichton avatar alexcrichton commented on August 19, 2024

Found it! Does this do what you are expecting?

from hermes.

ralebaskinson avatar ralebaskinson commented on August 19, 2024

It doesn't play on restart, but I'm not sure it does exactly what I'm expecting (yes, I have high expectations). With the new version, on restart, Hermes isn't playing any station. I would expect it to stay on the same station (and preferably even the same song) on restart, but it is in a paused state. Ideally, after a restart, you can just press the play/pause key and it'll be as if you never restarted.

I'm not sure how exactly the APIs work, but I'm not sure you would even need to refer to Lion APIs – just switch Hermes to a paused state when the computer is about to shut down, and then Lion should automatically restore this paused state when you restart.

from hermes.

alexcrichton avatar alexcrichton commented on August 19, 2024

Pandora's API gives a link to a song, and this link expires after an amount of time. This means that when you reboot, you're not guaranteed that the link will work.

I can see, however, that it might be possible to try its best at restoring the previous state. It could certainly save off where
you were in the song and the list of future songs/station/whatnot. On restart it would then read off all this information and try to restore state based off of that.

It's very likely this restore will fail, however, because all of the links will have expired. You can't ask Pandora for a link to a specific song, so you'd have to throw away the saved songs and continue playing song on the current station. Does that sound reasonable?

from hermes.

ralebaskinson avatar ralebaskinson commented on August 19, 2024

That sounds very reasonable. I'm not sure how long this link lasts, but in the current stable version of Hermes I'm fairly certain I left my computer off for around 12 hours and it resumed playing when I turned it back on. I don't know if this is because Pandora's link still hadn't expired, or the whole song was just cached and Lion restored this cache on startup.

from hermes.

alexcrichton avatar alexcrichton commented on August 19, 2024

How does this build look to you?

from hermes.

ralebaskinson avatar ralebaskinson commented on August 19, 2024

Works great!

from hermes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.