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"
23 * Represents a MIDI Output Port, handles sending message to devices.
26 class MIDIOutput final
: public MIDIPort
{
28 static RefPtr
<MIDIOutput
> Create(nsPIDOMWindowInner
* aWindow
,
29 MIDIAccess
* aMIDIAccessParent
,
30 const MIDIPortInfo
& aPortInfo
,
31 const bool aSysexEnabled
);
32 ~MIDIOutput() = default;
34 JSObject
* WrapObject(JSContext
* aCx
,
35 JS::Handle
<JSObject
*> aGivenProto
) override
;
37 // Send a message to an output port
38 void Send(const Sequence
<uint8_t>& aData
, const Optional
<double>& aTimestamp
,
40 // Clear any partially sent messages from the send queue
44 explicit MIDIOutput(nsPIDOMWindowInner
* aWindow
);
48 } // namespace mozilla
50 #endif // mozilla_dom_MIDIOutput_h