From c7428fab1c38d29bcc50ee263678504e34d01318 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 1 Feb 2021 22:13:46 -0500 Subject: Moved project files --- .gitignore | 39 ++++++++++++++++++++++++++----- App.axaml | 12 ---------- App.axaml.cs | 29 ----------------------- Assets/avalonia-logo.ico | Bin 176111 -> 0 bytes Erable.csproj | 19 --------------- Erable.sln | 27 +++++++++++---------- Erable/App.axaml | 12 ++++++++++ Erable/App.axaml.cs | 29 +++++++++++++++++++++++ Erable/Assets/avalonia-logo.ico | Bin 0 -> 176111 bytes Erable/Erable.csproj | 19 +++++++++++++++ Erable/Program.cs | 23 ++++++++++++++++++ Erable/ViewLocator.cs | 32 +++++++++++++++++++++++++ Erable/ViewModels/MainWindowViewModel.cs | 36 ++++++++++++++++++++++++++++ Erable/ViewModels/ViewModelBase.cs | 11 +++++++++ Erable/Views/MainWindow.axaml | 20 ++++++++++++++++ Erable/Views/MainWindow.axaml.cs | 22 +++++++++++++++++ Program.cs | 23 ------------------ ViewLocator.cs | 32 ------------------------- ViewModels/MainWindowViewModel.cs | 36 ---------------------------- ViewModels/ViewModelBase.cs | 11 --------- Views/MainWindow.axaml | 20 ---------------- Views/MainWindow.axaml.cs | 22 ----------------- 22 files changed, 250 insertions(+), 224 deletions(-) delete mode 100644 App.axaml delete mode 100644 App.axaml.cs delete mode 100644 Assets/avalonia-logo.ico delete mode 100644 Erable.csproj create mode 100644 Erable/App.axaml create mode 100644 Erable/App.axaml.cs create mode 100644 Erable/Assets/avalonia-logo.ico create mode 100644 Erable/Erable.csproj create mode 100644 Erable/Program.cs create mode 100644 Erable/ViewLocator.cs create mode 100644 Erable/ViewModels/MainWindowViewModel.cs create mode 100644 Erable/ViewModels/ViewModelBase.cs create mode 100644 Erable/Views/MainWindow.axaml create mode 100644 Erable/Views/MainWindow.axaml.cs delete mode 100644 Program.cs delete mode 100644 ViewLocator.cs delete mode 100644 ViewModels/MainWindowViewModel.cs delete mode 100644 ViewModels/ViewModelBase.cs delete mode 100644 Views/MainWindow.axaml delete mode 100644 Views/MainWindow.axaml.cs diff --git a/.gitignore b/.gitignore index d007509..b38e46b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,35 @@ -.idea/ -.vscode/ -.vs/ +# Common IntelliJ Platform excludes + +# User specific +**/.idea/**/workspace.xml +**/.idea/**/tasks.xml +**/.idea/shelf/* +**/.idea/dictionaries +**/.idea/httpRequests/ + +# Sensitive or high-churn files +**/.idea/**/dataSources/ +**/.idea/**/dataSources.ids +**/.idea/**/dataSources.xml +**/.idea/**/dataSources.local.xml +**/.idea/**/sqlDataSources.xml +**/.idea/**/dynamic.xml -bin/ -obj/ +# Rider +# Rider auto-generates .iml files, and contentModel.xml +**/.idea/**/*.iml +**/.idea/**/contentModel.xml +**/.idea/**/modules.xml + +.idea +*.suo +*.user +.vs/ +[Bb]in/ +[Oo]bj/ +_UpgradeReport_Files/ +[Pp]ackages/ -*.user \ No newline at end of file +Thumbs.db +Desktop.ini +.DS_Store diff --git a/App.axaml b/App.axaml deleted file mode 100644 index 992dbfb..0000000 --- a/App.axaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/App.axaml.cs b/App.axaml.cs deleted file mode 100644 index addd072..0000000 --- a/App.axaml.cs +++ /dev/null @@ -1,29 +0,0 @@ -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() - { - 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/Assets/avalonia-logo.ico b/Assets/avalonia-logo.ico deleted file mode 100644 index da8d49f..0000000 Binary files a/Assets/avalonia-logo.ico and /dev/null differ diff --git a/Erable.csproj b/Erable.csproj deleted file mode 100644 index b10f530..0000000 --- a/Erable.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - WinExe - net5.0 - enable - Erable - - - - - - - - - - - - - diff --git a/Erable.sln b/Erable.sln index f83cfd0..10bcb06 100644 --- a/Erable.sln +++ b/Erable.sln @@ -3,8 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26124.0 MinimumVisualStudioVersion = 15.0.26124.0 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Erable", "Erable.csproj", "{7816A5DD-C5B1-498D-9980-C36458D7465F}" - +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Erable", "Erable\Erable.csproj", "{2A160FE3-0D4C-4834-A5CF-FE87930E31B2}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -19,17 +18,17 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7816A5DD-C5B1-498D-9980-C36458D7465F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7816A5DD-C5B1-498D-9980-C36458D7465F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7816A5DD-C5B1-498D-9980-C36458D7465F}.Debug|x64.ActiveCfg = Debug|Any CPU - {7816A5DD-C5B1-498D-9980-C36458D7465F}.Debug|x64.Build.0 = Debug|Any CPU - {7816A5DD-C5B1-498D-9980-C36458D7465F}.Debug|x86.ActiveCfg = Debug|Any CPU - {7816A5DD-C5B1-498D-9980-C36458D7465F}.Debug|x86.Build.0 = Debug|Any CPU - {7816A5DD-C5B1-498D-9980-C36458D7465F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7816A5DD-C5B1-498D-9980-C36458D7465F}.Release|Any CPU.Build.0 = Release|Any CPU - {7816A5DD-C5B1-498D-9980-C36458D7465F}.Release|x64.ActiveCfg = Release|Any CPU - {7816A5DD-C5B1-498D-9980-C36458D7465F}.Release|x64.Build.0 = Release|Any CPU - {7816A5DD-C5B1-498D-9980-C36458D7465F}.Release|x86.ActiveCfg = Release|Any CPU - {7816A5DD-C5B1-498D-9980-C36458D7465F}.Release|x86.Build.0 = Release|Any CPU + {2A160FE3-0D4C-4834-A5CF-FE87930E31B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2A160FE3-0D4C-4834-A5CF-FE87930E31B2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2A160FE3-0D4C-4834-A5CF-FE87930E31B2}.Debug|x64.ActiveCfg = Debug|Any CPU + {2A160FE3-0D4C-4834-A5CF-FE87930E31B2}.Debug|x64.Build.0 = Debug|Any CPU + {2A160FE3-0D4C-4834-A5CF-FE87930E31B2}.Debug|x86.ActiveCfg = Debug|Any CPU + {2A160FE3-0D4C-4834-A5CF-FE87930E31B2}.Debug|x86.Build.0 = Debug|Any CPU + {2A160FE3-0D4C-4834-A5CF-FE87930E31B2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2A160FE3-0D4C-4834-A5CF-FE87930E31B2}.Release|Any CPU.Build.0 = Release|Any CPU + {2A160FE3-0D4C-4834-A5CF-FE87930E31B2}.Release|x64.ActiveCfg = Release|Any CPU + {2A160FE3-0D4C-4834-A5CF-FE87930E31B2}.Release|x64.Build.0 = Release|Any CPU + {2A160FE3-0D4C-4834-A5CF-FE87930E31B2}.Release|x86.ActiveCfg = Release|Any CPU + {2A160FE3-0D4C-4834-A5CF-FE87930E31B2}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/Erable/App.axaml b/Erable/App.axaml new file mode 100644 index 0000000..992dbfb --- /dev/null +++ b/Erable/App.axaml @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/Erable/App.axaml.cs b/Erable/App.axaml.cs new file mode 100644 index 0000000..addd072 --- /dev/null +++ b/Erable/App.axaml.cs @@ -0,0 +1,29 @@ +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() + { + 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 new file mode 100644 index 0000000..da8d49f Binary files /dev/null and b/Erable/Assets/avalonia-logo.ico differ diff --git a/Erable/Erable.csproj b/Erable/Erable.csproj new file mode 100644 index 0000000..b10f530 --- /dev/null +++ b/Erable/Erable.csproj @@ -0,0 +1,19 @@ + + + WinExe + net5.0 + enable + Erable + + + + + + + + + + + + + diff --git a/Erable/Program.cs b/Erable/Program.cs new file mode 100644 index 0000000..312bbb4 --- /dev/null +++ b/Erable/Program.cs @@ -0,0 +1,23 @@ +using System; +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +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) => BuildAvaloniaApp() + .StartWithClassicDesktopLifetime(args); + + // Avalonia configuration, don't remove; also used by visual designer. + public static AppBuilder BuildAvaloniaApp() + => AppBuilder.Configure() + .UsePlatformDetect() + .LogToTrace() + .UseReactiveUI(); + } +} diff --git a/Erable/ViewLocator.cs b/Erable/ViewLocator.cs new file mode 100644 index 0000000..0a6eb01 --- /dev/null +++ b/Erable/ViewLocator.cs @@ -0,0 +1,32 @@ +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 new file mode 100644 index 0000000..0c51fbd --- /dev/null +++ b/Erable/ViewModels/MainWindowViewModel.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Avalonia.Controls; +using Gst; + +namespace Erable.ViewModels +{ + public class MainWindowViewModel : ViewModelBase + { + public string Greeting => "Welcome to Erable Audio Player!"; + + public void PlayFunction(string[] args) + { + Application.Init(ref args); + // Build the pipeline + var pipeline = Parse.Launch("playbin uri=file:///home/andrew/Music/4616-werq-by-kevin-macleod.mp3"); + + // Start playing + pipeline.SetState(State.Playing); + + // Wait until error or EOS + var bus = pipeline.Bus; + var msg = bus.TimedPopFiltered (Constants.CLOCK_TIME_NONE, MessageType.Eos | MessageType.Error); + + // Free resources + //pipeline.SetState (State.Null); + } + + public void BrowseFunction() + { + //OpenFileDialog dialog = new OpenFileDialog(); + //dialog.Filters.Add(new FileDialogFilter() {Name = "Audio Files", Extensions = {"mp3"}}); + } + } +} diff --git a/Erable/ViewModels/ViewModelBase.cs b/Erable/ViewModels/ViewModelBase.cs new file mode 100644 index 0000000..6ab8d21 --- /dev/null +++ b/Erable/ViewModels/ViewModelBase.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; +using ReactiveUI; + +namespace Erable.ViewModels +{ + public class ViewModelBase : ReactiveObject + { + } +} diff --git a/Erable/Views/MainWindow.axaml b/Erable/Views/MainWindow.axaml new file mode 100644 index 0000000..6bb4cd1 --- /dev/null +++ b/Erable/Views/MainWindow.axaml @@ -0,0 +1,20 @@ + + + + + + + + + + + + diff --git a/Erable/Views/MainWindow.axaml.cs b/Erable/Views/MainWindow.axaml.cs new file mode 100644 index 0000000..814bc0f --- /dev/null +++ b/Erable/Views/MainWindow.axaml.cs @@ -0,0 +1,22 @@ +using Avalonia; +using Avalonia.Controls; +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); + } + } +} \ No newline at end of file diff --git a/Program.cs b/Program.cs deleted file mode 100644 index 312bbb4..0000000 --- a/Program.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using Avalonia; -using Avalonia.Controls.ApplicationLifetimes; -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) => BuildAvaloniaApp() - .StartWithClassicDesktopLifetime(args); - - // Avalonia configuration, don't remove; also used by visual designer. - public static AppBuilder BuildAvaloniaApp() - => AppBuilder.Configure() - .UsePlatformDetect() - .LogToTrace() - .UseReactiveUI(); - } -} diff --git a/ViewLocator.cs b/ViewLocator.cs deleted file mode 100644 index 0a6eb01..0000000 --- a/ViewLocator.cs +++ /dev/null @@ -1,32 +0,0 @@ -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/ViewModels/MainWindowViewModel.cs b/ViewModels/MainWindowViewModel.cs deleted file mode 100644 index 0c51fbd..0000000 --- a/ViewModels/MainWindowViewModel.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Avalonia.Controls; -using Gst; - -namespace Erable.ViewModels -{ - public class MainWindowViewModel : ViewModelBase - { - public string Greeting => "Welcome to Erable Audio Player!"; - - public void PlayFunction(string[] args) - { - Application.Init(ref args); - // Build the pipeline - var pipeline = Parse.Launch("playbin uri=file:///home/andrew/Music/4616-werq-by-kevin-macleod.mp3"); - - // Start playing - pipeline.SetState(State.Playing); - - // Wait until error or EOS - var bus = pipeline.Bus; - var msg = bus.TimedPopFiltered (Constants.CLOCK_TIME_NONE, MessageType.Eos | MessageType.Error); - - // Free resources - //pipeline.SetState (State.Null); - } - - public void BrowseFunction() - { - //OpenFileDialog dialog = new OpenFileDialog(); - //dialog.Filters.Add(new FileDialogFilter() {Name = "Audio Files", Extensions = {"mp3"}}); - } - } -} diff --git a/ViewModels/ViewModelBase.cs b/ViewModels/ViewModelBase.cs deleted file mode 100644 index 6ab8d21..0000000 --- a/ViewModels/ViewModelBase.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using ReactiveUI; - -namespace Erable.ViewModels -{ - public class ViewModelBase : ReactiveObject - { - } -} diff --git a/Views/MainWindow.axaml b/Views/MainWindow.axaml deleted file mode 100644 index d580753..0000000 --- a/Views/MainWindow.axaml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - diff --git a/Views/MainWindow.axaml.cs b/Views/MainWindow.axaml.cs deleted file mode 100644 index 814bc0f..0000000 --- a/Views/MainWindow.axaml.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Avalonia; -using Avalonia.Controls; -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); - } - } -} \ No newline at end of file -- cgit v1.2.3