BASS.NET API for the Un4seen BASS Audio LibraryTAG_INFOUpdateFromMIDILyric Method BASS.NET API for the Un4seen BASS Audio Library
Update the tags from a meta data pointer, when using in a SYNCPROC using BASS_SYNC_MIDI_LYRIC or BASS_MIDI_MARK_TEXT.

Namespace: Un4seen.Bass.AddOn.Tags
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.12.0
Syntax

public bool UpdateFromMIDILyric(
	BASS_MIDI_MARK midiMark
)

Parameters

midiMark
Type: Un4seen.Bass.AddOn.MidiBASS_MIDI_MARK
The instance of the BASS_MIDI_MARK structure from which to update the lyric text, as retrieved form BASS_MIDI_StreamGetMark(Int32, BASSMIDIMarker, Int32, BASS_MIDI_MARK).

Return Value

Type: Boolean
If any tag was updated is returned. If nothing was changed will be returned.
Remarks

The following members will be updated:
commentWith the detected new lyric text, if found.

If the lyric text begins with a '/' (slash) character, a new line ('\n')will be added to the comment. If it begins with a '\' (backslash) character, the comment will be cleared first - in all other cases the lyric text will be appended to the existing comment.

trackWith the midi track number, if changed.
Examples

Update MIDI lyric text in the comment member:
VB
Private _mySync As SYNCPROC
Private _tags As TAG_INFO
...
Dim midiStream As Integer =  BassMidi.BASS_MIDI_StreamCreateFile("test.mid", 0, 0, BASSFlag.BASS_STREAM_AUTOFREE, 44100) 
_tags = New TAG_INFO("test.mid")
' set a sync to get the lyric text updates out of the MIDI data...
_mySync = New SYNCPROC(AddressOf LyricSync)
Bass.BASS_ChannelSetSync(midi, BASSSync.BASS_SYNC_MIDI_LYRIC, 0, _mySync, IntPtr.Zero)
' get the initial tags...
BassTags.BASS_TAG_GetFromFile(midi, _tags)
...
Private Sub LyricSync(ByVal handle As Integer, ByVal channel As Integer, ByVal data As Integer, ByVal user As IntPtr)
  tags.UpdateFromMIDILyric(BassMidi.BASS_MIDI_StreamGetMark(channel, BASSMIDIMarker.BASS_MIDI_MARK_LYRIC, data))
  ' tags.comment now contains the updated lyric text
  Console.Write("{0}\r", _tags.comment)
End Sub
private SYNCPROC _mySync;
private TAG_INFO _tags;
...
int midi = BassMidi.BASS_MIDI_StreamCreateFile("test.mid", 0, 0, BASSFlag.BASS_STREAM_AUTOFREE, 44100);
_tags = new TAG_INFO("test.mid");
// set a sync to get the lyric text updates out of the MIDI data...
_mySync = new SYNCPROC(LyricSync);
Bass.BASS_ChannelSetSync(midi, BASSSync.BASS_SYNC_MIDI_LYRIC, 0, _mySync, IntPtr.Zero);
// get the initial tags
BassTags.BASS_TAG_GetFromFile(midi, _tags);
...
private void LyricSync(int handle, int channel, int data, IntPtr user)
{
    _tags.UpdateFromMIDILyric( BassMidi.BASS_MIDI_StreamGetMark(channel, BASSMIDIMarker.BASS_MIDI_MARK_LYRIC, data) );
    // tags.comment now contains the updated lyric text
    Console.Write("{0}\r", _tags.comment)
}
See Also

Reference