Debian Codegraph @

kysdk-soundeffects/src/ksoundeffects.h

raw
1 /*
2 * libkysdk-soundeffects's Library
3 *
4 * Copyright (C) 2023, KylinSoft Co., Ltd.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this library. If not, see <https://www.gnu.org/licenses/>.
18 *
19 * Authors: Zhenyu Wang <[email protected]>
20 *
21 */
22
23 #ifndef KSOUNDEFFECTS_H
24 #define KSOUNDEFFECTS_H
25
26 #include "kysdk-soundeffects_global.h"
27 #include <QObject>
28
29 namespace kdk
30 {
31 /**
32 * @defgroup NotificationModule
33 */
34
35 /**
36 * @brief 声音类型,不同场景下可以选择不同枚举类型来播放不同音效
37 * @since 2.2.1.0
38 */
39
40 enum SoundType{
41 AUDIO_VOLUME_CHANGE,
42 BATTERY_LOW,
43 COMPLETE,
44 DEVICE_ADDED_FAILED,
45 DEVICE_REMOVED,
46 DEVICE_ADDED,
47 DIALOG_ERROR,
48 DIALOG_WARNING,
49 NOTIFICATION_GENERAL,
50 NOTIFICATION_SPECIAL,
51 OPERATION_FILE,
52 OPERATION_UNSUPPORTED,
53 POWER_PLUG,
54 SCREEN_CAPTURE,
55 SCREEN_RECORD,
56 START_UP,
57 TRASH_EMPTY
58 };
59
60 /**
61 * @brief 音效通知,可以根据输入的类型触发不同的音效提示用户
62 */
63 class KYSDKSOUNDEFFECTS_EXPORT KSoundEffects : public QObject
64 {
65 Q_OBJECT
66 public:
67 KSoundEffects();
68
69 /**
70 * @brief 播放系统音效
71 * @param soundEvent
72 * @return
73 */
74 static void playSound(SoundType type);
75
76 };
77 }
78 #endif // KSOUNDEFFECTS_H