Class PlaybackCurrentTimeWatcher
Provides notifications about playback's current time changed.
Inheritance
PlaybackCurrentTimeWatcher
Assembly: Melanchall.DryWetMidi.dll
public sealed class PlaybackCurrentTimeWatcher : IDisposable, IClockDrivenObject
Constructors
Declaration
public PlaybackCurrentTimeWatcher(PlaybackCurrentTimeWatcherSettings settings = null)
Parameters
Properties
Declaration
public static PlaybackCurrentTimeWatcher Instance { get; }
Property Value
Gets a value indicating whether the watcher polls playbacks current times or not.
Declaration
public bool IsWatching { get; }
Property Value
Gets playbacks the watcher polls current time of.
Declaration
public IEnumerable<Playback> Playbacks { get; }
Property Value
Gets or sets the interval of playbacks current times polling.
Declaration
public TimeSpan PollingInterval { get; set; }
Property Value
Gets or sets the type of a playback's time to convert to in case of playback
was added in the watcher via
AddPlayback(Playback) method (without
specifying desired time type). The default value is
Midi.
Declaration
public TimeSpanType TimeType { get; set; }
Property Value
Exceptions
Methods
Adds a playback to the list of ones to watch current times of. The time will be reported
in the type defined by
TimeType property.
Declaration
public void AddPlayback(Playback playback)
Parameters
| Type |
Name |
Description |
| Playback |
playback |
Playback to watch current time of. |
Exceptions
Adds a playback to the list of ones to watch current times of. The time will be reported
in the specified type.
Declaration
public void AddPlayback(Playback playback, TimeSpanType timeType)
Parameters
| Type |
Name |
Description |
| Playback |
playback |
Playback to watch current time of. |
| TimeSpanType |
timeType |
Type of current time to convert to. |
Exceptions
Declaration
Removes all playbacks from the list of ones to watch current times of.
Declaration
public void RemoveAllPlaybacks()
Exceptions
Removes a playback from the list of ones to watch current times of.
Declaration
public void RemovePlayback(Playback playback)
Parameters
| Type |
Name |
Description |
| Playback |
playback |
Playback to exclude current time watching of. |
Exceptions
Sets the type the current time of the specified playback should be converted to.
Declaration
public void SetPlaybackTimeType(Playback playback, TimeSpanType timeType)
Parameters
| Type |
Name |
Description |
| Playback |
playback |
Playback to set time type for. |
| TimeSpanType |
timeType |
Type to convert current time of the playback to. |
Exceptions
Starts current times watching.
Declaration
Exceptions
Stops current times watching.
Declaration
Exceptions
Ticks internal clock.
Declaration
Exceptions
Events
Occurs when current times of playbacks are changed.
Declaration
public event EventHandler<PlaybackCurrentTimeChangedEventArgs> CurrentTimeChanged
Event Type
Implements