| 56 | |
| 57 | |
| 58 | void Timecode::set_timecode(const std::string &timecode) { |
| 59 | unsigned int h, m, s, f; |
| 60 | |
| 61 | if (sscanf(timecode.c_str(), "%2u%*1c%2u%*1c%2u%*1c%2u", &h, &m, &s, &f) == 4) { |
| 62 | hours_ = h; |
| 63 | minutes_ = m; |
| 64 | seconds_ = s; |
| 65 | frames_ = f; |
| 66 | } else { |
| 67 | throw std::invalid_argument("Invalid string passed."); |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | unsigned int Timecode::nominal_framerate() const { |
| 72 | int nominal_fps = static_cast<int>(frame_rate_); |
no outgoing calls