using System;
using System.Runtime.InteropServices;

namespace Bass
{
    public struct BassSample
    {
        UInt16 freq;
        UInt16 volume;
        UInt16 pan;
        UInt16 flags;
        UInt16 length;
        UInt16 max;
        UInt16 mode3d;
        float mindist;
        float maxdist;
        UInt16 iangle;
        UInt16 oangle;
        UInt16 outvol;
        UInt16 vam;
        UInt16 priority;
    }

    public static class Bass
    {
        [DllImport("bass.dll", CallingConvention = CallingConvention.StdCall, EntryPoint = "BASS_Init")]
	    [PreserveSig]
        public static extern bool BASS_Init(int device, UInt16 freq, UInt16 flags, IntPtr win, IntPtr clsid);

        [DllImport("bass.dll", CallingConvention = CallingConvention.StdCall, EntryPoint = "BASS_Free")]
	    [PreserveSig]
        public static extern bool BASS_Free();

        [DllImport("bass.dll", CallingConvention = CallingConvention.StdCall, EntryPoint = "BASS_Stop")]
	    [PreserveSig]
        public static extern bool BASS_Stop();

        [DllImport("bass.dll", CallingConvention = CallingConvention.StdCall, EntryPoint = "BASS_Start")]
	    [PreserveSig]
        public static extern bool BASS_Start();

        [DllImport("bass.dll", CallingConvention = CallingConvention.StdCall, EntryPoint = "BASS_SampleLoad", CharSet = CharSet.Ansi)]
	    [PreserveSig]
	    public static extern UInt32 BASS_SampleLoad(bool mem, string f, UInt16 offset, UInt16 length, UInt16 max, UInt16 flags);
        
        [DllImport("bass.dll", CallingConvention = CallingConvention.StdCall, EntryPoint = "BASS_SamplePlay")]
        [PreserveSig]
        public static extern bool BASS_SamplePlay(UInt32 UInt32);

        [DllImport("bass.dll", CallingConvention = CallingConvention.StdCall, EntryPoint = "BASS_StreamPlay")]
	    [PreserveSig]
        public static extern bool BASS_StreamPlay(UInt32 UInt32, bool flush, UInt16 flags);

        [DllImport("bass.dll", CallingConvention = CallingConvention.StdCall, EntryPoint = "BASS_StreamCreateFile")]
	    [PreserveSig]
        public static extern UInt32 BASS_StreamCreateFile(bool mem, string f, UInt16 offset, UInt16 length, UInt16 flags);

        [DllImport("bass.dll", CallingConvention = CallingConvention.StdCall, EntryPoint = "BASS_SampleSetInfo")]
        [PreserveSig]
        public static extern bool BASS_SampleSetInfo(UInt32 UInt32, BassSample Info);

        [DllImport("bass.dll", CallingConvention = CallingConvention.StdCall, EntryPoint = "BASS_SamplePlayEx")]
        [PreserveSig]
        public static extern bool BASS_SamplePlayEx(UInt32 UInt32, UInt16 start, int freq, int volume, int pan, bool loop);
    }

}