1 // Copyright 2017 The Fuchsia Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #pragma once 6 7 #include <zircon/device/audio.h> 8 9 namespace audio { 10 namespace audio_proto { 11 12 // C++ style aliases for protocol structures and types. 13 using Cmd = audio_cmd_t; 14 using CmdHdr = audio_cmd_hdr_t; 15 16 // Structures used with GET/SET format 17 using SampleFormat = audio_sample_format_t; 18 using FormatRange = audio_stream_format_range_t; 19 20 // AUDIO_STREAM_CMD_GET_FORMATS 21 using StreamGetFmtsReq = audio_stream_cmd_get_formats_req_t; 22 using StreamGetFmtsResp = audio_stream_cmd_get_formats_resp_t; 23 24 // AUDIO_STREAM_CMD_SET_FORMAT 25 using StreamSetFmtReq = audio_stream_cmd_set_format_req_t; 26 using StreamSetFmtResp = audio_stream_cmd_set_format_resp_t; 27 28 // AUDIO_STREAM_CMD_GET_GAIN 29 using GetGainReq = audio_stream_cmd_get_gain_req_t; 30 using GetGainResp = audio_stream_cmd_get_gain_resp_t; 31 32 // AUDIO_STREAM_CMD_SET_GAIN 33 using SetGainReq = audio_stream_cmd_set_gain_req_t; 34 using SetGainResp = audio_stream_cmd_set_gain_resp_t; 35 36 // AUDIO_STREAM_CMD_PLUG_DETECT 37 using PlugDetectReq = audio_stream_cmd_plug_detect_req_t; 38 using PlugDetectResp = audio_stream_cmd_plug_detect_resp_t; 39 40 // AUDIO_STREAM_PLUG_DETECT_NOTIFY 41 using PlugDetectNotify = audio_stream_plug_detect_notify_t; 42 43 // AUDIO_STREAM_CMD_GET_UNIQUE_ID 44 using GetUniqueIdReq = audio_stream_cmd_get_unique_id_req_t; 45 using GetUniqueIdResp = audio_stream_cmd_get_unique_id_resp_t; 46 47 // AUDIO_STREAM_CMD_GET_STRING 48 using GetStringReq = audio_stream_cmd_get_string_req_t; 49 using GetStringResp = audio_stream_cmd_get_string_resp_t; 50 51 // AUDIO_RB_CMD_GET_FIFO_DEPTH 52 using RingBufGetFifoDepthReq = audio_rb_cmd_get_fifo_depth_req_t; 53 using RingBufGetFifoDepthResp = audio_rb_cmd_get_fifo_depth_resp_t; 54 55 // AUDIO_RB_CMD_GET_BUFFER 56 using RingBufGetBufferReq = audio_rb_cmd_get_buffer_req_t; 57 using RingBufGetBufferResp = audio_rb_cmd_get_buffer_resp_t; 58 59 // AUDIO_RB_CMD_START 60 using RingBufStartReq = audio_rb_cmd_start_req_t; 61 using RingBufStartResp = audio_rb_cmd_start_resp_t; 62 63 // AUDIO_RB_CMD_STOP 64 using RingBufStopReq = audio_rb_cmd_stop_req_t; 65 using RingBufStopResp = audio_rb_cmd_stop_resp_t; 66 67 // AUDIO_RB_POSITION_NOTIFY 68 using RingBufPositionNotify = audio_rb_position_notify_t; 69 70 const char* SampleFormatToString(SampleFormat sample_format); 71 72 } // namespace audio_proto 73 } // namespace audio 74