| 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 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef MIDIOutput_h | 31 #ifndef MIDIOutput_h |
| 32 #define MIDIOutput_h | 32 #define MIDIOutput_h |
| 33 | 33 |
| 34 #include "core/dom/DOMTypedArray.h" | 34 #include "core/dom/DOMTypedArray.h" |
| 35 #include "core/dom/MaybeShared.h" |
| 35 #include "modules/webmidi/MIDIPort.h" | 36 #include "modules/webmidi/MIDIPort.h" |
| 36 | 37 |
| 37 namespace blink { | 38 namespace blink { |
| 38 | 39 |
| 39 class ExceptionState; | 40 class ExceptionState; |
| 40 class MIDIAccess; | 41 class MIDIAccess; |
| 41 | 42 |
| 42 class MIDIOutput final : public MIDIPort { | 43 class MIDIOutput final : public MIDIPort { |
| 43 DEFINE_WRAPPERTYPEINFO(); | 44 DEFINE_WRAPPERTYPEINFO(); |
| 44 | 45 |
| 45 public: | 46 public: |
| 46 static MIDIOutput* create(MIDIAccess*, | 47 static MIDIOutput* create(MIDIAccess*, |
| 47 unsigned portIndex, | 48 unsigned portIndex, |
| 48 const String& id, | 49 const String& id, |
| 49 const String& manufacturer, | 50 const String& manufacturer, |
| 50 const String& name, | 51 const String& name, |
| 51 const String& version, | 52 const String& version, |
| 52 midi::mojom::PortState); | 53 midi::mojom::PortState); |
| 53 ~MIDIOutput() override; | 54 ~MIDIOutput() override; |
| 54 | 55 |
| 55 void send(DOMUint8Array*, double timestamp, ExceptionState&); | 56 void send(const MaybeShared<DOMUint8Array>&, |
| 57 double timestamp, |
| 58 ExceptionState&); |
| 56 void send(Vector<unsigned>, double timestamp, ExceptionState&); | 59 void send(Vector<unsigned>, double timestamp, ExceptionState&); |
| 57 | 60 |
| 58 // send() without optional |timestamp|. | 61 // send() without optional |timestamp|. |
| 59 void send(DOMUint8Array*, ExceptionState&); | 62 void send(const MaybeShared<DOMUint8Array>&, ExceptionState&); |
| 60 void send(Vector<unsigned>, ExceptionState&); | 63 void send(Vector<unsigned>, ExceptionState&); |
| 61 | 64 |
| 62 DECLARE_VIRTUAL_TRACE(); | 65 DECLARE_VIRTUAL_TRACE(); |
| 63 | 66 |
| 64 private: | 67 private: |
| 65 MIDIOutput(MIDIAccess*, | 68 MIDIOutput(MIDIAccess*, |
| 66 unsigned portIndex, | 69 unsigned portIndex, |
| 67 const String& id, | 70 const String& id, |
| 68 const String& manufacturer, | 71 const String& manufacturer, |
| 69 const String& name, | 72 const String& name, |
| 70 const String& version, | 73 const String& version, |
| 71 midi::mojom::PortState); | 74 midi::mojom::PortState); |
| 72 | 75 |
| 73 unsigned m_portIndex; | 76 unsigned m_portIndex; |
| 74 }; | 77 }; |
| 75 | 78 |
| 76 } // namespace blink | 79 } // namespace blink |
| 77 | 80 |
| 78 #endif // MIDIOutput_h | 81 #endif // MIDIOutput_h |
| OLD | NEW |