Formatting pass

main
cosmonaut 2022-02-22 21:14:32 -08:00
parent 7a754e1c90
commit 26dc361d31
10 changed files with 912 additions and 910 deletions

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using MoonWorks.Math; using MoonWorks.Math;

View File

@ -1,4 +1,4 @@
using System; using System;
using MoonWorks.Math; using MoonWorks.Math;
namespace MoonWorks.Audio namespace MoonWorks.Audio

View File

@ -1,4 +1,4 @@
using System; using System;
namespace MoonWorks.Audio namespace MoonWorks.Audio
{ {

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using MoonWorks.Math; using MoonWorks.Math;
@ -169,7 +169,7 @@ namespace MoonWorks.Audio
bool loop bool loop
) : base(device) ) : base(device)
{ {
var blockAlign = (ushort)(4 * channels); var blockAlign = (ushort) (4 * channels);
var format = new FAudio.FAudioWaveFormatEx var format = new FAudio.FAudioWaveFormatEx
{ {
wFormatTag = 3, wFormatTag = 3,

View File

@ -1,4 +1,4 @@
namespace MoonWorks.Audio namespace MoonWorks.Audio
{ {
public enum SoundState public enum SoundState
{ {

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace MoonWorks.Audio namespace MoonWorks.Audio

View File

@ -1,4 +1,4 @@
using System; using System;
namespace MoonWorks.Audio namespace MoonWorks.Audio
{ {

View File

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
@ -131,7 +131,7 @@ namespace MoonWorks.Audio
PlayLength = ( PlayLength = (
lengthInBytes / lengthInBytes /
Format.nChannels / Format.nChannels /
(uint)(Format.wBitsPerSample / 8) (uint) (Format.wBitsPerSample / 8)
) )
}; };

View File

@ -1,4 +1,4 @@
using System; using System;
using System.IO; using System.IO;
namespace MoonWorks.Audio namespace MoonWorks.Audio
@ -20,7 +20,8 @@ namespace MoonWorks.Audio
string filePath, string filePath,
bool is3D = false, bool is3D = false,
bool loop = false bool loop = false
) { )
{
var fileHandle = FAudio.stb_vorbis_open_filename(filePath, out var error, IntPtr.Zero); var fileHandle = FAudio.stb_vorbis_open_filename(filePath, out var error, IntPtr.Zero);
if (error != 0) if (error != 0)
{ {
@ -59,7 +60,8 @@ namespace MoonWorks.Audio
out uint bufferOffset, out uint bufferOffset,
out uint bufferLength, out uint bufferLength,
out bool reachedEnd out bool reachedEnd
) { )
{
buffer = this.buffer; buffer = this.buffer;
/* NOTE: this function returns samples per channel, not total samples */ /* NOTE: this function returns samples per channel, not total samples */