| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 MIDIInput::MIDIInput(MIDIAccess* access, const String& id, const String& manufac
turer, const String& name, const String& version, PortState state) | 49 MIDIInput::MIDIInput(MIDIAccess* access, const String& id, const String& manufac
turer, const String& name, const String& version, PortState state) |
| 50 : MIDIPort(access, id, manufacturer, name, TypeInput, version, state) | 50 : MIDIPort(access, id, manufacturer, name, TypeInput, version, state) |
| 51 { | 51 { |
| 52 } | 52 } |
| 53 | 53 |
| 54 EventListener* MIDIInput::onmidimessage() | 54 EventListener* MIDIInput::onmidimessage() |
| 55 { | 55 { |
| 56 return getAttributeEventListener(EventTypeNames::midimessage); | 56 return getAttributeEventListener(EventTypeNames::midimessage); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void MIDIInput::setOnmidimessage(RawPtr<EventListener> listener) | 59 void MIDIInput::setOnmidimessage(EventListener* listener) |
| 60 { | 60 { |
| 61 // Implicit open. It does nothing if the port is already opened. | 61 // Implicit open. It does nothing if the port is already opened. |
| 62 // See http://www.w3.org/TR/webmidi/#widl-MIDIPort-open-Promise-MIDIPort | 62 // See http://www.w3.org/TR/webmidi/#widl-MIDIPort-open-Promise-MIDIPort |
| 63 open(); | 63 open(); |
| 64 | 64 |
| 65 setAttributeEventListener(EventTypeNames::midimessage, listener); | 65 setAttributeEventListener(EventTypeNames::midimessage, listener); |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool MIDIInput::addEventListenerInternal(const AtomicString& eventType, EventLis
tener* listener, const EventListenerOptions& options) | 68 bool MIDIInput::addEventListenerInternal(const AtomicString& eventType, EventLis
tener* listener, const EventListenerOptions& options) |
| 69 { | 69 { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 92 RefPtr<DOMUint8Array> array = DOMUint8Array::create(data, length); | 92 RefPtr<DOMUint8Array> array = DOMUint8Array::create(data, length); |
| 93 dispatchEvent(MIDIMessageEvent::create(timeStamp, array)); | 93 dispatchEvent(MIDIMessageEvent::create(timeStamp, array)); |
| 94 } | 94 } |
| 95 | 95 |
| 96 DEFINE_TRACE(MIDIInput) | 96 DEFINE_TRACE(MIDIInput) |
| 97 { | 97 { |
| 98 MIDIPort::trace(visitor); | 98 MIDIPort::trace(visitor); |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace blink | 101 } // namespace blink |
| OLD | NEW |