public bool Initialize() { //MediaMonkey autostarts whenever the com object is //instantized. If updates happen too frequently //it's possible a second instance of MM is created //when the com interface is queried shortly after the application was //closed, likely because the application is still technically running //while it's in the process of shutting down, but the com interface //was already disposed and therefore is re-initialized, //which results in a second instance of the application DateTime CurrentDate = DateTime.Now; if (((CurrentDate - DisposeDate).TotalMilliseconds) > DisposeTimeOut) { try { SDBApplication = new SongsDB.SDBApplication(); SDBPlayer = new SongsDB.SDBPlayer(); SDBSongData = new SongsDB.SDBSongData(); SDBApplication.ShutdownAfterDisconnect = false; Initialized = true; return(true); } catch { return(false); } } return(false); }
public MMTrack(SongsDB.SDBSongData s) { songRef = s; }