Index: Source/modules/webmidi/MIDIInput.cpp |
diff --git a/Source/modules/webmidi/MIDIInput.cpp b/Source/modules/webmidi/MIDIInput.cpp |
index 606d21c3cf41cdd1a59d310897208530fa5939e7..a5dee099588ff1cf228b26c9234b4e538f9e97da 100644 |
--- a/Source/modules/webmidi/MIDIInput.cpp |
+++ b/Source/modules/webmidi/MIDIInput.cpp |
@@ -30,6 +30,7 @@ |
#include "config.h" |
#include "modules/webmidi/MIDIInput.h" |
+#include "modules/webmidi/MIDIMessageEvent.h" |
namespace WebCore { |
@@ -44,4 +45,14 @@ MIDIInput::MIDIInput(ScriptExecutionContext* context, const String& id, const St |
ScriptWrappable::init(this); |
} |
+void MIDIInput::didReceiveMIDIData(unsigned portIndex, const unsigned char* data, size_t length, double timeStamp) |
+{ |
+ ASSERT(isMainThread()); |
+ |
+ RefPtr<Uint8Array> array = Uint8Array::create(length); |
+ array->setRange(data, length, 0); |
+ |
+ dispatchEvent(MIDIMessageEvent::create(timeStamp, array)); |
+} |
+ |
} // namespace WebCore |