Skip to content

Commit d8c747b

Browse files
committed
update v0.9.8
1 parent 0b7cc3e commit d8c747b

File tree

10 files changed

+91
-87
lines changed

10 files changed

+91
-87
lines changed

Controls.xaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,9 @@
141141
<Setter Property="FontWeight" Value="Bold"/>
142142
<Setter Property="BorderBrush" Value="#434B57"/>
143143
<Setter Property="BorderThickness" Value="10"/>
144-
<Setter Property="FontFamily" Value="Corbel"/>
145-
<Setter Property="FontSize" Value="15"/>
144+
<Setter Property="FontFamily" Value="Calibri"/>
145+
<Setter Property="FontSize" Value="14"/>
146+
<Setter Property="FontWeight" Value="SemiBold"/>
146147
<Setter Property="Template">
147148
<Setter.Value>
148149
<ControlTemplate TargetType="GridViewColumnHeader">
@@ -156,8 +157,9 @@
156157
</Style>
157158
<Style TargetType="ListViewItem">
158159
<Setter Property="OverridesDefaultStyle" Value="True"/>
159-
<Setter Property="FontFamily" Value="Calibri"/>
160-
<Setter Property="FontSize" Value="13"/>
160+
<Setter Property="FontFamily" Value="High Tower"/>
161+
<Setter Property="FontSize" Value="12"/>
162+
<Setter Property="FontWeight" Value="Thin"/>
161163
<Setter Property="Template">
162164
<Setter.Value>
163165
<ControlTemplate TargetType="ListViewItem">
@@ -259,4 +261,10 @@
259261
</Setter.Value>
260262
</Setter>
261263
</Style>
264+
<Style TargetType="Button">
265+
<Setter Property="Focusable" Value="False"/>
266+
</Style>
267+
<Style TargetType="Slider">
268+
<Setter Property="Focusable" Value="False"/>
269+
</Style>
262270
</ResourceDictionary>

CynthMusic.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<TargetFramework>netcoreapp3.1</TargetFramework>
66
<UseWPF>true</UseWPF>
77
<ApplicationIcon>favicon.ico</ApplicationIcon>
8-
<AssemblyVersion>0.95.0.0</AssemblyVersion>
9-
<FileVersion>0.95.0.0</FileVersion>
10-
<Version>0.9.5</Version>
8+
<AssemblyVersion>0.98.0.0</AssemblyVersion>
9+
<FileVersion>0.98.0.0</FileVersion>
10+
<Version>0.9.8</Version>
1111
<Platforms>AnyCPU;x86</Platforms>
1212
</PropertyGroup>
1313

MainWindow.xaml

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,24 @@
1111
</WindowChrome.WindowChrome>
1212
<Grid x:Name="panelMain" Background="#ff2c2929">
1313
<tb:TaskbarIcon x:Name="icon" IconSource="/favicon.ico">
14-
<tb:TaskbarIcon.ContextMenu>
15-
<ContextMenu x:Name="ctxNotify" Style="{StaticResource SuperContext}">
16-
<MenuItem x:Name="btnSHWindow" Header="Gizle"/>
17-
<MenuItem x:Name="btnPlayContext" Header="Oynat"/>
18-
<MenuItem x:Name="btnPreviousContext" Header="Önceki"/>
19-
<MenuItem x:Name="btnNextContext" Header="Sonraki"/>
20-
<MenuItem x:Name="btnStop" Header="Durdur"/>
21-
<MenuItem x:Name="btnExitContext" Header="Çıkış"/>
22-
</ContextMenu>
23-
</tb:TaskbarIcon.ContextMenu>
14+
<tb:TaskbarIcon.TrayPopup>
15+
<Border CornerRadius="5">
16+
<Border.Background>
17+
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
18+
<GradientStop Color="#434343"/>
19+
<GradientStop Color="#353535" Offset="1"/>
20+
</LinearGradientBrush>
21+
</Border.Background>
22+
<Grid MinWidth="300" Height="200">
23+
<Label x:Name="lblStateContext" Foreground="White" Content="Boş" FontSize="20" Margin="10,10,10,10" VerticalAlignment="Top"/>
24+
<Button VerticalContentAlignment="Center" FontSize="15" Foreground="White" Style="{StaticResource PlayerButton}" Width="40" Height="40" Margin="50,0,0,66" VerticalAlignment="Bottom" HorizontalAlignment="Left" x:Name="btnPreviousContext" Content=""/>
25+
<Button VerticalContentAlignment="Center" FontSize="25" Foreground="White" Style="{StaticResource PlayerButton}" Width="50" Height="50" Margin="0,0,0,60" VerticalAlignment="Bottom" HorizontalAlignment="Center" x:Name="btnPlayContext" Content=""/>
26+
<Button VerticalContentAlignment="Center" FontSize="15" Foreground="White" Style="{StaticResource PlayerButton}" Width="40" Height="40" Margin="0,0,50,66" VerticalAlignment="Bottom" HorizontalAlignment="Right" x:Name="btnNextContext" Content=""/>
27+
<Button VerticalContentAlignment="Center" FontSize="13" Background="Transparent" Foreground="White" Style="{StaticResource SuperButton}" Width="25" Height="25" Margin="0,0,10,10" VerticalAlignment="Bottom" HorizontalAlignment="Right" x:Name="btnExitContext" Content="X"/>
28+
<Button VerticalContentAlignment="Center" FontSize="13" Background="Transparent" Foreground="White" Style="{StaticResource SuperButton}" Width="25" Height="25" Margin="0,0,35,10" VerticalAlignment="Bottom" HorizontalAlignment="Right" x:Name="btnSHWindow" Content="👁"/>
29+
</Grid>
30+
</Border>
31+
</tb:TaskbarIcon.TrayPopup>
2432
</tb:TaskbarIcon>
2533
<MediaElement Name="media" Visibility="Hidden" LoadedBehavior="Manual" Volume="0.5"/>
2634
<Grid Margin="0,0,0,0" Height="20" VerticalAlignment="Top">
@@ -35,11 +43,11 @@
3543
<Grid.OpacityMask>
3644
<VisualBrush Visual="{Binding ElementName=maskMenu}"/>
3745
</Grid.OpacityMask>
38-
<Button x:Name="btnListNow" Style="{StaticResource SuperButton}" Content="Şu Anda" Background="Transparent" Height="50" FontSize="15" Foreground="White" Margin="0,0,0,0" VerticalAlignment="Top"/>
39-
<Button x:Name="btnListLists" Style="{StaticResource SuperButton}" Content="Listelerim" Background="Transparent" Height="40" FontSize="15" Foreground="White" Margin="0,60,0,0" VerticalAlignment="Top"/>
40-
<Button x:Name="btnListFavourites" Style="{StaticResource SuperButton}" Content="Favorilerim" Background="Transparent" Height="40" FontSize="15" Foreground="White" Margin="0,110,0,0" VerticalAlignment="Top"/>
41-
<Button x:Name="btnExplore" Style="{StaticResource SuperButton}" Content="Keşfet" Background="Transparent" Height="40" FontSize="15" Foreground="White" Margin="0,160,0,0" VerticalAlignment="Top"/>
42-
<Button x:Name="btnSettings" Style="{StaticResource SuperButton}" Content="Ayarlar" Background="Transparent" Height="40" FontSize="15" Foreground="White" Margin="0,0,0,10" VerticalAlignment="Bottom"/>
46+
<Button FontFamily="Montserrat" x:Name="btnListNow" Style="{StaticResource SuperButton}" Content="Şu Anda" Background="Transparent" Height="50" FontSize="13" Foreground="White" Margin="0,0,0,0" VerticalAlignment="Top"/>
47+
<Button FontFamily="Montserrat" x:Name="btnListLists" Style="{StaticResource SuperButton}" Content="Listelerim" Background="Transparent" Height="40" FontSize="13" Foreground="White" Margin="0,60,0,0" VerticalAlignment="Top"/>
48+
<Button FontFamily="Montserrat" x:Name="btnListFavourites" Style="{StaticResource SuperButton}" Content="Favorilerim" Background="Transparent" Height="40" FontSize="13" Foreground="White" Margin="0,110,0,0" VerticalAlignment="Top"/>
49+
<Button FontFamily="Montserrat" x:Name="btnExplore" Style="{StaticResource SuperButton}" Content="Keşfet" Background="Transparent" Height="40" FontSize="13" Foreground="White" Margin="0,160,0,0" VerticalAlignment="Top"/>
50+
<Button FontFamily="Montserrat" x:Name="btnSettings" Style="{StaticResource SuperButton}" Content="Ayarlar" Background="Transparent" Height="40" FontSize="13" Foreground="White" Margin="0,0,0,10" VerticalAlignment="Bottom"/>
4351
</Grid>
4452
</Grid>
4553
<Grid Margin="130,30,120,70">
@@ -127,7 +135,7 @@
127135
<GridViewColumn Width="50">
128136
<GridViewColumn.CellTemplate>
129137
<DataTemplate>
130-
<Button Style="{StaticResource SuperButton}" Margin="0,0,0,0" Background="Transparent" Foreground="White" FontSize="12" Content="" Height="20" Width="20" MouseEnter="DelFav_Enter" MouseLeave="DelFav_Leave" Click="DelFav_Click"/>
138+
<Button Style="{StaticResource SuperButton}" Margin="0,0,0,0" Background="Transparent" Foreground="White" FontSize="10" Content="🗙" FontWeight="ExtraBold" Height="20" Width="20" MouseEnter="DelFav_Enter" MouseLeave="DelFav_Leave" Click="DelFav_Click"/>
131139
</DataTemplate>
132140
</GridViewColumn.CellTemplate>
133141
</GridViewColumn>
@@ -194,18 +202,16 @@
194202
</Grid.OpacityMask>
195203
<Slider IsMoveToPointEnabled="True" Style="{StaticResource SuperSlider}" Foreground="#FF0D7F64" Name="sldVolume" Margin="0,10,0,0" VerticalAlignment="Top" Height="10"/>
196204
<Button Name="btnPrevious" Style="{StaticResource PlayerButton}" Foreground="White" Width="45" Height="45" Background="White" Content="" FontSize="18" Margin="22,90,22,0" VerticalAlignment="Top"/>
197-
<Button Name="btnPlay" Style="{StaticResource PlayerButton}" Foreground="White" Width="60" Height="60" Background="White" Content="" FontSize="30"/>
205+
<Button Focusable="False" Name="btnPlay" Style="{StaticResource PlayerButton}" Foreground="White" Width="60" Height="60" Background="White" Content="" FontSize="30" VerticalContentAlignment="Center"/>
198206
<Button Name="btnNext" Style="{StaticResource PlayerButton}" Foreground="White" Width="45" Height="45" Background="White" Content="" FontSize="18" Margin="22,0,22,90" VerticalAlignment="Bottom"/>
199-
<Button Style="{StaticResource SuperButton}" Name="btnInfinite" FontSize="20" Height="30" Margin="10,0,55,10" Background="Transparent" Foreground="White" Content="" VerticalAlignment="Bottom"/>
207+
<Button Style="{StaticResource SuperButton}" Name="btnInfinite" FontSize="20" Height="30" Margin="15,0,55,10" Background="Transparent" Foreground="White" Content="" VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
200208
<Button Style="{StaticResource SuperButton}" Name="btnShuffle" Width="25" FontSize="15" Height="30" Margin="0,0,10,10" Background="Transparent" Foreground="White" Content="🎲" VerticalAlignment="Bottom" HorizontalAlignment="Right"/>
201209
</Grid>
202210
</Grid>
203-
<Grid x:Name="panelBottom" Height="60" Margin="0,0,0,0" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" >
204-
<Label Foreground="AliceBlue" Margin="10,10,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" x:Name="lblState" Content="Boş" FontSize="15"/>
211+
<Grid Background="Transparent" x:Name="panelBottom" Height="60" Margin="0,0,0,0" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" >
212+
<Label FontFamily="Gotham Medium" FontWeight="SemiBold" Foreground="AliceBlue" Margin="10,10,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" x:Name="lblState" Content="Boş" FontSize="15"/>
205213
<Label Foreground="White" Margin="10,10,10,0" VerticalAlignment="Top" HorizontalAlignment="Right" x:Name="lblPosition" Content="0.00 / 0.00" FontSize="15"/>
206214
<Slider IsMoveToPointEnabled="True" Delay="300" x:Name="sldPosition" Margin="0,0,0,0" Foreground="#FF0D7F64" VerticalContentAlignment="Bottom" Value="0" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Style="{StaticResource SuperSlider}" />
207215
</Grid>
208-
209216
</Grid>
210-
211217
</Window>

MainWindow.xaml.cs

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ public partial class MainWindow : Window
3232
public static AddonManager addonManager;
3333
public static PlayerService playerService;
3434
public static PlaylistManager playlistManager;
35-
35+
3636
public static readonly ConfigService configService = new()
3737
{
3838
{ "LASTID", "" },
39-
{ "BTOP", "42,47,47" },
4039
{ "BGENERAL", "41,41,41" },
4140
{ "BGOPACITY", "100" },
4241
{ "BACKGROUND", "" },
@@ -79,7 +78,7 @@ public MainWindow()
7978
musicService = new(data, client);
8079

8180
playlistManager = new(ref lvPlaylists, ref lvPlaylist, ref lvPlaying, data, musicService, client);
82-
playerService = new(ref lvPlaying, ref media, musicService, (a) => icon.ToolTipText = a);
81+
playerService = new(ref lvPlaying, ref media, musicService, (a) => lblStateContext.Content = a);
8382
addonManager = new(ref lvLocations, ref lvFavourites, musicService);
8483
enumerator = new MMDeviceEnumerator();
8584
device = enumerator.GetDefaultAudioEndpoint(DataFlow.Render, Role.Multimedia);
@@ -90,8 +89,16 @@ public MainWindow()
9089
systemVolume = a.MasterVolume;
9190
return;
9291
}
93-
SetPlayState(!a.Muted);
94-
playerService.TogglePlay(!a.Muted);
92+
if (a.Muted)
93+
{
94+
SetPlayState(false);
95+
playerService.TogglePlay(false);
96+
}
97+
else if (!a.Muted && playerService.GetPlayingID() != null)
98+
{
99+
SetPlayState(true);
100+
playerService.TogglePlay(true);
101+
}
95102
});
96103
update = new UpdateService();
97104

@@ -123,7 +130,10 @@ public MainWindow()
123130
Restore();
124131

125132
interop = new InteropService(true);
126-
interop.PlayPausePress += async () => await Dispatcher.InvokeAsync(() => SetPlayState(playerService.TogglePlay()));
133+
interop.PlayPausePress += async () => await Dispatcher.InvokeAsync(() =>
134+
SetPlayState(playerService.TogglePlay()));
135+
interop.MediaNextPress += async () => await Dispatcher.InvokeAsync(() => playerService.Next());
136+
interop.MediaPreviousPress += async () => await Dispatcher.InvokeAsync(() => playerService.Previous());
127137

128138
if (GetBool("FIRST"))
129139
{
@@ -171,25 +181,27 @@ public void SetPlayState(bool playing)
171181
if (!playing)
172182
{
173183
btnPlay.Content = "ᐅ";
174-
btnPlayContext.Header = "Oynat";
184+
btnPlayContext.Content = "ᐅ";
185+
btnPlay.FontSize = 30;
175186
}
176187
else
177188
{
178-
btnPlay.Content = "| |";
179-
btnPlayContext.Header = "Duraklat";
189+
btnPlay.FontSize = 40;
190+
btnPlay.Content = "∣∣";
191+
btnPlayContext.Content = "∣∣";
180192
}
181193
}
182194
public void SwitchVisibility()
183195
{
184196
if (Visibility == Visibility.Visible)
185197
{
186198
Hide();
187-
btnSHWindow.Header = "Göster";
199+
btnSHWindow.Foreground = new SolidColorBrush(Colors.Aqua);
188200
}
189201
else
190202
{
191203
Show();
192-
btnSHWindow.Header = "Gizle";
204+
btnSHWindow.Foreground = new SolidColorBrush(Colors.White);
193205
}
194206
}
195207
private void SwitchMenu(int menu)
@@ -198,7 +210,8 @@ private void SwitchMenu(int menu)
198210
return;
199211
object c1 = FindName(menus[menu, 0].ToString());
200212
if (c1 is Button b1)
201-
b1.Background = new SolidColorBrush(Color.FromRgb(20, 40, 50));
213+
//b1.Background = new SolidColorBrush(Color.FromRgb(20, 40, 50));
214+
b1.FontWeight = FontWeights.SemiBold;
202215
else
203216
((Control)c1).Visibility = Visibility.Hidden;
204217
Control c2 = (Control)FindName(menus[menu, 1].ToString());
@@ -210,7 +223,8 @@ private void SwitchMenu(int menu)
210223
{
211224
object f = FindName(menus[i, 0].ToString());
212225
if (f is Button b2)
213-
b2.Background = new SolidColorBrush(Colors.Transparent);
226+
//b2.Background = new SolidColorBrush(Colors.Transparent);
227+
b2.FontWeight = FontWeights.Normal;
214228
((Control)FindName(menus[i, 1].ToString())).Visibility = Visibility.Hidden;
215229
}
216230
switchedMenu = menu;
@@ -283,16 +297,9 @@ public void RefreshTheme()
283297
{
284298
string back = configService.Get("BACKGROUND");
285299
if (IsValidImage(back))
286-
{
287-
panelBottom.Background = new SolidColorBrush(Colors.Transparent);
288300
panelMain.Background = new ImageBrush(new BitmapImage(new Uri(back)));
289-
}
290301
else
291-
{
292-
var x = GetColor("BTOP");
293-
panelBottom.Background = x == null ? new SolidColorBrush(x.Value) : bottom;
294302
panelMain.Background = new SolidColorBrush(GetColor("BGENERAL") ?? Color.FromRgb(41, 41, 41));
295-
}
296303
double opacity = (double)int.Parse(configService.Get("BGOPACITY")) / 100;
297304
panelListing.Opacity = opacity;
298305
string plT = configService.Get("PLAYERTHEME");
@@ -427,7 +434,7 @@ private void Initialize()
427434
icon.Dispose();
428435
Environment.Exit(0);
429436
};
430-
PreviewKeyDown += (a, b) =>
437+
PreviewKeyDown += async (a, b) =>
431438
{
432439
if (b.OriginalSource is TextBox)
433440
return;
@@ -451,14 +458,15 @@ private void Initialize()
451458
playerService.Stop();
452459
else if (Keyboard.Modifiers is ModifierKeys.Shift && b.Key is Key.R)
453460
Shuffle();
454-
else if (b.Key is Key.R)
461+
else if (b.Key is Key.R && Keyboard.Modifiers != ModifierKeys.Control)
455462
Infinite();
463+
else if (b.Key is Key.R && Keyboard.Modifiers == ModifierKeys.Control && playerService.GetPlayingID() != null)
464+
await playerService.PlayMusicWithLoad(playerService.srcPlaying[playerService.GetPlayingID().Value - 1]);
456465
else if (b.Key is Key.M)
457466
sldVolume.Value = sldVolume.Value == 0 ? volume : 0;
458467
};
459468
btnMaximize.Click += (a, b) => WindowState = WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
460469
btnMinimize.Click += (a, b) => WindowState = WindowState.Minimized;
461-
462470
btnInfo.Click += (a, b) => new AlertBox("Hakkında", $"Ürün: Cynth Müzik\nSürüm: {GetVersion()}\nYapımcı: Furkan M Yılmaz / Corelium INC").ShowDialog();
463471
btnPlay.Click += (a, b) =>
464472
{
@@ -467,7 +475,6 @@ private void Initialize()
467475
else
468476
SetPlayState(playerService.TogglePlay());
469477
};
470-
btnStop.Click += (a, b) => playerService.Stop();
471478
btnPlayContext.Click += (a, b) => SetPlayState(playerService.TogglePlay());
472479
btnNext.Click += (a, b) => playerService.Next();
473480
btnNextContext.Click += (a, b) => playerService.Next();

Management/PlayerManager.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,10 @@ public async void Play(IMusic music, int index = -1, TimeSpan? position = null)
9393
return;
9494
}
9595

96-
//StopGUI();
9796
window.sldPosition.Value = 0;
9897
player.Stop();
9998
player.Source = new Uri(music.PlayURL);
100-
setIconTip("Oynatılıyor: " + music.Name);
99+
setIconTip(music.Name);
101100
player.Play();
102101
if (index != -1)
103102
music.ID = index;
@@ -143,11 +142,11 @@ public void Play(string identity, TimeSpan? position = null) =>
143142
ConvertPlay(service.srcPlaying.FirstOrDefault(x => x.Item.Music.SaveIdentity == identity), position);
144143
public void StopGUI()
145144
{
146-
window.btnPlay.Content = "ᐅ";
147-
window.btnPlayContext.Header = "Oynat";
145+
window.SetPlayState(false);
148146
window.sldPosition.Value = 0;
149147
window.lblState.Content = "Boş";
150148
window.lblPosition.Content = "0.00 / 0.00";
149+
setIconTip("Boş");
151150
window.btnShuffle.Foreground = new SolidColorBrush(Colors.White);
152151
}
153152
public void Stop()

0 commit comments

Comments
 (0)