Giter VIP home page Giter VIP logo

itunes-smtc's People

Contributors

ad4mantis avatar thewizrd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

itunes-smtc's Issues

Not fully releasing iTunes COM object

I recently tried using your App and it works great so thank you. However, I noticed a bug where the
_iTunesApp object wasn’t correctly destroyed when closing iTunes. This causes iTunes to display a
Popup that an App is still using the iTunes interface and waits 20 before closing automatically.

Steps to reproduce:

  1. Start the iTunes-SMTC App
  2. Start iTunes
  3. Press Play to start a song
  4. Close iTunes
  5. The above-mentioned message appears

I had a look at the code myself and found this Code in the DisconnectiTunes() method:

if (_iTunesApp != null)
{
Debug.WriteLine("Releasing iTunes COM object...");
wasAlive = true;
RemoveEvents();
Marshal.ReleaseComObject(_iTunesApp);
}
_iTunesApp = null;
if (_currentTrack != null)
{
Marshal.ReleaseComObject(_currentTrack);
}
_currentTrack = null;

I had a similar problem with iTunes but I got it fixed by using Marshal.FinalReleaseComObject and GC.Collect();:

if (_iTunesApp != null)
{
    Debug.WriteLine("Releasing iTunes COM object...");
    wasAlive = true;
    RemoveEvents();
    Marshal.FinalReleaseComObject(_iTunesApp);
    GC.Collect();
}
_iTunesApp = null;
if (_currentTrack != null)
{
    Marshal.FinalReleaseComObject(_currentTrack);
    GC.Collect();
}
_currentTrack = null;

You can try the the Fix in my fork here: https://github.com/AD4MANTIS/iTunes-SMTC
The relevant comit is here: AD4MANTIS@a4db419

For me this fix works when I open the settings UI once before playing the first song with iTunes. The UI
doesn’t need to be open when pressing play to work. It’s the same thing when opening iTunes again
after closing it. If I don’t open the settings UI before playing the first song it gives me the message,
otherwise it closes normally.

I'm not sure what causes this, so maybe do you have an idea?

Collaboration with ModernFlyouts

Hi @thewizrd, im one of the developers of ModernFlyouts, i came across this project after one of our contributors added it to the list of extensions to get around problems with apps not supporting STMC. Nice project by the way, very useful.

I just thought I would enquire whether you would be interested in a collaboration of some sort to add this functionality to ModernFlyouts, possibly thought adapting this into an extension?

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.