|
|
|
|
@ -5,15 +5,12 @@ |
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
using Lib.Audio.Factories; |
|
|
|
|
using Lib.Audio.Interfaces; |
|
|
|
|
using NAudio.Midi; |
|
|
|
|
|
|
|
|
|
namespace Lib.Audio |
|
|
|
|
{ |
|
|
|
|
public class Device : IDevice |
|
|
|
|
{ |
|
|
|
|
private readonly IDeviceButtonConfiguration _buttonConfiguration; |
|
|
|
|
private readonly MidiIn _midiIn; |
|
|
|
|
private readonly MidiOut _midiOut; |
|
|
|
|
|
|
|
|
|
public Device(IChannelFactory channelFactory) |
|
|
|
|
{ |
|
|
|
|
@ -22,26 +19,8 @@ namespace Lib.Audio |
|
|
|
|
Channels = new List<IChannel>(); |
|
|
|
|
for (uint i = 0; i < 8; i++) //FixMe: remove hard coded config |
|
|
|
|
Channels.Add(channelFactory.Create(i, _buttonConfiguration)); |
|
|
|
|
|
|
|
|
|
var test = MidiIn.NumberOfDevices; |
|
|
|
|
_midiIn = new MidiIn(0); |
|
|
|
|
_midiOut = new MidiOut(0); |
|
|
|
|
|
|
|
|
|
_midiIn.MessageReceived += OnMidiInMessageReceived; |
|
|
|
|
_midiIn.ErrorReceived += OnMidiInErrorReceived; |
|
|
|
|
_midiIn.Start(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public List<IChannel> Channels { get; } |
|
|
|
|
|
|
|
|
|
private void OnMidiInMessageReceived(object? sender, MidiInMessageEventArgs args) |
|
|
|
|
{ |
|
|
|
|
int i = 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void OnMidiInErrorReceived(object? sender, MidiInMessageEventArgs args) |
|
|
|
|
{ |
|
|
|
|
int i = 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |