Esempio n. 1
0
        public AudioMetadataHandler(CancellationToken cancellationToken)
        {
            _updateTask = new SignalTask(Update, cancellationToken);

            _metadataSink = new ActionMetadataSink(_updateTask.Fire);

            _timer = new Timer(obj => ((AudioMetadataHandler)obj).Refresh(), this, Timeout.Infinite, Timeout.Infinite);
        }
Esempio n. 2
0
        public MetadataHandler(SystemMediaTransportControls systemMediaTransportControls, ForegroundNotifier notifier, Func<TimeSpan> getPosition, Action<TimeSpan> reportNextEvent, CancellationToken cancellationToken)
        {
            if (null == systemMediaTransportControls)
                throw new ArgumentNullException(nameof(systemMediaTransportControls));
            if (null == notifier)
                throw new ArgumentNullException(nameof(notifier));
            if (null == getPosition)
                throw new ArgumentNullException(nameof(getPosition));
            if (null == reportNextEvent)
                throw new ArgumentNullException(nameof(reportNextEvent));

            _systemMediaTransportControls = systemMediaTransportControls;
            _notifier = notifier;
            _getPosition = getPosition;
            _reportNextEvent = reportNextEvent;

            _updateTask = new SignalTask(Update, cancellationToken);

            _metadataSink = new ActionMetadataSink(_updateTask.Fire);
        }