private void BassInit()
{
string BassPath;
string BassVisPath;
BASS_DEVICEINFO info;
BassPath = Path.Combine(Application.StartupPath, "BassLib");
Win32Api.SetEnvironmentVariable("Path", BassPath);
// check the correct BASS was loaded
if (Win32Api.HiWord(Bass.BASS_GetVersion()) != Bass.BASSVERSION)
{
MessageBox.Show("BASS_Vis.DLL existiert nicht!", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
Application.Exit();
}
//Set Path to AddOns
BassVisPath = Path.Combine(Application.StartupPath, "BassADDOn");
Win32Api.SetEnvironmentVariable("Path", BassVisPath);
//Check "bass_Vis.dll" exist
string visDll = Path.Combine(Application.StartupPath, @"BassADDOn\bass_Vis.dll");
if (!File.Exists(visDll))
{
MessageBox.Show("BASS_Vis.DLL failed to load!", "BASS_Vis.DLL", MessageBoxButtons.OK, MessageBoxIcon.Error);
Application.Exit();
}
// setup recording and output devices (using default devices)
if ((Bass.BASS_RecordInit(-1) == false) || (Bass.BASS_Init(-1, 44100, 0,
Handle,
Guid.Empty) == false))
{
MessageBox.Show("Can\'t initialize device", "BASS.DLL", MessageBoxButtons.OK, MessageBoxIcon.Error);
Application.Exit();
}
else
{
input_ = 0;
info = new BASS_DEVICEINFO();
while (Bass.BASS_RecordGetDeviceInfo(input_, info))
{
Bass.BASS_RecordGetDeviceInfo(input_, info);
cmbInputs.Items.Add(info.name);
input_++;
}
cmbInputs.SelectedIndex = 0;
}
Text = "Bass_Vis Example for C# VS2012: BassVis Version: " + BassVis.BASSVIS_GetVersion();
Width = 498;
}
#endregion BassInit()