public AudioLogic(IServiceProvider serviceProvider, LaserAnimationStatus laserAnimationStatus, AudioSettings settings) { _serviceProvider = serviceProvider; _laserAnimationStatus = laserAnimationStatus; AudioCalibrationValue = settings.AudioCalibrationValue; SetTimer(); sampleAggregator.FftCalculated += FftCalculated; sampleAggregator.PerformFFT = true; waveIn = new WasapiLoopbackCapture(); waveIn.DataAvailable += OnDataAvailable; try { var patterns = AppDomain.CurrentDomain.GetAssemblies().SelectMany(e => e.GetTypes()) .Where(x => typeof(ILaserPattern).IsAssignableFrom(x) && !x.IsInterface); foreach (var pattern in patterns) { _patterns.Add((ILaserPattern)ActivatorUtilities.CreateInstance(_serviceProvider, pattern)); } } catch (Exception) { /* catch windows forms not found exception */ } }
public RandomDrawing(Laser laser, LaserPatternHelper laserPatternHelper, LaserSettings settings, LaserAnimationStatus laserAnimationStatus) { _laser = laser; _laserPatternHelper = laserPatternHelper; _settings = settings; _laserAnimationStatus = laserAnimationStatus; }
public LiquidSkyTilting(Laser laser, LaserPatternHelper laserPatternHelper, LaserSettings settings, LaserAnimationStatus laserAnimationStatus) { _laser = laser; _laserPatternHelper = laserPatternHelper; _settings = settings; _laserAnimationStatus = laserAnimationStatus; }
public MovingDotsUpDown(Laser laser, LaserPatternHelper laserPatternHelper, LaserSettings settings, LaserAnimationStatus laserAnimationStatus) { _laser = laser; _laserPatternHelper = laserPatternHelper; _settings = settings; _laserAnimationStatus = laserAnimationStatus; }
public MovingDots(Laser laser, LaserPatternHelper laserPatternHelper, LaserSettings settings, LaserAnimationStatus laserAnimationStatus) { Process myProcess = Process.GetCurrentProcess(); myProcess.PriorityClass = ProcessPriorityClass.High; _laser = laser; _laserPatternHelper = laserPatternHelper; _settings = settings; _laserAnimationStatus = laserAnimationStatus; }