package audio;

import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;

@SuppressWarnings("unused")
public interface BASSOPUS extends Library {
    BASSOPUS Instance = Native.load("bassopus", BASSOPUS.class);
    // BASS_CHANNELINFO type
    int BASS_CTYPE_STREAM_OPUS = 0x11200;

    // Additional attributes
    int BASS_ATTRIB_OPUS_ORIGFREQ = 0x13000;
    int BASS_ATTRIB_OPUS_GAIN = 0x13001;
    int BASS_STREAMPROC_OPUS_LOSS = 0x40000000;

    @Structure.FieldOrder({ "version", "channels", "preskip", "inputrate", "gain", "mapping", "streams", "coupled", "chanmap" })
    class BASS_OPUS_HEAD extends Structure{
        public byte version;
        public byte channels;
        public short  preskip;
        public int inputrate;
        public short gain;
        public byte mapping;
        public byte streams;
        public byte coupled;
        public byte[] chanmap = new byte[255];
    }

    int BASS_OPUS_StreamCreate(BASS_OPUS_HEAD head, int flags, Bass.STREAMPROC proc, Pointer user);
    int BASS_OPUS_StreamCreate(BASS_OPUS_HEAD head, int flags,Pointer proc, Pointer user);
    int BASS_OPUS_StreamCreateFile(boolean mem, String file, long offset, long length, int flags);
    int BASS_OPUS_StreamCreateURL(String url, int offset, int flags, Bass.DOWNLOADPROC proc, Pointer user);
    int BASS_OPUS_StreamCreateFileUser(int system, int flags, Bass.BASS_FILEPROCS procs, Pointer user);
    int BASS_OPUS_StreamPutData(int handle, Pointer buffer, int length);
}
