private static float[,] CreateFiveDotZeroUpMixMatrix(ConfigProfile _profile) { float[,] mixMatrix = null; switch (_profile.FiveDotZeroUpMix) { case FiveDotZeroUpMix.None: break; case FiveDotZeroUpMix.FiveDotOne: mixMatrix = new float[6, 5]; mixMatrix[0, 0] = 1; mixMatrix[1, 1] = 1; mixMatrix[2, 2] = 1; mixMatrix[4, 3] = 1; mixMatrix[5, 4] = 1; break; case FiveDotZeroUpMix.SevenDotOne: mixMatrix = new float[8, 5]; mixMatrix[0, 0] = 1; mixMatrix[1, 1] = 1; mixMatrix[2, 2] = 1; mixMatrix[4, 3] = 1; mixMatrix[5, 4] = 1; mixMatrix[6, 3] = 1; mixMatrix[7, 4] = 1; break; } return mixMatrix; }
public async Task <IActionResult> PostProfile([FromBody] ProfileRequest request) { var configProfile = new ConfigProfile(); configProfile.Name = request.Name; _context.Profiles.Add(configProfile); await _context.SaveChangesAsync(); return(new ObjectResult(configProfile) { StatusCode = 201 }); }
internal ConfigProfileWindow(DiscordPlugin plugin, ConfigProfile profile) { this.Plugin = plugin ?? new DiscordPlugin(); this.OriginalProfile = profile; this.Profile = profile.Clone(); this.Profile.CommitChanges(); InitializeComponent(); if (plugin.BetaEnabled) { Title = $"{Title} {ResourceUtils.GetResourceString(this.Resources, "Global_BetaModeLabel")}"; } this.DataContext = this; }
private void Move(ConfigProfile draggedItem, int newIndex) { if (draggedItem == null) { return; } var index = PluginConfig.ConfigProfiles.IndexOf(draggedItem); if (index < 0) { return; } PluginConfig.ConfigProfiles.Move(index, newIndex); }
private void AddConfigProfile_Click(object sender, RoutedEventArgs e) { try { var profile = new ConfigProfile(); if (EditProfile(profile)) { PluginConfig.ConfigProfiles.Add(profile); } } catch (Exception ex) { Debug.WriteLine($"ERROR: {nameof(AddConfigProfile_Click)}\r\n{ex.Message}"); MessageBox.Show(ResourceUtils.GetResourceString(this.Resources, "ConfigWindow_AddErrorLabel"), ResourceUtils.GetResourceString(this.Resources, "ConfigWindow_AddErrorTitle"), MessageBoxButton.OK, MessageBoxImage.Error); } }
private bool EditProfile(ConfigProfile profile) { if (profile == null) { return(false); } var window = new ConfigProfileWindow(Plugin, profile); window.Owner = this; var dialogResult = window.ShowDialog(); this.BringIntoView(); return(dialogResult.HasValue && dialogResult.Value); }
public static float[,] CreateMixingMatrix(int inputChannels, ConfigProfile _profile) { Log.Debug("Creating mixing matrix..."); switch (inputChannels) { case 1: return CreateMonoUpMixMatrix(_profile); case 2: return CreateStereoUpMixMatrix(_profile); case 4: return CreateQuadraphonicUpMixMatrix(_profile); case 5: return CreateFiveDotZeroUpMixMatrix(_profile); case 6: return CreateFiveDotOneUpMixMatrix(_profile); default: return null; } }
public WMPVisualizationWindow(ConfigProfile configProfile) { this._ConfigProfile = configProfile; _RenderDelegate = new RenderDelegate(Render); _WMPEffect = WMPEffect.SelectEffect(_ConfigProfile.WMPVizClsId, Handle); if (_WMPEffect != null && _ConfigProfile.WMPVizPreset < _WMPEffect.Presets.Length) _WMPEffect.SetCurrentPreset(_WMPEffect.Presets[0]); _WakeupRenderThread = new AutoResetEvent(false); _RenderThread = new Thread(new ThreadStart(RenderThread)); _RenderThread.IsBackground = true; _RenderThread.Start(); _Timer = new System.Timers.Timer(1000 / _ConfigProfile.WMPVizFps); _Timer.Elapsed += new ElapsedEventHandler(_Timer_Elapsed); _Timer.Start(); }
private void CreateSampleTask(ConfigContext dbContext) { var profile = new ConfigProfile() { Name = "Shared" }; dbContext.Add(profile); dbContext.SaveChanges(); var config1 = new Config() { Key = "Database", Value = "mssqldb", ProfileId = 1 }; var config2 = new Config() { Key = "Service", Value = "http://localhost", ProfileId = 1 }; dbContext.Add(config1); dbContext.Add(config2); dbContext.SaveChanges(); }
private static float[,] CreateMonoUpMixMatrix(ConfigProfile _profile) { float[,] mixMatrix = null; switch (_profile.MonoUpMix) { case MonoUpMix.None: break; case MonoUpMix.Stereo: // Channel 1: left front out = in // Channel 2: right front out = in mixMatrix = new float[2, 1]; mixMatrix[0, 0] = 1; mixMatrix[1, 0] = 1; break; case MonoUpMix.QuadraphonicPhonic: // Channel 1: left front out = in // Channel 2: right front out = in // Channel 3: left rear out = in // Channel 4: right rear out = in mixMatrix = new float[4, 1]; mixMatrix[0, 0] = 1; mixMatrix[1, 0] = 1; mixMatrix[2, 0] = 1; mixMatrix[3, 0] = 1; break; case MonoUpMix.FiveDotOne: // Channel 1: left front out = in // Channel 2: right front out = in // Channel 3: centre out = in // Channel 4: LFE out = in // Channel 5: left rear/side out = in // Channel 6: right rear/side out = in mixMatrix = new float[6, 1]; mixMatrix[0, 0] = 1; mixMatrix[1, 0] = 1; mixMatrix[2, 0] = 1; mixMatrix[3, 0] = 1; mixMatrix[4, 0] = 1; mixMatrix[5, 0] = 1; break; case MonoUpMix.SevenDotOne: // Channel 1: left front out = in // Channel 2: right front out = in // Channel 3: centre out = in // Channel 4: LFE out = in // Channel 5: left rear/side out = in // Channel 6: right rear/side out = in // Channel 7: left-rear center out = in // Channel 8: right-rear center out = in mixMatrix = new float[8, 1]; mixMatrix[0, 0] = 1; mixMatrix[1, 0] = 1; mixMatrix[2, 0] = 1; mixMatrix[3, 0] = 1; mixMatrix[4, 0] = 1; mixMatrix[5, 0] = 1; mixMatrix[6, 0] = 1; mixMatrix[7, 0] = 1; break; } return mixMatrix; }
private static float[,] CreateQuadraphonicUpMixMatrix(ConfigProfile _profile) { float[,] mixMatrix = null; switch (_profile.QuadraphonicUpMix) { case QuadraphonicUpMix.None: break; case QuadraphonicUpMix.FiveDotOne: // Channel 1: left front out = left front in // Channel 2: right front out = right front in // Channel 3: centre out = left/right front in // Channel 4: LFE out = left/right front in // Channel 5: left surround out = left surround in // Channel 6: right surround out = right surround in mixMatrix = new float[6, 4]; mixMatrix[0, 0] = 1; mixMatrix[1, 1] = 1; mixMatrix[2, 0] = 0.5f; mixMatrix[2, 1] = 0.5f; mixMatrix[3, 0] = 0.5f; mixMatrix[3, 1] = 0.5f; mixMatrix[4, 2] = 1; mixMatrix[5, 3] = 1; break; case QuadraphonicUpMix.SevenDotOne: // Channel 1: left front out = left front in // Channel 2: right front out = right front in // Channel 3: center out = left/right front in // Channel 4: LFE out = left/right front in // Channel 5: left surround out = left surround in // Channel 6: right surround out = right surround in // Channel 7: left back out = left surround in // Channel 8: right back out = right surround in mixMatrix = new float[8, 4]; mixMatrix[0, 0] = 1; mixMatrix[1, 1] = 1; mixMatrix[2, 0] = 0.5f; mixMatrix[2, 1] = 0.5f; mixMatrix[3, 0] = 0.5f; mixMatrix[3, 1] = 0.5f; mixMatrix[4, 2] = 1; mixMatrix[5, 3] = 1; mixMatrix[6, 2] = 1; mixMatrix[7, 3] = 1; break; } return mixMatrix; }
public static VisualizationFactory Create(ConfigProfile configProfile) { VisualizationFactory factory = new VisualizationFactory(configProfile); return factory; }
public VisualizationFactory(ConfigProfile configProfile) { this.configProfile = configProfile; }