BASS.NET API for the Un4seen BASS Audio Library

BASS_ADX_TAG_LOOP Structure

BASS.NET API for the Un4seen BASS Audio Library
TAG structure of an ADX block to be used with BASS_ChannelGetTags(Int32, BASSTag).

Namespace:  Un4seen.Bass.AddOn.Adx
Assembly:  Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax

[SerializableAttribute]
public struct BASS_ADX_TAG_LOOP

The BASS_ADX_TAG_LOOP type exposes the following members.

Fields

  NameDescription
Public fieldByteEnd
The byte end position.
Public fieldByteStart
The byte start position.
Public fieldLoopEnabled
, if looping is enabled - else .
Public fieldSampleEnd
The sample end position.
Public fieldSampleStart
The sample start position.
Top
Remarks

Use 'Marshal.PtrToStructure' to convert a tag pointer to this structure.
Examples

Getting the ADX tag info structure:
IntPtr p = Bass.BASS_ChannelGetTags(stream, BASSTag.BASS_TAG_ADX_LOOP);
if (p != IntPtr.Zero)
{
  BASS_ADX_TAG_LOOP adxLoop = (BASS_ADX_TAG_LOOP)Marshal.PtrToStructure(p, typeof(BASS_ADX_TAG_LOOP));
  ...
}
Setting a loop according to the ADX tag data (as given in adxLoop):
private int _loopSync = 0;
private SYNCPROC _loopSyncCallback;
...
if (adxLoop.LoopEnabled)
{
    _loopSyncCallback = new SYNCPROC(LoopSync);
    _loopSync = Bass.BASS_ChannelSetSync(stream, BASSSync.BASS_SYNC_POS | BASSSync.BASS_SYNC_MIXTIME, 
                                         adxLoop.ByteEnd, _loopSyncCallback, new IntPtr(adxLoop.ByteStart));
}
...
// to remove the loop call this
Bass.Bass.BASS_ChannelRemoveSync(stream, _loopSync);
...
// the sync callback
private void LoopSync(int syncHandle, int channel, int data, IntPtr user) 
{
    // move the position to the start (which is given in the user data)
    Bass.BASS_ChannelSetPosition(channel, user.ToInt64());
}
See Also

Reference