BASS.NET API for the Un4seen BASS Audio LibraryBASS_ADX_TAG_LOOP StructureBASS.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.12.0
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:
VB
Dim p As IntPtr = Bass.BASS_ChannelGetTags(stream, BASSTag.BASS_TAG_ADX_LOOP) 
If p <> IntPtr.Zero Then 
    Dim adxLoop As BASS_ADX_TAG_LOOP = DirectCast(Marshal.PtrToStructure(p, GetType(BASS_ADX_TAG_LOOP)), BASS_ADX_TAG_LOOP) 
    ...
End If
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):
VB
Private _loopSync As Integer = 0 
Private _loopSyncCallback As SYNCPROC 
...
If adxLoop.LoopEnabled Then 
    _loopSyncCallback = New SYNCPROC(AddressOf LoopSync);
    _loopSync = Bass.BASS_ChannelSetSync(stream, BASSSync.BASS_SYNC_POS Or BASSSync.BASS_SYNC_MIXTIME, 
                                         adxLoop.ByteEnd, _loopSyncCallback, New IntPtr(adxLoop.ByteStart)) 
End If
...
' to remove the loop call this
Bass.Bass.BASS_ChannelRemoveSync(stream, _loopSync)
...
' the sync callback
Private Sub LoopSync(ByVal handle As Integer, ByVal channel As Integer, 
                     ByVal data As Integer, ByVal user As IntPtr)
    ' move the position to the start (which is given in the user data)
    Bass.BASS_ChannelSetPosition(channel, user.ToInt64())
End Sub
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