Closed Yorgg closed 4 years ago
Hi,
I think it will be better to introduce interface like IInputDevice
that will be implemented by standard InputDevice
and that you can implement by yourself. IInputDevice
will contain event EventReceived
. And Recording
will work with that interface rather than with InputDevice
.
In my opinion it's more flexible way. Please tell me if it sounds good.
Agreed. That sounds good.
I've added IInputDevice
interface:
public interface IInputDevice
{
event EventHandler<MidiEventReceivedEventArgs> EventReceived;
bool IsListeningForEvents { get; }
void StartEventsListening();
void StopEventsListening();
}
I would like to send midi events to the midi
Recording
without using theInputDevice
.Perhaps If we change
OnEventReceived
to be public then other objects could subscribe to it?Something like this:
customEventGenerator.ProcessMidiEvent += recording.OnEventReceived
And the InputDevice could be optional in the
Recording
class?https://github.com/melanchall/drywetmidi/blob/ce71820e4679bf605b2f726aed4068347e36caa4/DryWetMidi/Devices/Recording/Recording.cs