Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the TimeSignature class with the 
        /// specified meta message.
        /// </summary>
        /// <param name="message">
        /// The meta message to use for initialization.
        /// </param>
        /// <exception cref="ArgumentException">
        /// If the specified meta message is not a time signature type.
        /// </exception>
        public TimeSignature(MetaMessage message)
        {
            // Enforce preconditions.
            if(message.Type != MetaType.TimeSignature)
                throw new ArgumentException("Wrong meta message type.",
                    "message");

            this.message = (MetaMessage)message.Clone();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the TimeSignature class with the
        /// specified meta message.
        /// </summary>
        /// <param name="message">
        /// The meta message to use for initialization.
        /// </param>
        /// <exception cref="ArgumentException">
        /// If the specified meta message is not a time signature type.
        /// </exception>
        public TimeSignature(MetaMessage message)
        {
            // Enforce preconditions.
            if (message.Type != MetaType.TimeSignature)
            {
                throw new ArgumentException("Wrong meta message type.",
                                            "message");
            }

            this.message = (MetaMessage)message.Clone();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the MetaMessageText class with the
        /// specified meta message.
        /// </summary>
        /// <param name="message">
        /// The meta message to use for initialization.
        /// </param>
        /// <exception cref="ArgumentException">
        /// If the meta message is not a text based type.
        /// </exception>
        /// <remarks>
        /// The meta message must be one of the following text based types:
        /// <list>
        /// <item>
        /// Copyright
        /// </item>
        /// <item>
        /// Cuepoint
        /// </item>
        /// <item>
        /// DeviceName
        /// </item>
        /// <item>
        /// InstrumentName
        /// </item>
        /// <item>
        /// Lyric
        /// </item>
        /// <item>
        /// Marker
        /// </item>
        /// <item>
        /// ProgramName
        /// </item>
        /// <item>
        /// Text
        /// </item>
        /// <item>
        /// TrackName
        /// </item>
        /// </list>
        /// If the meta message is not a text based type, an exception will be
        /// thrown.
        /// </remarks>
        public MetaMessageText(MetaMessage message)
        {
            // Enforce preconditions.
            if (!IsTextType(message.Type))
            {
                throw new ArgumentException("Not text based meta message.",
                                            "message");
            }

            this.message = (MetaMessage)message.Clone();
            this.type    = message.Type;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the MetaMessageText class with the
        /// specified meta message.
        /// </summary>
        /// <param name="message">
        /// The meta message to use for initialization.
        /// </param>
        /// <exception cref="ArgumentException">
        /// If the meta message is not a text based type.
        /// </exception>
        /// <remarks>
        /// The meta message must be one of the following text based types:
        /// <list>
        /// <item>
        /// Copyright
        /// </item>
        /// <item>
        /// Cuepoint
        /// </item>
        /// <item>
        /// DeviceName
        /// </item>
        /// <item>
        /// InstrumentName
        /// </item>
        /// <item>
        /// Lyric
        /// </item>
        /// <item>
        /// Marker
        /// </item>
        /// <item>
        /// ProgramName
        /// </item>
        /// <item>
        /// Text
        /// </item>
        /// <item>
        /// TrackName
        /// </item>
        /// </list>
        /// If the meta message is not a text based type, an exception will be 
        /// thrown.
        /// </remarks>
        public MetaMessageText(MetaMessage message)
        {
            // Enforce preconditions.
            if(!IsTextType(message.Type))
                throw new ArgumentException("Not text based meta message.",
                    "message");

            this.message = (MetaMessage)message.Clone();
            this.type = message.Type;
        }
Exemplo n.º 5
0
 /// <summary>
 /// Returns a clone of the adapted meta message.
 /// </summary>
 /// <returns>
 /// A clone of the adapted meta message.
 /// </returns>
 public MetaMessage ToMessage()
 {
     return((MetaMessage)message.Clone());
 }