Added logic for tags and audio engine.
This commit is contained in:
9
Harmonia.Core/Engine/AudioPlaybackState.cs
Normal file
9
Harmonia.Core/Engine/AudioPlaybackState.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Harmonia.Core.Engine;
|
||||
|
||||
public enum AudioPlaybackState
|
||||
{
|
||||
Stopped,
|
||||
Playing,
|
||||
Stalled,
|
||||
Paused
|
||||
}
|
||||
22
Harmonia.Core/Engine/IAudioEngine.cs
Normal file
22
Harmonia.Core/Engine/IAudioEngine.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace Harmonia.Core.Engine;
|
||||
|
||||
public interface IAudioEngine
|
||||
{
|
||||
string[] SupportedFormats { get; }
|
||||
string Source { get; }
|
||||
TimeSpan Position { get; set; }
|
||||
TimeSpan Length { get; }
|
||||
float Volume { get; set; }
|
||||
bool CanPause { get; }
|
||||
bool IsMuted { get; set; }
|
||||
AudioPlaybackState State { get; }
|
||||
|
||||
Task<bool> LoadAsync(string fileName);
|
||||
void Play();
|
||||
void Pause();
|
||||
void Stop();
|
||||
|
||||
event EventHandler<PlaybackStoppedEventArgs> PlaybackStopped;
|
||||
event EventHandler StreamFinished;
|
||||
event EventHandler<PlaybackStateChangedEventArgs> StateChanged;
|
||||
}
|
||||
7
Harmonia.Core/Engine/PlaybackStateChangedEventArgs.cs
Normal file
7
Harmonia.Core/Engine/PlaybackStateChangedEventArgs.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Harmonia.Core.Engine;
|
||||
|
||||
public class PlaybackStateChangedEventArgs(AudioPlaybackState oldState, AudioPlaybackState newState) : EventArgs
|
||||
{
|
||||
public AudioPlaybackState OldState { get; } = oldState;
|
||||
public AudioPlaybackState State { get; } = newState;
|
||||
}
|
||||
6
Harmonia.Core/Engine/PlaybackStoppedEventArgs.cs
Normal file
6
Harmonia.Core/Engine/PlaybackStoppedEventArgs.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Harmonia.Core.Engine;
|
||||
|
||||
public class PlaybackStoppedEventArgs(string message) : EventArgs
|
||||
{
|
||||
public string Message { get; } = message;
|
||||
}
|
||||
Reference in New Issue
Block a user