public SelectSound(CallBack cb, SoundButtonData data) { Data = data; _cb = cb; _fileDialog.Filter = "All playable files (*.wav,*.mp3)|*.wav;*.WAV;*.mp3;*.MP3"; _fileDialog.FilterIndex = 0; InitializeComponent(); LoadFromData(); //Sound = new AudioSloaound(data.FilePath, data.Slider1, data.Slider2, data.Volume); }
public SoundButtonMaker(int x, int y, int height, int width, string name) { Name = name; Data = new SoundButtonData(); SoundForm = new SelectSound(UpdateBtnText, Data); Btn = new Button(); Btn.Click += Btn_Click; Btn.Size = new Size(width * Scale, height * Scale); Btn.Location = new Point(Origin.X + x * Scale, Origin.Y + y * Scale); Btn.Text = name; Btn.TextAlign = ContentAlignment.TopCenter; Parent.Controls.Add(Btn); Parent.KeyPress += Form_KeyPress; }