michael@0: /* michael@0: * Copyright (C) 2008 The Android Open Source Project michael@0: * michael@0: * Licensed under the Apache License, Version 2.0 (the "License"); michael@0: * you may not use this file except in compliance with the License. michael@0: * You may obtain a copy of the License at michael@0: * michael@0: * http://www.apache.org/licenses/LICENSE-2.0 michael@0: * michael@0: * Unless required by applicable law or agreed to in writing, software michael@0: * distributed under the License is distributed on an "AS IS" BASIS, michael@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. michael@0: * See the License for the specific language governing permissions and michael@0: * limitations under the License. michael@0: */ michael@0: michael@0: #include michael@0: michael@0: /* michael@0: * The following definitions are copied from the android sources. Only the michael@0: * relevant enum member and values needed are copied. michael@0: */ michael@0: michael@0: /* michael@0: * From https://android.googlesource.com/platform/frameworks/base/+/android-2.2.3_r2.1/include/utils/Errors.h michael@0: */ michael@0: typedef int32_t status_t; michael@0: michael@0: /* michael@0: * From https://android.googlesource.com/platform/frameworks/base/+/android-2.2.3_r2.1/include/media/AudioTrack.h michael@0: */ michael@0: struct Buffer { michael@0: uint32_t flags; michael@0: int channelCount; michael@0: int format; michael@0: size_t frameCount; michael@0: size_t size; michael@0: union { michael@0: void* raw; michael@0: short* i16; michael@0: int8_t* i8; michael@0: }; michael@0: }; michael@0: michael@0: enum event_type { michael@0: EVENT_MORE_DATA = 0, michael@0: EVENT_UNDERRUN = 1, michael@0: EVENT_LOOP_END = 2, michael@0: EVENT_MARKER = 3, michael@0: EVENT_NEW_POS = 4, michael@0: EVENT_BUFFER_END = 5 michael@0: }; michael@0: michael@0: /** michael@0: * From https://android.googlesource.com/platform/frameworks/base/+/android-2.2.3_r2.1/include/media/AudioSystem.h michael@0: * and michael@0: * https://android.googlesource.com/platform/system/core/+/android-4.2.2_r1/include/system/audio.h michael@0: */ michael@0: michael@0: #define AUDIO_STREAM_TYPE_MUSIC 3 michael@0: michael@0: enum { michael@0: AUDIO_CHANNEL_OUT_FRONT_LEFT_ICS = 0x1, michael@0: AUDIO_CHANNEL_OUT_FRONT_RIGHT_ICS = 0x2, michael@0: AUDIO_CHANNEL_OUT_MONO_ICS = AUDIO_CHANNEL_OUT_FRONT_LEFT_ICS, michael@0: AUDIO_CHANNEL_OUT_STEREO_ICS = (AUDIO_CHANNEL_OUT_FRONT_LEFT_ICS | AUDIO_CHANNEL_OUT_FRONT_RIGHT_ICS) michael@0: } AudioTrack_ChannelMapping_ICS; michael@0: michael@0: enum { michael@0: AUDIO_CHANNEL_OUT_FRONT_LEFT_Froyo = 0x4, michael@0: AUDIO_CHANNEL_OUT_FRONT_RIGHT_Froyo = 0x8, michael@0: AUDIO_CHANNEL_OUT_MONO_Froyo = AUDIO_CHANNEL_OUT_FRONT_LEFT_Froyo, michael@0: AUDIO_CHANNEL_OUT_STEREO_Froyo = (AUDIO_CHANNEL_OUT_FRONT_LEFT_Froyo | AUDIO_CHANNEL_OUT_FRONT_RIGHT_Froyo) michael@0: } AudioTrack_ChannelMapping_Froyo; michael@0: michael@0: typedef enum { michael@0: AUDIO_FORMAT_PCM = 0x00000000, michael@0: AUDIO_FORMAT_PCM_SUB_16_BIT = 0x1, michael@0: AUDIO_FORMAT_PCM_16_BIT = (AUDIO_FORMAT_PCM | AUDIO_FORMAT_PCM_SUB_16_BIT), michael@0: } AudioTrack_SampleType; michael@0: