Example #1
0
        private void DisposeObjects()
        {
            logger.Info("");

            dataSynchronizer.Dispose();
            DisposeStreams();
            DisposeAllSubjects();

            logger.Info("Disposing clock sources");
            // data clock uses player clock. Dispose data clock first.
            _dataClock.Dispose();
            _playerClock.Dispose();

            // Shut down player
            logger.Info("Disposing ESPlayer");
            // Don't call Close. Dispose does that. Otherwise exceptions will fly
            player.Dispose();
            if (usesExternalWindow == false)
            {
                WindowUtils.DestroyElmSharpWindow(displayWindow);
            }

            logger.Info("Disposing Tokens");
            // Clean up internal object
            activeTaskCts.Dispose();

            logger.Info("End");
        }
Example #2
0
        public void Dispose()
        {
            if (isDisposed)
            {
                return;
            }

            logger.Info("");

            // disable buffering (if on)
            _suspendResumeLogic.SetBuffering(false);

            TerminateAsyncOperations();
            WaitForAsyncOperationsCompletion();

            logger.Info("Stopping playback");
            try
            {
                player.Stop();
            }
            catch (Exception e)
            {
                if (!(e is InvalidOperationException))
                {
                    logger.Error(e);
                }
                // Ignore. Will be raised if not playing :)
            }

            DisposeAllSubscriptions();
            DetachEventHandlers();
            dataSynchronizer.Dispose();
            DisposeStreams();
            DisposeAllSubjects();

            logger.Info("Disposing clock sources");
            // data clock uses player clock. Dispose data clock first.
            _dataClock.Dispose();
            _playerClock.Dispose();

            // Shut down player
            logger.Info("Disposing ESPlayer");
            // Don't call Close. Dispose does that. Otherwise exceptions will fly
            player.Dispose();
            if (usesExternalWindow == false)
            {
                WindowUtils.DestroyElmSharpWindow(displayWindow);
            }

            logger.Info("Disposing Tokens");
            // Clean up internal object
            activeTaskCts.Dispose();

            isDisposed = true;
        }
Example #3
0
        public void Dispose()
        {
            if (isDisposed)
            {
                return;
            }

            logger.Info("");

            // Stop data streams
            DisableTransfer();
            TerminateAsyncOperations();
            WaitForAsyncOperationsCompletion();

            logger.Info("Stopping playback");
            try
            {
                player.Stop();
            }
            catch (Exception e)
            {
                if (!(e is InvalidOperationException))
                {
                    logger.Error(e);
                }
                // Ignore. Will be raised if not playing :)
            }

            DetachEventHandlers();

            DisposeStreams();

            bufferController.Dispose();

            DisposeAllSubjects();

            DisposeAllSubscriptions();

            // Shut down player
            logger.Info("Disposing ESPlayer");

            // Don't call Close. Dispose does that. Otherwise exceptions will fly
            player.Dispose();
            if (usesExternalWindow == false)
            {
                WindowUtils.DestroyElmSharpWindow(displayWindow);
            }

            logger.Info("Disposing Tokens");
            // Clean up internal object
            activeTaskCts.Dispose();
            clockGeneratorCts?.Dispose();

            isDisposed = true;
        }
Example #4
0
        public void Dispose()
        {
            if (isDisposed)
            {
                return;
            }

            logger.Info("Stopping playback");
            try
            {
                player.Stop();
            }
            catch (InvalidOperationException)
            {
                // Ignore. Will be raised if not playing :)
            }

            logger.Info("Data Streams shutdown");
            // Stop data streams
            DisableTransfer();

            DetachEventHandlers();

            TerminateAsyncOperations();

            ShutdownStreams();

            DisposeAllSubjects();

            DisposeAllSubscriptions();

            // Shut down player
            logger.Info("ESPlayer shutdown");

            // Don't call Close. Dispose does that. Otherwise exceptions will fly
            player.Dispose();
            if (usesExternalWindow == false)
            {
                WindowUtils.DestroyElmSharpWindow(displayWindow);
            }

            // Clean up internal object
            activeTaskCts.Dispose();
            clockGeneratorCts?.Dispose();

            isDisposed = true;
        }