/src/mozilla-central/dom/midi/MIDIPortInterface.cpp
Line | Count | Source (jump to first uncovered line) |
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/. */ |
6 | | |
7 | | #include "mozilla/dom/MIDIPortInterface.h" |
8 | | #include "mozilla/dom/MIDIPlatformService.h" |
9 | | #include "mozilla/dom/MIDITypes.h" |
10 | | |
11 | | MIDIPortInterface::MIDIPortInterface(const MIDIPortInfo& aPortInfo, bool aSysexEnabled) : |
12 | | mId(aPortInfo.id()), |
13 | | mName(aPortInfo.name()), |
14 | | mManufacturer(aPortInfo.manufacturer()), |
15 | | mVersion(aPortInfo.version()), |
16 | | mSysexEnabled(aSysexEnabled), |
17 | | mType((MIDIPortType)aPortInfo.type()), |
18 | | // We'll never initialize a port object that's not connected |
19 | | mDeviceState(MIDIPortDeviceState::Connected), |
20 | | // Open everything on connection |
21 | | mConnectionState(MIDIPortConnectionState::Open), |
22 | | mShuttingDown(false) |
23 | 0 | { |
24 | 0 | } |
25 | | |
26 | | MIDIPortInterface::~MIDIPortInterface() |
27 | 0 | { |
28 | 0 | Shutdown(); |
29 | 0 | } |
30 | | |
31 | | void |
32 | | MIDIPortInterface::Shutdown() |
33 | 0 | { |
34 | 0 | mShuttingDown = true; |
35 | 0 | } |
36 | | |