Re-integrate export-optimization branch.
[ardour.git] / libs / audiographer / audiographer / types.h
1 #ifndef AUDIOGRAPHER_TYPES_H
2 #define AUDIOGRAPHER_TYPES_H
3
4 #include <stdint.h>
5
6 namespace AudioGrapher {
7
8 typedef int64_t nframes_t;
9 typedef uint8_t ChannelCount;
10
11 /** Flag field capable of holding 32 flags.
12     Easily grown in size to 64 flags by changing storage_type */
13 class FlagField {
14   public:
15         typedef uint8_t  Flag;
16         typedef uint32_t storage_type;
17         
18         FlagField() : _flags (0) {}
19         FlagField(FlagField const & other) : _flags (other._flags) {}
20         
21         inline bool has (Flag flag) const  { return _flags & (1 << flag); }
22         inline void set (Flag flag)        { _flags |= (1 << flag); }
23         inline void remove (Flag flag)     { _flags &= ~(1 << flag); }
24         inline storage_type flags () const { return _flags; }
25
26   private:
27         storage_type _flags;
28 };
29
30 } // namespace
31
32 #endif // __audiographer_types_h__