add windows vista and newer taskbar buttons for playback and mute control, unsure if this commit also adds volume control or if i added that in the last commit, but there's volume control now. finally sussed how to do resources in xaml.
|
@ -3,6 +3,12 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:WinPlaza"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
<Application.Resources>
|
||||
<BitmapImage x:Key="tbPlaying" UriSource="/WinPlaza;component/Resources/music.png"/>
|
||||
<BitmapImage x:Key="tbStopped" UriSource="/WinPlaza;component/Resources/nomusic.png"/>
|
||||
<BitmapImage x:Key="tbPlayStop" UriSource="/WinPlaza;component/Resources/playstop.png"/>
|
||||
<BitmapImage x:Key="tbMuted" UriSource="/WinPlaza;component/Resources/muted.png"/>
|
||||
<BitmapImage x:Key="tbAudible" UriSource="/WinPlaza;component/Resources/unmuted.png"/>
|
||||
<BitmapImage x:Key="imUsr" UriSource="/WinPlaza;component/Resources/usr.png"/>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
|
|
@ -5,7 +5,15 @@
|
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:WinPlaza"
|
||||
mc:Ignorable="d"
|
||||
Title="Nightwave.Net" Height="200" Width="480" Background="#FFF0F0F0" ResizeMode="CanMinimize" Deactivated="Window_Deactivated" Activated="Window_Activated" UseLayoutRounding="True">
|
||||
Title="Nightwave.Net" Height="200" Width="480" Background="#FFF0F0F0" ResizeMode="CanMinimize" Deactivated="Window_Deactivated" Activated="Window_Activated" UseLayoutRounding="True" Closing="Window_Closing">
|
||||
<Window.TaskbarItemInfo>
|
||||
<TaskbarItemInfo>
|
||||
<TaskbarItemInfo.ThumbButtonInfos>
|
||||
<ThumbButtonInfo x:Name="tbPlayPause" Description="Play/Stop" Click="TbPlayPause_Click" ImageSource="{DynamicResource tbPlayStop}"/>
|
||||
<ThumbButtonInfo x:Name="tbMute" Description="Mute/Unmute" Click="TbMute_Click" ImageSource="{DynamicResource tbAudible}"/>
|
||||
</TaskbarItemInfo.ThumbButtonInfos>
|
||||
</TaskbarItemInfo>
|
||||
</Window.TaskbarItemInfo>
|
||||
<Grid ClipToBounds="True">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition/>
|
||||
|
|
|
@ -63,6 +63,7 @@ namespace WinPlaza {
|
|||
* 100 / Bass.StreamGetFilePosition(BuffCh, FileStreamPosition.End);
|
||||
if(progress > 75 || Bass.StreamGetFilePosition(BuffCh, FileStreamPosition.Connected) == 0) {
|
||||
tAudio.Stop();
|
||||
//tbPlayPause.ImageSource = (BitmapImage)FindResource("tbPlaying");
|
||||
SetStatus("Playing");
|
||||
SetTitle($"▶ {lbTitle.Content} - {lbArtist.Content}");
|
||||
tGfx.Start();
|
||||
|
@ -104,6 +105,7 @@ namespace WinPlaza {
|
|||
_ = Bass.ChannelStop(BufferReqs);
|
||||
_ = Bass.ChannelStop(BuffCh);
|
||||
tAudio.Stop();
|
||||
//tbPlayPause.ImageSource = (BitmapImage)FindResource("tbStopped");
|
||||
SetStatus("Idle..");
|
||||
SetTitle("Nightwave.Net");
|
||||
}
|
||||
|
@ -139,10 +141,12 @@ namespace WinPlaza {
|
|||
MuteVol = Bass.GlobalStreamVolume;
|
||||
Bass.GlobalStreamVolume = 0;
|
||||
sbMute.Content = "🔇";
|
||||
tbMute.ImageSource = (BitmapImage)FindResource("tbMuted");
|
||||
} else {
|
||||
Bass.GlobalStreamVolume = MuteVol;
|
||||
MuteVol = -1;
|
||||
sbMute.Content = "🔊";
|
||||
tbMute.ImageSource = (BitmapImage)FindResource("tbAudible");
|
||||
}
|
||||
}
|
||||
private void SbVol_MouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e) {
|
||||
|
@ -151,6 +155,18 @@ namespace WinPlaza {
|
|||
}
|
||||
private void SbVol_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) =>
|
||||
Bass.GlobalStreamVolume = (int)sbVol.Value * 100;
|
||||
private void TbPlayPause_Click(object sender, EventArgs e) =>
|
||||
btPlayPause.IsChecked = !btPlayPause.IsChecked;
|
||||
private void TbMute_Click(object sender, EventArgs e) =>
|
||||
SbMute_Click(sender, new RoutedEventArgs());
|
||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) {
|
||||
tRefresh.Stop();
|
||||
if(AudioInit) {
|
||||
tAudio.Stop();
|
||||
tGfx.Stop();
|
||||
PlazaStop();
|
||||
}
|
||||
}
|
||||
private void Window_Deactivated(object sender, EventArgs e) {
|
||||
if(tGfx.Enabled)
|
||||
tGfx.Interval = 1000.0 / 25.0;
|
||||
|
|
After Width: | Height: | Size: 560 B |
After Width: | Height: | Size: 147 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 711 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 162 B |
After Width: | Height: | Size: 239 B |
After Width: | Height: | Size: 228 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 527 B |
After Width: | Height: | Size: 396 B |
|
@ -173,6 +173,13 @@
|
|||
<Content Include="bass.dll">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Resource Include="Resources\playstop.png" />
|
||||
<Resource Include="Resources\music.png" />
|
||||
<Resource Include="Resources\usr.png" />
|
||||
<Resource Include="Resources\app.png" />
|
||||
<Resource Include="Resources\muted.png" />
|
||||
<Resource Include="Resources\nomusic.png" />
|
||||
<Resource Include="Resources\unmuted.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="bin\Debug\" />
|
||||
|
|