Bug 1472338: part 2) Change `clipboard.readText()` to read from the clipboard asynchr...
[gecko.git] / dom / midi / MIDIOutput.h
blob72d0efb55e7a295e4f6ff769ed8310486e4be2d5
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_MIDIOutput_h
8 #define mozilla_dom_MIDIOutput_h
10 #include "mozilla/dom/MIDIPort.h"
11 #include "mozilla/Attributes.h"
12 #include "nsWrapperCache.h"
14 struct JSContext;
16 namespace mozilla {
17 class ErrorResult;
19 namespace dom {
21 class MIDIPortInfo;
22 class MIDIMessage;
24 /**
25 * Represents a MIDI Output Port, handles sending message to devices.
28 class MIDIOutput final : public MIDIPort {
29 public:
30 static MIDIOutput* Create(nsPIDOMWindowInner* aWindow,
31 MIDIAccess* aMIDIAccessParent,
32 const MIDIPortInfo& aPortInfo,
33 const bool aSysexEnabled);
34 ~MIDIOutput() = default;
36 JSObject* WrapObject(JSContext* aCx,
37 JS::Handle<JSObject*> aGivenProto) override;
39 // Send a message to an output port
40 void Send(const Sequence<uint8_t>& aData, const Optional<double>& aTimestamp,
41 ErrorResult& aRv);
42 // Clear any partially sent messages from the send queue
43 void Clear();
45 private:
46 MIDIOutput(nsPIDOMWindowInner* aWindow, MIDIAccess* aMIDIAccessParent);
49 } // namespace dom
50 } // namespace mozilla
52 #endif // mozilla_dom_MIDIOutput_h