private void OnLoad(object sender, EventArgs e) { _handle = 0; _SpectrumIdx = 2; // Options.MainSettings.PlayerSpectrumIndex; labelInfo.Text = "00:00:00.000 / 00:00:00.000"; _PositionTrack.Maximum = 100; _PositionTrack.Enabled = true; _CheckLoop.Checked = Loop; _VolumeTrack.Value = (int)(Volume * 100); // create a secure timer _UpdateTimer = new BASSTimer(_UpdateInterval); _UpdateTimer.Tick += new EventHandler(timerUpdate_Tick); /*if (Bass.CurrentDevice == -1) * { * // Using the play function for the first time * Console.WriteLine("Player: Bass Initialisation"); * * Bass.Free(); * * if (!Bass.Init(_defaultSoundDevice, 44100, DeviceInitFlags.Default, IntPtr.Zero)) * { * Console.WriteLine("Player: Error Init Bass: {0:G}", Bass.LastError); * return; * } * }*/ // Bass.UpdatePeriod = 230; // Bass.Start(); return false if (!Bass.Configure(Configuration.IncludeDefaultDevice, true)) { Console.WriteLine("Player: Error Configure Bass: {0:G}", Bass.LastError); return; } if (!Bass.Init()) { Console.WriteLine("Player: Error Init Bass: {0:G}", Bass.LastError); return; } }