Beispiel #1
0
 private void RenameButton_Click(object sender, EventArgs e)
 {
     if (CharListView.SelectedItems.Count > 0)
     {
         ListViewItem item = CharListView.SelectedItems[0];
         if (item.Tag != null)
         {
             AddForm add = new AddForm(item.Text, "Введите новое имя.");
             add.ShowDialog(this);
             if (Configer.Tmp != "" && Configer.Tmp != item.Text)
             {
                 if (File.Exists(Path.Combine(Path.Combine(_profile.Name, item.Tag.ToString()), Configer.Tmp) + ".wav"))
                 {
                     MessageBox.Show("Звук с таким именем уже существует.");
                     return;
                 }
                 File.Move(Path.Combine(Path.Combine(_profile.Name, item.Tag.ToString()), item.Text) + ".wav",
                           Path.Combine(Path.Combine(_profile.Name, item.Tag.ToString()), Configer.Tmp) + ".wav");
                 Configer.LoadProfile(_profile, _profile.Name);
                 item.Text        = Configer.Tmp;
                 item.ToolTipText = item.Text;
                 CharListView.Sort();
             }
         }
     }
 }
Beispiel #2
0
        private void initVisualControls()
        {
            Speaker sp = new Speaker();
            //BoomBox bb = new BoomBox();
            VinilControl vv = new VinilControl();

            _profile.AddSpecificTypes(vv.GetSpecificSoundTypes());
            Configer.LoadProfile(_profile, "Dima");
            List <VisualControl> cls = new List <VisualControl>();

            cls.Add(sp);
            //cls.Add(bb);
            cls.Add(vv);
            _visualControls = new List <VisualControlInfo>();
            for (int i = 0; i < cls.Count; i++)
            {
                VisualControlInfo vc = new VisualControlInfo();
                vc.control = cls[i];
                _effectsForm.EffectsEvent += new EffectsEventHandler(vc.control.OnEffectsEvent);
                vc.control.Init(_profile, this);
                vc.control.Enabled = false;
                vc.height          = cls[i].Height;
                vc.width           = cls[i].Width;
                _visualControls.Add(vc);
                vc.control.ProcessStopped += new Action(control_ProcessStopped);
            }
            setNewVisualControl(_visualControls[0]);
        }
Beispiel #3
0
 // new profile choosed
 private void ProfileComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (_profile.Name != ProfileComboBox.SelectedItem.ToString())
     {
         Configer.LoadProfile(_profile, ProfileComboBox.SelectedItem.ToString());
     }
     CharBox.Enabled       = true;
     CharsStatusLabel.Text = ProfileComboBox.SelectedItem.ToString() + ": " + _profile.LoadedSounds.ToString() + " загружено";
 }
Beispiel #4
0
 private bool record(string name, string path)
 {
     try
     {
         RecordForm recf = new RecordForm(_profile, "./" + path + "/" + name + ".wav");
         recf.ShowDialog(this);
         if (Configer.Tmp == "")
         {
             return(false);
         }
         //AudioModifier.RemoveSilence(Path.Combine(_profile.Name, path + "/" + name + ".wav"));
         Configer.LoadProfile(_profile, _profile.Name);
         SetCharBoxItemColor((CharListView.SelectedItems.Count > 0) ? CharListView.SelectedItems[0].Index : CharListView.Items.Count - 1, true);
         ButtonPlay.Enabled   = true;
         ButtonRemove.Enabled = true;
         return(true);
     }
     catch (Exception ee)
     {
         MessageBox.Show("Failed to record sound", ee.Message);
     }
     return(false);
 }