mirror of
https://github.com/Crunchy-DL/Crunchy-Downloader.git
synced 2026-05-15 22:42:17 +00:00
- Added **fallback for sync failures** [#407](https://github.com/Crunchy-DL/Crunchy-Downloader/issues/407) - Added **history setting** to remove non-existent series/episodes on refresh [#420](https://github.com/Crunchy-DL/Crunchy-Downloader/issues/420) - Added **movies to history** - Added **queue persistence** - Changed **download item state handling** - Changed **download item removal processing** - Made small changes to **font detection** - Changed **rate limit error handling** - Fixed issue where **files were not always cleaned up** for removed downloads - Fixed **crash when the queue list was modified** - Fixed **changelog parsing** not handling versions like `vX.X.X.X`, which caused changes to be re-added on every restart
29 lines
No EOL
594 B
C#
29 lines
No EOL
594 B
C#
using System;
|
|
using NetCoreAudio;
|
|
|
|
namespace CRD.Utils;
|
|
|
|
public class AudioPlayer{
|
|
private readonly Player _player;
|
|
private bool _isPlaying;
|
|
|
|
public AudioPlayer(){
|
|
_player = new Player();
|
|
}
|
|
|
|
public async void Play(string path){
|
|
if (_isPlaying){
|
|
Console.WriteLine("Audio is already playing, ignoring duplicate request.");
|
|
return;
|
|
}
|
|
|
|
_isPlaying = true;
|
|
await _player.Play(path);
|
|
_isPlaying = false;
|
|
}
|
|
|
|
public async void Stop(){
|
|
await _player.Stop();
|
|
_isPlaying = false;
|
|
}
|
|
} |