예제 #1
0
        public ApplicationForm(IRecorderService recorderService,
                               IConverterService converterService,
                               IEncryptionService encryptionService)
        {
            if (recorderService == null)
            {
                throw new ArgumentException("recorderService");
            }
            if (converterService == null)
            {
                throw new ArgumentException("converterService");
            }
            if (encryptionService == null)
            {
                throw new ArgumentException("encryptionService");
            }

            _recorderService   = recorderService;
            _converterService  = converterService;
            _encryptionService = encryptionService;

            AppParameters = new Parameters {
                TemporaryFolder = ApplicationConfiguration.TemporaryFolder.GetProgramDataSubFolder()
            };

            InitializeComponent();

            _devices = new Dictionary <string, Device>();

            MMDeviceEnumerator enumerator = new MMDeviceEnumerator();

            foreach (MMDevice device in enumerator.EnumerateAudioEndPoints(DataFlow.Capture, DeviceState.Active))
            {
                _devices.Add(device.ID, new Device(device.ID, device.FriendlyName, false));
            }

            MMDevice loopbackDevice = WasapiLoopbackCapture.GetDefaultLoopbackCaptureDevice();

            _devices.Add(loopbackDevice.ID, new Device(loopbackDevice.ID, string.Format("Windows mixed output - {0}", loopbackDevice.FriendlyName), true));

            _devices.ForEach(device => cb_soundcard.Items.Add(new ComboboxItem {
                Text = device.Value.ProductName, Value = device.Key
            }));

            LoadConfiguration();
        }
예제 #2
0
        public ApplicationForm(IRecorderService recorderService,
                               IConverterService converterService,
                               IEncryptionService encryptionService)
        {
            if (recorderService == null)
            {
                throw new ArgumentException("recorderService");
            }
            if (converterService == null)
            {
                throw new ArgumentException("converterService");
            }
            if (encryptionService == null)
            {
                throw new ArgumentException("encryptionService");
            }

            _recorderService   = recorderService;
            _converterService  = converterService;
            _encryptionService = encryptionService;

            AppParameters = new Parameters {
                TemporaryFolder = ApplicationConfiguration.TemporaryFolder.GetProgramDataSubFolder()
            };

            InitializeComponent();

            _devices = new Dictionary <int, Device>();
            var deviceCount = WaveIn.DeviceCount;

            for (var deviceId = 0; deviceId < deviceCount; deviceId++)
            {
                _devices.Add(deviceId, new Device(WaveIn.GetCapabilities(deviceId), deviceId));
            }
            _devices.Add(deviceCount + 1, new Device {
                ProductName = "Windows mixed output", DeviceId = int.MaxValue
            });
            _devices.ForEach(device => cb_soundcard.Items.Add(new ComboboxItem {
                Text = device.Value.ProductName, Value = device.Key
            }));

            LoadConfiguration();
        }
예제 #3
0
 public RecorderController(IRecorderService service)
 {
     _service = service;
 }