From fca7c5fdfb1e17a2c2ca47fe27ca4e7c229279f4 Mon Sep 17 00:00:00 2001 From: Matthew Connelly Date: Tue, 29 Oct 2019 17:00:05 +0000 Subject: [PATCH] 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. --- WinPlaza/App.xaml | 8 +++++++- WinPlaza/MainWindow.xaml | 10 +++++++++- WinPlaza/MainWindow.xaml.cs | 16 ++++++++++++++++ WinPlaza/Resources/app.png | Bin 0 -> 560 bytes WinPlaza/Resources/music.png | Bin 0 -> 147 bytes WinPlaza/Resources/muted.ico | Bin 0 -> 1078 bytes WinPlaza/Resources/muted.png | Bin 0 -> 711 bytes WinPlaza/Resources/nomusic.ico | Bin 0 -> 1078 bytes WinPlaza/Resources/nomusic.png | Bin 0 -> 162 bytes WinPlaza/Resources/nomusic1.png | Bin 0 -> 239 bytes WinPlaza/Resources/playstop.png | Bin 0 -> 228 bytes WinPlaza/Resources/unmuted.ico | Bin 0 -> 1078 bytes WinPlaza/Resources/unmuted.png | Bin 0 -> 527 bytes WinPlaza/Resources/usr.png | Bin 0 -> 396 bytes WinPlaza/WinPlaza.csproj | 7 +++++++ 15 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 WinPlaza/Resources/app.png create mode 100644 WinPlaza/Resources/music.png create mode 100644 WinPlaza/Resources/muted.ico create mode 100644 WinPlaza/Resources/muted.png create mode 100644 WinPlaza/Resources/nomusic.ico create mode 100644 WinPlaza/Resources/nomusic.png create mode 100644 WinPlaza/Resources/nomusic1.png create mode 100644 WinPlaza/Resources/playstop.png create mode 100644 WinPlaza/Resources/unmuted.ico create mode 100644 WinPlaza/Resources/unmuted.png create mode 100644 WinPlaza/Resources/usr.png diff --git a/WinPlaza/App.xaml b/WinPlaza/App.xaml index 42474cb..7ae2587 100644 --- a/WinPlaza/App.xaml +++ b/WinPlaza/App.xaml @@ -3,6 +3,12 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WinPlaza" StartupUri="MainWindow.xaml"> - + + + + + + + diff --git a/WinPlaza/MainWindow.xaml b/WinPlaza/MainWindow.xaml index f8ce2b8..d0ec138 100644 --- a/WinPlaza/MainWindow.xaml +++ b/WinPlaza/MainWindow.xaml @@ -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"> + + + + + + + + diff --git a/WinPlaza/MainWindow.xaml.cs b/WinPlaza/MainWindow.xaml.cs index 6b44cc2..344314f 100644 --- a/WinPlaza/MainWindow.xaml.cs +++ b/WinPlaza/MainWindow.xaml.cs @@ -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 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; diff --git a/WinPlaza/Resources/app.png b/WinPlaza/Resources/app.png new file mode 100644 index 0000000000000000000000000000000000000000..e4472cd34dda20ef9266c2dfdab5802660ac1ea0 GIT binary patch literal 560 zcmV-00?+-4P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0mVr~K~z{r)l~tK zgCGoq&izY%rv6M{X0wD;qzSaBH+MUe1{uq)$r}AMO`H1#jN|Cj@_;BHgpe-p!LlrE z0U<1D>v~L+U4ci+-B^|ogJ{fk4W|X1#c2WDKK78cuHo;P5I5ZcIolFI4xKi-VMD$H z+1XBu|8K%?G0*d1@?Iujp1t#)!ve@lFI*x3_4Y@7>@8q`eO27+n+8`AW z($Whb2>_{p&L!ke&KUx%a$}#op_ZxH0+5g6mWTlm#)rvr9Ozb}K$Yc-ec50!xBvokO4i6DB~R&uOL@|GXN7JG+5=2&{VZTs{o!he|jLV0M_}n z#Npzb$lIX_(8v&_5Rac;P;1hkx%6q^#5Ja%X}k>GA0q(%;8kb;0V&0qKs#`hw4f}% y)eeNZ*%P@4jnEQt$^#{649COh%x3Qy&OHG^*cj)Wf&Kyj0000DFOHZk!Y80HSaxl6Bv6 zifo0+)Eg^nB&(pIVz23KG!8bDelhVsfl7hKvR*e;3{^0hNY8Dt<(ZMG4cMF!pe_=n z-dn_$WQO6foV_7tG{mR9*-Ru($txaAhe>iQ*%r&JKT`z;6r3gG6Z046qdd=HioP4^jlB?qRR1$jzUBxHp(|+oypz$-r zdQxh>tPAtgg!;K+)=yxogp+H{U$N#yg^yalKLyr`9NnldXsFNnhw@f8`7M`@en82BZy0_h_84-X`|e0NLQ&TbtoD*Qd|S+tTpK%^+oS*myih$_AfGF+5+c zJ}n!5oT+}pTUs>3IJJgNAs>#Ys1AZ3-2%TRz@`mc-v#E6fZ_q;enR3YMGK(o9?!@Z O_o?%cy3fNMz55$PyF=pu literal 0 HcmV?d00001 diff --git a/WinPlaza/Resources/muted.png b/WinPlaza/Resources/muted.png new file mode 100644 index 0000000000000000000000000000000000000000..247774f2aeb34bcad7b8031f56359320787d57b4 GIT binary patch literal 711 zcmV;&0yzDNP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0$fQ%K~z{r&6Zns zgD?z4Nly0#OCvjjm8BY417pPoLVtQs6~(fwhiyn7!wug4S7U*0#d?N51PN8bTye!` zp690h5DiM1=i$99i+wE`fwK>!L@0^BPOgCrM}g}gVQSJm0$qf&<@qA{ zG%aoi<2Y8DpqQ6Ald~c!;7kdV!_IBOyM<(qb^#LRK0Rkm4$QP|zoG>&4n)U3DKw8j zA1QA8I8HWt59_*?i33`RGAwp0fQycj%TyP}A&f_j`8Yz_>qT^ICx6?Ge4zSanx>D- z=hsz0EIk$^WiIA%V1ytk#S9^U8g8Y7k2?@CD2S`ciOz%S4xnRw%yz$zI5myVq0zA$ zj__`yD*K4;``8i}bO+hihP1j?=oiD?K&}+viOZlC`z5c?V@U(j>KcL-xZV(L1&I0s+>yok_R0M}5$e2*Lq0=pKGyQRPna7SYJ tJsR|?#L|jZ5!Wt7qLtwC1^ZtN!!NCG$4jR-u0#L;002ovPDHLkV1nl+J1YPH literal 0 HcmV?d00001 diff --git a/WinPlaza/Resources/nomusic.ico b/WinPlaza/Resources/nomusic.ico new file mode 100644 index 0000000000000000000000000000000000000000..227c96d47f86fd40592cd0249de45a4537e92d44 GIT binary patch literal 1078 zcmeHFF%H5o47?U3Hk2o1LVZSuN_>Z{tG9IHNy&2b9QwVdH5dkj5I4SNlky3()Fffb@!=M(0j~?mv z0$mOXZ3YQvR(at1_n-Tb^)Jl(*BEMLLV~%?@zm~4EB=@`tCxMQ>qLvLL8)7d|0-r9 sqjT;ko?>&JXfGpvZO-p~k}&!lvI6;>1s;*b3=DjSL74G){)!Z!V2h`VV@QPi+i8Y;2NXCMHtH|7f1LRxHB6+9 zk56sttW&C58wvv1603y-Q+w}f?hO`oaMAsF@QgpB%l&SJU8@c({JGj-`7VZYc{x6U z5{X?7)tAh|_uhy|=UDon^{X)B%_7fDbK)ZGC;ogc&?ms82t)I^*L+mJGRsQ3?P6 literal 0 HcmV?d00001 diff --git a/WinPlaza/Resources/playstop.png b/WinPlaza/Resources/playstop.png new file mode 100644 index 0000000000000000000000000000000000000000..23576132c55aa34cb4f69a53ad004e60767efb8e GIT binary patch literal 228 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W?!3HGtkJx+wQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ISV`@iy0WWg+Z8+Vb&Z8pkSq^i(`m||JuonTn7|57)syYuG{_JGFQnW zcS@;%$CZUMJzPGp3YyMxj%h!3+u$LqL~v?FaMq95sx1$V-gvTas9yMlHB-6v@Z=gv zor!VDNPHb6Mw<&;$SUB=tg`D4 zN5!nNE!MS6Qp=?_Az0LrMNw7yjyUc{W!aK^ZODt273m7t;bk6qZm7rW+Z}eLb1q_C z(@I}>@AYcOhmvLKVJ{dp*N=K?apTCF4kOE6e2cqk<PL+*y>SJh`% zkGKZ%=VATSVpw0~d-Ye>!|#Jx6zX==svc~4xDeLnBdp5D@Of^+>sbg*%Hz?Ies7Sz zt&v0WBP>N-E+(SVY9sBWO%1z zV9V~m@44F6WwsC%sJi{OMG~WOF{*nH!G&=;m00;iVrg6)SA`$sGov=-srR&y0L**! e50CucQecw+Yx;`*N^kaD#)Olc4fAD=%>4m%i4p?< literal 0 HcmV?d00001 diff --git a/WinPlaza/Resources/unmuted.png b/WinPlaza/Resources/unmuted.png new file mode 100644 index 0000000000000000000000000000000000000000..60ebf214c460bc0ac386d7102f4bbff93a37a769 GIT binary patch literal 527 zcmV+q0`UEbP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0i;PpK~z{r?Urkj zgCG!uaVz(VH;cI$p3I#dXdP!o@bz!MD#F7s-3&q!{yEDqgh?uvCWc{X{_ZXik1?t^ z>RMnte@q;dOx!9AC{6WkdN z8DOwleIMo+A~-V8QirDdpk+H|1LKJEo`OS!eP16z3{)q~TY$?3A|Q#SzORYg1G#k( zzV*CxQh&LGd@WN}C5H^)dQP>quKbw zmI)ayiUTi-K1&`t227yPL=IG4{T8Rq&;*Uh&?y5Jez*FE1c>l_o@2x> zIY?r@7~s9PI>s1P0B$c{MD)B0;PL$G|3gH2Oqt|U_X1-B=-u_Qm8pn`NC;sBaJu{= z=z}@XxI5?cg>-Tb3U_5<4S>T+MFcTMB2sRm2RK^nUlb>H1kh0kLD|fEfNC6KjLBL# zYyYaK`a>(L`bmCLrl!7D)xQue^SVE7$z7Sumgu84W;QR+GS$21<6d9~i7 zj_rB^m}oP(7ytkO4|t-jz%cXUX}&BK^I!t<5H2yy0KAoPJZRg?J!9}<_`Hr~{#F7i qRfONI)TOshs<#TOOGlUA?0x{C<%;s!9=5;$0000 Always + + + + + + +