| 137 | //*************************************************************************** |
| 138 | |
| 139 | class TimeCode |
| 140 | { |
| 141 | public: |
| 142 | typedef bitset8 flags_type; |
| 143 | class flags : public flags_type |
| 144 | { |
| 145 | public: |
| 146 | flags() : flags_type() {} |
| 147 | flags& DropFrame(bool Value = true) { set(IsDrop_, Value); return *this; } |
| 148 | flags& FPS1001(bool Value = true) { set(Is1001_, Value); return *this; } |
| 149 | flags& Field(bool Value = true) { set(IsField_, Value); return *this; } |
| 150 | flags& Wrapped24Hours(bool Value = true) { set(IsWrapped24Hours_, Value); return *this; } |
| 151 | flags& Negative(bool Value = true) { set(IsNegative_, Value); return *this; } |
| 152 | flags& Timed(bool Value = true) { set(IsTimed_, Value); return *this; } |
| 153 | |
| 154 | private: |
| 155 | enum flag |
| 156 | { |
| 157 | IsDrop_, |
| 158 | Is1001_, |
| 159 | IsField_, |
| 160 | IsWrapped24Hours_, |
| 161 | IsNegative_, |
| 162 | IsTimed_, |
| 163 | IsValid_, |
| 164 | IsUndefined_, |
| 165 | }; |
| 166 | bool IsDropFrame() const { return test(IsDrop_); } |
| 167 | bool Is1001fps() const { return test(Is1001_); } |
| 168 | bool IsField() const { return test(IsField_); } |
| 169 | bool IsWrapped24Hours() const { return test(IsWrapped24Hours_); } |
| 170 | bool IsNegative() const { return test(IsNegative_); } |
| 171 | bool IsTimed() const { return test(IsTimed_); } |
| 172 | flags& SetValid(bool Value = true) { set(IsValid_, Value); return *this; } |
| 173 | bool IsValid() const { return test(IsValid_); } |
| 174 | flags& SetUndefined(bool Value = true) { set(IsUndefined_, Value); return *this; } |
| 175 | bool IsUndefined() const { return test(IsUndefined_); } |
| 176 | flags(uint8_t); |
| 177 | friend class TimeCode; |
| 178 | }; |
| 179 | |
| 180 | enum rounding : uint8_t |
| 181 | { |
| 182 | Nearest, |
| 183 | Floor, |
| 184 | Ceil, |
| 185 | }; |
| 186 | |
| 187 | class string_view |
| 188 | { |
| 189 | public: |
| 190 | constexpr string_view(const char* s, size_t count) : s_(s), count_(count) {} |
| 191 | constexpr const char* data() const noexcept { return s_; } |
| 192 | constexpr size_t size() const noexcept { return count_; } |
| 193 | private: |
| 194 | const char* s_; |
| 195 | size_t count_; |
| 196 | }; |
no test coverage detected