From 5a5fb453305ae43f981b9061fc9444068e493fdc Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 1 Feb 2021 16:29:53 -0500 Subject: It can now play audio! --- Alee Audio Player.csproj | 1 + Alee Audio Player.sln | 34 ++++++++++++++++++++++++++++++++++ ViewModels/MainWindowViewModel.cs | 18 ++++++++++++++++++ Views/MainWindow.axaml | 3 +-- appveyor.yml | 8 ++++++++ 5 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 Alee Audio Player.sln create mode 100644 appveyor.yml diff --git a/Alee Audio Player.csproj b/Alee Audio Player.csproj index 4121966..42dc411 100644 --- a/Alee Audio Player.csproj +++ b/Alee Audio Player.csproj @@ -14,5 +14,6 @@ + diff --git a/Alee Audio Player.sln b/Alee Audio Player.sln new file mode 100644 index 0000000..c735ca0 --- /dev/null +++ b/Alee Audio Player.sln @@ -0,0 +1,34 @@ + +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}") = "Alee Audio Player", "Alee Audio Player.csproj", "{7816A5DD-C5B1-498D-9980-C36458D7465F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + 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 + EndGlobalSection +EndGlobal diff --git a/ViewModels/MainWindowViewModel.cs b/ViewModels/MainWindowViewModel.cs index a604491..e1f86e3 100644 --- a/ViewModels/MainWindowViewModel.cs +++ b/ViewModels/MainWindowViewModel.cs @@ -1,11 +1,29 @@ using System; using System.Collections.Generic; using System.Text; +using Gst; namespace AleeAudioPlayer.ViewModels { public class MainWindowViewModel : ViewModelBase { public string Greeting => "Welcome to Alee 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); + } } } diff --git a/Views/MainWindow.axaml b/Views/MainWindow.axaml index 60d0f4d..dabf29b 100644 --- a/Views/MainWindow.axaml +++ b/Views/MainWindow.axaml @@ -13,8 +13,7 @@ - - + diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..85c77cc --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,8 @@ +version: 1.0.{build} +image: Visual Studio 2019 +before_build: +- cmd: dotnet restore +build: + verbosity: normal +before_deploy: +- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/deploy.ps1')) -- cgit v1.2.3