/// <summary> /// Removes all the configuration processors. /// </summary> /// <returns>The table builder.</returns> public ITableBuilder ClearProcessors() { CheckInitialized(); Processors.Clear(); return(this); }
private void Load(string fileName) { Processors.Clear(); Pipes.Clear(); try { //var serializer = new XmlSerializer(typeof(Pipeline)); using (var stream = new FileStream(fileName, FileMode.Open)) { Model = _serializer.ReadObject(stream) as Pipeline ?? new Pipeline(); foreach (var target in Model.Targets) { AddNode(target); } BuildPipeViewModels(Model); } } catch (Exception e) { ExceptionMessageBox.ShowException(e, String.Format("Could not load pipeline. {0}.", e.Message)); } Name = fileName; }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); // If the process has started, all three disposable objects will be valid // I would just call OnStop, but the code analysis tool doesn't look inside // it and thinks the members aren't being Disposed. if (Processors.Count > 0) { // Clean up the directory watcher and crash processor threads foreach (var Processor in Processors) { Processor.Dispose(); } Processors.Clear(); Watcher.Dispose(); Watcher = null; StatusReporter.Dispose(); StatusReporter = null; Slack.Dispose(); Slack = null; // Flush the log to disk Log.Dispose(); Log = null; } } base.Dispose(disposing); }
public void PlatformClose() { foreach (var item in Processors) { item.Trush(); } Processors.Clear(); Processors = null; PlatformInitialized = false; OptionalUseGPU = false; }
internal override void ReadData(AwesomeReader ar) { Pedals.Clear(); Processors.Clear(); AmpPath = ar.ReadUInt64(); GainLevel = ar.ReadSingle(); BassLevel = ar.ReadSingle(); MidLevel = ar.ReadSingle(); TrebleLevel = ar.ReadSingle(); ReverbLevel = ar.ReadSingle(); VolumeLevel = ar.ReadSingle(); AmpReverb = ar.ReadUInt64(); int pedalCount = ar.ReadInt32(); ar.BaseStream.Position += 4; int processorCount = ar.ReadInt32(); ar.BaseStream.Position += 4; // Reads pedals for (int i = 0; i < pedalCount; i++) { Pedal pedal = new Pedal(); pedal.ModelPath = ar.ReadUInt64(); pedal.Flag1 = ar.ReadBoolean(); pedal.Flag2 = ar.ReadBoolean(); pedal.Flag3 = ar.ReadBoolean(); pedal.Flag4 = ar.ReadBoolean(); pedal.Knob1 = ar.ReadSingle(); pedal.Knob2 = ar.ReadSingle(); pedal.Knob3 = ar.ReadSingle(); Pedals.Add(pedal); } // Reads audio processors for (int i = 0; i < processorCount; i++) { AudioProcessor processor = new AudioProcessor(); processor.ModelPath = ar.ReadUInt64(); processor.Knob1 = ar.ReadSingle(); processor.Knob2 = ar.ReadSingle(); Processors.Add(processor); } }
private void OnNew() { var defaultPipeline = MessageBox.Show("Do you want create an new pipeline?", "Default Pipeline", MessageBoxButton.YesNo, MessageBoxImage.Question); if (defaultPipeline != MessageBoxResult.Yes) { return; } foreach (var processor in Processors) { processor.Stop(); } Model.Stop(); Processors.Clear(); Pipes.Clear(); Model = new Pipeline(); }
public void RestoreFrom(CachedAppConfig src) { InputFile.FilePath = src.InputPath; OutputFile.FilePath = src.OutputPath; ProcessorType = src.ProcessorType; Processors.Clear(); foreach (var kvp in src.Processors) { var cachedPI = new ProcessorInfo { MaxDistanceMultiplier = kvp.Value.MaxDistanceMultiplier, MaxSeparation = new Distance(kvp.Value.MaxSeparation.Unit, kvp.Value.MaxSeparation.OriginalValue) }; Processors.Add(kvp.Key, cachedPI); } APIKey = src.APIKey; RouteWidth = src.RouteWidth; RouteColor = src.RouteColor; RouteHighlightColor = src.RouteHighlightColor; }