comparison base/RealTime.h @ 1038:cc27f35aa75c cxx11

Introducing the signed 64-bit frame index type, and fixing build failures from inclusion of -Wconversion with -Werror. Not finished yet.
author Chris Cannam
date Tue, 03 Mar 2015 15:18:24 +0000
parents 75f154085a4d
children a1cd5abcb38b
comparison
equal deleted inserted replaced
1037:bf0e5944289b 1038:cc27f35aa75c
19 */ 19 */
20 20
21 #ifndef _REAL_TIME_H_ 21 #ifndef _REAL_TIME_H_
22 #define _REAL_TIME_H_ 22 #define _REAL_TIME_H_
23 23
24 #include "BaseTypes.h"
25
24 #include <iostream> 26 #include <iostream>
25 #include <string> 27 #include <string>
26 28
27 struct timeval; 29 struct timeval;
28
29 30
30 /** 31 /**
31 * RealTime represents time values to nanosecond precision 32 * RealTime represents time values to nanosecond precision
32 * with accurate arithmetic and frame-rate conversion functions. 33 * with accurate arithmetic and frame-rate conversion functions.
33 */ 34 */
147 std::string toXsdDuration() const; 148 std::string toXsdDuration() const;
148 149
149 /** 150 /**
150 * Convert a RealTime into a sample frame at the given sample rate. 151 * Convert a RealTime into a sample frame at the given sample rate.
151 */ 152 */
152 static long realTime2Frame(const RealTime &r, unsigned int sampleRate); 153 static sv_frame_t realTime2Frame(const RealTime &r, int sampleRate);
153 154
154 /** 155 /**
155 * Convert a sample frame at the given sample rate into a RealTime. 156 * Convert a sample frame at the given sample rate into a RealTime.
156 */ 157 */
157 static RealTime frame2RealTime(long frame, unsigned int sampleRate); 158 static RealTime frame2RealTime(sv_frame_t frame, int sampleRate);
158 159
159 static const RealTime zeroTime; 160 static const RealTime zeroTime;
160 }; 161 };
161 162
162 std::ostream &operator<<(std::ostream &out, const RealTime &rt); 163 std::ostream &operator<<(std::ostream &out, const RealTime &rt);