Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Unified Diff: Source/modules/webmidi/MIDIAccess.h

Issue 16288002: Web MIDI API (work in progress) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add accessApproved() Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/webaudio/AudioContext.idl ('k') | Source/modules/webmidi/MIDIAccess.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webmidi/MIDIAccess.h
diff --git a/Source/modules/webmidi/MIDIAccess.h b/Source/modules/webmidi/MIDIAccess.h
index 792b979f525fa0dea2de5147804f77850a156ce6..bb36ee27596da7649b5fe79433a2eaf29a96f0dd 100644
--- a/Source/modules/webmidi/MIDIAccess.h
+++ b/Source/modules/webmidi/MIDIAccess.h
@@ -34,8 +34,10 @@
#include "bindings/v8/ScriptWrappable.h"
#include "core/dom/ActiveDOMObject.h"
#include "core/dom/EventTarget.h"
+#include "core/platform/midi/MIDIAccessor.h"
#include "modules/webmidi/MIDIInput.h"
#include "modules/webmidi/MIDIOutput.h"
+#include "wtf/OwnPtr.h"
#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
#include "wtf/Vector.h"
@@ -44,7 +46,7 @@ namespace WebCore {
class ScriptExecutionContext;
-class MIDIAccess : public RefCounted<MIDIAccess>, public ScriptWrappable, public ActiveDOMObject, public EventTarget {
+class MIDIAccess : public ActiveDOMObject, public RefCounted<MIDIAccess>, public EventTarget, public MIDIAccessorClient {
public:
virtual ~MIDIAccess();
static PassRefPtr<MIDIAccess> create(ScriptExecutionContext*);
@@ -65,6 +67,12 @@ public:
// ActiveDOMObject
virtual bool canSuspend() const OVERRIDE { return true; }
+ // MIDIAccessorClient
+ virtual void addInputPort(const String& id, const String& manufacturer, const String& name, const String& version) OVERRIDE;
+ virtual void addOutputPort(const String& id, const String& manufacturer, const String& name, const String& version) OVERRIDE;
+ virtual void accessApproved(bool approved) OVERRIDE;
+ virtual void receiveMIDIData(unsigned portIndex, const unsigned char* data, size_t length, double timeStamp) OVERRIDE;
+
private:
explicit MIDIAccess(ScriptExecutionContext*);
@@ -77,6 +85,8 @@ private:
MIDIInputVector m_inputs;
MIDIOutputVector m_outputs;
EventTargetData m_eventTargetData;
+
+ OwnPtr<MIDIAccessor> m_midiAccessor;
};
} // namespace WebCore
« no previous file with comments | « Source/modules/webaudio/AudioContext.idl ('k') | Source/modules/webmidi/MIDIAccess.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698