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

Side by Side Diff: Source/modules/webmidi/MIDIAccess.h

Issue 649683006: Web MIDI: add blink APIs to notify device connection events (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address a comment at #21 Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/modules/webmidi/MIDIAccess.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 bool sysexEnabled() const { return m_sysexEnabled; } 70 bool sysexEnabled() const { return m_sysexEnabled; }
71 71
72 // EventTarget 72 // EventTarget
73 virtual const AtomicString& interfaceName() const override { return EventTar getNames::MIDIAccess; } 73 virtual const AtomicString& interfaceName() const override { return EventTar getNames::MIDIAccess; }
74 virtual ExecutionContext* executionContext() const override { return ActiveD OMObject::executionContext(); } 74 virtual ExecutionContext* executionContext() const override { return ActiveD OMObject::executionContext(); }
75 75
76 // ActiveDOMObject 76 // ActiveDOMObject
77 virtual void stop() override; 77 virtual void stop() override;
78 78
79 // MIDIAccessorClient 79 // MIDIAccessorClient
80 virtual void didAddInputPort(const String& id, const String& manufacturer, c onst String& name, const String& version) override; 80 virtual void didAddInputPort(const String& id, const String& manufacturer, c onst String& name, const String& version, bool isActive) override;
81 virtual void didAddOutputPort(const String& id, const String& manufacturer, const String& name, const String& version) override; 81 virtual void didAddOutputPort(const String& id, const String& manufacturer, const String& name, const String& version, bool isActive) override;
82 virtual void didSetInputPortState(unsigned portIndex, bool isActive) overrid e;
83 virtual void didSetOutputPortState(unsigned portIndex, bool isActive) overri de;
82 virtual void didStartSession(bool success, const String& error, const String & message) override 84 virtual void didStartSession(bool success, const String& error, const String & message) override
83 { 85 {
84 // This method is for MIDIAccess initialization: MIDIAccessInitializer 86 // This method is for MIDIAccess initialization: MIDIAccessInitializer
85 // has the implementation. 87 // has the implementation.
86 ASSERT_NOT_REACHED(); 88 ASSERT_NOT_REACHED();
87 } 89 }
88 virtual void didReceiveMIDIData(unsigned portIndex, const unsigned char* dat a, size_t length, double timeStamp) override; 90 virtual void didReceiveMIDIData(unsigned portIndex, const unsigned char* dat a, size_t length, double timeStamp) override;
89 91
90 // |timeStampInMilliseconds| is in the same time coordinate system as perfor mance.now(). 92 // |timeStampInMilliseconds| is in the same time coordinate system as perfor mance.now().
91 void sendMIDIData(unsigned portIndex, const unsigned char* data, size_t leng th, double timeStampInMilliseconds); 93 void sendMIDIData(unsigned portIndex, const unsigned char* data, size_t leng th, double timeStampInMilliseconds);
92 94
93 virtual void trace(Visitor*) override; 95 virtual void trace(Visitor*) override;
94 96
95 private: 97 private:
96 MIDIAccess(PassOwnPtr<MIDIAccessor>, bool sysexEnabled, const Vector<MIDIAcc essInitializer::PortDescriptor>&, ExecutionContext*); 98 MIDIAccess(PassOwnPtr<MIDIAccessor>, bool sysexEnabled, const Vector<MIDIAcc essInitializer::PortDescriptor>&, ExecutionContext*);
97 99
98 OwnPtr<MIDIAccessor> m_accessor; 100 OwnPtr<MIDIAccessor> m_accessor;
99 bool m_sysexEnabled; 101 bool m_sysexEnabled;
100 HeapVector<Member<MIDIInput> > m_inputs; 102 HeapVector<Member<MIDIInput> > m_inputs;
101 HeapVector<Member<MIDIOutput> > m_outputs; 103 HeapVector<Member<MIDIOutput> > m_outputs;
102 }; 104 };
103 105
104 } // namespace blink 106 } // namespace blink
105 107
106 #endif // MIDIAccess_h 108 #endif // MIDIAccess_h
OLDNEW
« no previous file with comments | « no previous file | Source/modules/webmidi/MIDIAccess.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698