-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/MikiraSora/OngekiFumenEditor
- Loading branch information
Showing
32 changed files
with
601 additions
and
204 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace OngekiFumenEditor.Base | ||
{ | ||
public interface IBulletPalleteChangable | ||
{ | ||
public string SetStrID { get; set; } | ||
} | ||
} |
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 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 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
15 changes: 15 additions & 0 deletions
15
OngekiFumenEditor/Kernel/Audio/NAudioImpl/AudioOutputType.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,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace OngekiFumenEditor.Kernel.Audio.NAudioImpl | ||
{ | ||
public enum AudioOutputType | ||
{ | ||
WaveOut, | ||
Wasapi, | ||
Asio | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
OngekiFumenEditor/Kernel/Audio/NAudioImpl/Music/BufferWaveStream.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,46 @@ | ||
using NAudio.Wave; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace OngekiFumenEditor.Kernel.Audio.NAudioImpl.Music | ||
{ | ||
internal class BufferWaveStream : WaveStream, IWaveProvider, ISampleProvider | ||
{ | ||
private readonly byte[] waveBuffer; | ||
private readonly WaveFormat format; | ||
|
||
public BufferWaveStream(byte[] buffer, WaveFormat format) | ||
{ | ||
waveBuffer = buffer; | ||
this.format = format; | ||
} | ||
|
||
public override WaveFormat WaveFormat => format; | ||
|
||
public override long Length => waveBuffer.LongLength; | ||
|
||
public override long Position { get; set; } = 0; | ||
|
||
public override int Read(byte[] buffer, int offset, int count) | ||
{ | ||
var beforePosition = Position; | ||
for (int i = 0; i < count && Position < waveBuffer.Length; i++) | ||
buffer[offset + i] = waveBuffer[Position++]; | ||
return (int)(Position - beforePosition); | ||
} | ||
|
||
public int Read(float[] buffer, int offset, int count) | ||
{ | ||
var floatBuffer = MemoryMarshal.Cast<byte, float>(waveBuffer); | ||
|
||
var floatPosition = (int)(Position / sizeof(float)); | ||
var floatLength = waveBuffer.Length / sizeof(float); | ||
|
||
var beforePosition = floatPosition; | ||
for (int i = 0; i < count && floatPosition < floatLength; i++) | ||
buffer[offset + i] = floatBuffer[floatPosition++]; | ||
var read = floatPosition - beforePosition; | ||
Position = floatPosition * sizeof(float); | ||
return read; | ||
} | ||
} | ||
} |
Oops, something went wrong.