Skip to content

Commit

Permalink
- GUI imporvments.
Browse files Browse the repository at this point in the history
- Bug fixes.
- Conversion performance improvments.
  • Loading branch information
Razmoth committed Oct 24, 2024
1 parent 1df3ef6 commit 932522a
Show file tree
Hide file tree
Showing 33 changed files with 805 additions and 731 deletions.
6 changes: 4 additions & 2 deletions Audio.GUI.Desktop/Audio.GUI.Desktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::IsOSPlatform('Windows'))">
<ItemGroup Condition="$(RuntimeIdentifier.StartsWith('win'))">
<PackageReference Include="VideoLAN.LibVLC.Windows" Version="3.0.21" />

<VlcWindowsX64IncludeFiles Include="libvlc.dll" />
<VlcWindowsX64IncludeFiles Include="libvlccore.dll" />
<VlcWindowsX64IncludeFiles Include="plugins\access\libimem_plugin.dll" />
<VlcWindowsX64IncludeFiles Include="plugins\audio_filter\libaudio_format_plugin.dll" />
<VlcWindowsX64IncludeFiles Include="plugins\audio_filter\libugly_resampler_plugin.dll" />
<VlcWindowsX64IncludeFiles Include="plugins\audio_filter\libtrivial_channel_mixer_plugin.dll" />
<VlcWindowsX64IncludeFiles Include="plugins\audio_output\libmmdevice_plugin.dll" />
<VlcWindowsX64IncludeFiles Include="plugins\audio_output\libwasapi_plugin.dll" />
Expand All @@ -31,6 +32,7 @@
<VlcWindowsX86IncludeFiles Include="libvlccore.dll" />
<VlcWindowsX86IncludeFiles Include="plugins\access\libimem_plugin.dll" />
<VlcWindowsX86IncludeFiles Include="plugins\audio_filter\libaudio_format_plugin.dll" />
<VlcWindowsX86IncludeFiles Include="plugins\audio_filter\libugly_resampler_plugin.dll" />
<VlcWindowsX86IncludeFiles Include="plugins\audio_filter\libtrivial_channel_mixer_plugin.dll" />
<VlcWindowsX86IncludeFiles Include="plugins\audio_output\libmmdevice_plugin.dll" />
<VlcWindowsX86IncludeFiles Include="plugins\audio_output\libwasapi_plugin.dll" />
Expand All @@ -39,7 +41,7 @@
<VlcWindowsX86IncludeFiles Include="plugins\codec\liboggspots_plugin.dll" />
</ItemGroup>

<ItemGroup Condition="$([MSBuild]::IsOSPlatform('OSX'))">
<ItemGroup Condition="$(RuntimeIdentifier.Contains('osx'))">
<PackageReference Include="VideoLAN.LibVLC.Mac" Version="3.1.3.1" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions Audio.GUI/Audio.GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
</ItemGroup>

<ItemGroup>
<Compile Update="Controls\VLCPlayer.axaml.cs">
<DependentUpon>VLCPlayer.axaml</DependentUpon>
<Compile Update="Views\PlayerView.axaml.cs">
<DependentUpon>PlayerView.axaml</DependentUpon>
</Compile>
<Compile Update="Views\EntryView.axaml.cs">
<DependentUpon>EntryView.axaml</DependentUpon>
Expand Down
45 changes: 45 additions & 0 deletions Audio.GUI/Behaviours/FileDropBehaviour.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using Audio.GUI.ViewModels;
using Avalonia.Input;
using Avalonia.Platform.Storage;
using Avalonia.Xaml.Interactions.DragAndDrop;
using System.Collections.Generic;
using System.IO;

namespace Audio.GUI.Behaviours;
public class FileDropBehaviour : DropHandlerBase
{
public override bool Execute(object? sender, DragEventArgs e, object? sourceContext, object? targetContext, object? state)
{
if (targetContext is MainViewModel mainViewModel)
{
List<string> files = [];

foreach(IStorageItem? storageItem in e.Data.GetFiles() ?? [])
{
string? path = storageItem.TryGetLocalPath();
if (!string.IsNullOrWhiteSpace(path))
{
if (Directory.Exists(path))
{
files.AddRange(Directory.GetFiles(path, "*.*", SearchOption.AllDirectories));
}
else if (File.Exists(path))
{
files.Add(path);
}
}
}

_ = mainViewModel.LoadFiles(files);

return true;
}

return false;
}

public override bool Validate(object? sender, DragEventArgs e, object? sourceContext, object? targetContext, object? state)
{
return targetContext is MainViewModel && e.Data.Contains(DataFormats.Files);
}
}
48 changes: 0 additions & 48 deletions Audio.GUI/Behaviours/ScrollToEndOnCollectionChangedBehaviour.cs

This file was deleted.

175 changes: 0 additions & 175 deletions Audio.GUI/Controls/VLCPlayer.axaml.cs

This file was deleted.

1 change: 1 addition & 0 deletions Audio.GUI/Models/EntryTreeNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public override bool HasMatch(string? searchText)
{
foreach (KeyValuePair<FNVID<uint>, HashSet<EventTag>> evt in uintTag.Events)
{
match |= regex.IsMatch(evt.Key.ToString());
foreach (EventTag tag in evt.Value)
{
match |= regex.IsMatch(tag.Type.ToString());
Expand Down
10 changes: 10 additions & 0 deletions Audio.GUI/ViewModels/EntryViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,26 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Audio.GUI.ViewModels;

public partial class EntryViewModel : ViewModelBase
{
private readonly PlayerViewModel _playerViewModel;

[ObservableProperty]
private string infoText = "";

[ObservableProperty]
private Entry? entry;

public PlayerViewModel PlayerViewModel => _playerViewModel;

public EntryViewModel()
{
_playerViewModel = new();
}
partial void OnEntryChanged(Entry? value)
{
if (value != null)
Expand All @@ -39,6 +48,7 @@ partial void OnEntryChanged(Entry? value)
}

InfoText = sb.ToString();
Task.Run(() => _playerViewModel.LoadAudio(value));
}
}
}
Loading

0 comments on commit 932522a

Please sign in to comment.