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

            int micid = -1;

            if (am.DialogResult == DialogResult.OK)
            {
                UnlockLayout();
                micid = am.VolumeLevel.Micobject.id = NextMicrophoneId;
                Microphones.Add(vl.Micobject);
                string path = Conf.MediaDirectory + "audio\\" + vl.Micobject.directory + "\\";
                if (!Directory.Exists(path))
                    Directory.CreateDirectory(path);
                SetNewStartPosition();
                NeedsSync = true;
            }
            else
            {
                vl.Disable();
                _pnlCameras.Controls.Remove(vl);
                vl.Dispose();
            }
            am.Dispose();
            TopMost = Conf.AlwaysOnTop;
            return micid;
        }
Example #2
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 AddMicrophoneForm { VolumeLevel = vlf };
                am.ShowDialog(this);
                am.Dispose();
                TopMost = Conf.AlwaysOnTop;
            }
        }