Giter Club home page Giter Club logo

Comments (14)

kailan avatar kailan commented on August 17, 2024

@dlrudie Is there a way to force load the COM library on start of Snip? The only problem I could see with this is another application using the library while it gets reloaded.

from snip.

dlrudie avatar dlrudie commented on August 17, 2024

That's possible but as soon as you load the COM library it will automatically start iTunes. I'm not sure people would like that; I know I wouldn't.

from snip.

kailan avatar kailan commented on August 17, 2024

Could it force load it when they select iTunes in the list like it did before?

from snip.

dlrudie avatar dlrudie commented on August 17, 2024

I've only seen this issue once or twice in all of my tests and I've seen nothing specific that triggers it. Users have reported it occasionally too but it always seems random. I'm not quite sure how to track down the issue.

from snip.

DougBarry avatar DougBarry commented on August 17, 2024

I too have had this issue, but every single time that iTunes is open at all.

Have a look at: http://support.microsoft.com/kb/198996

In summary(ish), problems with systray message pump activity while COM operations occur. Have forked and will hopefully get time to write something to test that idea out.

EDIT: Further reading indicates this is for an old version of windows. Presents almost the same though, always crashes for me when selecting iTunes from the systray menu.

In the mean time, some exception handling would be lovely :)

from snip.

DougBarry avatar DougBarry commented on August 17, 2024

Similar thing reported other places: https://obsproject.com/forum/threads/now-playing-music-for-spotify-itunes-winamp-on-stream.925/page-8

I have had a quick go at looking into the threading issue. No matter which thread attempts to load the COM object, if iTunes is already running, the COM object will throw an error and not instantiate.

Looks like the iTunes SDK is just a steaming pile...

from snip.

dlrudie avatar dlrudie commented on August 17, 2024

Added a COMException catch in commit 9facf7d that will just spit the message out, hopefully providing a more detailed reason as to why it's failing.

from snip.

dlrudie avatar dlrudie commented on August 17, 2024

I can typically replicate this error if Snip loaded the COM library, I exit Snip, compile a new version, and then run the newly compiled version.

It seems like the only thing I can really do is pop up a message saying that the user will need to exit iTunes and let Snip launch it instead.

from snip.

DougBarry avatar DougBarry commented on August 17, 2024

Thats exactly what I was thinking. Could have a button that says "Click
here to close iTunes and relaunch with Snip support", send iTunes a close
to the win handle, wait for the process to disappear and then instantiate
the COM object. That's going to need a disclaimer!

I have had a look around for alternative methods of pulling information
from iTunes, to no avail. I did wonder if the iTunes remote protocol had
been reverse engineered, as that would give you all the access you needed,
over a socket.

from snip.

dlrudie avatar dlrudie commented on August 17, 2024

I don't really want Snip to have the ability to exit applications. I think a message will suffice. If iTunes is running and this message appears, you can just exit iTunes and reselect it from within Snip and it will start iTunes for you. I find that convenient enough.

from snip.

dlrudie avatar dlrudie commented on August 17, 2024

Changes made in ae68641. Unfortunately it takes 120 seconds for it to timeout and there is no way to adjust that timeout. So after 2 minutes of unresponsiveness the MessageBox will appear.

from snip.

DougBarry avatar DougBarry commented on August 17, 2024

Think I've found the true cause of this. I notice that Snip requires execution as an elevated process. If i have iTunes running as an elevated process also, I never have the COM problem if iTunes is already running when Snip starts.

I'm assuming it has to run as an elevated process to call the Unsafe methods used to get information from winamp/foobar/spotify?

If i modify the Snip manifest to not require elevated access, it works first time every time. I wonder if there is an elegant way around that.

I've just tried winamp with both processes running as normal non-elevated, and the unsafe methods used to retrieve the window text from winamp work fine. If the same is true of spotify and foobar, perhaps this could be a considered change?

from snip.

dlrudie avatar dlrudie commented on August 17, 2024

I believe I had it require elevated privileges before because I was actually hooking the Spotify process and reading its memory. Since I've went away from that I actually can probably drop it back down.

from snip.

dlrudie avatar dlrudie commented on August 17, 2024

I went ahead and made a commit 9002793 for this and I'll see how this release goes with everyone testing it later.

from snip.

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.