Skip to content

Commit 284f6f4

Browse files
committed
Making the progress into the sogn say 00:00 instead of " " when song is stopped
1 parent f840eee commit 284f6f4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CSediaPlayer/MainWindow.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<Button x:Name="select" Content="Song Select" HorizontalAlignment="Right" Height="51" Margin="0,0,422,315" VerticalAlignment="Bottom" Width="147" Click="Select"/>
1515
<Slider x:Name="Progress_Slider" Height="30" Margin="0,275,123,0" VerticalAlignment="Top" Value="0.1" HorizontalAlignment="Right" Width="587" Thumb.DragStarted="Progress_Slider_DragStarted" Thumb.DragCompleted="Progress_Slider_DragCompleted" Thumb.DragDelta="Progress_Slider_DragDelta"/>
1616
<TextBlock x:Name="Current_Playing" HorizontalAlignment="Right" Height="56" Margin="0,173,10,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="601"><Run Text="Now Playing"/><LineBreak/><Run/></TextBlock>
17-
<TextBlock x:Name="Current_Time" HorizontalAlignment="Left" Margin="55,275,0,0" TextWrapping="Wrap" Text="0:00" VerticalAlignment="Top"/>
18-
<TextBlock x:Name="Max_Time" HorizontalAlignment="Right" Margin="0,275,96,0" TextWrapping="Wrap" Text="0:00" VerticalAlignment="Top"/>
17+
<TextBlock x:Name="Current_Time" HorizontalAlignment="Left" Margin="42,275,0,0" TextWrapping="Wrap" VerticalAlignment="Top"><Run Text="0"/><Run Text="0:00"/></TextBlock>
18+
<TextBlock x:Name="Max_Time" HorizontalAlignment="Right" Margin="0,275,90,0" TextWrapping="Wrap" VerticalAlignment="Top"><Run Text="0"/><Run Text="0:00"/></TextBlock>
1919
<Slider x:Name="Volume_Slider" HorizontalAlignment="Right" Height="26" Margin="0,331,574,0" VerticalAlignment="Top" Width="103" ValueChanged="VolumeSlider" Maximum="100"/>
2020
<TextBlock x:Name="Volume_Text" HorizontalAlignment="Right" Margin="0,310,601,0" TextWrapping="Wrap" Text="Volume" Width="46" Height="21" VerticalAlignment="Top"/>
2121
<ToggleButton x:Name="Mute_Toggle" Content="Mute" HorizontalAlignment="Right" Height="21" Margin="0,331,513,0" VerticalAlignment="Top" Width="56" Checked="Mute" Unchecked="Mute"/>

CSediaPlayer/MainWindow.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private void Looper()
8484
private void UpdateSongPosition()
8585
{
8686
Progress_Slider.Value = player.controls.currentPosition;
87-
Current_Time.Text = player.controls.currentPositionString;
87+
if(player.controls.currentPosition == 0){Current_Time.Text = "00:00";}else{Current_Time.Text = player.controls.currentPositionString;}
8888
Progress_Slider.Maximum = player.currentMedia.duration;
8989
Max_Time.Text = player.currentMedia.durationString;
9090
}
@@ -109,6 +109,7 @@ private void Play(object sender, RoutedEventArgs e)
109109
private void Stop(object sender, RoutedEventArgs e)
110110
{
111111
player.controls.stop();
112+
UpdateSongPosition();
112113
}
113114

114115
private void Select(object sender, RoutedEventArgs e)

0 commit comments

Comments
 (0)