• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 OHOS_AVSESSION_CALLBACK_CLIENT_H
17 #define OHOS_AVSESSION_CALLBACK_CLIENT_H
18 
19 #include "avsession_callback_stub.h"
20 #include "avsession_info.h"
21 #include "key_event.h"
22 #include "avsession_log.h"
23 
24 namespace OHOS::AVSession {
25 class AVSessionCallbackClient : public AVSessionCallbackStub {
26 public:
27     explicit AVSessionCallbackClient(const std::shared_ptr<AVSessionCallback>& callback);
28     ~AVSessionCallbackClient();
29 
30     void OnPlay() override;
31     void OnPause() override;
32     void OnStop() override;
33     void OnPlayNext() override;
34     void OnPlayPrevious() override;
35     void OnFastForward() override;
36     void OnRewind() override;
37     void OnSeek(int64_t time) override;
38     void OnSetSpeed(double speed) override;
39     void OnSetLoopMode(int32_t loopMode) override;
40     void OnToggleFavorite(const std::string& mediald) override;
41     void OnMediaKeyEvent(const MMI::KeyEvent& keyEvent) override;
42     void OnOutputDeviceChange(const OutputDeviceInfo& outputDeviceInfo) override;
43 
44 private:
45     std::shared_ptr<AVSessionCallback> callback_;
46     static constexpr const char* EVENT_NAME = "AVSessionCallback";
47 };
48 } // namespace OHOS::AVSession
49 #endif // OHOS_AVSESSION_CALLBACK_CLIENT_H