OLD | NEW |
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 const String& message) override { | 113 const String& message) override { |
114 // This method is for MIDIAccess initialization: MIDIAccessInitializer | 114 // This method is for MIDIAccess initialization: MIDIAccessInitializer |
115 // has the implementation. | 115 // has the implementation. |
116 NOTREACHED(); | 116 NOTREACHED(); |
117 } | 117 } |
118 void didReceiveMIDIData(unsigned portIndex, | 118 void didReceiveMIDIData(unsigned portIndex, |
119 const unsigned char* data, | 119 const unsigned char* data, |
120 size_t length, | 120 size_t length, |
121 double timeStamp) override; | 121 double timeStamp) override; |
122 | 122 |
123 // |timeStampInMilliseconds| is in the same time coordinate system as performa
nce.now(). | 123 // |timeStampInMilliseconds| is in the same time coordinate system as |
| 124 // performance.now(). |
124 void sendMIDIData(unsigned portIndex, | 125 void sendMIDIData(unsigned portIndex, |
125 const unsigned char* data, | 126 const unsigned char* data, |
126 size_t length, | 127 size_t length, |
127 double timeStampInMilliseconds); | 128 double timeStampInMilliseconds); |
128 | 129 |
129 // Eager finalization needed to promptly release m_accessor. Otherwise | 130 // Eager finalization needed to promptly release m_accessor. Otherwise |
130 // its client back reference could end up being unsafely used during | 131 // its client back reference could end up being unsafely used during |
131 // the lazy sweeping phase. | 132 // the lazy sweeping phase. |
132 DECLARE_VIRTUAL_TRACE(); | 133 DECLARE_VIRTUAL_TRACE(); |
133 | 134 |
134 private: | 135 private: |
135 MIDIAccess(std::unique_ptr<MIDIAccessor>, | 136 MIDIAccess(std::unique_ptr<MIDIAccessor>, |
136 bool sysexEnabled, | 137 bool sysexEnabled, |
137 const Vector<MIDIAccessInitializer::PortDescriptor>&, | 138 const Vector<MIDIAccessInitializer::PortDescriptor>&, |
138 ExecutionContext*); | 139 ExecutionContext*); |
139 void dispose(); | 140 void dispose(); |
140 | 141 |
141 std::unique_ptr<MIDIAccessor> m_accessor; | 142 std::unique_ptr<MIDIAccessor> m_accessor; |
142 bool m_sysexEnabled; | 143 bool m_sysexEnabled; |
143 bool m_hasPendingActivity; | 144 bool m_hasPendingActivity; |
144 HeapVector<Member<MIDIInput>> m_inputs; | 145 HeapVector<Member<MIDIInput>> m_inputs; |
145 HeapVector<Member<MIDIOutput>> m_outputs; | 146 HeapVector<Member<MIDIOutput>> m_outputs; |
146 }; | 147 }; |
147 | 148 |
148 } // namespace blink | 149 } // namespace blink |
149 | 150 |
150 #endif // MIDIAccess_h | 151 #endif // MIDIAccess_h |
OLD | NEW |