class Test
{
private FILEREADPROC _readProc;
private BASS_FILEPROCS fileProcs;
private int mStream;
public Test()
{
_readProc = new FILEREADPROC(fileReadProc);
fileProcs = new BASS_FILEPROCS(null, null, _readProc, null);
mStream = 0;
BassNet.Registration("email", "pass");
if (!Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero))
throw new Exception("Can't run without Init");
}
private void button1_Click(object sender, EventArgs e)
{
if (mStream == 0)
{
mStream = Bass.BASS_StreamCreateFileUser(BASSStreamSystem.STREAMFILE_BUFFERPUSH, BASSFlag.BASS_STREAM_AUTOFREE, fileProcs, IntPtr.Zero);
...
}
}
private int fileReadProc(IntPtr buffer, int length, IntPtr user)
{
...
}
}
The implementation of fileReadProc doesn't really matter since it never gets hit, it's on the CreateStreamFileUser-call where I get the NotSupportedException :s