1 /* 2 * Copyright (C) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef AVRCP_MEDIA_H 17 #define AVRCP_MEDIA_H 18 19 #include <cstdint> 20 #include <string> 21 #include <vector> 22 #include "cstdint" 23 #include "iosfwd" 24 25 namespace OHOS { 26 namespace bluetooth { 27 /** 28 * @brief This class provides a set of attributes for saving the packet of the <b>Media player item</b>. 29 * @see Audio/Video Remote Control 1.6.2 Section 6.10.2.1 Media player item. 30 * 31 * @since 6.0 32 */ 33 class AvrcMpItem { 34 public: 35 AvrcMpItem(uint8_t itemType, uint16_t playerId, uint8_t majorType, uint32_t subType, uint8_t playStatus, 36 const std::vector<uint8_t> &features, const std::string &name); 37 38 AvrcMpItem() = default; 39 AvrcMpItem(const AvrcMpItem& other) = default; 40 ~AvrcMpItem() = default; 41 42 uint8_t itemType_ = 0; // The value of the "Item Type ". 43 uint16_t playerId_ = 0; // The value of the "Player Id". 44 uint8_t majorType_ = 0; // The value of the "Major Player Type". Refer to <b>AvrcMediaMajorPlayerType</b>. 45 uint32_t subType_ = 0; // The value of the "Player Sub Type". Refer to <b>AvrcMediaPlayerSubType</b>. 46 uint8_t playStatus_ = 0; // The value of the "Play Status". Refer to <b>AvrcPlayStatus</b>. 47 std::vector<uint8_t> features_ {}; // The value of the "Feature Bit Mask". 48 std::string name_ {}; // The value of the "Displayable Name". 49 }; 50 51 /** 52 * @brief This class provides a set of attributes for saving the packet of the <b>Media player item</b>. 53 * @see Audio/Video Remote Control 1.6.2 Section 6.10.2.2 Folder item and Section 6.10.2.3 Media element item. 54 * 55 * @since 6.0 56 */ 57 class AvrcMeItem { 58 public: 59 AvrcMeItem(uint8_t itemType, uint64_t uid, uint8_t type, uint8_t playable, const std::string &name, 60 const std::vector<uint32_t> &attributes, const std::vector<std::string> &values); 61 AvrcMeItem() = default; 62 AvrcMeItem(const AvrcMeItem& other) = default; 63 ~AvrcMeItem() = default; 64 65 uint8_t itemType_ = 0; // The value of the "Item Type ". 66 // The value of the "Folder UID" and the "Media Element UID". 67 uint64_t uid_ = 0; 68 // The value of the "Folder Type" and the "Media Type". Refer to <b>AvrcMediaFolderType</b> and 69 // <b>AvrcMediaElementType</b>. 70 uint8_t type_ = 0; 71 // The value of the "Is Playable". Refer to <b>AvrcMediaFolderPlayable</b>. 72 uint8_t playable_ = 0; 73 // The value of the "Displayable Name". 74 std::string name_ {}; 75 // The list of the "Attribute ID". Refer to <b>AvrcMediaAttribute</b>. 76 std::vector<uint32_t> attributes_ {}; 77 // The list of the "Attribute Value". 78 std::vector<std::string> values_ {}; 79 }; 80 } // namespace bluetooth 81 } // namespace OHOS 82 83 #endif // AVRCP_MEDIA_H