/// <summary> /// Converts time from the specified time type to <see cref="long"/>. /// </summary> /// <param name="time">Time to convert.</param> /// <param name="tempoMap">Tempo map used to convert <paramref name="time"/>.</param> /// <returns>Time as <see cref="long"/>.</returns> /// <exception cref="ArgumentNullException"><paramref name="time"/> is null. -or- /// <paramref name="tempoMap"/> is null.</exception> public static long ConvertFrom(ITime time, TempoMap tempoMap) { ThrowIfArgument.IsNull(nameof(time), time); ThrowIfArgument.IsNull(nameof(tempoMap), tempoMap); return(TimeConverterFactory.GetConverter(time.GetType()) .ConvertFrom(time, tempoMap)); }