1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 #ifndef ANDROID_HARDWARE_BROADCASTRADIO_V1_1_VIRTUALPROGRAM_H 17 #define ANDROID_HARDWARE_BROADCASTRADIO_V1_1_VIRTUALPROGRAM_H 18 19 #include <android/hardware/broadcastradio/1.1/types.h> 20 #include <broadcastradio-utils-1x/Utils.h> 21 22 namespace android { 23 namespace hardware { 24 namespace broadcastradio { 25 namespace V1_1 { 26 namespace implementation { 27 28 /** 29 * A radio program mock. 30 * 31 * This represents broadcast waves flying over the air, 32 * not an entry for a captured station in the radio tuner memory. 33 */ 34 struct VirtualProgram { 35 V1_1::ProgramSelector selector; 36 37 std::string programName = ""; 38 std::string songArtist = ""; 39 std::string songTitle = ""; 40 41 V1_1::ProgramInfo getProgramInfo(utils::HalRevision halRev) const; 42 43 friend bool operator<(const VirtualProgram& lhs, const VirtualProgram& rhs); 44 }; 45 46 std::vector<V1_1::ProgramInfo> getProgramInfoVector(const std::vector<VirtualProgram>& vec, 47 utils::HalRevision halRev); 48 49 } // namespace implementation 50 } // namespace V1_1 51 } // namespace broadcastradio 52 } // namespace hardware 53 } // namespace android 54 55 #endif // ANDROID_HARDWARE_BROADCASTRADIO_V1_1_VIRTUALPROGRAM_H 56