Tomasz Wasilczyk | 4837755 | 2017-06-22 10:45:33 -0700 | [diff] [blame] | 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 | |
Tomasz Wasilczyk | 100f2ed | 2017-06-29 16:04:05 -0700 | [diff] [blame] | 19 | #include <android/hardware/broadcastradio/1.1/types.h> |
Tomasz Wasilczyk | 5be4c2b | 2017-07-27 13:17:07 -0700 | [diff] [blame] | 20 | #include <broadcastradio-utils/Utils.h> |
Tomasz Wasilczyk | 4837755 | 2017-06-22 10:45:33 -0700 | [diff] [blame] | 21 | |
| 22 | namespace android { |
| 23 | namespace hardware { |
| 24 | namespace broadcastradio { |
| 25 | namespace V1_1 { |
| 26 | namespace implementation { |
| 27 | |
Tomasz Wasilczyk | efadc19 | 2017-07-28 10:08:46 -0700 | [diff] [blame] | 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 | */ |
Tomasz Wasilczyk | 4837755 | 2017-06-22 10:45:33 -0700 | [diff] [blame] | 34 | struct VirtualProgram { |
Tomasz Wasilczyk | a02b6ef | 2017-07-05 11:23:30 -0700 | [diff] [blame] | 35 | ProgramSelector selector; |
Tomasz Wasilczyk | 4837755 | 2017-06-22 10:45:33 -0700 | [diff] [blame] | 36 | |
Tomasz Wasilczyk | 100f2ed | 2017-06-29 16:04:05 -0700 | [diff] [blame] | 37 | std::string programName = ""; |
| 38 | std::string songArtist = ""; |
| 39 | std::string songTitle = ""; |
| 40 | |
Tomasz Wasilczyk | 5be4c2b | 2017-07-27 13:17:07 -0700 | [diff] [blame] | 41 | ProgramInfo getProgramInfo(utils::HalRevision halRev) const; |
| 42 | |
Tomasz Wasilczyk | 4837755 | 2017-06-22 10:45:33 -0700 | [diff] [blame] | 43 | friend bool operator<(const VirtualProgram& lhs, const VirtualProgram& rhs); |
| 44 | }; |
| 45 | |
Tomasz Wasilczyk | 5be4c2b | 2017-07-27 13:17:07 -0700 | [diff] [blame] | 46 | std::vector<ProgramInfo> getProgramInfoVector(const std::vector<VirtualProgram>& vec, |
| 47 | utils::HalRevision halRev); |
| 48 | |
Tomasz Wasilczyk | 4837755 | 2017-06-22 10:45:33 -0700 | [diff] [blame] | 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 |