blob: 05fd58d84abaafbb13fa8e8fee6c71028e5d2a66 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.hardware.midi;
using zx;
/// Describes what type of MIDI device an implementation of Device represents
struct Info {
/// Whether or not this device is a MIDI sink
bool is_sink;
/// Whether or not this device is a MIDI source
bool is_source;
};
const uint32 READ_SIZE = 3;
protocol Device {
/// Get information about the type of MIDI device
GetInfo() -> (Info info);
/// Reads data from the midi device. Only applicable if GetInfo returns
/// is_source.
Read() -> (vector<uint8>:READ_SIZE event) error zx.status;
/// Writes data to the midi device. Only applicable if GetInfo returns
/// is_sink.
Write(vector<uint8>:MAX data) -> () error zx.status;
};