swift
notificationsounds.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_MISC_NOTIFICATIONSOUNDS_H
7 #define SWIFT_MISC_NOTIFICATIONSOUNDS_H
8 
9 #include <QMetaType>
10 
11 #include "misc/swiftmiscexport.h"
12 
13 namespace swift::misc::audio
14 {
21  {
24  {
25  NoNotifications = 0,
26  // 1 << 0 previously used for NotificationError
27  NotificationLogin = 1 << 1,
28  NotificationLogoff = 1 << 2,
29  NotificationTextMessageFrequency = 1 << 12,
30  NotificationTextMessagePrivate = 1 << 3,
31  NotificationTextMessageSupervisor = 1 << 4,
32  NotificationTextMessageUnicom = 1 << 13,
33  NotificationTextCallsignMentioned = 1 << 5,
34  // 1 << 6 previously used for NoAudioTransmission
35  // 1 << 10 previously used for NotificationAtcTunedIn
36  // 1 << 11 previously used for NotificationAtcTunedOut
37  PTTClickKeyDown = 1 << 7,
38  PTTClickKeyUp = 1 << 8,
39  // 1 << 9 previously used for PTTBlocked
40 
41  // AFVClicked and AFVBlocked are not played back from the notification player itself (except for preview
42  // playback). Instead, they are provided from swift::sound::sample_provider::Samples. They are included here
43  // to allow to disable playing them.
44  AFVClicked = 1 << 14,
45  AFVBlocked = 1 << 15
46  };
47  Q_DECLARE_FLAGS(Notification, NotificationFlag)
48 
49 
50  constexpr static Notification AllTextNotifications = Notification(
51  NotificationTextMessageFrequency | NotificationTextMessagePrivate | NotificationTextCallsignMentioned |
52  NotificationTextMessageSupervisor | NotificationTextMessageUnicom);
53 
55  constexpr static Notification AllLoginNotifications = Notification(NotificationLogin | NotificationLogoff);
56 
58  constexpr static Notification AllPTTNotifications = Notification(PTTClickKeyUp | PTTClickKeyDown);
59 
61  constexpr static Notification AllAfv = Notification(AFVClicked | AFVBlocked);
62 
64  constexpr static Notification AllNotifications =
65  Notification(AllTextNotifications | AllLoginNotifications | AllPTTNotifications | AllAfv);
66 
68  constexpr static Notification DefaultNotifications =
69  Notification(AllNotifications & ~(NotificationTextMessageFrequency | NotificationTextMessageUnicom));
70 
72  static const QString &flagToString(NotificationFlag notification);
73 
75  static QString toString(Notification notification);
76  };
77 } // namespace swift::misc::audio
78 
79 Q_DECLARE_METATYPE(swift::misc::audio::CNotificationSounds::Notification)
80 Q_DECLARE_METATYPE(swift::misc::audio::CNotificationSounds::NotificationFlag)
81 
82 #endif // SWIFT_MISC_NOTIFICATIONSOUNDS_H
Simplified enums to play sounds.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.