aboutsummaryrefslogtreecommitdiff
path: root/Erable
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2021-11-24 17:19:15 -0500
committerAndrew Lee <alee14498@protonmail.com>2021-11-24 17:19:15 -0500
commit61ed8a3ffb60d2a037dc0bd2b5b0a47e53670b69 (patch)
tree3fd5329ee3a54765cf14ae99a72194e8b8aa0261 /Erable
parent6e207e667ddc77f0901e402fd6d6e04ddf7cd89f (diff)
downloaderable-godot-61ed8a3ffb60d2a037dc0bd2b5b0a47e53670b69.tar.gz
erable-godot-61ed8a3ffb60d2a037dc0bd2b5b0a47e53670b69.tar.bz2
erable-godot-61ed8a3ffb60d2a037dc0bd2b5b0a47e53670b69.zip
Removed .NET files; Now using Godot as the base of the audio player
Diffstat (limited to 'Erable')
-rw-r--r--Erable/App.axaml12
-rw-r--r--Erable/App.axaml.cs49
-rw-r--r--Erable/Assets/avalonia-logo.icobin176111 -> 0 bytes
-rw-r--r--Erable/Assets/erable.pngbin76609 -> 0 bytes
-rw-r--r--Erable/DiscordRPC.cs76
-rw-r--r--Erable/Erable.csproj52
-rw-r--r--Erable/Program.cs65
-rw-r--r--Erable/ViewLocator.cs51
-rw-r--r--Erable/ViewModels/MainWindowViewModel.cs82
-rw-r--r--Erable/ViewModels/ViewModelBase.cs30
-rw-r--r--Erable/Views/About.axaml17
-rw-r--r--Erable/Views/About.axaml.cs49
-rw-r--r--Erable/Views/MainWindow.axaml36
-rw-r--r--Erable/Views/MainWindow.axaml.cs55
-rw-r--r--Erable/Views/MessageBox.axaml19
-rw-r--r--Erable/Views/MessageBox.axaml.cs93
16 files changed, 0 insertions, 686 deletions
diff --git a/Erable/App.axaml b/Erable/App.axaml
deleted file mode 100644
index 992dbfb..0000000
--- a/Erable/App.axaml
+++ /dev/null
@@ -1,12 +0,0 @@
-<Application xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="using:Erable"
- x:Class="Erable.App">
- <Application.DataTemplates>
- <local:ViewLocator/>
- </Application.DataTemplates>
-
- <Application.Styles>
- <FluentTheme Mode="Dark"/>
- </Application.Styles>
-</Application>
diff --git a/Erable/App.axaml.cs b/Erable/App.axaml.cs
deleted file mode 100644
index 9528c60..0000000
--- a/Erable/App.axaml.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-/**********************************************************************
- *
- * Erable: Audio Player
- * Copyright (C) 2021 Alee Productions
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- ************************************************************************/
-using Avalonia;
-using Avalonia.Controls.ApplicationLifetimes;
-using Avalonia.Markup.Xaml;
-using Erable.ViewModels;
-using Erable.Views;
-
-namespace Erable
-{
- public class App : Application
- {
- public override void Initialize()
- {
- DiscordRpc.Initialize();
- AvaloniaXamlLoader.Load(this);
- }
-
- public override void OnFrameworkInitializationCompleted()
- {
- if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
- {
- desktop.MainWindow = new MainWindow
- {
- DataContext = new MainWindowViewModel(),
- };
- }
-
- base.OnFrameworkInitializationCompleted();
- }
- }
-} \ No newline at end of file
diff --git a/Erable/Assets/avalonia-logo.ico b/Erable/Assets/avalonia-logo.ico
deleted file mode 100644
index da8d49f..0000000
--- a/Erable/Assets/avalonia-logo.ico
+++ /dev/null
Binary files differ
diff --git a/Erable/Assets/erable.png b/Erable/Assets/erable.png
deleted file mode 100644
index 1d25b8a..0000000
--- a/Erable/Assets/erable.png
+++ /dev/null
Binary files differ
diff --git a/Erable/DiscordRPC.cs b/Erable/DiscordRPC.cs
deleted file mode 100644
index e0be617..0000000
--- a/Erable/DiscordRPC.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-/**********************************************************************
- *
- * Erable: Audio Player
- * Copyright (C) 2021 Alee Productions
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- ************************************************************************/
-
-using System;
-using DiscordRPC;
-using DiscordRPC.Logging;
-
-namespace Erable
-{
- public class DiscordRpc
- {
-
-//Called when your application first starts.
-//For example, just before your main loop, on OnEnable for unity.
- public static void Initialize()
- {
- /*
- Create a Discord client
- NOTE: If you are using Unity3D, you must use the full constructor and define
- the pipe connection.
- */
- var client = new DiscordRpcClient("808844258038644747")
- {
- Logger = new ConsoleLogger() {Level = LogLevel.Warning}
- };
-
- //Set the logger
-
- //Subscribe to events
- client.OnReady += (sender, e) =>
- {
- Console.WriteLine("Connected to Discord...");
- Console.WriteLine("Received Ready from user {0}", e.User.Username);
- };
- #if DEBUG
- client.OnPresenceUpdate += (sender, e) =>
- {
- Console.WriteLine("Received Update! {0}", e.Presence);
- };
- #endif
-
- //Connect to the RPC
- client.Initialize();
-
- //Set the rich presence
- //Call this as many times as you want and anywhere in your code.
- client.SetPresence(new RichPresence()
- {
- Details = "Playing Nothing",
- State = "RPC is being implemented!",
- Assets = new Assets()
- {
- LargeImageKey = "erable_logo",
- LargeImageText = "Erable Audio Player"
- }
- });
- }
- }
-} \ No newline at end of file
diff --git a/Erable/Erable.csproj b/Erable/Erable.csproj
deleted file mode 100644
index 88b6034..0000000
--- a/Erable/Erable.csproj
+++ /dev/null
@@ -1,52 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
- <PropertyGroup>
- <OutputType>WinExe</OutputType>
- <TargetFramework>net5.0</TargetFramework>
- <Nullable>enable</Nullable>
- <PublishTrimmed>true</PublishTrimmed>
- <TrimMode>link</TrimMode>
- <RootNamespace>Erable</RootNamespace>
- <Company>Alee Productions</Company>
- <AssemblyVersion>0.0.1</AssemblyVersion>
- <IsPackable>false</IsPackable>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
- <PlatformTarget>x64</PlatformTarget>
- </PropertyGroup>
- <PropertyGroup>
- <RuntimeIdentifiers>osx-x64</RuntimeIdentifiers>
- <CFBundleName>Erable</CFBundleName> <!-- Also defines .app file name -->
- <CFBundleDisplayName>Erable</CFBundleDisplayName>
- <CFBundleIdentifier>xyz.aleeproductions</CFBundleIdentifier>
- <CFBundleVersion>0.0.1</CFBundleVersion>
- <CFBundleShortVersionString>0.0.1</CFBundleShortVersionString>
- <CFBundlePackageType>AAPL</CFBundlePackageType>
- <CFBundleSignature>????</CFBundleSignature>
- <CFBundleExecutable>Erable</CFBundleExecutable>
- <!-- <CFBundleIconFile>AppName.icns</CFBundleIconFile> Will be copied from output directory -->
- <NSPrincipalClass>NSApplication</NSPrincipalClass>
- <NSHighResolutionCapable>true</NSHighResolutionCapable>
- <UseAppHost>true</UseAppHost>
- </PropertyGroup>
- <ItemGroup>
- <Folder Include="Models\" />
- <AvaloniaResource Include="Assets\**" />
- </ItemGroup>
- <ItemGroup>
- <PackageReference Include="Avalonia" Version="0.10.0" />
- <PackageReference Include="Avalonia.Desktop" Version="0.10.0" />
- <PackageReference Include="Avalonia.Diagnostics" Version="0.10.0" />
- <PackageReference Include="Avalonia.ReactiveUI" Version="0.10.0" />
- <PackageReference Include="DiscordRichPresence" Version="1.0.175" />
- <PackageReference Include="Dotnet.Bundle" Version="0.9.13" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Sirop.Backend\Sirop.Backend.csproj" />
- </ItemGroup>
- <ItemGroup>
- <Compile Update="Views\About.axaml.cs">
- <DependentUpon>About.axaml</DependentUpon>
- <SubType>Code</SubType>
- </Compile>
- </ItemGroup>
-</Project>
diff --git a/Erable/Program.cs b/Erable/Program.cs
deleted file mode 100644
index 827f1bf..0000000
--- a/Erable/Program.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-/**********************************************************************
- *
- * Erable: Audio Player
- * Copyright (C) 2021 Alee Productions
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- ************************************************************************/
-using System;
-using Avalonia;
-using Avalonia.ReactiveUI;
-
-namespace Erable
-{
- class Program
- {
- // Initialization code. Don't use any Avalonia, third-party APIs or any
- // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
- // yet and stuff might break.
- public static void Main(string[] args)
- {
- Console.WriteLine("Erable {0}: Audio Player by Alee Productions", Sirop.Backend.Version.ErableVersion);
- Console.WriteLine("Powered by Sirop Backend {0} ", Sirop.Backend.Version.SiropVersion);
-
- AppDomain.CurrentDomain.UnhandledException += ErrorHandler;
-
- #if DEBUG
- Console.WriteLine("Running on .NET " + Environment.Version + ", and " + Environment.OSVersion);
- Console.WriteLine("Opening window...");
- #endif
-
- BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
-
- }
-
- static void ErrorHandler(object sender, UnhandledExceptionEventArgs e)
- {
- Console.WriteLine("Oh no! An error has occurred!");
- Console.WriteLine("Erable Version: " + Sirop.Backend.Version.ErableVersion);
- Console.WriteLine("Sirop Version: " + Sirop.Backend.Version.SiropVersion);
- Console.WriteLine("OS Version: " + Environment.OSVersion);
- Console.WriteLine(".NET Version: " + Environment.Version);
- Console.WriteLine("Report this to the developers...");
- Console.WriteLine("Did this crashed? " + e.IsTerminating);
- }
-
- // Avalonia configuration, don't remove; also used by visual designer.
- static AppBuilder BuildAvaloniaApp()
- => AppBuilder.Configure<App>()
- .UsePlatformDetect()
- .LogToTrace()
- .UseReactiveUI();
- }
-}
diff --git a/Erable/ViewLocator.cs b/Erable/ViewLocator.cs
deleted file mode 100644
index c857616..0000000
--- a/Erable/ViewLocator.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-/**********************************************************************
- *
- * Erable: Audio Player
- * Copyright (C) 2021 Alee Productions
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- ************************************************************************/
-using System;
-using Avalonia.Controls;
-using Avalonia.Controls.Templates;
-using Erable.ViewModels;
-
-namespace Erable
-{
- public class ViewLocator : IDataTemplate
- {
- public bool SupportsRecycling => false;
-
- public IControl Build(object data)
- {
- var name = data.GetType().FullName!.Replace("ViewModel", "View");
- var type = Type.GetType(name);
-
- if (type != null)
- {
- return (Control)Activator.CreateInstance(type)!;
- }
- else
- {
- return new TextBlock { Text = "Not Found: " + name };
- }
- }
-
- public bool Match(object data)
- {
- return data is ViewModelBase;
- }
- }
-} \ No newline at end of file
diff --git a/Erable/ViewModels/MainWindowViewModel.cs b/Erable/ViewModels/MainWindowViewModel.cs
deleted file mode 100644
index b686425..0000000
--- a/Erable/ViewModels/MainWindowViewModel.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-/**********************************************************************
- *
- * Erable: Audio Player
- * Copyright (C) 2021 Alee Productions
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- ************************************************************************/
-using System;
-using System.Threading;
-using Avalonia.Controls;
-using Erable.Views;
-using Sirop.Backend;
-
-namespace Erable.ViewModels
-{
- public class MainWindowViewModel : ViewModelBase
- {
-
- public void PlayFunction()
- {
- try
- {
- Thread t = new(Playback.PlayAudio);
- t.Start();
- }
- catch(Exception ex)
- {
- MessageBox.Show(new MainWindow(), ex.ToString(), "Error", MessageBox.MessageBoxButtons.Ok);
- }
- }
-
- public void StopFunction()
- {
-
- }
-
- public void BrowseFunction()
- {
- var dialog = new OpenFileDialog();
- // dialog.Title
- dialog.Filters.Add(new FileDialogFilter() {Name = "Audio Files", Extensions = {"mp3", "wav", "flac"}});
- dialog.Title = "Select Audio FIle";
- /*
- var files = await dialog.ShowAsync(this);
-
- if(files != null && files.Length > 0)
- {
- var file = files[0];
- if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows))
- {
- PlayFunction($"file:/{file.Replace('\\', '/')}");
- }
- else
- {
- PlayFunction($"file://{file}");
- }
- }*/
- }
-
- public void MsgBoxTest()
- {
- MessageBox.Show(new MainWindow(), "Hello world", "Test Title", MessageBox.MessageBoxButtons.Ok);
- }
-
- public void ExceptionButton()
- {
- throw new Exception();
- }
- }
-}
diff --git a/Erable/ViewModels/ViewModelBase.cs b/Erable/ViewModels/ViewModelBase.cs
deleted file mode 100644
index 017fde3..0000000
--- a/Erable/ViewModels/ViewModelBase.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-/**********************************************************************
- *
- * Erable: Audio Player
- * Copyright (C) 2021 Alee Productions
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- ************************************************************************/
-using System;
-using System.Collections.Generic;
-using System.Text;
-using ReactiveUI;
-
-namespace Erable.ViewModels
-{
- public class ViewModelBase : ReactiveObject
- {
- }
-}
diff --git a/Erable/Views/About.axaml b/Erable/Views/About.axaml
deleted file mode 100644
index 7d6017f..0000000
--- a/Erable/Views/About.axaml
+++ /dev/null
@@ -1,17 +0,0 @@
-<Window xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d" d:DesignWidth="600" d:DesignHeight="150"
- x:Class="Erable.Views.About"
- Width="600"
- Height="150"
- Icon="/Assets/erable.png"
- Title="About Erable">
- <StackPanel Margin="10">
- <TextBlock HorizontalAlignment="Center" FontSize="30">About Erable 0.1 Pre-Alpha</TextBlock>
- <TextBlock HorizontalAlignment="Center" FontSize="20">© Copyright 2021, Alee Productions</TextBlock>
- <TextBlock HorizontalAlignment="Center" FontSize="20">Licensed with GPL-3.0</TextBlock>
- <TextBlock HorizontalAlignment="Center" FontSize="20">Report Bugs at https://git.io/JtrAO</TextBlock>
- </StackPanel>
-</Window>
diff --git a/Erable/Views/About.axaml.cs b/Erable/Views/About.axaml.cs
deleted file mode 100644
index 7c87162..0000000
--- a/Erable/Views/About.axaml.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-/**********************************************************************
- *
- * Erable: Audio Player
- * Copyright (C) 2021 Alee Productions
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- ************************************************************************/
-using System;
-using Avalonia;
-using Avalonia.Controls;
-using Avalonia.Input;
-using Avalonia.Markup.Xaml;
-
-namespace Erable.Views
-{
- public class About : Window
- {
-
- public About()
- {
- InitializeComponent();
-#if DEBUG
- this.AttachDevTools();
-#endif
- }
-
- private void InitializeComponent()
- {
- AvaloniaXamlLoader.Load(this);
- }
-
- private void InputElement_OnPointerPressed(object? sender, PointerPressedEventArgs e)
- {
- Environment.Exit(0);
- }
- }
-} \ No newline at end of file
diff --git a/Erable/Views/MainWindow.axaml b/Erable/Views/MainWindow.axaml
deleted file mode 100644
index ca78244..0000000
--- a/Erable/Views/MainWindow.axaml
+++ /dev/null
@@ -1,36 +0,0 @@
-<Window xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:vm="using:Erable.ViewModels"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
- x:Class="Erable.Views.MainWindow"
- Width="800"
- Height="450"
- Icon="/Assets/erable.png"
- Title="Erable">
-
- <Design.DataContext>
- <vm:MainWindowViewModel/>
- </Design.DataContext>
- <StackPanel>
- <DockPanel>
- <Menu DockPanel.Dock="Top">
- <MenuItem Header="_File">
- <MenuItem Header="_Open..."/>
- <Separator/>
- <MenuItem Header="_Exit" PointerPressed="Exit_OnPointerPressed"/>
- </MenuItem>
- <MenuItem Header="_Help">
- <MenuItem Header="_About" PointerPressed="About_OnPointerPressed"/>
- </MenuItem>
- </Menu>
- </DockPanel>
- <Button Name="PlayButton" Width="80" Command="{Binding PlayFunction}" >Play</Button>
- <Button Name="StopButton" Width="80" Command="{Binding StopFunction}">Stop</Button>
- <Button Name="BrowseButton" Width="80" Command="{Binding BrowseFunction }" >Browse</Button>
- <Button Name="ExceptionButton" Width="80" Command="{Binding ExceptionButton}">Exception</Button>
- <Button Name="MessageBoxTest" Width="80" Command="{Binding MsgBoxTest }" >Message Box Test</Button>
- <Slider Name="AudioSlider"/>
- </StackPanel>
-</Window>
diff --git a/Erable/Views/MainWindow.axaml.cs b/Erable/Views/MainWindow.axaml.cs
deleted file mode 100644
index e32cd42..0000000
--- a/Erable/Views/MainWindow.axaml.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-/**********************************************************************
- *
- * Erable: Audio Player
- * Copyright (C) 2021 Alee Productions
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- ************************************************************************/
-using System;
-using Avalonia;
-using Avalonia.Controls;
-using Avalonia.Input;
-using Avalonia.Markup.Xaml;
-
-namespace Erable.Views
-{
- public class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
-#if DEBUG
- this.AttachDevTools();
-#endif
- }
-
- private void InitializeComponent()
- {
- AvaloniaXamlLoader.Load(this);
- }
-
- private void Exit_OnPointerPressed(object? sender, PointerPressedEventArgs e)
- {
- Environment.Exit(0);
- }
-
- private void About_OnPointerPressed(object? sender, PointerPressedEventArgs e)
- {
- About about = new();
- about.ShowDialog(this);
-
- }
- }
-} \ No newline at end of file
diff --git a/Erable/Views/MessageBox.axaml b/Erable/Views/MessageBox.axaml
deleted file mode 100644
index 459817a..0000000
--- a/Erable/Views/MessageBox.axaml
+++ /dev/null
@@ -1,19 +0,0 @@
-<Window xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:vm="using:Erable.ViewModels"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
- x:Class="Erable.Views.MessageBox" SizeToContent="WidthAndHeight" CanResize="False">
- <StackPanel HorizontalAlignment="Center">
- <TextBlock HorizontalAlignment="Center" Name="Text"/>
- <StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Name="Buttons">
- <StackPanel.Styles>
- <Style Selector="Button">
- <Setter Property="Margin" Value="5"/>
- </Style>
- </StackPanel.Styles>
-
- </StackPanel>
- </StackPanel>
-</Window> \ No newline at end of file
diff --git a/Erable/Views/MessageBox.axaml.cs b/Erable/Views/MessageBox.axaml.cs
deleted file mode 100644
index af0ed38..0000000
--- a/Erable/Views/MessageBox.axaml.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-/**********************************************************************
- *
- * Erable: Audio Player
- * Copyright (C) 2021 Alee Productions
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- ************************************************************************/
-using System.Threading.Tasks;
-using Avalonia.Controls;
-using Avalonia.Markup.Xaml;
-
-namespace Erable.Views
-{
- public class MessageBox : Window
- {
- public enum MessageBoxButtons
- {
- Ok,
- OkCancel,
- YesNo,
- YesNoCancel
- }
-
- public enum MessageBoxResult
- {
- Ok,
- Cancel,
- Yes,
- No
- }
-
-
- public MessageBox()
- {
- AvaloniaXamlLoader.Load(this);
- }
-
- public static Task<MessageBoxResult> Show(Window parent, string text, string title, MessageBoxButtons buttons)
- {
- var msgbox = new MessageBox()
- {
- Title = title
- };
- msgbox.FindControl<TextBlock>("Text").Text = text;
- var buttonPanel = msgbox.FindControl<StackPanel>("Buttons");
-
- var res = MessageBoxResult.Ok;
-
- void AddButton(string caption, MessageBoxResult r, bool def = false)
- {
- var btn = new Button {Content = caption};
- btn.Click += (_, __) => {
- res = r;
- msgbox.Close();
- };
- buttonPanel.Children.Add(btn);
- if (def)
- res = r;
- }
-
- if (buttons == MessageBoxButtons.Ok || buttons == MessageBoxButtons.OkCancel)
- AddButton("OK", MessageBoxResult.Ok, true);
- if (buttons == MessageBoxButtons.YesNo || buttons == MessageBoxButtons.YesNoCancel)
- {
- AddButton("Yes", MessageBoxResult.Yes);
- AddButton("No", MessageBoxResult.No, true);
- }
-
- if (buttons == MessageBoxButtons.OkCancel || buttons == MessageBoxButtons.YesNoCancel)
- AddButton("Cancel", MessageBoxResult.Cancel, true);
-
-
- var tcs = new TaskCompletionSource<MessageBoxResult>();
- msgbox.Closed += delegate { tcs.TrySetResult(res); };
- if (parent != null)
- msgbox.ShowDialog(parent);
- else msgbox.Show();
- return tcs.Task;
- }
- }
-} \ No newline at end of file