Skip to content

Commit

Permalink
+ Added interfaces for Audio Devices and Enumeration for them.
Browse files Browse the repository at this point in the history
  • Loading branch information
MineCake147E committed Sep 16, 2019
1 parent a92ab23 commit 010435a
Show file tree
Hide file tree
Showing 6 changed files with 399 additions and 91 deletions.
29 changes: 0 additions & 29 deletions MonoAudio.Core/IO/Capabilities/CapabilityInformation.cs

This file was deleted.

28 changes: 28 additions & 0 deletions MonoAudio.Core/IO/DataFlow.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace MonoAudio.IO
{
/// <summary>
/// Represents a flow kind of audio data.
/// </summary>
[Flags]
public enum DataFlow
{
/// <summary>
/// Invalid.
/// </summary>
None = 0,

/// <summary>
/// Output.
/// </summary>
Render = 1,

/// <summary>
/// Input.
/// </summary>
Capture = 2,
}
}
19 changes: 19 additions & 0 deletions MonoAudio.Core/IO/IAudioDeviceEnumerator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace MonoAudio.IO
{
/// <summary>
/// Defines a base infrastructure of an audio device enumerator.
/// </summary>
public interface IAudioDeviceEnumerator
{
/// <summary>
/// Enumerates devices of specified <paramref name="dataFlow"/>.
/// </summary>
/// <param name="dataFlow">The <see cref="DataFlow"/> kind to enumerate devices of.</param>
/// <returns>The <see cref="IEnumerable{T}"/> of audio devices.</returns>
IEnumerable<IAudioDevice> EnumerateDevices(DataFlow dataFlow);
}
}
19 changes: 19 additions & 0 deletions MonoAudio.Core/IO/IAudioInputDevice.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace MonoAudio.IO
{
/// <summary>
/// Defines a base structure of audio input device.
/// </summary>
public interface IAudioInputDevice : IAudioDevice
{
/// <summary>
/// Indicates whether the audio input device supports a particular stream format.
/// </summary>
/// <param name="format">The format to judge the availability.</param>
/// <returns><c>true</c> if succeeded and the audio device supports the specified stream format.</returns>
bool IsFormatSupported(WaveFormat format);
}
}
19 changes: 19 additions & 0 deletions MonoAudio.Core/IO/IAudioOutputDevice.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace MonoAudio.IO
{
/// <summary>
/// Defines a base structure of audio output device.
/// </summary>
public interface IAudioOutputDevice : IAudioDevice
{
/// <summary>
/// Indicates whether the audio output device supports a particular stream format.
/// </summary>
/// <param name="format">The format to judge the availability.</param>
/// <returns><c>true</c> if succeeded and the audio device supports the specified stream format.</returns>
bool IsFormatSupported(WaveFormat format);
}
}
Loading

0 comments on commit 010435a

Please sign in to comment.