blob: df12a3ea1780f5a26aebe50dbcf4ce3ea8de1875 [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 */
16#include "VirtualProgram.h"
17
18namespace android {
19namespace hardware {
20namespace broadcastradio {
21namespace V1_1 {
22namespace implementation {
23
Tomasz Wasilczyk100f2ed2017-06-29 16:04:05 -070024using V1_0::MetaData;
25using V1_0::MetadataKey;
26using V1_0::MetadataType;
27
28VirtualProgram::operator ProgramInfo() const {
29 ProgramInfo info11 = {};
30 auto& info10 = info11.base;
31
32 info10.channel = channel;
33 info10.tuned = true;
34 info10.stereo = true;
35 info10.signalStrength = 100;
36
37 info10.metadata = hidl_vec<MetaData>({
38 {MetadataType::TEXT, MetadataKey::RDS_PS, {}, {}, programName, {}},
39 {MetadataType::TEXT, MetadataKey::TITLE, {}, {}, songTitle, {}},
40 {MetadataType::TEXT, MetadataKey::ARTIST, {}, {}, songArtist, {}},
41 });
42
43 return info11;
44}
45
Tomasz Wasilczyk48377552017-06-22 10:45:33 -070046bool operator<(const VirtualProgram& lhs, const VirtualProgram& rhs) {
47 return lhs.channel < rhs.channel;
48}
49
50} // namespace implementation
51} // namespace V1_1
52} // namespace broadcastradio
53} // namespace hardware
54} // namespace android