示例#1
0
        /// <summary>
        /// Retrieves the markers in a MIDI file stream.
        /// </summary>
        /// <param name="Handle">The MIDI stream to retrieve the markers from.</param>
        /// <param name="Track">The track to get the markers from... 0 = 1st track, -1 = all tracks.</param>
        /// <param name="Type">The type of marker to retrieve.</param>
        /// <returns>On success, an array of <see cref="MidiMarker" /> instances is returned, else <see langword="null" /> is returned. Use <see cref="Bass.LastError" /> to get the error code.</returns>
        /// <remarks>
        /// <para>The markers are ordered chronologically, and by track number (lowest first) if multiple markers have the same position.</para>
        /// <para>SYNCs can be used to be informed of when markers are encountered during playback.</para>
        /// <para>
        /// If a lyric marker text begins with a / (slash) character, that means a new line should be started.
        /// If the text begins with a \ (backslash) character, the display should be cleared.
        /// Lyrics can sometimes be found in <see cref="MidiMarkerType.Text"/> instead of <see cref="MidiMarkerType.Lyric"/> markers.
        /// </para>
        /// </remarks>
        /// <exception cref="Errors.Handle"><paramref name="Handle" /> is not valid.</exception>
        /// <exception cref="Errors.Type"><paramref name="Type" /> is not valid.</exception>
        /// <exception cref="Errors.Parameter"><paramref name="Track" /> is not valid.</exception>
        public static MidiMarker[] StreamGetMarks(int Handle, int Track, MidiMarkerType Type)
        {
            var markCount = StreamGetMarks(Handle, Track, Type, null);

            if (markCount <= 0)
            {
                return(null);
            }

            var marks = new MidiMarker[markCount];

            StreamGetMarks(Handle, Track, Type, marks);

            return(marks);
        }
示例#2
0
 public static extern bool StreamGetMark(int Handle, MidiMarkerType Type, int Index, out MidiMarker Mark);