private static void solveEffectIdentification(EffectIdentificationRequest request) { EffectIdentificationWindow eiw = new EffectIdentificationWindow(request); eiw.Owner = App.Current.MainWindow; eiw.ShowDialog(); request.Handled = true; }
private void load_FX() { // Effects var effectSelectorInCommands = getCriticalEffectSelectorInCommands(); var effectSelectorOutCommands = getCriticalEffectSelectorOutCommands(); if (effectSelectorInCommands.Any() || effectSelectorOutCommands.Any()) { // need FxSettings for interpretation but not provided by file itself? if (FxSettings == null) { // call for help string rId = new FileInfo(Path).Name; var request = new EffectIdentificationRequest(rId); var handler = EffectIdentificationRequest; if (handler != null) { handler(this, request); // wait for help while (!request.Handled) { Thread.Sleep(100); } if (request.FxSettings != null) { FxSettings = request.FxSettings; } } } // if possible, replace effect indices (position on a list) with ids (actual command) if (FxSettings != null) { restoreEffectSelectorCommands(effectSelectorInCommands, effectSelectorOutCommands); } else { _ignoreFx = true; } } }
static void onEffectIdentificationRequest(object sender, EffectIdentificationRequest e) { App.Current.Dispatcher.BeginInvoke(new Action(() => solveEffectIdentification(e))); }
public EffectIdentificationWindow(EffectIdentificationRequest request) { _request = request; InitializeComponent(); Loaded += EffectIdentificationWindow_Loaded; }
public EffectIdentificationViewModel(EffectIdentificationRequest request) { _request = request; _currentOption = Options.Option3; }
private void load(TsiXmlDocument xml) { // Traktor version, optional (only for "Traktor Settings.tsi") var browserDirRoot = xml.GetEntry <BrowserDirRoot>(); if (browserDirRoot != null) { Match m = REGEX_TRAKTOR_FOLDER.Match(browserDirRoot.Value); if (m.Success) // Overwrite version if possible { TraktorVersion = m.Groups[1].Value; } } // effects, optional (FxSettings.Load may return null) FxSettings = FxSettings.Load(xml); // devices var controllerConfig = xml.GetEntry <DeviceIoConfigController>(); if (controllerConfig != null) { byte[] decoded = Convert.FromBase64String(controllerConfig.Value); _devicesContainer = new DeviceMappingsContainer(new MemoryStream(decoded)); int id = 0; _devices = _devicesContainer.Devices.List.Select(d => new Device(id++, d)).ToList(); var effectSelectorInCommands = getCriticalEffectSelectorInCommands(); var effectSelectorOutCommands = getCriticalEffectSelectorOutCommands(); if (effectSelectorInCommands.Any() || effectSelectorOutCommands.Any()) { // need FxSettings for interpretation but not provided by file itself? if (FxSettings == null) { // call for help string rId = new FileInfo(Path).Name; var request = new EffectIdentificationRequest(rId); var handler = EffectIdentificationRequest; if (handler != null) { handler(this, request); // wait for help while (!request.Handled) { Thread.Sleep(100); } if (request.FxSettings != null) { FxSettings = request.FxSettings; } } } // if possible, replace effect indices with ids if (FxSettings != null) { restoreEffectSelectorCommands(effectSelectorInCommands, effectSelectorOutCommands); } else { _ignoreFx = true; } } } }