1 /* 2 * Copyright (c) 2023 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 MIGRATE_AVSESSION_CONSTANT_H 17 #define MIGRATE_AVSESSION_CONSTANT_H 18 19 #include <iostream> 20 #include <string> 21 22 namespace OHOS::AVSession { 23 constexpr int32_t PROCESS_STATE_IDLE = 0; 24 constexpr int32_t PROCESS_STATE_CONNECTING = 1; 25 constexpr int32_t PROCESS_STATE_CONNECTED = 2; 26 27 constexpr int32_t MEDIA_SESSION_PLAYBACK_STATE_PLAY = 3; 28 constexpr int32_t MEDIA_SESSION_PLAYBACK_STATE_PAUSE = 2; 29 constexpr int32_t MEDIA_SESSION_PLAYBACK_STATE_STOP = 1; 30 constexpr int32_t MEDIA_SESSION_PLAYBACK_STATE_ERROR = 7; 31 32 constexpr int32_t HEART_BEAT_TIME = 180000; 33 34 constexpr int32_t SYNC_MEDIASESSION_CALLBACK_ON_COMMAND = 30; 35 constexpr int32_t SYNC_MEDIASESSION_CALLBACK_ON_MEDIABUTTON_EVENT = 31; 36 constexpr int32_t SYNC_MEDIASESSION_CALLBACK_ON_PLAY_FROM_SEARCH = 37; 37 constexpr int32_t SYNC_MEDIASESSION_CALLBACK_ON_PLAY_FROM_MEDIAID = 38; 38 constexpr int32_t SYNC_MEDIASESSION_CALLBACK_ON_CUSTOMACTION = 50; 39 constexpr int32_t SYNC_MEDIASESSION_CALLBACK_ON_PLAY = 36; 40 constexpr int32_t SYNC_MEDIASESSION_CALLBACK_ON_PLAY_FROM_URI = 39; 41 constexpr int32_t SYNC_MEDIASESSION_CALLBACK_ON_PAUSE = 41; 42 constexpr int32_t SYNC_MEDIASESSION_CALLBACK_ON_SKIP_TO_NEXT = 42; 43 constexpr int32_t SYNC_MEDIASESSION_CALLBACK_ON_SKIP_TO_PREVIOUS = 43; 44 constexpr int32_t SYNC_MEDIASESSION_CALLBACK_ON_STOP = 46; 45 constexpr int32_t SYNC_MEDIASESSION_CALLBACK_ON_SET_RATING = 48; 46 constexpr int32_t SYNC_CONTROLLER_CALLBACK_ON_AUDIOINFO_CHANGED = 18; 47 48 constexpr int32_t MSG_HEAD_LENGTH = 2; 49 constexpr int32_t MSG_HEAD_MODE = 100; 50 51 constexpr int32_t SYNC_CONTROLLER_LIST = 1; 52 constexpr int32_t SYNC_CONTROLLER = 2; 53 constexpr int32_t SYNC_COMMAND = 3; 54 constexpr int32_t SYNC_HEARTBEAT = 4; 55 constexpr int32_t GET_HISTORY_MEDIA_INFO = 5; 56 constexpr int32_t COLD_START = 6; 57 58 constexpr int32_t SYNC_CONTROLLER_CALLBACK_ON_DESTROYED = 11; 59 constexpr int32_t SYNC_CONTROLLER_CALLBACK_ON_SESSION_EVENT = 12; 60 constexpr int32_t SYNC_CONTROLLER_CALLBACK_ON_PLAYBACKSTATE_CHANGED = 13; 61 constexpr int32_t SYNC_CONTROLLER_CALLBACK_ON_METADATA_CHANNGED = 14; 62 63 constexpr int REASON_EXIST = -3; 64 65 const std::string EMIT_UTF8 = "emitUTF8"; 66 const std::string PLAYBACK_SPEED = "playbackSpeed"; 67 const std::string PLAYBACK_POSITION_ELAPSED_TIME = "playbackPositionElapsedTime_"; 68 const std::string PLAYBACK_POSITION_UPDATE_TIME = "playbackPositionUpdateTime_"; 69 const std::string PLAYBACK_GET_ACTIVE_ITEM_ID = "playbackGetActiveItemId"; 70 71 const std::string EVENT_COMMAND_UNLOCK_LYRIC = "EVENT_COMMAND_UNLOCK_LYRIC"; 72 const std::string EVENT_COMMAND_SHOW_LYRIC = "EVENT_COMMAND_SHOW_LYRIC"; 73 const std::string EVENT_COMMAND_HIDE_LYRIC = "EVENT_COMMAND_HIDE_LYRIC"; 74 75 const std::string MEDIA_CONTROLLER_LIST = "MediaControllerList"; 76 77 const std::string HISTORY_MEDIA_PLAYER_INFO = "HistoryMediaPlayerInfo"; 78 79 const std::string MEDIA_SESSION = "MediaSession"; 80 81 const std::string METADATA_TITLE = "MetadataTitle"; 82 83 const std::string METADATA_ARTIST = "MetadataArtist"; 84 85 const std::string METADATA_IMAGE = "MetadataArt"; 86 87 const std::string PLAYBACK_STATE = "PlaybackState"; 88 89 const std::string SESSION_INFO = "SessionInfo"; 90 91 const std::string RATING = "Rating"; 92 93 const std::string LYRIC_STATE = "LyricState"; 94 95 const std::string PLAYBACK_INFO = "PlaybackInfo"; 96 97 const std::string MEDIA_COMMAND = "MediaCommand"; 98 99 const std::string COMMAND = "command"; 100 101 const std::string QUERY = "query"; 102 103 const std::string EVENT = "event"; 104 105 const std::string EXTRAS = "extras"; 106 107 const std::string PLAYER_ID = "PlayerId"; 108 109 const std::string PACKAGE_NAME = "PackageName"; 110 111 const std::string MEDIA_INFO = "MediaInfo"; 112 113 const std::string CALLBACK_INFO = "CallbackInfo"; 114 115 const std::string VOLUME_INFO = "VolumeInfo"; 116 117 const std::string METADATA_MASK_ALL = "11111111111111111"; 118 const std::string METADATA_MASK_NULL = "00000000000000000"; 119 const std::string PLAYBACK_MASK_ALL = "111111111"; 120 const std::string PLAYBACK_MASK_NULL = "000000000"; 121 constexpr int32_t VOLUMN_INFO = 15; 122 123 const std::string CONFIG_SOFTBUS_SESSION_TAG = "Media_Session_RemoteCtrl"; 124 } // namespace OHOS::AVSession 125 126 #endif // MIGRATE_AVSESSION_CONSTANT_H