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 #include "mozilla/dom/MIDIPortInterface.h"
8 #include "mozilla/dom/MIDIPlatformService.h"
9 #include "mozilla/dom/MIDITypes.h"
11 mozilla::dom::MIDIPortInterface::MIDIPortInterface(
12 const MIDIPortInfo
& aPortInfo
, bool aSysexEnabled
)
13 : mId(aPortInfo
.id()),
14 mName(aPortInfo
.name()),
15 mManufacturer(aPortInfo
.manufacturer()),
16 mVersion(aPortInfo
.version()),
17 mSysexEnabled(aSysexEnabled
),
18 mType((MIDIPortType
)aPortInfo
.type()),
19 // We'll never initialize a port object that's not connected
20 mDeviceState(MIDIPortDeviceState::Connected
),
21 mConnectionState(MIDIPortConnectionState::Closed
),
22 mShuttingDown(false) {}
24 mozilla::dom::MIDIPortInterface::~MIDIPortInterface() { Shutdown(); }
26 void mozilla::dom::MIDIPortInterface::Shutdown() { mShuttingDown
= true; }