MIDIUtils.h (967B)
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/TimeStamp.h" 8 #include "nsTArray.h" 9 10 namespace mozilla::dom { 11 class MIDIMessage; 12 13 /** 14 * Set of utility functions for dealing with MIDI Messages. 15 * 16 */ 17 namespace MIDIUtils { 18 19 // Takes a nsTArray of bytes and parses it into zero or more MIDI messages. 20 // Returns true if no errors were encountered, false otherwise. 21 bool ParseMessages(const nsTArray<uint8_t>& aByteBuffer, 22 const TimeStamp& aTimestamp, 23 nsTArray<MIDIMessage>& aMsgArray); 24 // Returns true if a message is a sysex message. 25 bool IsSysexMessage(const MIDIMessage& a); 26 } // namespace MIDIUtils 27 } // namespace mozilla::dom