Class TimeSignature
Represents time signature which is number of beats of specified length.
Inheritance
TimeSignature
Assembly: Melanchall.DryWetMidi.dll
Syntax
public sealed class TimeSignature
Constructors
TimeSignature(int, int)
Initializes a new instance of the
TimeSignature with the specified
numerator and denominator.
Declaration
public TimeSignature(int numerator, int denominator)
Parameters
Type |
Name |
Description |
int |
numerator |
Numerator of the time signature which defines number of beats. |
int |
denominator |
Denominator of the time signature which defines beat length. |
Exceptions
Type |
Condition |
ArgumentOutOfRangeException |
One of the following errors occurred:
-
numerator is zero or negative. -
denominator is zero or negative. -
denominator is not a power of two.
|
Fields
Default
Default time signature which is 4/4.
Declaration
public static readonly TimeSignature Default
Field Value
Properties
Denominator
Gets denominator of the time signature which defines beat length.
Declaration
public int Denominator { get; }
Property Value
Numerator
Gets numerator of the time signature which defines number of beats.
Declaration
public int Numerator { get; }
Property Value
Methods
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
object |
obj |
The object to compare with the current object. |
Returns
Type |
Description |
bool |
true if the specified object is equal to the current object; otherwise, false . |
Overrides
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type |
Description |
int |
A 32-bit signed integer hash code. |
Overrides
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type |
Description |
string |
A string that represents the current object. |
Overrides
Operators
operator ==(TimeSignature, TimeSignature)
Declaration
public static bool operator ==(TimeSignature timeSignature1, TimeSignature timeSignature2)
Parameters
Returns
Type |
Description |
bool |
true if the time signatures are equal, false otherwise. |
operator >(TimeSignature, TimeSignature)
Indicates whether a specified
TimeSignature is greater than another one.
Declaration
public static bool operator >(TimeSignature timeSignature1, TimeSignature timeSignature2)
Parameters
Returns
Type |
Description |
bool |
true if the value of timeSignature1 is greater than the value of
timeSignature2 ; otherwise, false . |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
timeSignature1 is null . -
timeSignature2 is null .
|
operator >=(TimeSignature, TimeSignature)
Indicates whether a specified
TimeSignature is greater than or equal to
another one.
Declaration
public static bool operator >=(TimeSignature timeSignature1, TimeSignature timeSignature2)
Parameters
Returns
Type |
Description |
bool |
true if the value of timeSignature1 is greater than or equal to the value of
timeSignature2 ; otherwise, false . |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
timeSignature1 is null . -
timeSignature2 is null .
|
operator !=(TimeSignature, TimeSignature)
Declaration
public static bool operator !=(TimeSignature timeSignature1, TimeSignature timeSignature2)
Parameters
Returns
Type |
Description |
bool |
false if the time signatures are equal, true otherwise. |
operator <(TimeSignature, TimeSignature)
Indicates whether a specified
TimeSignature is less than another one.
Declaration
public static bool operator <(TimeSignature timeSignature1, TimeSignature timeSignature2)
Parameters
Returns
Type |
Description |
bool |
true if the value of timeSignature1 is less than the value of
timeSignature2 ; otherwise, false . |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
timeSignature1 is null . -
timeSignature2 is null .
|
operator <=(TimeSignature, TimeSignature)
Indicates whether a specified
TimeSignature is less than or equal to
another one.
Declaration
public static bool operator <=(TimeSignature timeSignature1, TimeSignature timeSignature2)
Parameters
Returns
Type |
Description |
bool |
true if the value of timeSignature1 is less than or equal to the value of
timeSignature2 ; otherwise, false . |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
timeSignature1 is null . -
timeSignature2 is null .
|
See Also