Class TempoMapManager
Provides a way to manage tempo map of a MIDI file. More info in the
Tempo map article.
Inheritance
TempoMapManager
Assembly: Melanchall.DryWetMidi.dll
Syntax
public sealed class TempoMapManager : IDisposable
Constructors
TempoMapManager()
Initializes a new instance of the
TempoMapManager that can be used
to manage new tempo map with the default time division (96 ticks per quarter note).
Declaration
TempoMapManager(TimeDivision)
Initializes a new instance of the
TempoMapManager with the
specified time division.
Declaration
public TempoMapManager(TimeDivision timeDivision)
Parameters
Type |
Name |
Description |
TimeDivision |
timeDivision |
Time division of a new tempo that will be managed by this manager. |
Exceptions
TempoMapManager(TimeDivision, IEnumerable<EventsCollection>)
Initializes a new instance of the
TempoMapManager with the specified time division
and events collections.
Declaration
public TempoMapManager(TimeDivision timeDivision, IEnumerable<EventsCollection> eventsCollections)
Parameters
Type |
Name |
Description |
TimeDivision |
timeDivision |
MIDI file time division which specifies the meaning of the time
used by events of the file. |
IEnumerable<EventsCollection> |
eventsCollections |
Collection of EventsCollection which hold events that
represent tempo map of a MIDI file. |
Exceptions
Properties
TempoMap
Declaration
public TempoMap TempoMap { get; }
Property Value
Methods
ClearTempo(ITimeSpan)
Removes all changes of tempo that occurred since the specified time.
Declaration
public void ClearTempo(ITimeSpan startTime)
Parameters
Type |
Name |
Description |
ITimeSpan |
startTime |
Time to remove changes of tempo since. |
Exceptions
ClearTempo(ITimeSpan, ITimeSpan)
Removes all changes of tempo that occurred between the specified times.
Declaration
public void ClearTempo(ITimeSpan startTime, ITimeSpan endTime)
Parameters
Type |
Name |
Description |
ITimeSpan |
startTime |
Start of time range to remove changes of tempo in. |
ITimeSpan |
endTime |
End of time range to remove changes of tempo in. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
startTime is null . -
endTime is null .
|
ClearTempo(long)
Removes all changes of tempo that occurred since the specified time.
Declaration
public void ClearTempo(long startTime)
Parameters
Type |
Name |
Description |
long |
startTime |
Time to remove changes of tempo since. |
Exceptions
ClearTempo(long, long)
Removes all changes of tempo that occurred between the specified times.
Declaration
public void ClearTempo(long startTime, long endTime)
Parameters
Type |
Name |
Description |
long |
startTime |
Start of time range to remove changes of tempo in. |
long |
endTime |
End of time range to remove changes of tempo in. |
Exceptions
ClearTempoMap()
Clears current tempo map removing all changes of tempo and time signature.
Declaration
public void ClearTempoMap()
ClearTimeSignature(ITimeSpan)
Removes all changes of time signature that occurred since the specified time.
Declaration
public void ClearTimeSignature(ITimeSpan startTime)
Parameters
Type |
Name |
Description |
ITimeSpan |
startTime |
Time to remove changes of time signature since. |
Exceptions
ClearTimeSignature(ITimeSpan, ITimeSpan)
Removes all changes of time signature that occurred between the specified times.
Declaration
public void ClearTimeSignature(ITimeSpan startTime, ITimeSpan endTime)
Parameters
Type |
Name |
Description |
ITimeSpan |
startTime |
Start of time range to remove changes of time signature in. |
ITimeSpan |
endTime |
End of time range to remove changes of time signature in. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
startTime is null . -
endTime is null .
|
ClearTimeSignature(long)
Removes all changes of time signature that occurred since the specified time.
Declaration
public void ClearTimeSignature(long startTime)
Parameters
Type |
Name |
Description |
long |
startTime |
Time to remove changes of time signature since. |
Exceptions
ClearTimeSignature(long, long)
Removes all changes of time signature that occurred between the specified times.
Declaration
public void ClearTimeSignature(long startTime, long endTime)
Parameters
Type |
Name |
Description |
long |
startTime |
Start of time range to remove changes of time signature in. |
long |
endTime |
End of time range to remove changes of time signature in. |
Exceptions
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting
unmanaged resources.
Declaration
ReplaceTempoMap(TempoMap)
Replaces current tempo map with the specified one.
Declaration
public void ReplaceTempoMap(TempoMap tempoMap)
Parameters
Type |
Name |
Description |
TempoMap |
tempoMap |
Tempo map to replace the current one. |
Exceptions
SaveChanges()
Saves tempo map changes that were made with the
TempoMapManager updating
underlying events collections.
Declaration
public void SaveChanges()
SetTempo(ITimeSpan, Tempo)
Sets new tempo that will last from the specified time until next change of tempo.
Declaration
public void SetTempo(ITimeSpan time, Tempo tempo)
Parameters
Type |
Name |
Description |
ITimeSpan |
time |
Time to set the new tempo at. |
Tempo |
tempo |
New tempo that will last from the specified time until next change
of tempo. |
Exceptions
SetTempo(long, Tempo)
Sets new tempo that will last from the specified time until next change of tempo.
Declaration
public void SetTempo(long time, Tempo tempo)
Parameters
Type |
Name |
Description |
long |
time |
Time to set the new tempo at. |
Tempo |
tempo |
New tempo that will last from the specified time until next change
of tempo. |
Exceptions
SetTimeSignature(ITimeSpan, TimeSignature)
Sets new time signature that will last from the specified time until next change of
time signature.
Declaration
public void SetTimeSignature(ITimeSpan time, TimeSignature timeSignature)
Parameters
Type |
Name |
Description |
ITimeSpan |
time |
Time to set the new time signature at. |
TimeSignature |
timeSignature |
New time signature that will last from the specified
time until next change of time signature. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
time is null . -
timeSignature is null .
|
SetTimeSignature(long, TimeSignature)
Sets new time signature that will last from the specified time until next change of
time signature.
Declaration
public void SetTimeSignature(long time, TimeSignature timeSignature)
Parameters
Type |
Name |
Description |
long |
time |
Time to set the new time signature at. |
TimeSignature |
timeSignature |
New time signature that will last from the specified
time until next change of time signature. |
Exceptions
Implements
See Also