blob: 0c20721bf2297bee76163b6b25faaf4269fd25df [file] [log] [blame]
Weilin Xub2a6ca62022-05-08 23:47:04 +00001/*
2 * Copyright (C) 2022 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
17#pragma once
18
19#include <aidl/android/hardware/broadcastradio/IdentifierType.h>
20#include <aidl/android/hardware/broadcastradio/ProgramInfo.h>
21#include <aidl/android/hardware/broadcastradio/ProgramSelector.h>
22
23namespace aidl::android::hardware::broadcastradio {
24
25constexpr int kSignalQualityDigital = 100;
26constexpr int kSignalQualityNonDigital = 80;
27/**
28 * A radio program mock.
29 *
30 * This represents broadcast waves flying over the air,
31 * not an entry for a captured station in the radio tuner memory.
32 */
33struct VirtualProgram {
34 ProgramSelector selector;
35
36 std::string programName = "";
37 std::string songArtist = "";
38 std::string songTitle = "";
39
40 operator ProgramInfo() const;
41
42 /**
43 * Defines order in which virtual programs appear on the "air" with
44 * ITunerSession::scan().
45 *
46 * It's for default implementation purposes, may not be complete or correct.
47 */
48 friend bool operator<(const VirtualProgram& lhs, const VirtualProgram& rhs);
49};
50
51} // namespace aidl::android::hardware::broadcastradio