diff --git a/DryWetMidi.Tests/Devices/Playback/PlaybackTests.cs b/DryWetMidi.Tests/Devices/Playback/PlaybackTests.cs index 4d4fff6c4..dc6dbdf18 100644 --- a/DryWetMidi.Tests/Devices/Playback/PlaybackTests.cs +++ b/DryWetMidi.Tests/Devices/Playback/PlaybackTests.cs @@ -47,7 +47,7 @@ private sealed class PlaybackContext private static readonly PlaybackAction NoPlaybackAction = (context, playback) => { }; - private static readonly object[] ParametersForDurationCheck = new[] + private static readonly object[] ParametersForDurationCheck = { new object[] { TimeSpan.Zero, TimeSpan.FromSeconds(2) }, new object[] { TimeSpan.FromMilliseconds(500), TimeSpan.FromSeconds(3) }, diff --git a/DryWetMidi.Tests/Devices/Recording/RecordingTests.cs b/DryWetMidi.Tests/Devices/Recording/RecordingTests.cs index 796efd53b..5138f30f6 100644 --- a/DryWetMidi.Tests/Devices/Recording/RecordingTests.cs +++ b/DryWetMidi.Tests/Devices/Recording/RecordingTests.cs @@ -18,7 +18,7 @@ public sealed class RecordingTests private const int RetriesNumber = 3; - private static readonly object[] ParametersForDurationCheck = new[] + private static readonly object[] ParametersForDurationCheck = { new object[] { TimeSpan.Zero, TimeSpan.FromSeconds(2) }, new object[] { TimeSpan.FromMilliseconds(500), TimeSpan.FromSeconds(3) }, diff --git a/DryWetMidi.Tests/Smf.Interaction/Pattern/PatternTests.cs b/DryWetMidi.Tests/Smf.Interaction/Pattern/PatternTests.cs index 3a99924e3..98ebb7871 100644 --- a/DryWetMidi.Tests/Smf.Interaction/Pattern/PatternTests.cs +++ b/DryWetMidi.Tests/Smf.Interaction/Pattern/PatternTests.cs @@ -130,7 +130,6 @@ public void Note_Multiple_MetricLengths() new NoteInfo(NoteName.B, 2, new MetricTimeSpan(0, 1, 24), new MetricTimeSpan(0, 0, 5)), }); - var tempoMap = midiFile.GetTempoMap(); Assert.AreEqual(new MetricTimeSpan(0, 1, 29), midiFile.GetDuration()); } @@ -157,7 +156,6 @@ public void Note_Multiple_MetricLengths_TempoChanged() .Select(i => Tuple.Create(i * 1000L, new Tempo(i * 100 + 10))) .ToArray()); - var tempoMap = midiFile.GetTempoMap(); Assert.AreEqual(new MetricTimeSpan(0, 1, 29).TotalMicroseconds, midiFile.GetDuration().TotalMicroseconds); } diff --git a/DryWetMidi.Tests/Smf.Interaction/TimeSpan/MetricTimeSpanTests.cs b/DryWetMidi.Tests/Smf.Interaction/TimeSpan/MetricTimeSpanTests.cs index 786a4b63f..e672afcec 100644 --- a/DryWetMidi.Tests/Smf.Interaction/TimeSpan/MetricTimeSpanTests.cs +++ b/DryWetMidi.Tests/Smf.Interaction/TimeSpan/MetricTimeSpanTests.cs @@ -53,7 +53,7 @@ public sealed class MetricTimeSpanTests Tuple.Create(new MetricTimeSpan(10000), new MetricTimeSpan(10000)), }; - private static readonly object[] ParametersForValidParseCheck = new[] + private static readonly object[] ParametersForValidParseCheck = { new object[] { "0:0:0:0", new MetricTimeSpan() }, new object[] { "0:0:0", new MetricTimeSpan() }, diff --git a/DryWetMidi/Devices/InputDevice/InputDevice.cs b/DryWetMidi/Devices/InputDevice/InputDevice.cs index 04622429a..7ac4ec666 100644 --- a/DryWetMidi/Devices/InputDevice/InputDevice.cs +++ b/DryWetMidi/Devices/InputDevice/InputDevice.cs @@ -55,8 +55,6 @@ public sealed class InputDevice : MidiDevice private readonly MemoryStream _channelMessageMemoryStream = new MemoryStream(ChannelParametersBufferSize); private readonly MidiReader _channelEventReader; - private readonly MemoryStream _sysExMessageMemoryStream = new MemoryStream(SysExBufferLength); - private readonly MidiReader _sysExEventReader; private IntPtr _sysExHeaderPointer = IntPtr.Zero; private MidiWinApi.MidiMessageCallback _callback; @@ -67,11 +65,10 @@ public sealed class InputDevice : MidiDevice #region Constructor - internal InputDevice(int id) + private InputDevice(int id) : base(id) { _channelEventReader = new MidiReader(_channelMessageMemoryStream); - _sysExEventReader = new MidiReader(_sysExMessageMemoryStream); SetDeviceInformation(); } diff --git a/DryWetMidi/Devices/MidiDeviceException.cs b/DryWetMidi/Devices/MidiDeviceException.cs index a8433d890..191a559a7 100644 --- a/DryWetMidi/Devices/MidiDeviceException.cs +++ b/DryWetMidi/Devices/MidiDeviceException.cs @@ -13,7 +13,6 @@ public sealed class MidiDeviceException : Exception /// Initializes a new instance of the . /// public MidiDeviceException() - : base() { } diff --git a/DryWetMidi/Devices/OutputDevice/OutputDevice.cs b/DryWetMidi/Devices/OutputDevice/OutputDevice.cs index 9f4631cfe..552222110 100644 --- a/DryWetMidi/Devices/OutputDevice/OutputDevice.cs +++ b/DryWetMidi/Devices/OutputDevice/OutputDevice.cs @@ -19,8 +19,6 @@ public sealed class OutputDevice : MidiDevice private const int ChannelEventBufferSize = 3; private static readonly byte[] ZeroBuffer = new byte[ChannelEventBufferSize]; - private const int SysExBufferLength = 2048; - #endregion #region Events diff --git a/DryWetMidi/Devices/Playback/Snapping/PlaybackSnapping.cs b/DryWetMidi/Devices/Playback/Snapping/PlaybackSnapping.cs index 12ff7dbfd..4dd537663 100644 --- a/DryWetMidi/Devices/Playback/Snapping/PlaybackSnapping.cs +++ b/DryWetMidi/Devices/Playback/Snapping/PlaybackSnapping.cs @@ -3,7 +3,6 @@ using System.Linq; using Melanchall.DryWetMidi.Common; using Melanchall.DryWetMidi.Smf.Interaction; -using Melanchall.DryWetMidi.Tools; namespace Melanchall.DryWetMidi.Devices { diff --git a/DryWetMidi/Tools/CsvConverter/Common/CsvReader.cs b/DryWetMidi/Tools/CsvConverter/Common/CsvReader.cs index 78f315810..9ff07247a 100644 --- a/DryWetMidi/Tools/CsvConverter/Common/CsvReader.cs +++ b/DryWetMidi/Tools/CsvConverter/Common/CsvReader.cs @@ -11,8 +11,6 @@ internal sealed class CsvReader : IDisposable #region Constants private const char Quote = '"'; - private const string QuoteString = "\""; - private const string DoubleQuote = "\"\""; #endregion diff --git a/DryWetMidi/Tools/CsvConverter/MidiFile/ToCsv/MidiFileToCsvConverter.cs b/DryWetMidi/Tools/CsvConverter/MidiFile/ToCsv/MidiFileToCsvConverter.cs index ba87a174b..593edef0d 100644 --- a/DryWetMidi/Tools/CsvConverter/MidiFile/ToCsv/MidiFileToCsvConverter.cs +++ b/DryWetMidi/Tools/CsvConverter/MidiFile/ToCsv/MidiFileToCsvConverter.cs @@ -208,7 +208,7 @@ private static void WriteRecord(CsvWriter csvWriter, private static object[] ProcessParameter(object parameter) { if (parameter == null) - return new[] { string.Empty }; + return new object[] { string.Empty }; var bytes = parameter as byte[]; if (bytes != null) diff --git a/DryWetMidi/Tools/CsvConverter/Notes/NotesToCsvConverter.cs b/DryWetMidi/Tools/CsvConverter/Notes/NotesToCsvConverter.cs index 0039e8b1d..9736e2b20 100644 --- a/DryWetMidi/Tools/CsvConverter/Notes/NotesToCsvConverter.cs +++ b/DryWetMidi/Tools/CsvConverter/Notes/NotesToCsvConverter.cs @@ -15,7 +15,7 @@ public static void ConvertToCsv(IEnumerable notes, Stream stream, TempoMap { foreach (var note in notes.Where(n => n != null)) { - csvWriter.WriteRecord(new object[] + csvWriter.WriteRecord(new[] { note.TimeAs(settings.TimeType, tempoMap), note.Channel,