Example #1
0
        public void Play(Sound sound)
        {
            try
            {
                Stop();
                File.WriteAllBytes("temp\\" + sound.Name, sound.Data);
            }
            catch (IOException)
            {
                return;
            }

            PlayingIndex = Sounds.IndexOf(sound);

            player.URL = "temp\\" + sound.Name;
            player.controls.play();
        }
Example #2
0
        private void BTN_Add_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();
            dlg.Multiselect = true;

            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                WaitingForm form = new WaitingForm();
                form.Show();
                Application.DoEvents();

                for (int i = 0; i < dlg.FileNames.Count(); i++)
                {
                    byte[] data = File.ReadAllBytes(dlg.FileNames[i]);
                    Sound sound = new Sound() { Data = data, Name = dlg.SafeFileNames[i] };

                    SoundBundle.Sounds.Add(sound);
                    LIST_Sounds.Items.Add(sound);
                }
                form.Close();
            }
        }
Example #3
0
 public AnimationFrame(SerializationInfo info, StreamingContext context)
 {
     Particules = info.GetValue("Particules", typeof(AnimationParticules[])) as AnimationParticules[];
     Images = info.GetValue("Images", typeof(List<AnimationPatternFrame>)) as List<AnimationPatternFrame>;
     Pixels = info.GetValue("Pixels", typeof(AnimationPixels[])) as AnimationPixels[];
     Overlay = (Color)info.GetValue("Overlay", typeof(Color));
     Upperlay = (Color)info.GetValue("Upperlay", typeof(Color));
     BGS = info.GetValue("BGS", typeof(Sound)) as Sound;
 }