1 // Copyright 2016 The Android Open Source Project 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 // 15 16 // Implementation of brillo_audio_device_info.h. 17 18 #include "include/brillo_audio_device_info.h" 19 20 #include "brillo_audio_device_info_def.h" 21 #include "brillo_audio_device_info_internal.h" 22 23 using brillo::BAudioDeviceInfoInternal; 24 BAudioDeviceInfo_new(int device)25BAudioDeviceInfo* BAudioDeviceInfo_new(int device) { 26 BAudioDeviceInfo* audio_device_info = new BAudioDeviceInfo; 27 audio_device_info->internal_ = 28 std::make_unique<BAudioDeviceInfoInternal>(device); 29 return audio_device_info; 30 } 31 BAudioDeviceInfo_getType(BAudioDeviceInfo * device)32int BAudioDeviceInfo_getType(BAudioDeviceInfo* device) { 33 return device->internal_->GetDeviceId(); 34 } 35 BAudioDeviceInfo_delete(BAudioDeviceInfo * device)36void BAudioDeviceInfo_delete(BAudioDeviceInfo* device) { 37 delete device; 38 } 39