blob: fd7a5e7731f5aead51fb28cc7900097b5669107a [file] [log] [blame]
Tomasz Wasilczyk48377552017-06-22 10:45:33 -07001/*
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 */
Tomasz Wasilczyk8c34c812018-02-08 13:42:31 -080016#ifndef ANDROID_HARDWARE_BROADCASTRADIO_V1_1_VIRTUALPROGRAM_H
17#define ANDROID_HARDWARE_BROADCASTRADIO_V1_1_VIRTUALPROGRAM_H
Tomasz Wasilczyk48377552017-06-22 10:45:33 -070018
Tomasz Wasilczyk8c34c812018-02-08 13:42:31 -080019#include <android/hardware/broadcastradio/1.1/types.h>
Tomasz Wasilczyk06100b32017-12-04 09:53:32 -080020#include <broadcastradio-utils-1x/Utils.h>
Tomasz Wasilczyk48377552017-06-22 10:45:33 -070021
22namespace android {
23namespace hardware {
24namespace broadcastradio {
Tomasz Wasilczyk8c34c812018-02-08 13:42:31 -080025namespace V1_1 {
Tomasz Wasilczyk48377552017-06-22 10:45:33 -070026namespace implementation {
27
Tomasz Wasilczykefadc192017-07-28 10:08:46 -070028/**
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 Wasilczyk48377552017-06-22 10:45:33 -070034struct VirtualProgram {
Tomasz Wasilczykf679e8b2017-09-14 09:43:35 -070035 V1_1::ProgramSelector selector;
Tomasz Wasilczyk48377552017-06-22 10:45:33 -070036
Tomasz Wasilczyk100f2ed2017-06-29 16:04:05 -070037 std::string programName = "";
38 std::string songArtist = "";
39 std::string songTitle = "";
40
Tomasz Wasilczykf679e8b2017-09-14 09:43:35 -070041 V1_1::ProgramInfo getProgramInfo(utils::HalRevision halRev) const;
Tomasz Wasilczyk5be4c2b2017-07-27 13:17:07 -070042
Tomasz Wasilczyk48377552017-06-22 10:45:33 -070043 friend bool operator<(const VirtualProgram& lhs, const VirtualProgram& rhs);
44};
45
Tomasz Wasilczykf679e8b2017-09-14 09:43:35 -070046std::vector<V1_1::ProgramInfo> getProgramInfoVector(const std::vector<VirtualProgram>& vec,
47 utils::HalRevision halRev);
Tomasz Wasilczyk5be4c2b2017-07-27 13:17:07 -070048
Tomasz Wasilczyk48377552017-06-22 10:45:33 -070049} // namespace implementation
Tomasz Wasilczyk8c34c812018-02-08 13:42:31 -080050} // namespace V1_1
Tomasz Wasilczyk48377552017-06-22 10:45:33 -070051} // namespace broadcastradio
52} // namespace hardware
53} // namespace android
54
Tomasz Wasilczyk8c34c812018-02-08 13:42:31 -080055#endif // ANDROID_HARDWARE_BROADCASTRADIO_V1_1_VIRTUALPROGRAM_H