From 88d7b7d49237dab6d0a574a801116de5cf4fff69 Mon Sep 17 00:00:00 2001 From: morkt Date: Wed, 22 Apr 2015 22:35:28 +0400 Subject: [PATCH] added separate status bar text for sound file currently playing. --- MainWindow.xaml | 6 +++++- MainWindow.xaml.cs | 11 ++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/MainWindow.xaml b/MainWindow.xaml index ac7fdf82..395e9d48 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -221,9 +221,13 @@ Visibility="{Binding Source={x:Static p:Settings.Default}, Path=winStatusBarVisibility, Mode=TwoWay}"> - + + + + + { appStatusText.Text = text; }); } + public void SetResourceText (string text) + { + Dispatcher.Invoke (() => { appResourceText.Text = text; }); + } + /// /// Popup error message box. Could be called from any thread. /// @@ -822,8 +827,8 @@ namespace GARbro.GUI m_audio.PlaybackStopped += OnPlaybackStopped; m_audio.Play(); var fmt = wave_stream.WaveFormat; - SetStatusText (string.Format ("Playing {0} / {2}bps / {1}Hz", entry.Name, - fmt.SampleRate, sound.SourceBitrate / 1000)); + SetResourceText (string.Format ("Playing {0} / {2}bps / {1}Hz", entry.Name, + fmt.SampleRate, sound.SourceBitrate / 1000)); } } catch (Exception X) @@ -834,7 +839,7 @@ namespace GARbro.GUI private void OnPlaybackStopped (object sender, StoppedEventArgs e) { - SetStatusText (""); + SetResourceText (""); } ///