• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef MINDSPORE_INCLUDE_JS_API_MS_INFO_H
16 #define MINDSPORE_INCLUDE_JS_API_MS_INFO_H
17 
18 namespace mindspore {
19 enum InterruptType {
20   INTERRUPT_TYPE_BEGIN = 1,
21   INTERRUPT_TYPE_END = 2,
22 };
23 
24 enum InterruptHint {
25   INTERRUPT_HINT_NONE = 0,
26   INTERRUPT_HINT_RESUME,
27   INTERRUPT_HINT_PAUSE,
28   INTERRUPT_HINT_STOP,
29   INTERRUPT_HINT_DUCK,
30   INTERRUPT_HINT_UNDUCK
31 };
32 
33 enum InterruptForceType {
34   /**
35    * Force type, system change audio state.
36    */
37   INTERRUPT_FORCE = 0,
38   /**
39    * Share type, application change audio state.
40    */
41   INTERRUPT_SHARE
42 };
43 
44 struct InterruptEvent {
45   /**
46    * Interrupt event type, begin or end
47    */
48   InterruptType eventType;
49   /**
50    * Interrupt force type, force or share
51    */
52   InterruptForceType forceType;
53   /**
54    * Interrupt hint type. In force type, the audio state already changed,
55    * but in share mode, only provide a hint for application to decide.
56    */
57   InterruptHint hintType;
58 };
59 
60 // Used internally only by AudioFramework
61 struct InterruptEventInternal {
62   InterruptType eventType;
63   InterruptForceType forceType;
64   InterruptHint hintType;
65   float duckVolume;
66 };
67 
68 }  // namespace mindspore
69 #endif  // MS_INFO_H