added separate status bar text for sound file currently playing.

This commit is contained in:
morkt 2015-04-22 22:35:28 +04:00
parent ec8f39a2c7
commit 88d7b7d492
2 changed files with 13 additions and 4 deletions

View File

@ -221,9 +221,13 @@
Visibility="{Binding Source={x:Static p:Settings.Default}, Path=winStatusBarVisibility, Mode=TwoWay}">
<Separator Height="1" Margin="0"/>
<StatusBar>
<StatusBarItem>
<StatusBarItem Width="{Binding ElementName=CurrentDirectory, Path=ActualWidth}">
<TextBlock x:Name="appStatusText"/>
</StatusBarItem>
<Separator Width="1"/>
<StatusBarItem>
<TextBlock x:Name="appResourceText"/>
</StatusBarItem>
</StatusBar>
</StackPanel>
<Grid x:Name="ContentGrid" DockPanel.Dock="Left" VerticalAlignment="Stretch"

View File

@ -146,6 +146,11 @@ namespace GARbro.GUI
Dispatcher.Invoke (() => { appStatusText.Text = text; });
}
public void SetResourceText (string text)
{
Dispatcher.Invoke (() => { appResourceText.Text = text; });
}
/// <summary>
/// Popup error message box. Could be called from any thread.
/// </summary>
@ -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 ("");
}
/// <summary>