diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2021-02-01 16:29:53 -0500 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2021-02-01 16:29:53 -0500 |
| commit | 5a5fb453305ae43f981b9061fc9444068e493fdc (patch) | |
| tree | ed9f08fdd703b66c1672270c44ee282b9ea46386 | |
| parent | 7f5e6c86692f4e1ee5f7f7238baa3c706ced4906 (diff) | |
| download | erable-godot-5a5fb453305ae43f981b9061fc9444068e493fdc.tar.gz erable-godot-5a5fb453305ae43f981b9061fc9444068e493fdc.tar.bz2 erable-godot-5a5fb453305ae43f981b9061fc9444068e493fdc.zip | |
It can now play audio!
| -rw-r--r-- | Alee Audio Player.csproj | 1 | ||||
| -rw-r--r-- | Alee Audio Player.sln | 34 | ||||
| -rw-r--r-- | ViewModels/MainWindowViewModel.cs | 18 | ||||
| -rw-r--r-- | Views/MainWindow.axaml | 3 | ||||
| -rw-r--r-- | appveyor.yml | 8 |
5 files changed, 62 insertions, 2 deletions
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 @@ <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="gstreamer-sharp-netcore" Version="0.0.8" />
</ItemGroup>
</Project>
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 @@ </Design.DataContext>
<StackPanel>
<TextBlock Text="{Binding Greeting}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
-
- <Button Name="PlayButton" Width="50" >Play</Button>
+ <Button Name="PlayButton" Width="50" Command="{Binding PlayFunction}" >Play</Button>
<Button Name="StopButton" Width="50" >Stop</Button>
</StackPanel>
</Window>
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'))
|
