Ejemplo n.º 1
0
        public void Dispose() {
            MainWindowProcess?.Dispose();
            _processesCache?.DisposeAll();

            AudioSession?.Dispose();

            _windowCreationEventHook?.Dispose();
            _titleChangeEventHook?.Dispose();
            _windowDestructionEventHook?.Dispose();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Clears all the state associated with a hooked spotify process.
        /// </summary>
        protected void ClearHookData() {
            MainWindowProcess?.Dispose();
            _processesCache?.DisposeAll();
            _audioSession?.Dispose();

            MainWindowProcess = null;
            _processesCache = null;
            _audioSession = null;
            WindowTitle = null;
            ActiveSong = null;
            State = SpotifyState.Unknown;

            if (_windowCreationEventHook.Hooked)
                _windowCreationEventHook.Unhook();
            if (_titleChangeEventHook.Hooked)
                _titleChangeEventHook.Unhook();
            if (_windowDestructionEventHook.Hooked)
                _windowDestructionEventHook.Unhook();
        }