Exemple #1
0
        public int AddMicrophone(int audioSourceIndex)
        {
            VolumeLevel vl = NewVolumeLevel(audioSourceIndex);
            TopMost = false;
            var am = new AddMicrophone { VolumeLevel = vl };
            am.ShowDialog(this);

            int micid = -1;

            if (am.DialogResult == DialogResult.OK)
            {
                MainForm.Conf.LockLayout = false;
                micid = am.VolumeLevel.Micobject.id = MainForm.NextMicrophoneId;
                MainForm.Microphones.Add(vl.Micobject);
                string path = MainForm.Conf.MediaDirectory + "audio\\" + vl.Micobject.directory + "\\";
                if (!Directory.Exists(path))
                    Directory.CreateDirectory(path);
                SetNewStartPosition();
                MainForm.NeedsSync = true;
            }
            else
            {
                vl.Disable();
                _pnlCameras.Controls.Remove(vl);
                vl.Dispose();
            }
            am.Dispose();
            TopMost = MainForm.Conf.AlwaysOnTop;
            return micid;
        }
        internal void EditMicrophone(objectsMicrophone om, IWin32Window owner = null)
        {
            VolumeLevel vlf = null;

            for (int index = 0; index < _pnlCameras.Controls.Count; index++)
            {
                Control c = _pnlCameras.Controls[index];
                if (c.GetType() != typeof(VolumeLevel)) continue;
                var vl = (VolumeLevel)c;
                if (vl.Micobject.id == om.id)
                {
                    vlf = vl;
                    break;
                }
            }

            if (vlf != null)
            {
                var am = new AddMicrophone { VolumeLevel = vlf, MainClass = this };
                am.ShowDialog(owner ?? this);
                am.Dispose();
            }
        }
        public int AddMicrophone(int audioSourceIndex)
        {
            VolumeLevel vl = NewVolumeLevel(audioSourceIndex);
            TopMost = false;
            var am = new AddMicrophone { VolumeLevel = vl, IsNew = true, MainClass = this };
            am.ShowDialog(this);

            int micid = -1;

            if (am.DialogResult == DialogResult.OK)
            {
                UnlockLayout();
                micid = am.VolumeLevel.Micobject.id = NextMicrophoneId;
                Microphones.Add(vl.Micobject);
                SetNewStartPosition();
                NeedsSync = true;
            }
            else
            {
                vl.Disable();
                _pnlCameras.Controls.Remove(vl);
                vl.Dispose();
            }
            am.Dispose();
            TopMost = Conf.AlwaysOnTop;
            return micid;
        }
Exemple #4
0
        internal void EditMicrophone(objectsMicrophone om)
        {
            VolumeLevel vlf = null;

            for (int index = 0; index < _pnlCameras.Controls.Count; index++)
            {
                Control c = _pnlCameras.Controls[index];
                if (c.GetType() != typeof(VolumeLevel)) continue;
                var vl = (VolumeLevel)c;
                if (vl.Micobject.id == om.id)
                {
                    vlf = vl;
                    break;
                }
            }

            if (vlf != null)
            {
                TopMost = false;
                var am = new AddMicrophone { VolumeLevel = vlf };
                am.ShowDialog(this);
                am.Dispose();
                TopMost = MainForm.Conf.AlwaysOnTop;
            }
        }