Audacity  2.2.0
CommandFlag.h
Go to the documentation of this file.
1 //
2 // CommandFlag.h
3 // Audacity
4 //
5 // Created by Paul Licameli on 11/22/16.
6 //
7 //
8 
9 #ifndef __AUDACITY_COMMAND_FLAG__
10 #define __AUDACITY_COMMAND_FLAG__
11 
12 // Flags used in command handling.
13 
14 // These flags represent the majority of the states that affect
15 // whether or not items in menus are enabled or disabled.
16 enum CommandFlag : unsigned long long
17 {
18  AlwaysEnabledFlag = 0x00000000,
19 
20  AudioIONotBusyFlag = 0x00000001,
21  TimeSelectedFlag = 0x00000002, // This is equivalent to check if there is a valid selection, so it's used for Zoom to Selection too
22  TracksSelectedFlag = 0x00000004,
23  TracksExistFlag = 0x00000008,
24  LabelTracksExistFlag = 0x00000010,
25  WaveTracksSelectedFlag = 0x00000020,
26  ClipboardFlag = 0x00000040,
27  TextClipFlag = 0x00000040, // Same as Clipboard flag for now.
28  UnsavedChangesFlag = 0x00000080,
29  HasLastEffectFlag = 0x00000100,
30  UndoAvailableFlag = 0x00000200,
31  RedoAvailableFlag = 0x00000400,
32  ZoomInAvailableFlag = 0x00000800,
33  ZoomOutAvailableFlag = 0x00001000,
34  StereoRequiredFlag = 0x00002000, //lda
35  TopDockHasFocus = 0x00004000, //lll
36  TrackPanelHasFocus = 0x00008000, //lll
37  BotDockHasFocus = 0x00010000, //lll
38  LabelsSelectedFlag = 0x00020000,
39  AudioIOBusyFlag = 0x00040000, //lll
40  PlayRegionLockedFlag = 0x00080000, //msmeyer
41  PlayRegionNotLockedFlag= 0x00100000, //msmeyer
42  CutCopyAvailableFlag = 0x00200000,
43  WaveTracksExistFlag = 0x00400000,
44  NoteTracksExistFlag = 0x00800000, //gsw
45  NoteTracksSelectedFlag = 0x01000000, //gsw
46  HaveRecentFiles = 0x02000000,
47  IsNotSyncLockedFlag = 0x04000000, //awd
48  IsSyncLockedFlag = 0x08000000, //awd
49  IsRealtimeNotActiveFlag= 0x10000000, //lll
50  CaptureNotBusyFlag = 0x20000000,
51  CanStopAudioStreamFlag = 0x40000000,
52  RulerHasFocus = 0x80000000ULL, // prl
53  NotMinimizedFlag = 0x100000000ULL, // prl
54  PausedFlag = 0x200000000ULL, // jkc
55  NotPausedFlag = 0x400000000ULL, // jkc
56  HasWaveDataFlag = 0x800000000ULL, // jkc
57  PlayableTracksExistFlag = 0x1000000000ULL,
58  AudioTracksSelectedFlag = 0x2000000000ULL,
59  NoAutoSelect = 0x4000000000ULL, // jkc
60 
62 };
63 
64 // Prevent accidental misuse with narrower types
65 
66 bool operator == (CommandFlag, unsigned long) PROHIBITED;
68 bool operator == (unsigned long, CommandFlag) PROHIBITED;
69 bool operator == (long, CommandFlag) PROHIBITED;
70 
71 bool operator != (CommandFlag, unsigned long) PROHIBITED;
72 bool operator != (CommandFlag, long) PROHIBITED;
73 bool operator != (unsigned long, CommandFlag) PROHIBITED;
74 bool operator != (long, CommandFlag) PROHIBITED;
75 
76 CommandFlag operator & (CommandFlag, unsigned long) PROHIBITED;
77 CommandFlag operator & (CommandFlag, long) PROHIBITED;
78 CommandFlag operator & (unsigned long, CommandFlag) PROHIBITED;
79 CommandFlag operator & (long, CommandFlag) PROHIBITED;
80 
81 CommandFlag operator | (CommandFlag, unsigned long) PROHIBITED;
82 CommandFlag operator | (CommandFlag, long) PROHIBITED;
83 CommandFlag operator | (unsigned long, CommandFlag) PROHIBITED;
84 CommandFlag operator | (long, CommandFlag) PROHIBITED;
85 
86 CommandFlag operator ^ (CommandFlag, unsigned long) PROHIBITED;
87 CommandFlag operator ^ (CommandFlag, long) PROHIBITED;
88 CommandFlag operator ^ (unsigned long, CommandFlag) PROHIBITED;
89 CommandFlag operator ^ (long, CommandFlag) PROHIBITED;
90 
91 bool operator == (CommandFlag, unsigned int) PROHIBITED;
92 bool operator == (CommandFlag, int) PROHIBITED;
93 bool operator == (unsigned int, CommandFlag) PROHIBITED;
94 bool operator == (int, CommandFlag) PROHIBITED;
95 
96 bool operator != (CommandFlag, unsigned int) PROHIBITED;
97 bool operator != (CommandFlag, int) PROHIBITED;
98 bool operator != (unsigned int, CommandFlag) PROHIBITED;
99 bool operator != (int, CommandFlag) PROHIBITED;
100 
101 CommandFlag operator & (CommandFlag, unsigned int) PROHIBITED;
102 CommandFlag operator & (CommandFlag, int) PROHIBITED;
103 CommandFlag operator & (unsigned int, CommandFlag) PROHIBITED;
104 CommandFlag operator & (int, CommandFlag) PROHIBITED;
105 
106 CommandFlag operator | (CommandFlag, unsigned int) PROHIBITED;
107 CommandFlag operator | (CommandFlag, int) PROHIBITED;
108 CommandFlag operator | (unsigned int, CommandFlag) PROHIBITED;
109 CommandFlag operator | (int, CommandFlag) PROHIBITED;
110 
111 CommandFlag operator ^ (CommandFlag, unsigned int) PROHIBITED;
112 CommandFlag operator ^ (CommandFlag, int) PROHIBITED;
113 CommandFlag operator ^ (unsigned int, CommandFlag) PROHIBITED;
114 CommandFlag operator ^ (int, CommandFlag) PROHIBITED;
115 
116 // Supply the bitwise operations
117 
118 inline CommandFlag operator ~ (CommandFlag flag)
119 {
120  return static_cast<CommandFlag>( ~ static_cast<unsigned long long> (flag) );
121 }
123 {
124  return static_cast<CommandFlag> (
125  static_cast<unsigned long long>(lhs) &
126  static_cast<unsigned long long>(rhs)
127  );
128 }
130 {
131  return static_cast<CommandFlag> (
132  static_cast<unsigned long long>(lhs) |
133  static_cast<unsigned long long>(rhs)
134  );
135 }
137 {
138  lhs = lhs | rhs;
139  return lhs;
140 }
141 
143 
144 #endif
Definition: CommandFlag.h:35
#define PROHIBITED
Definition: Audacity.h:224
CommandFlag operator&(CommandFlag, unsigned long) PROHIBITED
Definition: CommandFlag.h:27
Definition: CommandFlag.h:45
bool operator==(CommandFlag, unsigned long) PROHIBITED
Definition: CommandFlag.h:42
Definition: CommandFlag.h:52
Definition: CommandFlag.h:21
Definition: CommandFlag.h:31
Definition: CommandFlag.h:20
Definition: CommandFlag.h:54
Definition: CommandFlag.h:55
Definition: CommandFlag.h:59
Definition: CommandFlag.h:24
Definition: CommandFlag.h:25
Definition: CommandFlag.h:49
Definition: CommandFlag.h:33
Definition: CommandFlag.h:44
CommandFlag operator|(CommandFlag, unsigned long) PROHIBITED
Definition: CommandFlag.h:50
Definition: CommandFlag.h:18
Definition: CommandFlag.h:61
Definition: CommandFlag.h:40
Definition: CommandFlag.h:47
Definition: CommandFlag.h:41
Definition: CommandFlag.h:46
Definition: CommandFlag.h:34
Definition: CommandFlag.h:29
Definition: CommandFlag.h:23
Definition: CommandFlag.h:30
Definition: CommandFlag.h:53
Definition: CommandFlag.h:37
CommandFlag
Definition: CommandFlag.h:16
Definition: CommandFlag.h:26
Definition: CommandFlag.h:32
Definition: CommandFlag.h:38
CommandFlag & operator|=(CommandFlag &lhs, CommandFlag rhs)
Definition: CommandFlag.h:136
Definition: CommandFlag.h:58
Definition: CommandFlag.h:28
Definition: CommandFlag.h:39
Definition: CommandFlag.h:48
Definition: CommandFlag.h:51
Definition: CommandFlag.h:22
Definition: CommandFlag.h:56
Definition: CommandFlag.h:36
Definition: CommandFlag.h:57
Definition: CommandFlag.h:43