forked from naudio/NAudio
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
74 changed files
with
864 additions
and
1,424 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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace NAudio.Codecs | ||
{ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace NAudio.Dsp | ||
{ | ||
/// <summary> | ||
|
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace NAudio.Wave | ||
{ | ||
|
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.IO; | ||
|
||
namespace NAudio.Wave | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace NAudio.Wave | ||
{ | ||
|
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 |
---|---|---|
@@ -1,136 +1,82 @@ | ||
using System; | ||
|
||
namespace NAudio.SoundFont | ||
namespace NAudio.SoundFont | ||
{ | ||
/// <summary> | ||
/// Soundfont generator | ||
/// </summary> | ||
public class Generator | ||
{ | ||
private GeneratorEnum generatorType; | ||
private ushort rawAmount; | ||
private Instrument instrument; | ||
private SampleHeader sampleHeader; | ||
|
||
/// <summary> | ||
/// Gets the generator type | ||
/// </summary> | ||
public GeneratorEnum GeneratorType | ||
{ | ||
get | ||
{ | ||
return generatorType; | ||
} | ||
set | ||
{ | ||
generatorType = value; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Generator amount as an unsigned short | ||
/// </summary> | ||
public ushort UInt16Amount | ||
{ | ||
get | ||
{ | ||
return rawAmount; | ||
} | ||
set | ||
{ | ||
rawAmount = value; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Generator amount as a signed short | ||
/// </summary> | ||
public short Int16Amount | ||
{ | ||
get | ||
{ | ||
return (short) rawAmount; | ||
} | ||
set | ||
{ | ||
rawAmount = (ushort) value; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Low byte amount | ||
/// </summary> | ||
public byte LowByteAmount | ||
{ | ||
get | ||
{ | ||
return (byte) (rawAmount & 0x00FF); | ||
} | ||
set | ||
{ | ||
rawAmount &= 0xFF00; | ||
rawAmount += value; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// High byte amount | ||
/// </summary> | ||
public byte HighByteAmount | ||
{ | ||
get | ||
{ | ||
return (byte) ((rawAmount & 0xFF00) >> 8); | ||
} | ||
set | ||
{ | ||
rawAmount &= 0x00FF; | ||
rawAmount += (ushort) (value << 8); | ||
} | ||
} | ||
/// <summary> | ||
/// Soundfont generator | ||
/// </summary> | ||
public class Generator | ||
{ | ||
/// <summary> | ||
/// Gets the generator type | ||
/// </summary> | ||
public GeneratorEnum GeneratorType { get; set; } | ||
|
||
/// <summary> | ||
/// Generator amount as an unsigned short | ||
/// </summary> | ||
public ushort UInt16Amount { get; set; } | ||
|
||
/// <summary> | ||
/// Generator amount as a signed short | ||
/// </summary> | ||
public short Int16Amount | ||
{ | ||
get => (short)UInt16Amount; | ||
set => UInt16Amount = (ushort)value; | ||
} | ||
|
||
/// <summary> | ||
/// Low byte amount | ||
/// </summary> | ||
public byte LowByteAmount | ||
{ | ||
get | ||
{ | ||
return (byte)(UInt16Amount & 0x00FF); | ||
} | ||
set | ||
{ | ||
UInt16Amount &= 0xFF00; | ||
UInt16Amount += value; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Instrument | ||
/// </summary> | ||
public Instrument Instrument | ||
{ | ||
get | ||
{ | ||
return instrument; | ||
} | ||
set | ||
{ | ||
instrument = value; | ||
} | ||
} | ||
/// <summary> | ||
/// High byte amount | ||
/// </summary> | ||
public byte HighByteAmount | ||
{ | ||
get | ||
{ | ||
return (byte)((UInt16Amount & 0xFF00) >> 8); | ||
} | ||
set | ||
{ | ||
UInt16Amount &= 0x00FF; | ||
UInt16Amount += (ushort)(value << 8); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Sample Header | ||
/// </summary> | ||
public SampleHeader SampleHeader | ||
{ | ||
get | ||
{ | ||
return sampleHeader; | ||
} | ||
set | ||
{ | ||
sampleHeader = value; | ||
} | ||
} | ||
/// <summary> | ||
/// Instrument | ||
/// </summary> | ||
public Instrument Instrument { get; set; } | ||
|
||
/// <summary> | ||
/// <see cref="object.ToString"/> | ||
/// </summary> | ||
public override string ToString() | ||
{ | ||
if(generatorType == GeneratorEnum.Instrument) | ||
return String.Format("Generator Instrument {0}",instrument.Name); | ||
else if(generatorType == GeneratorEnum.SampleID) | ||
return String.Format("Generator SampleID {0}",sampleHeader); | ||
else | ||
return String.Format("Generator {0} {1}",generatorType,rawAmount); | ||
} | ||
/// <summary> | ||
/// Sample Header | ||
/// </summary> | ||
public SampleHeader SampleHeader { get; set; } | ||
|
||
} | ||
/// <summary> | ||
/// <see cref="object.ToString"/> | ||
/// </summary> | ||
public override string ToString() | ||
{ | ||
if (GeneratorType == GeneratorEnum.Instrument) | ||
return $"Generator Instrument {Instrument.Name}"; | ||
else if (GeneratorType == GeneratorEnum.SampleID) | ||
return $"Generator SampleID {SampleHeader}"; | ||
else | ||
return $"Generator {GeneratorType} {UInt16Amount}"; | ||
} | ||
} | ||
} |
Oops, something went wrong.