tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

MIDIPortInterface.h (1648B)


      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 #ifndef mozilla_dom_MIDIPortInterface_h
      8 #define mozilla_dom_MIDIPortInterface_h
      9 
     10 #include "mozilla/dom/MIDIPortBinding.h"
     11 
     12 namespace mozilla::dom {
     13 class MIDIPortInfo;
     14 /**
     15 * Base class for MIDIPort Parent/Child Actors. Makes sure both sides of the
     16 * MIDIPort IPC connection need to a synchronized set of info/state.
     17 *
     18 */
     19 class MIDIPortInterface {
     20 public:
     21  MIDIPortInterface(const MIDIPortInfo& aPortInfo, bool aSysexEnabled);
     22  const nsString& Id() const { return mId; }
     23  const nsString& Name() const { return mName; }
     24  const nsString& Manufacturer() const { return mManufacturer; }
     25  const nsString& Version() const { return mVersion; }
     26  bool SysexEnabled() const { return mSysexEnabled; }
     27  MIDIPortType Type() const { return mType; }
     28  MIDIPortDeviceState DeviceState() const { return mDeviceState; }
     29  MIDIPortConnectionState ConnectionState() const { return mConnectionState; }
     30  bool IsShutdown() const { return mShuttingDown; }
     31  virtual void Shutdown();
     32 
     33 protected:
     34  virtual ~MIDIPortInterface();
     35  nsString mId;
     36  nsString mName;
     37  nsString mManufacturer;
     38  nsString mVersion;
     39  bool mSysexEnabled;
     40  MIDIPortType mType;
     41  MIDIPortDeviceState mDeviceState;
     42  MIDIPortConnectionState mConnectionState;
     43  bool mShuttingDown;
     44 };
     45 
     46 }  // namespace mozilla::dom
     47 
     48 #endif  // mozilla_dom_MIDIPortInterface_h