final touches, hopefully no major mistakes

This commit is contained in:
Royce551 2021-08-18 22:10:53 -05:00
parent 508c1504c8
commit 3ae5aac25e
9 changed files with 21 additions and 16 deletions

View file

@ -51,12 +51,16 @@ namespace FRESHMusicPlayer.ViewModels
{ {
Player = new(); Player = new();
StartThings(); StartThings();
#if DEBUG // allow multiple instances of FMP in debug (at the expense of stability with heavy library use)
var library = new LiteDatabase($"Filename=\"{Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FRESHMusicPlayer", "database.fdb2")}\";Connection=shared"); var library = new LiteDatabase($"Filename=\"{Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FRESHMusicPlayer", "database.fdb2")}\";Connection=shared");
#elif !DEBUG
var library = new LiteDatabase(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FRESHMusicPlayer", "database.fdb2"));
#endif
Library = new Library(library); Library = new Library(library);
InitializeLibrary(); InitializeLibrary();
} }
public const string ProjectName = "FRESHMusicPlayer for Mac and Linux Release Candidate 1"; public const string ProjectName = "FRESHMusicPlayer";
private string windowTitle = ProjectName; private string windowTitle = ProjectName;
public string WindowTitle public string WindowTitle
{ {
@ -69,7 +73,7 @@ namespace FRESHMusicPlayer.ViewModels
public void ClearAllNotificationsCommand() => Notifications.ClearAll(); public void ClearAllNotificationsCommand() => Notifications.ClearAll();
#region Core #region Core
private void Player_SongException(object sender, PlaybackExceptionEventArgs e) private void Player_SongException(object sender, PlaybackExceptionEventArgs e)
{ {
Notifications.Add(new() Notifications.Add(new()
@ -316,9 +320,9 @@ namespace FRESHMusicPlayer.ViewModels
set => this.RaiseAndSetIfChanged(ref pauseAfterCurrentTrack, value); set => this.RaiseAndSetIfChanged(ref pauseAfterCurrentTrack, value);
} }
#endregion #endregion
#region Library #region Library
public async void InitializeLibrary() public async void InitializeLibrary()
{ {
@ -844,9 +848,9 @@ namespace FRESHMusicPlayer.ViewModels
await Task.Delay(100); await Task.Delay(100);
ShowTracksForAlbum(CurrentTrack.Album); ShowTracksForAlbum(CurrentTrack.Album);
} }
#endregion #endregion
#region NavBar #region NavBar
public void OpenSettingsCommand() public void OpenSettingsCommand()
{ {
new Views.Settings().SetThings(Program.Config, Library).Show(Window); new Views.Settings().SetThings(Program.Config, Library).Show(Window);
@ -872,9 +876,9 @@ namespace FRESHMusicPlayer.ViewModels
var tracks = new List<string>(); var tracks = new List<string>();
if (Player.FileLoaded) tracks.Add(Player.FilePath); if (Player.FileLoaded) tracks.Add(Player.FilePath);
else tracks = Player.Queue.Queue; else tracks = Player.Queue.Queue;
new Views.TagEditor.TagEditor().SetStuff(Player, Library).SetInitialFiles(tracks).Show(); new Views.TagEditor.TagEditor().SetStuff(Player, Library).SetInitialFiles(tracks).Show(Window);
} }
#endregion #endregion
} }
public class PauseAfterCurrentTrackToBrushConverter : IValueConverter public class PauseAfterCurrentTrackToBrushConverter : IValueConverter

View file

@ -29,12 +29,13 @@ namespace FRESHMusicPlayer.ViewModels
{ {
new(Properties.Resources.Automatic, "automatic"), new(Properties.Resources.Automatic, "automatic"),
new("English", "en"), new("English", "en"),
new("Danish", "da"),
new("German", "de"), new("German", "de"),
new("Vietnamese", "vi"), new("Vietnamese", "vi"),
new("Arabic (Saudi Arabia)", "ar") new("Arabic (Saudi Arabia)", "ar")
}; };
public string Version => MainWindowViewModel.ProjectName; public string Version => $"FRESHMusicPlayer {Assembly.GetEntryAssembly().GetName().Version} for Mac and Linux";
public DisplayLanguage Language public DisplayLanguage Language
{ {

View file

@ -5,7 +5,7 @@
xmlns:controls="clr-namespace:FRESHMusicPlayer.Controls.BlurryImage" xmlns:controls="clr-namespace:FRESHMusicPlayer.Controls.BlurryImage"
xmlns:vm="using:FRESHMusicPlayer.ViewModels" xmlns:vm="using:FRESHMusicPlayer.ViewModels"
xmlns:resx ="clr-namespace:FRESHMusicPlayer.Properties" xmlns:resx ="clr-namespace:FRESHMusicPlayer.Properties"
mc:Ignorable="d" Width="500" Height="300" mc:Ignorable="d" Width="500" Height="300" Icon="/Assets/icon.ico" ShowInTaskbar="False"
x:Class="FRESHMusicPlayer.Views.Lyrics" WindowStartupLocation="CenterOwner" Closing="OnClosing" x:Class="FRESHMusicPlayer.Views.Lyrics" WindowStartupLocation="CenterOwner" Closing="OnClosing"
Title="{x:Static resx:Resources.Lyrics}"> Title="{x:Static resx:Resources.Lyrics}">
<Window.DataContext> <Window.DataContext>

View file

@ -5,7 +5,7 @@
xmlns:vm="using:FRESHMusicPlayer.ViewModels" xmlns:vm="using:FRESHMusicPlayer.ViewModels"
xmlns:resx ="clr-namespace:FRESHMusicPlayer.Properties" xmlns:resx ="clr-namespace:FRESHMusicPlayer.Properties"
mc:Ignorable="d" SizeToContent="Height" Width="600" CanResize="False" mc:Ignorable="d" SizeToContent="Height" Width="600" CanResize="False"
x:Class="FRESHMusicPlayer.Views.PlaylistManagement" x:Class="FRESHMusicPlayer.Views.PlaylistManagement" Icon="/Assets/icon.ico"
Title="{x:Static resx:Resources.PlaylistManagement}"> Title="{x:Static resx:Resources.PlaylistManagement}">
<Window.DataContext> <Window.DataContext>

View file

@ -5,7 +5,7 @@
xmlns:resx ="clr-namespace:FRESHMusicPlayer.Properties" xmlns:resx ="clr-namespace:FRESHMusicPlayer.Properties"
xmlns:vm="using:FRESHMusicPlayer.ViewModels.TagEditor" xmlns:vm="using:FRESHMusicPlayer.ViewModels.TagEditor"
mc:Ignorable="d" Width="600" Height="400" mc:Ignorable="d" Width="600" Height="400"
x:Class="FRESHMusicPlayer.Views.TagEditor.IntegrationDisambiguation" x:Class="FRESHMusicPlayer.Views.TagEditor.IntegrationDisambiguation" Icon="/Assets/icon.ico"
Title="{x:Static vm:TagEditorViewModel.WindowName}" CanResize="False" WindowStartupLocation="CenterOwner"> Title="{x:Static vm:TagEditorViewModel.WindowName}" CanResize="False" WindowStartupLocation="CenterOwner">
<Window.DataContext> <Window.DataContext>

View file

@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" Width="600" Height="450" mc:Ignorable="d" Width="600" Height="450"
x:Class="FRESHMusicPlayer.Views.TagEditor.ReleaseIntegrationPage" x:Class="FRESHMusicPlayer.Views.TagEditor.ReleaseIntegrationPage"
xmlns:resx ="clr-namespace:FRESHMusicPlayer.Properties" xmlns:resx ="clr-namespace:FRESHMusicPlayer.Properties" Icon="/Assets/icon.ico"
xmlns:vm="using:FRESHMusicPlayer.ViewModels.TagEditor" xmlns:vm="using:FRESHMusicPlayer.ViewModels.TagEditor"
Title="{Binding Album}"> Title="{Binding Album}">

View file

@ -5,7 +5,7 @@
xmlns:resx ="clr-namespace:FRESHMusicPlayer.Properties" xmlns:resx ="clr-namespace:FRESHMusicPlayer.Properties"
xmlns:vm="using:FRESHMusicPlayer.ViewModels.TagEditor" xmlns:vm="using:FRESHMusicPlayer.ViewModels.TagEditor"
mc:Ignorable="d" Height="451" Width="600" mc:Ignorable="d" Height="451" Width="600"
x:Class="FRESHMusicPlayer.Views.TagEditor.TagEditor" Closing="OnClosing" x:Class="FRESHMusicPlayer.Views.TagEditor.TagEditor" Closing="OnClosing" Icon="/Assets/icon.ico" WindowStartupLocation="CenterOwner"
Title="{Binding WindowTitle}"> Title="{Binding WindowTitle}">
<Window.DataContext> <Window.DataContext>

View file

@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:FRESHMusicPlayer.ViewModels" xmlns:vm="using:FRESHMusicPlayer.ViewModels"
mc:Ignorable="d" SizeToContent="Height" Width="450" WindowStartupLocation="CenterOwner" mc:Ignorable="d" SizeToContent="Height" Width="450" WindowStartupLocation="CenterOwner"
x:Class="FRESHMusicPlayer.Views.TextEntryBox" x:Class="FRESHMusicPlayer.Views.TextEntryBox" Icon="/Assets/icon.ico" ShowInTaskbar="False"
Title=""> Title="">
<Window.DataContext> <Window.DataContext>
<vm:TextEntryBoxViewModel/> <vm:TextEntryBoxViewModel/>

View file

@ -87,7 +87,7 @@ namespace FRESHMusicPlayer
LiteDatabase library; LiteDatabase library;
try try
{ {
#if DEBUG // allow multiple instances of FMP in debug #if DEBUG // allow multiple instances of FMP in debug (at the expense of stability with heavy library use)
library = new LiteDatabase($"Filename=\"{Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FRESHMusicPlayer", "database.fdb2")}\";Connection=shared"); library = new LiteDatabase($"Filename=\"{Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FRESHMusicPlayer", "database.fdb2")}\";Connection=shared");
#elif !DEBUG #elif !DEBUG
library = new LiteDatabase(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FRESHMusicPlayer", "database.fdb2")); library = new LiteDatabase(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FRESHMusicPlayer", "database.fdb2"));