-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a281a2
commit dff891b
Showing
15 changed files
with
412 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
namespace Hypercube.Client.Audio; | ||
|
||
public readonly struct AudioId(int value) : IEquatable<AudioId> | ||
{ | ||
public static readonly AudioId Invalid = new(-1); | ||
public static readonly AudioId Zero = new(0); | ||
|
||
public readonly int Value = value; | ||
|
||
public bool Equals(AudioId other) | ||
{ | ||
return Value == other.Value; | ||
} | ||
|
||
public override bool Equals(object? obj) | ||
{ | ||
return obj is AudioId id && Equals(id); | ||
} | ||
|
||
public static bool operator ==(AudioId a, AudioId b) | ||
{ | ||
return a.Equals(b); | ||
} | ||
|
||
public static bool operator !=(AudioId a, AudioId b) | ||
{ | ||
return !a.Equals(b); | ||
} | ||
|
||
public static implicit operator int(AudioId id) | ||
{ | ||
return id.Value; | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
return Value; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return $"audio({Value})"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace Hypercube.Client.Audio; | ||
|
||
public readonly struct AudioSettings; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace Hypercube.Client.Audio; | ||
|
||
public sealed class AudioStream | ||
{ | ||
public readonly AudioId Id; | ||
public readonly TimeSpan Length; | ||
|
||
public AudioStream(AudioId id, TimeSpan length) | ||
{ | ||
Id = id; | ||
Length = length; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
9 changes: 4 additions & 5 deletions
9
Hypercube.Client/Audio/IAudio.cs → Hypercube.Client/Audio/IAudioSource.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
Hypercube.Client/Audio/Realisations/OpenAL/ContextExtension.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Hypercube.Client.Audio.Realisations.OpenAL; | ||
|
||
public static class ContextExtension | ||
{ | ||
public const string Eax = "EAX2.0"; | ||
public const string Efx = "ALC_EXT_EFX"; | ||
} |
Oops, something went wrong.