using System.Threading;
using Cysharp.Threading.Tasks;
using Darkmatter.Core.Data.Dynamic.Services.Audio;
using Darkmatter.Core.Enums.Services.Audio;
using UnityEngine;

namespace Darkmatter.Core.Contracts.Services.Audio
{
    public interface IAudioService
    {
        AudioHandle Play(in AudioRequest request);
        UniTask InitializeAsync(CancellationToken cancellationToken);
        UniTask<AudioClip> LoadClipFromPath(string path, CancellationToken cancellationToken);
        void Stop(AudioHandle handle, float fadeOutSeconds = 0f);
        void SetPitch(AudioHandle handle, float pitch);
        void SetVolume(AudioHandle handle, float volume01);
        bool IsPlaying(AudioHandle handle);
        void SetChannelPaused(AudioChannel channel, bool paused);
        void SetChannelVolume(AudioChannel channel, float volume01);
        void SetSnapshotWeights(params float[] weights);
        void TransitionSnapshotWeights(float duration, params float[] weights);
    }
}
