Ejemplo n.º 1
0
        /// <summary>
        /// Creates an instance of the <see cref="TempoMap"/> with the specified tempo and
        /// time signature using default time division (96 ticks per quarter note).
        /// </summary>
        /// <param name="tempo">Tempo of the tempo map.</param>
        /// <param name="timeSignature">Time signature of the tempo map.</param>
        /// <returns><see cref="TempoMap"/> with the specified tempo and time signature.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="tempo"/> is null. -or-
        /// <paramref name="timeSignature"/> is null.</exception>
        public static TempoMap Create(Tempo tempo, TimeSignature timeSignature)
        {
            ThrowIfArgument.IsNull(nameof(tempo), tempo);
            ThrowIfArgument.IsNull(nameof(timeSignature), timeSignature);

            var tempoMap = Default.Clone();

            tempoMap.Tempo.SetValue(0, tempo);
            tempoMap.TimeSignature.SetValue(0, timeSignature);

            return(tempoMap);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates an instance of the <see cref="TempoMap"/> with the specified tempo and
        /// time signature using default time division (96 ticks per quarter note).
        /// </summary>
        /// <param name="tempo">Tempo of the tempo map.</param>
        /// <param name="timeSignature">Time signature of the tempo map.</param>
        /// <returns><see cref="TempoMap"/> with the specified tempo and time signature.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="tempo"/> is null. -or-
        /// <paramref name="timeSignature"/> is null.</exception>
        public static TempoMap Create(Tempo tempo, TimeSignature timeSignature)
        {
            ThrowIfArgument.IsNull(nameof(tempo), tempo);
            ThrowIfArgument.IsNull(nameof(timeSignature), timeSignature);

            var tempoMap = Default.Clone();

            SetGlobalTempo(tempoMap, tempo);
            SetGlobalTimeSignature(tempoMap, timeSignature);

            return(tempoMap);
        }