Added logic for tags and audio engine.

This commit is contained in:
2025-02-20 00:01:07 -05:00
parent 2bafd474a0
commit f8cda3105a
20 changed files with 316 additions and 10 deletions

View File

@@ -0,0 +1,43 @@
using Harmonia.Core.Data;
namespace Harmonia.Core.Playlists;
public class PlaylistManager(IRepository<Playlist> playlistRepository) : IPlaylistManager
{
private Playlist? _currentPlaylist;
public Playlist? CurrentPlaylist
{
get
{
return _currentPlaylist;
}
set
{
_currentPlaylist = value;
CurrentPlaylistChanged?.Invoke(this, new());
}
}
public event EventHandler? CurrentPlaylistChanged;
public event EventHandler<PlaylistAddedEventArgs>? PlaylistAdded;
public event EventHandler<PlaylistRemovedEventArgs>? PlaylistRemoved;
public void AddPlaylist()
{
Playlist playlist = new()
{
Name = "New Playlist"
};
playlistRepository.Save(playlist);
PlaylistAdded?.Invoke(this, new(playlist));
}
public void RemovePlaylist(Playlist playlist)
{
playlistRepository.Delete(playlist);
PlaylistRemoved?.Invoke(this, new(playlist));
}
}