public MainWindow() { InitializeComponent(); overrideSwitch = latchSwitch; Title += $" - v{Configs.Version}"; outputDevice = new WaveOutEvent(); MiniHud = HUD; SoundsListEx = SoundsList; PlayPauseDial.PlaySymbol.Opacity = 100; PlayPauseDial.PauseFunctionality = true; PlayPauseDialx = PlayPauseDial; string[] args = Environment.GetCommandLineArgs(); if (args.Length > 1) { if (!string.IsNullOrWhiteSpace(args[1])) { LibraryFileManager.LoadLibrary(args[1]); } } outputDevice.PlaybackStopped += (x, y) => { if (StopSource_Unloaded) { MiniHud.TrackStatus.Text = "Status: Unloaded"; StopSource_Unloaded = false; } else if (currentlyPlayingAudioFile != null) { if (currentlyPlayingAudioFile.CurrentTime == currentlyPlayingAudioFile.TotalTime) { HUD.TrackStatus.Text = "Status: Stopped"; MainWindow.MiniHud.TrackProgress.BeginAnimation(ProgressBar.ValueProperty, null); IsPlaying = false; PlayPauseDial.VisualStatePause(); } } else { HUD.TrackStatus.Text = "Status: Stopped"; MainWindow.MiniHud.TrackProgress.BeginAnimation(ProgressBar.ValueProperty, null); IsPlaying = false; PlayPauseDial.VisualStatePause(); } }; timerVideoTime = new DispatcherTimer(); timerVideoTime.Interval = TimeSpan.FromMilliseconds(1000); timerVideoTime.Tick += (x, y) => { if (IsPlaying) { var ts = currentlyPlayingAudioFile.CurrentTime; //HUD.TrackCurrentPos.Text = (ty.TotalHours >= 1 ? $"{ty.Hours}:" : $"") + $"{ty.Minutes}:{ty.Seconds}"; HUD.TrackCurrentPos.Text = string.Format("{0:00}:{1:00}:{2:00}", (int)(ts.TotalHours), ts.Minutes, ts.Seconds); } }; timerVideoTime.Start(); }
private void Button_Click(object sender, RoutedEventArgs e) { // Import OpenFileDialog o = new OpenFileDialog(); o.Filter = "MicroART Reverb Engine Library (*.relib)|*.relib"; if (o.ShowDialog() == true) { foreach (var f in o.FileNames) { LibraryFileManager.LoadLibrary(f); } } }
private void Window_Drop(object sender, DragEventArgs e) { string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); foreach (var s in files) { if (System.IO.Path.GetExtension(s).ToLower() == ".relib") { LibraryFileManager.LoadLibrary(s); } else { try { AddSoundFile(s); } catch (Exception) { } } } }