From ec48a838c72d6c32c2d3580c4afd7ee3cd347ca6 Mon Sep 17 00:00:00 2001 From: "SND\\AstrorEnales_cp" Date: Sun, 12 Feb 2012 13:00:17 +0000 Subject: [PATCH] Cleaned and formatted all the Audio namespace files --- ANX.Framework/Audio/AudioCategory.cs | 133 ++++++------ ANX.Framework/Audio/AudioChannels.cs | 17 +- ANX.Framework/Audio/AudioEngine.cs | 125 +++++++----- ANX.Framework/Audio/Cue.cs | 190 +++++++++++++----- .../Audio/DynamicSoundEffectInstance.cs | 35 +++- .../Audio/InstancePlayLimitException.cs | 4 +- ANX.Framework/Audio/Microphone.cs | 146 ++++++++++---- ANX.Framework/Audio/MicrophoneState.cs | 17 +- .../Audio/NoAudioHardwareException.cs | 39 ++-- .../Audio/NoMicrophoneConnectedException.cs | 36 ++-- ANX.Framework/Audio/SoundBank.cs | 107 ++++++---- ANX.Framework/Audio/SoundState.cs | 19 +- ANX.Framework/Audio/WaveBank.cs | 93 ++++++--- 13 files changed, 607 insertions(+), 354 deletions(-) diff --git a/ANX.Framework/Audio/AudioCategory.cs b/ANX.Framework/Audio/AudioCategory.cs index 12ef257a..1e544f21 100644 --- a/ANX.Framework/Audio/AudioCategory.cs +++ b/ANX.Framework/Audio/AudioCategory.cs @@ -1,7 +1,4 @@ -#region Using Statements -using System; - -#endregion // Using Statements +using System; #region License @@ -52,70 +49,88 @@ using System; namespace ANX.Framework.Audio { - public struct AudioCategory : IEquatable - { + public struct AudioCategory : IEquatable + { + #region Public + public string Name + { + get + { + throw new NotImplementedException(); + } + } + #endregion - public void Pause() - { - throw new NotImplementedException(); - } + #region Pause + public void Pause() + { + throw new NotImplementedException(); + } + #endregion - public void Resume() - { - throw new NotImplementedException(); - } + #region Resume + public void Resume() + { + throw new NotImplementedException(); + } + #endregion - public void SetVolume(float volume) - { - throw new NotImplementedException(); - } + #region SetVolume + public void SetVolume(float volume) + { + throw new NotImplementedException(); + } + #endregion - public void Stop(AudioStopOptions options) - { - throw new NotImplementedException(); - } + #region Stop + public void Stop(AudioStopOptions options) + { + throw new NotImplementedException(); + } + #endregion - public string Name - { - get - { - throw new NotImplementedException(); - } - } + #region GetHashCode + public override int GetHashCode() + { + throw new NotImplementedException(); + } + #endregion - public override int GetHashCode() - { - throw new NotImplementedException(); - } + #region ToString + public override string ToString() + { + throw new NotImplementedException(); + } + #endregion - public override string ToString() - { - throw new NotImplementedException(); - } + #region Equals + public override bool Equals(object obj) + { + if (obj != null && + obj is AudioCategory) + { + return this == (AudioCategory)obj; + } - public override bool Equals(object obj) - { - if (obj != null && obj.GetType() == this.GetType()) - { - return this == (AudioCategory)obj; - } + return false; + } - return false; - } + public bool Equals(AudioCategory other) + { + return this == other; + } + #endregion - public bool Equals(AudioCategory other) - { - return this == other; - } + #region Equality + public static bool operator ==(AudioCategory lhs, AudioCategory rhs) + { + throw new NotImplementedException(); + } - public static bool operator ==(AudioCategory lhs, AudioCategory rhs) - { - throw new NotImplementedException(); - } - - public static bool operator !=(AudioCategory lhs, AudioCategory rhs) - { - throw new NotImplementedException(); - } - } + public static bool operator !=(AudioCategory lhs, AudioCategory rhs) + { + throw new NotImplementedException(); + } + #endregion + } } diff --git a/ANX.Framework/Audio/AudioChannels.cs b/ANX.Framework/Audio/AudioChannels.cs index f38d1057..f7e75690 100644 --- a/ANX.Framework/Audio/AudioChannels.cs +++ b/ANX.Framework/Audio/AudioChannels.cs @@ -1,7 +1,4 @@ -#region Using Statements -using System; - -#endregion // Using Statements +using System; #region License @@ -52,10 +49,10 @@ using System; namespace ANX.Framework.Audio { - [Flags] - public enum AudioChannels - { - Mono = 1, - Stereo = 2, - } + [Flags] + public enum AudioChannels + { + Mono = 1, + Stereo = 2, + } } diff --git a/ANX.Framework/Audio/AudioEngine.cs b/ANX.Framework/Audio/AudioEngine.cs index 4c339399..cc3a6b6d 100644 --- a/ANX.Framework/Audio/AudioEngine.cs +++ b/ANX.Framework/Audio/AudioEngine.cs @@ -1,10 +1,6 @@ -#region Using Statements -using System; -using System.IO; +using System; using System.Collections.ObjectModel; -#endregion // Using Statements - #region License // @@ -54,53 +50,90 @@ using System.Collections.ObjectModel; namespace ANX.Framework.Audio { - public class AudioEngine : IDisposable - { - public const int ContentVersion = 0x27; + public class AudioEngine : IDisposable + { + #region Constants + public const int ContentVersion = 0x27; + #endregion + #region Events + public event EventHandler Disposing; + #endregion - public AudioEngine(string settingsFile) - { + #region Public + public bool IsDisposed + { + get + { + throw new NotImplementedException(); + } + } - } - public AudioEngine(string settingsFile, TimeSpan lookAheadTime, string rendererId) - { + public ReadOnlyCollection RendererDetails + { + get + { + throw new NotImplementedException(); + } + } + #endregion - } + #region Constructor + public AudioEngine(string settingsFile) + { + throw new NotImplementedException(); + } - public bool IsDisposed { get { throw new NotImplementedException(); } } - public ReadOnlyCollection RendererDetails { get { throw new NotImplementedException(); } } + public AudioEngine(string settingsFile, TimeSpan lookAheadTime, + string rendererId) + { + throw new NotImplementedException(); + } - public AudioCategory GetCategory(string name) - { - throw new NotImplementedException(); - } - public float GetGlobalVariable(string name) - { - throw new NotImplementedException(); - } - public void SetGlobalVariable(string name, float value) - { - throw new NotImplementedException(); - } - public void Update () - { - throw new NotImplementedException(); - } + ~AudioEngine() + { + Dispose(); + } + #endregion - ~AudioEngine() - { - throw new NotImplementedException(); - } - protected virtual void Dispose ( bool disposing) - { - throw new NotImplementedException(); - } + #region GetCategory + public AudioCategory GetCategory(string name) + { + throw new NotImplementedException(); + } + #endregion - public void Dispose() - { - throw new NotImplementedException(); - } - public event EventHandler Disposing; - } + #region GetGlobalVariable + public float GetGlobalVariable(string name) + { + throw new NotImplementedException(); + } + #endregion + + #region SetGlobalVariable + public void SetGlobalVariable(string name, float value) + { + throw new NotImplementedException(); + } + #endregion + + #region Update + public void Update() + { + throw new NotImplementedException(); + } + #endregion + + #region Dispose + protected virtual void Dispose(bool disposing) + { + throw new NotImplementedException(); + } + + public void Dispose() + { + throw new NotImplementedException(); + } + #endregion + } } diff --git a/ANX.Framework/Audio/Cue.cs b/ANX.Framework/Audio/Cue.cs index feba6858..969aa879 100644 --- a/ANX.Framework/Audio/Cue.cs +++ b/ANX.Framework/Audio/Cue.cs @@ -1,8 +1,4 @@ -#region Using Statements -using System; -using System.IO; - -#endregion // Using Statements +using System; #region License @@ -53,57 +49,147 @@ using System.IO; namespace ANX.Framework.Audio { - public sealed class Cue : IDisposable - { - public bool IsCreated { get { throw new NotImplementedException(); } } - public bool IsDisposed { get { throw new NotImplementedException(); } } - public bool IsPaused { get { throw new NotImplementedException(); } } - public bool IsPlaying { get { throw new NotImplementedException(); } } - public bool IsPrepared { get { throw new NotImplementedException(); } } - public bool IsPreparing { get { throw new NotImplementedException(); } } - public bool IsStopped { get { throw new NotImplementedException(); } } - public bool IsStopping { get { throw new NotImplementedException(); } } - public string Name { get { throw new NotImplementedException(); } } + public sealed class Cue : IDisposable + { + #region Events + public event EventHandler Disposing; + #endregion + #region Public + public bool IsCreated + { + get + { + throw new NotImplementedException(); + } + } - public event EventHandler Disposing; + public bool IsDisposed + { + get + { + throw new NotImplementedException(); + } + } - public void Apply3D(AudioListener listener, AudioEmitter emitter) - { + public bool IsPaused + { + get + { + throw new NotImplementedException(); + } + } - } - public float GetVariable(string name) - { - throw new NotImplementedException(); - } - public void Pause () - { - throw new NotImplementedException(); - } - public void Play () - { - throw new NotImplementedException(); - } - public void Resume () - { - throw new NotImplementedException(); - } - public void SetVariable(string name, float value) - { - throw new NotImplementedException(); - } - public void Stop(AudioStopOptions options) - { - throw new NotImplementedException(); - } + public bool IsPlaying + { + get + { + throw new NotImplementedException(); + } + } - ~Cue() - { + public bool IsPrepared + { + get + { + throw new NotImplementedException(); + } + } - } - public void Dispose() - { - throw new NotImplementedException(); - } - } + public bool IsPreparing + { + get + { + throw new NotImplementedException(); + } + } + + public bool IsStopped + { + get + { + throw new NotImplementedException(); + } + } + + public bool IsStopping + { + get + { + throw new NotImplementedException(); + } + } + + public string Name + { + get + { + throw new NotImplementedException(); + } + } + #endregion + + #region Constructor + ~Cue() + { + Dispose(); + } + #endregion + + #region Apply3D + public void Apply3D(AudioListener listener, AudioEmitter emitter) + { + throw new NotImplementedException(); + } + #endregion + + #region SetVariable + public void SetVariable(string name, float value) + { + throw new NotImplementedException(); + } + #endregion + + #region GetVariable + public float GetVariable(string name) + { + throw new NotImplementedException(); + } + #endregion + + #region Pause + public void Pause() + { + throw new NotImplementedException(); + } + #endregion + + #region Play + public void Play() + { + throw new NotImplementedException(); + } + #endregion + + #region Resume + public void Resume() + { + throw new NotImplementedException(); + } + #endregion + + #region Stop + public void Stop(AudioStopOptions options) + { + throw new NotImplementedException(); + } + #endregion + + #region Dispose + public void Dispose() + { + throw new NotImplementedException(); + } + #endregion + } } diff --git a/ANX.Framework/Audio/DynamicSoundEffectInstance.cs b/ANX.Framework/Audio/DynamicSoundEffectInstance.cs index d6c3020e..dedcf695 100644 --- a/ANX.Framework/Audio/DynamicSoundEffectInstance.cs +++ b/ANX.Framework/Audio/DynamicSoundEffectInstance.cs @@ -1,8 +1,4 @@ -#region Using Statements -using System; -using System.IO; - -#endregion // Using Statements +using System; #region License @@ -51,18 +47,15 @@ using System.IO; #endregion // License - namespace ANX.Framework.Audio { public sealed class DynamicSoundEffectInstance : SoundEffectInstance { + #region Events public event EventHandler BufferNeeded; + #endregion - public DynamicSoundEffectInstance(int sampleRate, AudioChannels channels) - { - throw new NotImplementedException(); - } - + #region Public public override bool IsLooped { get @@ -82,35 +75,55 @@ namespace ANX.Framework.Audio throw new NotImplementedException(); } } + #endregion + #region Constructor + public DynamicSoundEffectInstance(int sampleRate, AudioChannels channels) + { + throw new NotImplementedException(); + } + #endregion + + #region GetSampleDuration public TimeSpan GetSampleDuration(int sizeInBytes) { throw new NotImplementedException(); } + #endregion + #region GetSampleSizeInBytes public int GetSampleSizeInBytes(TimeSpan duration) { throw new NotImplementedException(); } + #endregion + #region Play public override void Play() { throw new NotImplementedException(); } + #endregion + #region SubmitBuffer public void SubmitBuffer(byte[] buffer) { throw new NotImplementedException(); } + #endregion + #region SubmitBuffer public void SubmitBuffer(byte[] buffer, int offset, int count) { throw new NotImplementedException(); } + #endregion + #region Dispose protected override void Dispose(bool disposing) { throw new NotImplementedException(); } + #endregion } } diff --git a/ANX.Framework/Audio/InstancePlayLimitException.cs b/ANX.Framework/Audio/InstancePlayLimitException.cs index bdcb11af..7124b356 100644 --- a/ANX.Framework/Audio/InstancePlayLimitException.cs +++ b/ANX.Framework/Audio/InstancePlayLimitException.cs @@ -63,8 +63,8 @@ namespace ANX.Framework.Audio { } - public InstancePlayLimitException(string message, Exception inner) - : base(message, inner) + public InstancePlayLimitException(string message, Exception innerException) + : base(message, innerException) { } #endregion diff --git a/ANX.Framework/Audio/Microphone.cs b/ANX.Framework/Audio/Microphone.cs index 6c670885..5fe91544 100644 --- a/ANX.Framework/Audio/Microphone.cs +++ b/ANX.Framework/Audio/Microphone.cs @@ -1,9 +1,6 @@ -#region Using Statements -using System; +using System; using System.Collections.ObjectModel; -#endregion // Using Statements - #region License // @@ -51,48 +48,111 @@ using System.Collections.ObjectModel; #endregion // License - namespace ANX.Framework.Audio { - public sealed class Microphone - { - public readonly string Name; - public static ReadOnlyCollection All { get { throw new NotImplementedException(); } } - public TimeSpan BufferDuration { get; set; } - public static Microphone Default { get { throw new NotImplementedException(); } } - public bool IsHeadset { get { throw new NotImplementedException(); } } - public int SampleRate { get { throw new NotImplementedException(); } } - public MicrophoneState State { get { throw new NotImplementedException(); } } - public event EventHandler BufferReady; + public sealed class Microphone + { + #region Events + public event EventHandler BufferReady; + #endregion - public void Stop () - { - - } + #region Public + public readonly string Name; - public void Start () - { + public static ReadOnlyCollection All + { + get + { + throw new NotImplementedException(); + } + } - } - public int GetSampleSizeInBytes (TimeSpan duration) - { - throw new NotImplementedException(); - } - public TimeSpan GetSampleDuration (int sizeInBytes) - { - throw new NotImplementedException(); - } - public int GetData(byte[] buffer) - { - throw new NotImplementedException(); - } - public int GetData(byte[] buffer, int offset, int count) - { - throw new NotImplementedException(); - } - ~Microphone() - { - throw new NotImplementedException(); - } - } + public TimeSpan BufferDuration + { + get; + set; + } + + public static Microphone Default + { + get + { + throw new NotImplementedException(); + } + } + + public bool IsHeadset + { + get + { + throw new NotImplementedException(); + } + } + + public int SampleRate + { + get + { + throw new NotImplementedException(); + } + } + + public MicrophoneState State + { + get + { + throw new NotImplementedException(); + } + } + #endregion + + #region Constructor + ~Microphone() + { + throw new NotImplementedException(); + } + #endregion + + #region Stop + public void Stop() + { + throw new NotImplementedException(); + } + #endregion + + #region Start + public void Start() + { + throw new NotImplementedException(); + } + #endregion + + #region GetSampleSizeInBytes + public int GetSampleSizeInBytes(TimeSpan duration) + { + throw new NotImplementedException(); + } + #endregion + + #region GetSampleDuration + public TimeSpan GetSampleDuration(int sizeInBytes) + { + throw new NotImplementedException(); + } + #endregion + + #region GetData + public int GetData(byte[] buffer) + { + throw new NotImplementedException(); + } + #endregion + + #region GetData + public int GetData(byte[] buffer, int offset, int count) + { + throw new NotImplementedException(); + } + #endregion + } } diff --git a/ANX.Framework/Audio/MicrophoneState.cs b/ANX.Framework/Audio/MicrophoneState.cs index aa8737e2..37c3a30b 100644 --- a/ANX.Framework/Audio/MicrophoneState.cs +++ b/ANX.Framework/Audio/MicrophoneState.cs @@ -1,9 +1,4 @@ -#region Using Statements -using System; - -#endregion // Using Statements - -#region License +#region License // // This file is part of the ANX.Framework created by the "ANX.Framework developer group". @@ -52,9 +47,9 @@ using System; namespace ANX.Framework.Audio { - public enum MicrophoneState - { - Started, - Stopped, - } + public enum MicrophoneState + { + Started, + Stopped, + } } diff --git a/ANX.Framework/Audio/NoAudioHardwareException.cs b/ANX.Framework/Audio/NoAudioHardwareException.cs index 026ad0ae..3733fd8d 100644 --- a/ANX.Framework/Audio/NoAudioHardwareException.cs +++ b/ANX.Framework/Audio/NoAudioHardwareException.cs @@ -1,10 +1,6 @@ -#region Using Statements -using System; -using System.IO; +using System; using System.Runtime.InteropServices; -#endregion // Using Statements - #region License // @@ -51,24 +47,25 @@ using System.Runtime.InteropServices; // particular purpose and non-infringement. #endregion // License + namespace ANX.Framework.Audio { - [SerializableAttribute] - public sealed class NoAudioHardwareException : ExternalException - { - public NoAudioHardwareException() - { + [SerializableAttribute] + public sealed class NoAudioHardwareException : ExternalException + { + public NoAudioHardwareException() + : base() + { + } - } - public NoAudioHardwareException(string message) - { + public NoAudioHardwareException(string message) + : base(message) + { + } - } - public NoAudioHardwareException(string message, Exception inner) - { - - } - - - } + public NoAudioHardwareException(string message, Exception innerException) + : base(message, innerException) + { + } + } } diff --git a/ANX.Framework/Audio/NoMicrophoneConnectedException.cs b/ANX.Framework/Audio/NoMicrophoneConnectedException.cs index d395f8b6..c059d829 100644 --- a/ANX.Framework/Audio/NoMicrophoneConnectedException.cs +++ b/ANX.Framework/Audio/NoMicrophoneConnectedException.cs @@ -1,8 +1,4 @@ -#region Using Statements -using System; -using System.IO; - -#endregion // Using Statements +using System; #region License @@ -51,23 +47,23 @@ using System.IO; #endregion // License - namespace ANX.Framework.Audio { - public sealed class NoMicrophoneConnectedException : Exception - { - public NoMicrophoneConnectedException() - { + public sealed class NoMicrophoneConnectedException : Exception + { + public NoMicrophoneConnectedException() + : base() + { + } - } - public NoMicrophoneConnectedException(string message) - { + public NoMicrophoneConnectedException(string message) + : base(message) + { + } - } - public NoMicrophoneConnectedException(string message, Exception inner) - { - - } - - } + public NoMicrophoneConnectedException(string message, Exception innerException) + : base(message, innerException) + { + } + } } diff --git a/ANX.Framework/Audio/SoundBank.cs b/ANX.Framework/Audio/SoundBank.cs index 451b1b6d..6df271c5 100644 --- a/ANX.Framework/Audio/SoundBank.cs +++ b/ANX.Framework/Audio/SoundBank.cs @@ -1,8 +1,4 @@ -#region Using Statements -using System; -using System.IO; - -#endregion // Using Statements +using System; #region License @@ -53,42 +49,77 @@ using System.IO; namespace ANX.Framework.Audio { - public class SoundBank : IDisposable - { - public SoundBank(AudioEngine audioEngine, string filename) - { + public class SoundBank : IDisposable + { + #region Events + public event EventHandler Disposing; + #endregion + + #region Public + public bool IsDisposed + { + get; + private set; + } - } - public bool IsDisposed { get { throw new NotImplementedException(); } } - public bool IsInUse { get { throw new NotImplementedException(); } } + public bool IsInUse + { + get + { + throw new NotImplementedException(); + } + } + #endregion + + #region Constructor + public SoundBank(AudioEngine audioEngine, string filename) + { + throw new NotImplementedException(); + } - public event EventHandler Disposing; + ~SoundBank() + { + Dispose(); + } + #endregion + #region GetCue + public Cue GetCue(string name) + { + throw new NotImplementedException(); + } + #endregion - public Cue GetCue(string name) - { - throw new NotImplementedException(); - } - public void PlayCue(string name) - { - throw new NotImplementedException(); - } - public void PlayCue(string name, AudioListener listener, AudioEmitter emitter) - { - throw new NotImplementedException(); - } + #region PlayCue + public void PlayCue(string name) + { + throw new NotImplementedException(); + } + #endregion - ~SoundBank() - { - throw new NotImplementedException(); - } - public void Dispose() - { - throw new NotImplementedException(); - } - protected virtual void Dispose(bool disposing) - { - throw new NotImplementedException(); - } - } + #region PlayCue + public void PlayCue(string name, AudioListener listener, AudioEmitter emitter) + { + throw new NotImplementedException(); + } + #endregion + + #region Dispose + public void Dispose() + { + Dispose(true); + } + + protected virtual void Dispose(bool disposing) + { + if (IsDisposed) + { + return; + } + + IsDisposed = true; + throw new NotImplementedException(); + } + #endregion + } } diff --git a/ANX.Framework/Audio/SoundState.cs b/ANX.Framework/Audio/SoundState.cs index 10b2807e..8066b2e0 100644 --- a/ANX.Framework/Audio/SoundState.cs +++ b/ANX.Framework/Audio/SoundState.cs @@ -1,7 +1,4 @@ -#region Using Statements -using System; - -#endregion // Using Statements +using System; #region License @@ -52,11 +49,11 @@ using System; namespace ANX.Framework.Audio { - [Flags] - public enum SoundState - { - Playing = 0, - Paused = 1, - Stopped = 2, - } + [Flags] + public enum SoundState + { + Playing = 0, + Paused = 1, + Stopped = 2, + } } diff --git a/ANX.Framework/Audio/WaveBank.cs b/ANX.Framework/Audio/WaveBank.cs index 72e9d411..cb762e5f 100644 --- a/ANX.Framework/Audio/WaveBank.cs +++ b/ANX.Framework/Audio/WaveBank.cs @@ -1,8 +1,4 @@ -#region Using Statements -using System; -using System.Collections.ObjectModel; - -#endregion // Using Statements +using System; #region License @@ -53,33 +49,70 @@ using System.Collections.ObjectModel; namespace ANX.Framework.Audio { - public class WaveBank : IDisposable - { - public WaveBank(AudioEngine audioEngine, string nonStreamingWaveBankFilename) - { + public class WaveBank : IDisposable + { + #region Events + public event EventHandler Disposing; + #endregion - } - public WaveBank(AudioEngine audioEngine, string streamingWaveBankFilename, int offset, short packetsize) - { + #region Public + public bool IsDisposed + { + get; + private set; + } - } - public bool IsDisposed { get { throw new NotImplementedException(); } } - public bool IsInUse { get { throw new NotImplementedException(); } } - public bool IsPrepared { get { throw new NotImplementedException(); } } + public bool IsInUse + { + get + { + throw new NotImplementedException(); + } + } + public bool IsPrepared + { + get + { + throw new NotImplementedException(); + } + } + #endregion - ~WaveBank() - { - throw new NotImplementedException(); - } - public void Dispose() - { - throw new NotImplementedException(); - } - protected virtual void Dispose(bool disposing) - { - throw new NotImplementedException(); - } - public event EventHandler Disposing; - } + #region Constructor + public WaveBank(AudioEngine audioEngine, string nonStreamingWaveBankFilename) + { + + } + public WaveBank(AudioEngine audioEngine, string streamingWaveBankFilename, + int offset, short packetsize) + { + + } + + ~WaveBank() + { + Dispose(); + } + #endregion + + #region Dispose + public void Dispose() + { + Dispose(true); + } + + protected virtual void Dispose(bool disposing) + { + if (IsDisposed) + { + return; + } + + IsDisposed = true; + + throw new NotImplementedException(); + } + #endregion + } }