using Harmonia.Core.Caching;
using Harmonia.Core.Engine;
using Harmonia.Core.Imaging;
using Harmonia.Core.Player;
using Harmonia.Core.Playlists;
using Harmonia.Core.Scanner;
using Harmonia.Core.Tags;
using Microsoft.Extensions.DependencyInjection;

namespace Harmonia.Core.Extensions;

public static class ServiceCollectionExtensions
{
    public static IServiceCollection AddHarmonia(this IServiceCollection services)
    {
        services.AddSingleton<IAudioEngine, BassAudioEngine>();
        services.AddSingleton<IAudioPlayer, AudioPlayer>();
        services.AddSingleton<ITagResolver, TagLibTagResolver>();
        services.AddSingleton<IAudioImageExtractor, AudioImageExtractor>();
        services.AddSingleton<IAudioImageCache, AudioImageMemoryCache>();
        services.AddSingleton<IAudioFileScanner, AudioFileScanner>();
        services.AddSingleton<IPlaylistRepository, PlaylistRepository>();
        services.AddSingleton<IPlaylistManager, PlaylistManager>();

        return services;
    }
}