Example #1
0
        void sb_OnSoundFileChanged(object sender, EventArgs e)
        {
            SoundBite sb = sender as SoundBite;

            Properties.Settings.Default["sb" + sb.id] = sb.fileName;
            Properties.Settings.Default.Save();
        }
Example #2
0
 void sb_OnHotkeySetStart(object sender, EventArgs e)
 {
     this.KeyPreview = true;
     this.sbSetKey   = sender as SoundBite;
     this.KeyDown   += SoundBoard_KeyDown;
     gkh.unhook();
 }
Example #3
0
        void sb_PlayPressed(object sender, EventArgs e)
        {
            SoundBite sb         = (SoundBite)sender;
            Thread    playThread = new Thread(new ParameterizedThreadStart(PlaySoundFile));

            SoundBitePlaying.Add(sb);
            playThread.Start(sb.fileName);
        }
Example #4
0
        private void addSoundBite(int id)
        {
            SoundBite sb = new SoundBite();

            sb.PlayPressed        += sb_PlayPressed;
            sb.OnSoundFileChanged += sb_OnSoundFileChanged;
            sb.id = id;
            if (Properties.Settings.Default["sb" + sb.id] != null)
            {
                string file = Properties.Settings.Default["sb" + sb.id].ToString();
                if (System.IO.File.Exists(file))
                {
                    sb.fileName = file;
                }
            }

            // Hotkeys
            sb.OnHotkeySetStart += sb_OnHotkeySetStart;
            string        hkstring      = Settings.Default["sbkey" + id] as string;
            KeysConverter keysConverter = new KeysConverter();

            if (hkstring != "")
            {
                Keys hk = (Keys)keysConverter.ConvertFromString(hkstring);
                if (hk != Keys.None)
                {
                    sb.hotkey = hk;
                    gkh.HookedKeys.Add(hk);
                }

                string hkmodstring = Settings.Default["sbkeymod" + id] as string;
                keysConverter = new KeysConverter();
                if (hkmodstring != "")
                {
                    Keys hkmod = (Keys)keysConverter.ConvertFromString(hkmodstring);
                    if (hkmod != Keys.None)
                    {
                        sb.hotkeymod = hkmod;
                    }
                }
            }


            sb.OnPlayStop += sb_OnPlayStop;
            soundBites.Add(sb);
            sb.Parent = flowLayoutPanel1;
        }
Example #5
0
        private void addSoundBite(int id)
        {
            SoundBite sb = new SoundBite();
            sb.PlayPressed += sb_PlayPressed;
            sb.OnSoundFileChanged += sb_OnSoundFileChanged;
            sb.id = id;
            if (Properties.Settings.Default["sb" + sb.id] != null)
            {
                string file = Properties.Settings.Default["sb" + sb.id].ToString();
                if (System.IO.File.Exists(file))
                    sb.fileName = file;
            }

            // Hotkeys
            sb.OnHotkeySetStart += sb_OnHotkeySetStart;
            string hkstring = Settings.Default["sbkey" + id] as string;
            KeysConverter keysConverter = new KeysConverter();
            if (hkstring != "")
            {
                Keys hk = (Keys)keysConverter.ConvertFromString(hkstring);
                if (hk != Keys.None)
                {
                    sb.hotkey = hk;
                    gkh.HookedKeys.Add(hk);
                }

                string hkmodstring = Settings.Default["sbkeymod" + id] as string;
                keysConverter = new KeysConverter();
                if (hkmodstring != "")
                {
                    Keys hkmod = (Keys)keysConverter.ConvertFromString(hkmodstring);
                    if (hkmod != Keys.None)
                    {
                        sb.hotkeymod = hkmod;
                    }
                }
            }

            sb.OnPlayStop += sb_OnPlayStop;
            soundBites.Add(sb);
            sb.Parent = flowLayoutPanel1;
        }
Example #6
0
 void sb_OnHotkeySetStart(object sender, EventArgs e)
 {
     this.KeyPreview = true;
     this.sbSetKey = sender as SoundBite;
     this.KeyDown += SoundBoard_KeyDown;
     gkh.unhook();
 }